{"diffoscope-json-version": 1, "source1": "/srv/reproducible-results/rbuild-debian/r-b-build.GxQYxfJL/b1/libtorrent-rasterbar_2.0.11-1_armhf.changes", "source2": "/srv/reproducible-results/rbuild-debian/r-b-build.GxQYxfJL/b2/libtorrent-rasterbar_2.0.11-1_armhf.changes", "unified_diff": null, "details": [{"source1": "Files", "source2": "Files", "unified_diff": "@@ -1,7 +1,7 @@\n \n 0977649b8cfd10d7a5b62272730df74c 366372 libdevel optional libtorrent-rasterbar-dev_2.0.11-1_armhf.deb\n- 894f3a1155e41d276e324f3200fed4fe 1673028 doc optional libtorrent-rasterbar-doc_2.0.11-1_all.deb\n+ 0f8f43e1a9886fee05a3f1c9eeee9c95 1672520 doc optional libtorrent-rasterbar-doc_2.0.11-1_all.deb\n 70932590a799f490213cef1ea34ca72e 50834912 debug optional libtorrent-rasterbar2.0t64-dbgsym_2.0.11-1_armhf.deb\n f081b7e5ef3fa8a6a46cb16eeef42c07 1494280 libs optional libtorrent-rasterbar2.0t64_2.0.11-1_armhf.deb\n c6f6118ea09d8817d73831a55809b289 13107940 debug optional python3-libtorrent-dbgsym_2.0.11-1_armhf.deb\n- 5c712bb156665a5397be71364c18c1b8 644396 python optional python3-libtorrent_2.0.11-1_armhf.deb\n+ d652a61c5de65c7992c390aed5283e36 644392 python optional python3-libtorrent_2.0.11-1_armhf.deb\n"}, {"source1": "libtorrent-rasterbar-doc_2.0.11-1_all.deb", "source2": "libtorrent-rasterbar-doc_2.0.11-1_all.deb", "unified_diff": null, "details": [{"source1": "file list", "source2": "file list", "unified_diff": "@@ -1,3 +1,3 @@\n -rw-r--r-- 0 0 0 4 2025-01-28 14:33:12.000000 debian-binary\n -rw-r--r-- 0 0 0 3632 2025-01-28 14:33:12.000000 control.tar.xz\n--rw-r--r-- 0 0 0 1669204 2025-01-28 14:33:12.000000 data.tar.xz\n+-rw-r--r-- 0 0 0 1668696 2025-01-28 14:33:12.000000 data.tar.xz\n"}, {"source1": "control.tar.xz", "source2": "control.tar.xz", "unified_diff": null, "details": [{"source1": "control.tar", "source2": "control.tar", "unified_diff": null, "details": [{"source1": "./md5sums", "source2": "./md5sums", "unified_diff": null, "details": [{"source1": "./md5sums", "source2": "./md5sums", "comments": ["Files differ"], "unified_diff": null}]}]}]}, {"source1": "data.tar.xz", "source2": "data.tar.xz", "unified_diff": null, "details": [{"source1": "data.tar", "source2": "data.tar", "unified_diff": null, "details": [{"source1": "file list", "source2": "file list", "unified_diff": "@@ -79,37 +79,37 @@\n -rw-r--r-- 0 root (0) root (0) 9768 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/index.html\n -rw-r--r-- 0 root (0) root (0) 144610 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/manual-ref.html\n -rw-r--r-- 0 root (0) root (0) 9650 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/projects.html\n -rw-r--r-- 0 root (0) root (0) 22814 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/python_binding.html\n -rw-r--r-- 0 root (0) root (0) 33687 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Add_Torrent.html\n -rw-r--r-- 0 root (0) root (0) 256772 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Alerts.html\n -rw-r--r-- 0 root (0) root (0) 27441 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Bdecoding.html\n--rw-r--r-- 0 root (0) root (0) 25856 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Bencoding.html\n+-rw-r--r-- 0 root (0) root (0) 25858 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Bencoding.html\n -rw-r--r-- 0 root (0) root (0) 88956 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Core.html\n -rw-r--r-- 0 root (0) root (0) 43859 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Create_Torrents.html\n -rw-r--r-- 0 root (0) root (0) 137008 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Custom_Storage.html\n -rw-r--r-- 0 root (0) root (0) 24960 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-DHT.html\n--rw-r--r-- 0 root (0) root (0) 48763 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Error_Codes.html\n+-rw-r--r-- 0 root (0) root (0) 48765 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Error_Codes.html\n -rw-r--r-- 0 root (0) root (0) 13261 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Filter.html\n -rw-r--r-- 0 root (0) root (0) 12804 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-PeerClass.html\n -rw-r--r-- 0 root (0) root (0) 68487 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Plugins.html\n -rw-r--r-- 0 root (0) root (0) 9618 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Resume_Data.html\n--rw-r--r-- 0 root (0) root (0) 102481 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Session.html\n+-rw-r--r-- 0 root (0) root (0) 102483 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Session.html\n -rw-r--r-- 0 root (0) root (0) 169276 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Settings.html\n -rw-r--r-- 0 root (0) root (0) 9742 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Stats.html\n -rw-r--r-- 0 root (0) root (0) 56863 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Storage.html\n--rw-r--r-- 0 root (0) root (0) 129828 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Torrent_Handle.html\n+-rw-r--r-- 0 root (0) root (0) 129838 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Torrent_Handle.html\n -rw-r--r-- 0 root (0) root (0) 55637 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Torrent_Info.html\n -rw-r--r-- 0 root (0) root (0) 48385 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Torrent_Status.html\n--rw-r--r-- 0 root (0) root (0) 16459 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Trackers.html\n+-rw-r--r-- 0 root (0) root (0) 16461 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Trackers.html\n -rw-r--r-- 0 root (0) root (0) 25530 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Utility.html\n -rw-r--r-- 0 root (0) root (0) 9129 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference-ed25519.html\n--rw-r--r-- 0 root (0) root (0) 34353 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference.html\n+-rw-r--r-- 0 root (0) root (0) 34357 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/reference.html\n -rw-r--r-- 0 root (0) root (0) 29242 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/security-audit.html\n--rw-r--r-- 0 root (0) root (0) 1360922 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/single-page-ref.html\n+-rw-r--r-- 0 root (0) root (0) 1360940 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/single-page-ref.html\n -rw-r--r-- 0 root (0) root (0) 10121 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/streaming.html\n -rw-r--r-- 0 root (0) root (0) 8807 2025-01-28 10:57:42.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/style.css\n -rw-r--r-- 0 root (0) root (0) 522888 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/todo.html\n -rw-r--r-- 0 root (0) root (0) 3023 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/troubleshooting.html\n -rw-r--r-- 0 root (0) root (0) 25162 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/tuning-ref.html\n -rw-r--r-- 0 root (0) root (0) 132630 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/tutorial-ref.html\n -rw-r--r-- 0 root (0) root (0) 16383 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/udp_tracker_protocol.html\n"}, {"source1": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Add_Torrent.html", "source2": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Add_Torrent.html", "unified_diff": "@@ -28,65 +28,23 @@\n 2.0.11\n \n \n

home

\n
\n

Table of contents

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

client_data_t

\n-

Declared in "libtorrent/client_data.hpp"

\n-

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

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

client_data_t()

\n-
\n-client_data_t () = default;\n-
\n-

construct a nullptr client data

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

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

\n-
\n-client_data_t& operator= (void*) = delete;\n-client_data_t& operator= (void const*) = delete;\n-operator void const* () const = delete;\n-operator void* () const = delete;\n-
\n-

we don't allow type-unsafe operations

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

add_torrent_params

\n

Declared in "libtorrent/add_torrent_params.hpp"

\n

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

\n
\n+
\n+

client_data_t

\n+

Declared in "libtorrent/client_data.hpp"

\n+

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

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

client_data_t()

\n+
\n+client_data_t () = default;\n+
\n+

construct a nullptr client data

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

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

\n+
\n+client_data_t& operator= (void*) = delete;\n+operator void const* () const = delete;\n+operator void* () const = delete;\n+client_data_t& operator= (void const*) = delete;\n+
\n+

we don't allow type-unsafe operations

\n+
\n
\n \n
\n \n
\n
\n
\n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,48 +1,16 @@\n >\n _\b[_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b _\bl_\bo_\bg_\bo_\b]\n V\bVe\ber\brs\bsi\bio\bon\bn:\b: 2.0.11\n _\bh_\bo_\bm_\be\n Table of contents\n+ * _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs\n * _\bc_\bl_\bi_\be_\bn_\bt_\b__\bd_\ba_\bt_\ba_\b__\bt\n o _\bc_\bl_\bi_\be_\bn_\bt_\b__\bd_\ba_\bt_\ba_\b__\bt_\b(_\b)\n- o _\bv_\bo_\bi_\bd_\b*_\b(_\b)_\b _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b=_\b(_\b)_\b _\bc_\bo_\bn_\bs_\bt_\b*_\b(_\b)\n- * _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* c\bcl\bli\bie\ben\bnt\bt_\b_d\bda\bat\bta\ba_\b_t\bt *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bc_\bl_\bi_\be_\bn_\bt_\b__\bd_\ba_\bt_\ba_\b._\bh_\bp_\bp\"\n-A thin wrapper around a void pointer used as \"user data\". i.e. an opaque cookie\n-passed in to libtorrent and returned on demand. It adds type-safety by\n-requiring the same type be requested out of it as was assigned to it.\n-struct client_data_t\n-{\n- c\bcl\bli\bie\ben\bnt\bt_\b_d\bda\bat\bta\ba_\b_t\bt () = default;\n- explicit c\bcl\bli\bie\ben\bnt\bt_\b_d\bda\bat\bta\ba_\b_t\bt (T* v);\n- client_data_t& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (T* v);\n- T* g\bge\bet\bt () const;\n- explicit operator T\bT () const;\n- client_data_t& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (void*) = delete;\n- client_data_t& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (void const*) = delete;\n- operator void c\bco\bon\bns\bst\bt*\b* () const = delete;\n- operator v\bvo\boi\bid\bd*\b* () const = delete;\n-\n- template ::value>::type>\n-};\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* c\bcl\bli\bie\ben\bnt\bt_\b_d\bda\bat\bta\ba_\b_t\bt(\b()\b) *\b**\b**\b**\b**\b*\n-c\bcl\bli\bie\ben\bnt\bt_\b_d\bda\bat\bta\ba_\b_t\bt () = default;\n-construct a nullptr client data\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* v\bvo\boi\bid\bd*\b*(\b()\b) o\bop\bpe\ber\bra\bat\bto\bor\br=\b=(\b()\b) c\bco\bon\bns\bst\bt*\b*(\b()\b) *\b**\b**\b**\b**\b*\n-client_data_t& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (void*) = delete;\n-client_data_t& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (void const*) = delete;\n-operator void c\bco\bon\bns\bst\bt*\b* () const = delete;\n-operator v\bvo\boi\bid\bd*\b* () const = delete;\n-we don't allow type-unsafe operations\n+ o _\bc_\bo_\bn_\bs_\bt_\b*_\b(_\b)_\b _\bv_\bo_\bi_\bd_\b*_\b(_\b)_\b _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b=_\b(_\b)\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_p\bpa\bar\bra\bam\bms\bs *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs_\b._\bh_\bp_\bp\"\n The _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs contains all the information in a .torrent file along\n with all information necessary to add that torrent to a _\bs_\be_\bs_\bs_\bi_\bo_\bn. The key fields\n when adding a torrent are:\n * ti - the immutable info-dict part of the torrent\n@@ -291,14 +259,46 @@\n applied before the torrent is added.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n last_download last_upload\n the posix time of the last time payload was received or sent for this\n torrent, respectively. A value of 0 means we don't know when we last\n uploaded or downloaded, or we have never uploaded or downloaded any\n payload for this torrent.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* c\bcl\bli\bie\ben\bnt\bt_\b_d\bda\bat\bta\ba_\b_t\bt *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bc_\bl_\bi_\be_\bn_\bt_\b__\bd_\ba_\bt_\ba_\b._\bh_\bp_\bp\"\n+A thin wrapper around a void pointer used as \"user data\". i.e. an opaque cookie\n+passed in to libtorrent and returned on demand. It adds type-safety by\n+requiring the same type be requested out of it as was assigned to it.\n+struct client_data_t\n+{\n+ c\bcl\bli\bie\ben\bnt\bt_\b_d\bda\bat\bta\ba_\b_t\bt () = default;\n+ explicit c\bcl\bli\bie\ben\bnt\bt_\b_d\bda\bat\bta\ba_\b_t\bt (T* v);\n+ client_data_t& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (T* v);\n+ T* g\bge\bet\bt () const;\n+ explicit operator T\bT () const;\n+ client_data_t& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (void*) = delete;\n+ operator void c\bco\bon\bns\bst\bt*\b* () const = delete;\n+ operator v\bvo\boi\bid\bd*\b* () const = delete;\n+ client_data_t& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (void const*) = delete;\n+\n+ template ::value>::type>\n+};\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* c\bcl\bli\bie\ben\bnt\bt_\b_d\bda\bat\bta\ba_\b_t\bt(\b()\b) *\b**\b**\b**\b**\b*\n+c\bcl\bli\bie\ben\bnt\bt_\b_d\bda\bat\bta\ba_\b_t\bt () = default;\n+construct a nullptr client data\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* c\bco\bon\bns\bst\bt*\b*(\b()\b) v\bvo\boi\bid\bd*\b*(\b()\b) o\bop\bpe\ber\bra\bat\bto\bor\br=\b=(\b()\b) *\b**\b**\b**\b**\b*\n+client_data_t& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (void*) = delete;\n+operator void c\bco\bon\bns\bst\bt*\b* () const = delete;\n+operator v\bvo\boi\bid\bd*\b* () const = delete;\n+client_data_t& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (void const*) = delete;\n+we don't allow type-unsafe operations\n _\bh_\bo_\bm_\be\n _\bb_\bl_\bo_\bg\n _\bu_\bT_\bP\n _\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd\n _\bd_\bo_\bc_\bu_\bm_\be_\bn_\bt_\ba_\bt_\bi_\bo_\bn\n _\bD_\bH_\bT_\b _\bp_\bu_\bt_\b _\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn\n _\bp_\by_\bt_\bh_\bo_\bn_\b _\bb_\bi_\bn_\bd_\bi_\bn_\bg_\bs\n"}]}, {"source1": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Alerts.html", "source2": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Alerts.html", "unified_diff": "@@ -28,211 +28,211 @@\n 2.0.11\n \n \n

home

\n
\n

Table of contents

\n
\n

The pop_alerts() function on session is the main interface for retrieving\n alerts (warnings, messages and errors from libtorrent). If no alerts have\n been posted by libtorrent pop_alerts() will return an empty list.

\n

By default, only errors are reported. settings_pack::alert_mask can be\n used to specify which kinds of events should be reported. The alert mask is\n@@ -246,15 +246,124 @@\n

There are other alert base classes that some alerts derive from, all the\n alerts that are generated for a specific torrent are derived from\n torrent_alert, and tracker events derive from tracker_alert.

\n

Alerts returned by pop_alerts() are only valid until the next call to\n pop_alerts(). You may not copy an alert object to access it after the next\n call to pop_alerts(). Internal members of alerts also become invalid once\n pop_alerts() is called again.

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

alert

\n+

Declared in "libtorrent/alert.hpp"

\n+

The alert class is the base class that specific messages are derived from.\n+alert types are not copyable, and cannot be constructed by the client. The\n+pointers returned by libtorrent are short lived (the details are described\n+under session_handle::pop_alerts())

\n+
\n+struct alert\n+{\n+   time_point timestamp () const;\n+   virtual int type () const noexcept = 0;\n+   virtual char const* what () const noexcept = 0;\n+   virtual std::string message () const = 0;\n+   virtual alert_category_t category () const noexcept = 0;\n+\n+   static constexpr alert_category_t error_notification  = 0_bit;\n+   static constexpr alert_category_t peer_notification  = 1_bit;\n+   static constexpr alert_category_t port_mapping_notification  = 2_bit;\n+   static constexpr alert_category_t storage_notification  = 3_bit;\n+   static constexpr alert_category_t tracker_notification  = 4_bit;\n+   static constexpr alert_category_t connect_notification  = 5_bit;\n+   static constexpr alert_category_t status_notification  = 6_bit;\n+   static constexpr alert_category_t ip_block_notification  = 8_bit;\n+   static constexpr alert_category_t performance_warning  = 9_bit;\n+   static constexpr alert_category_t dht_notification  = 10_bit;\n+   static constexpr alert_category_t session_log_notification  = 13_bit;\n+   static constexpr alert_category_t torrent_log_notification  = 14_bit;\n+   static constexpr alert_category_t peer_log_notification  = 15_bit;\n+   static constexpr alert_category_t incoming_request_notification  = 16_bit;\n+   static constexpr alert_category_t dht_log_notification  = 17_bit;\n+   static constexpr alert_category_t dht_operation_notification  = 18_bit;\n+   static constexpr alert_category_t port_mapping_log_notification  = 19_bit;\n+   static constexpr alert_category_t picker_log_notification  = 20_bit;\n+   static constexpr alert_category_t file_progress_notification  = 21_bit;\n+   static constexpr alert_category_t piece_progress_notification  = 22_bit;\n+   static constexpr alert_category_t upload_notification  = 23_bit;\n+   static constexpr alert_category_t block_progress_notification  = 24_bit;\n+   static constexpr alert_category_t all_categories  = alert_category_t::all();\n+};\n+
\n+[report issue]
\n+

timestamp()

\n+
\n+time_point timestamp () const;\n+
\n+

a timestamp is automatically created in the constructor

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

type()

\n+
\n+virtual int type () const noexcept = 0;\n+
\n+

returns an integer that is unique to this alert type. It can be\n+compared against a specific alert by querying a static constant called alert_type\n+in the alert. It can be used to determine the run-time type of an alert* in\n+order to cast to that alert type and access specific members.

\n+

e.g:

\n+
\n+std::vector<alert*> alerts;\n+ses.pop_alerts(&alerts);\n+for (alert* a : alerts) {\n+        switch (a->type()) {\n+\n+                case read_piece_alert::alert_type:\n+                {\n+                        auto* p = static_cast<read_piece_alert*>(a);\n+                        if (p->ec) {\n+                                // read_piece failed\n+                                break;\n+                        }\n+                        // use p\n+                        break;\n+                }\n+                case file_renamed_alert::alert_type:\n+                {\n+                        // etc...\n+                }\n+        }\n+}\n+
\n+[report issue]
\n+
\n+

what()

\n+
\n+virtual char const* what () const noexcept = 0;\n+
\n+

returns a string literal describing the type of the alert. It does\n+not include any information that might be bundled with the alert.

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

message()

\n+
\n+virtual std::string message () const = 0;\n+
\n+

generate a string describing the alert and the information bundled\n+with it. This is mainly intended for debug and development use. It is not suitable\n+to use this for applications that may be localized. Instead, handle each alert\n+type individually and extract and render the information from the alert depending\n+on the locale.

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

category()

\n+
\n+virtual alert_category_t category () const noexcept = 0;\n+
\n+

returns a bitmask specifying which categories this alert belong to.

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

dht_routing_bucket

\n

Declared in "libtorrent/alert_types.hpp"

\n

struct to hold information about a single DHT routing table bucket

\n
\n struct dht_routing_bucket\n {\n    int num_nodes;\n@@ -285,15 +394,15 @@\n {\n    std::string message () const override;\n    char const* torrent_name () const;\n \n    torrent_handle handle;\n };\n 
\n-[report issue]
\n+[report issue]
\n

message()

\n
\n std::string message () const override;\n 
\n

returns the message associated with this alert

\n [report issue]
\n
handle
\n@@ -435,27 +544,27 @@\n

Declared in "libtorrent/alert_types.hpp"

\n

This is posted as a response to a torrent_handle::rename_file() call, if the rename\n operation succeeds.

\n
\n struct file_renamed_alert final : torrent_alert\n {\n    std::string message () const override;\n-   char const* new_name () const;\n    char const* old_name () const;\n+   char const* new_name () const;\n \n    static constexpr alert_category_t static_category  = alert_category::storage;\n    file_index_t const index;\n };\n 
\n-\n-[report issue]
\n-

old_name() new_name()

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

new_name() old_name()

\n
\n-char const* new_name () const;\n char const* old_name () const;\n+char const* new_name () const;\n 
\n

returns the new and previous file name, respectively.

\n [report issue]
\n
index
\n
refers to the index of the file that was renamed,
\n
\n [report issue]
\n@@ -1178,26 +1287,26 @@\n torrent_handle::move_storage. This is useful to synchronize with the\n actual disk. The storage_path() member return the new path of the\n storage.

\n
\n struct storage_moved_alert final : torrent_alert\n {\n    std::string message () const override;\n-   char const* storage_path () const;\n    char const* old_path () const;\n+   char const* storage_path () const;\n \n    static constexpr alert_category_t static_category  = alert_category::storage;\n };\n 
\n-\n-[report issue]
\n-

storage_path() old_path()

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

old_path() storage_path()

\n
\n-char const* storage_path () const;\n char const* old_path () const;\n+char const* storage_path () const;\n 
\n

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

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

storage_moved_failed_alert

\n

Declared in "libtorrent/alert_types.hpp"

\n@@ -2896,17 +3005,17 @@\n static constexpr alert_category_t static_category = alert_category::dht_operation;\n sha1_hash node_id;\n aux::noexcept_movable<udp::endpoint> endpoint;\n time_duration const interval;\n int const num_infohashes;\n };\n \n-\n-[report issue]
\n-

samples() num_samples()

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

num_samples() samples()

\n
\n int num_samples () const;\n std::vector<sha1_hash> samples () const;\n 
\n

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

\n@@ -2970,16 +3079,16 @@\n

this alert is posted to indicate to the client that some alerts were\n dropped. Dropped meaning that the alert failed to be delivered to the\n client. The most common cause of such failure is that the internal alert\n queue grew too big (controlled by alert_queue_size).

\n
\n struct alerts_dropped_alert final : alert\n {\n-   static_assert (num_alert_types <= abi_alert_count, "need to increase bitset. This is an ABI break");\n    std::string message () const override;\n+   static_assert (num_alert_types <= abi_alert_count, "need to increase bitset. This is an ABI break");\n \n    static constexpr alert_category_t static_category  = alert_category::error;\n    std::bitset<abi_alert_count> dropped_alerts;\n };\n 
\n [report issue]
\n
dropped_alerts
\n@@ -3185,147 +3294,38 @@\n std::vector<announce_entry> trackers;\n };\n \n [report issue]
\n
trackers
\n
list of trackers and their status for the torrent
\n
\n-[report issue]
\n-
\n-

alert

\n-

Declared in "libtorrent/alert.hpp"

\n-

The alert class is the base class that specific messages are derived from.\n-alert types are not copyable, and cannot be constructed by the client. The\n-pointers returned by libtorrent are short lived (the details are described\n-under session_handle::pop_alerts())

\n-
\n-struct alert\n-{\n-   time_point timestamp () const;\n-   virtual int type () const noexcept = 0;\n-   virtual char const* what () const noexcept = 0;\n-   virtual std::string message () const = 0;\n-   virtual alert_category_t category () const noexcept = 0;\n-\n-   static constexpr alert_category_t error_notification  = 0_bit;\n-   static constexpr alert_category_t peer_notification  = 1_bit;\n-   static constexpr alert_category_t port_mapping_notification  = 2_bit;\n-   static constexpr alert_category_t storage_notification  = 3_bit;\n-   static constexpr alert_category_t tracker_notification  = 4_bit;\n-   static constexpr alert_category_t connect_notification  = 5_bit;\n-   static constexpr alert_category_t status_notification  = 6_bit;\n-   static constexpr alert_category_t ip_block_notification  = 8_bit;\n-   static constexpr alert_category_t performance_warning  = 9_bit;\n-   static constexpr alert_category_t dht_notification  = 10_bit;\n-   static constexpr alert_category_t session_log_notification  = 13_bit;\n-   static constexpr alert_category_t torrent_log_notification  = 14_bit;\n-   static constexpr alert_category_t peer_log_notification  = 15_bit;\n-   static constexpr alert_category_t incoming_request_notification  = 16_bit;\n-   static constexpr alert_category_t dht_log_notification  = 17_bit;\n-   static constexpr alert_category_t dht_operation_notification  = 18_bit;\n-   static constexpr alert_category_t port_mapping_log_notification  = 19_bit;\n-   static constexpr alert_category_t picker_log_notification  = 20_bit;\n-   static constexpr alert_category_t file_progress_notification  = 21_bit;\n-   static constexpr alert_category_t piece_progress_notification  = 22_bit;\n-   static constexpr alert_category_t upload_notification  = 23_bit;\n-   static constexpr alert_category_t block_progress_notification  = 24_bit;\n-   static constexpr alert_category_t all_categories  = alert_category_t::all();\n-};\n-
\n-[report issue]
\n-

timestamp()

\n-
\n-time_point timestamp () const;\n-
\n-

a timestamp is automatically created in the constructor

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

type()

\n-
\n-virtual int type () const noexcept = 0;\n-
\n-

returns an integer that is unique to this alert type. It can be\n-compared against a specific alert by querying a static constant called alert_type\n-in the alert. It can be used to determine the run-time type of an alert* in\n-order to cast to that alert type and access specific members.

\n-

e.g:

\n-
\n-std::vector<alert*> alerts;\n-ses.pop_alerts(&alerts);\n-for (alert* a : alerts) {\n-        switch (a->type()) {\n-\n-                case read_piece_alert::alert_type:\n-                {\n-                        auto* p = static_cast<read_piece_alert*>(a);\n-                        if (p->ec) {\n-                                // read_piece failed\n-                                break;\n-                        }\n-                        // use p\n-                        break;\n-                }\n-                case file_renamed_alert::alert_type:\n-                {\n-                        // etc...\n-                }\n-        }\n-}\n-
\n-[report issue]
\n-
\n-

what()

\n-
\n-virtual char const* what () const noexcept = 0;\n-
\n-

returns a string literal describing the type of the alert. It does\n-not include any information that might be bundled with the alert.

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

message()

\n-
\n-virtual std::string message () const = 0;\n-
\n-

generate a string describing the alert and the information bundled\n-with it. This is mainly intended for debug and development use. It is not suitable\n-to use this for applications that may be localized. Instead, handle each alert\n-type individually and extract and render the information from the alert depending\n-on the locale.

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

category()

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

operation_name()

\n+

Declared in "libtorrent/operations.hpp"

\n
\n-virtual alert_category_t category () const noexcept = 0;\n+char const* operation_name (operation_t op);\n 
\n-

returns a bitmask specifying which categories this alert belong to.

\n+

maps an operation id (from peer_error_alert and peer_disconnected_alert)\n+to its name. See operation_t for the constants

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

alert_cast()

\n

Declared in "libtorrent/alert.hpp"

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

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

\n
\n

Note

\n

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

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

operation_name()

\n-

Declared in "libtorrent/operations.hpp"

\n-
\n-char const* operation_name (operation_t op);\n-
\n-

maps an operation id (from peer_error_alert and peer_disconnected_alert)\n-to its name. See operation_t for the constants

\n [report issue]
\n
\n

enum operation_t

\n

Declared in "libtorrent/operations.hpp"

\n \n \n \n@@ -3530,26 +3530,14 @@\n \n \n \n \n \n \n
file_truncate46call to ftruncate() (or SetEndOfFile() on windows)
\n-[report issue]
\n-
\n-

int

\n-

Declared in "libtorrent/alert_types.hpp"

\n-
\n-
user_alert_id
\n-
user defined alerts should use IDs greater than this
\n-
\n-
\n-
num_alert_types
\n-
this constant represents "max_alert_index" + 1
\n-
\n [report issue]
\n
\n

alert_category_t

\n

Declared in "libtorrent/alert.hpp"

\n
\n
error
\n

Enables alerts that report an error. This includes:

\n@@ -3677,14 +3665,26 @@\n

The full bitmask, representing all available categories.

\n

since the enum is signed, make sure this isn't\n interpreted as -1. For instance, boost.python\n does that and fails when assigning it to an\n unsigned parameter.

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

int

\n+

Declared in "libtorrent/alert_types.hpp"

\n+
\n+
user_alert_id
\n+
user defined alerts should use IDs greater than this
\n+
\n+
\n+
num_alert_types
\n+
this constant represents "max_alert_index" + 1
\n+
\n
\n \n
\n
\n
\n
\n
\n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,23 +1,29 @@\n >\n _\b[_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b _\bl_\bo_\bg_\bo_\b]\n V\bVe\ber\brs\bsi\bio\bon\bn:\b: 2.0.11\n _\bh_\bo_\bm_\be\n Table of contents\n+ * _\ba_\bl_\be_\br_\bt\n+ o _\bt_\bi_\bm_\be_\bs_\bt_\ba_\bm_\bp_\b(_\b)\n+ o _\bt_\by_\bp_\be_\b(_\b)\n+ o _\bw_\bh_\ba_\bt_\b(_\b)\n+ o _\bm_\be_\bs_\bs_\ba_\bg_\be_\b(_\b)\n+ o _\bc_\ba_\bt_\be_\bg_\bo_\br_\by_\b(_\b)\n * _\bd_\bh_\bt_\b__\br_\bo_\bu_\bt_\bi_\bn_\bg_\b__\bb_\bu_\bc_\bk_\be_\bt\n * _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\ba_\bl_\be_\br_\bt\n o _\bm_\be_\bs_\bs_\ba_\bg_\be_\b(_\b)\n * _\bp_\be_\be_\br_\b__\ba_\bl_\be_\br_\bt\n * _\bt_\br_\ba_\bc_\bk_\be_\br_\b__\ba_\bl_\be_\br_\bt\n o _\bt_\br_\ba_\bc_\bk_\be_\br_\b__\bu_\br_\bl_\b(_\b)\n * _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\br_\be_\bm_\bo_\bv_\be_\bd_\b__\ba_\bl_\be_\br_\bt\n * _\br_\be_\ba_\bd_\b__\bp_\bi_\be_\bc_\be_\b__\ba_\bl_\be_\br_\bt\n * _\bf_\bi_\bl_\be_\b__\bc_\bo_\bm_\bp_\bl_\be_\bt_\be_\bd_\b__\ba_\bl_\be_\br_\bt\n * _\bf_\bi_\bl_\be_\b__\br_\be_\bn_\ba_\bm_\be_\bd_\b__\ba_\bl_\be_\br_\bt\n- o _\bo_\bl_\bd_\b__\bn_\ba_\bm_\be_\b(_\b)_\b _\bn_\be_\bw_\b__\bn_\ba_\bm_\be_\b(_\b)\n+ o _\bn_\be_\bw_\b__\bn_\ba_\bm_\be_\b(_\b)_\b _\bo_\bl_\bd_\b__\bn_\ba_\bm_\be_\b(_\b)\n * _\bf_\bi_\bl_\be_\b__\br_\be_\bn_\ba_\bm_\be_\b__\bf_\ba_\bi_\bl_\be_\bd_\b__\ba_\bl_\be_\br_\bt\n * _\bp_\be_\br_\bf_\bo_\br_\bm_\ba_\bn_\bc_\be_\b__\ba_\bl_\be_\br_\bt\n o _\be_\bn_\bu_\bm_\b _\bp_\be_\br_\bf_\bo_\br_\bm_\ba_\bn_\bc_\be_\b__\bw_\ba_\br_\bn_\bi_\bn_\bg_\b__\bt\n * _\bs_\bt_\ba_\bt_\be_\b__\bc_\bh_\ba_\bn_\bg_\be_\bd_\b__\ba_\bl_\be_\br_\bt\n * _\bt_\br_\ba_\bc_\bk_\be_\br_\b__\be_\br_\br_\bo_\br_\b__\ba_\bl_\be_\br_\bt\n o _\bf_\ba_\bi_\bl_\bu_\br_\be_\b__\br_\be_\ba_\bs_\bo_\bn_\b(_\b)\n * _\bt_\br_\ba_\bc_\bk_\be_\br_\b__\bw_\ba_\br_\bn_\bi_\bn_\bg_\b__\ba_\bl_\be_\br_\bt\n@@ -41,15 +47,15 @@\n * _\bp_\bi_\be_\bc_\be_\b__\bf_\bi_\bn_\bi_\bs_\bh_\be_\bd_\b__\ba_\bl_\be_\br_\bt\n * _\br_\be_\bq_\bu_\be_\bs_\bt_\b__\bd_\br_\bo_\bp_\bp_\be_\bd_\b__\ba_\bl_\be_\br_\bt\n * _\bb_\bl_\bo_\bc_\bk_\b__\bt_\bi_\bm_\be_\bo_\bu_\bt_\b__\ba_\bl_\be_\br_\bt\n * _\bb_\bl_\bo_\bc_\bk_\b__\bf_\bi_\bn_\bi_\bs_\bh_\be_\bd_\b__\ba_\bl_\be_\br_\bt\n * _\bb_\bl_\bo_\bc_\bk_\b__\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\bi_\bn_\bg_\b__\ba_\bl_\be_\br_\bt\n * _\bu_\bn_\bw_\ba_\bn_\bt_\be_\bd_\b__\bb_\bl_\bo_\bc_\bk_\b__\ba_\bl_\be_\br_\bt\n * _\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bm_\bo_\bv_\be_\bd_\b__\ba_\bl_\be_\br_\bt\n- o _\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bp_\ba_\bt_\bh_\b(_\b)_\b _\bo_\bl_\bd_\b__\bp_\ba_\bt_\bh_\b(_\b)\n+ o _\bo_\bl_\bd_\b__\bp_\ba_\bt_\bh_\b(_\b)_\b _\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bp_\ba_\bt_\bh_\b(_\b)\n * _\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bm_\bo_\bv_\be_\bd_\b__\bf_\ba_\bi_\bl_\be_\bd_\b__\ba_\bl_\be_\br_\bt\n o _\bf_\bi_\bl_\be_\b__\bp_\ba_\bt_\bh_\b(_\b)\n * _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bd_\be_\bl_\be_\bt_\be_\bd_\b__\ba_\bl_\be_\br_\bt\n * _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bd_\be_\bl_\be_\bt_\be_\b__\bf_\ba_\bi_\bl_\be_\bd_\b__\ba_\bl_\be_\br_\bt\n * _\bs_\ba_\bv_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b__\ba_\bl_\be_\br_\bt\n * _\bs_\ba_\bv_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b__\bf_\ba_\bi_\bl_\be_\bd_\b__\ba_\bl_\be_\br_\bt\n * _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\bu_\bs_\be_\bd_\b__\ba_\bl_\be_\br_\bt\n@@ -117,39 +123,33 @@\n * _\bd_\bh_\bt_\b__\bd_\bi_\br_\be_\bc_\bt_\b__\br_\be_\bs_\bp_\bo_\bn_\bs_\be_\b__\ba_\bl_\be_\br_\bt\n * _\bp_\bi_\bc_\bk_\be_\br_\b__\bl_\bo_\bg_\b__\ba_\bl_\be_\br_\bt\n * _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\be_\br_\br_\bo_\br_\b__\ba_\bl_\be_\br_\bt\n * _\bd_\bh_\bt_\b__\bl_\bi_\bv_\be_\b__\bn_\bo_\bd_\be_\bs_\b__\ba_\bl_\be_\br_\bt\n o _\bn_\bo_\bd_\be_\bs_\b(_\b)_\b _\bn_\bu_\bm_\b__\bn_\bo_\bd_\be_\bs_\b(_\b)\n * _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bs_\bt_\ba_\bt_\bs_\b__\bh_\be_\ba_\bd_\be_\br_\b__\ba_\bl_\be_\br_\bt\n * _\bd_\bh_\bt_\b__\bs_\ba_\bm_\bp_\bl_\be_\b__\bi_\bn_\bf_\bo_\bh_\ba_\bs_\bh_\be_\bs_\b__\ba_\bl_\be_\br_\bt\n- o _\bs_\ba_\bm_\bp_\bl_\be_\bs_\b(_\b)_\b _\bn_\bu_\bm_\b__\bs_\ba_\bm_\bp_\bl_\be_\bs_\b(_\b)\n+ o _\bn_\bu_\bm_\b__\bs_\ba_\bm_\bp_\bl_\be_\bs_\b(_\b)_\b _\bs_\ba_\bm_\bp_\bl_\be_\bs_\b(_\b)\n o _\bn_\bu_\bm_\b__\bn_\bo_\bd_\be_\bs_\b(_\b)\n o _\bn_\bo_\bd_\be_\bs_\b(_\b)\n * _\bb_\bl_\bo_\bc_\bk_\b__\bu_\bp_\bl_\bo_\ba_\bd_\be_\bd_\b__\ba_\bl_\be_\br_\bt\n * _\ba_\bl_\be_\br_\bt_\bs_\b__\bd_\br_\bo_\bp_\bp_\be_\bd_\b__\ba_\bl_\be_\br_\bt\n * _\bs_\bo_\bc_\bk_\bs_\b5_\b__\ba_\bl_\be_\br_\bt\n * _\bf_\bi_\bl_\be_\b__\bp_\br_\bi_\bo_\b__\ba_\bl_\be_\br_\bt\n * _\bo_\bv_\be_\br_\bs_\bi_\bz_\be_\bd_\b__\bf_\bi_\bl_\be_\b__\ba_\bl_\be_\br_\bt\n * _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bc_\bo_\bn_\bf_\bl_\bi_\bc_\bt_\b__\ba_\bl_\be_\br_\bt\n * _\bp_\be_\be_\br_\b__\bi_\bn_\bf_\bo_\b__\ba_\bl_\be_\br_\bt\n * _\bf_\bi_\bl_\be_\b__\bp_\br_\bo_\bg_\br_\be_\bs_\bs_\b__\ba_\bl_\be_\br_\bt\n * _\bp_\bi_\be_\bc_\be_\b__\bi_\bn_\bf_\bo_\b__\ba_\bl_\be_\br_\bt\n * _\bp_\bi_\be_\bc_\be_\b__\ba_\bv_\ba_\bi_\bl_\ba_\bb_\bi_\bl_\bi_\bt_\by_\b__\ba_\bl_\be_\br_\bt\n * _\bt_\br_\ba_\bc_\bk_\be_\br_\b__\bl_\bi_\bs_\bt_\b__\ba_\bl_\be_\br_\bt\n- * _\ba_\bl_\be_\br_\bt\n- o _\bt_\bi_\bm_\be_\bs_\bt_\ba_\bm_\bp_\b(_\b)\n- o _\bt_\by_\bp_\be_\b(_\b)\n- o _\bw_\bh_\ba_\bt_\b(_\b)\n- o _\bm_\be_\bs_\bs_\ba_\bg_\be_\b(_\b)\n- o _\bc_\ba_\bt_\be_\bg_\bo_\br_\by_\b(_\b)\n- * _\ba_\bl_\be_\br_\bt_\b__\bc_\ba_\bs_\bt_\b(_\b)\n * _\bo_\bp_\be_\br_\ba_\bt_\bi_\bo_\bn_\b__\bn_\ba_\bm_\be_\b(_\b)\n+ * _\ba_\bl_\be_\br_\bt_\b__\bc_\ba_\bs_\bt_\b(_\b)\n * _\be_\bn_\bu_\bm_\b _\bo_\bp_\be_\br_\ba_\bt_\bi_\bo_\bn_\b__\bt\n- * _\bi_\bn_\bt\n * _\ba_\bl_\be_\br_\bt_\b__\bc_\ba_\bt_\be_\bg_\bo_\br_\by_\b__\bt\n+ * _\bi_\bn_\bt\n The _\bp_\bo_\bp_\b__\ba_\bl_\be_\br_\bt_\bs_\b(_\b) function on _\bs_\be_\bs_\bs_\bi_\bo_\bn is the main interface for retrieving\n alerts (warnings, messages and errors from libtorrent). If no alerts have been\n posted by libtorrent _\bp_\bo_\bp_\b__\ba_\bl_\be_\br_\bt_\bs_\b(_\b) will return an empty list.\n By default, only errors are reported. _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk_\b:_\b:_\ba_\bl_\be_\br_\bt_\b__\bm_\ba_\bs_\bk can be used to\n specify which kinds of events should be reported. The _\ba_\bl_\be_\br_\bt mask is a\n combination of the _\ba_\bl_\be_\br_\bt_\b__\bc_\ba_\bt_\be_\bg_\bo_\br_\by_\b__\bt flags in the _\ba_\bl_\be_\br_\bt class.\n Every _\ba_\bl_\be_\br_\bt belongs to one or more category. There is a cost associated with\n@@ -162,14 +162,103 @@\n that are generated for a specific torrent are derived from _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\ba_\bl_\be_\br_\bt, and\n tracker events derive from _\bt_\br_\ba_\bc_\bk_\be_\br_\b__\ba_\bl_\be_\br_\bt.\n Alerts returned by _\bp_\bo_\bp_\b__\ba_\bl_\be_\br_\bt_\bs_\b(_\b) are only valid until the next call to\n _\bp_\bo_\bp_\b__\ba_\bl_\be_\br_\bt_\bs_\b(_\b). You may not copy an _\ba_\bl_\be_\br_\bt object to access it after the next call\n to _\bp_\bo_\bp_\b__\ba_\bl_\be_\br_\bt_\bs_\b(_\b). Internal members of alerts also become invalid once _\bp_\bo_\bp_\b__\ba_\bl_\be_\br_\bt_\bs\n _\b(_\b) is called again.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* a\bal\ble\ber\brt\bt *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bl_\be_\br_\bt_\b._\bh_\bp_\bp\"\n+The alert class is the base class that specific messages are derived from.\n+_\ba_\bl_\be_\br_\bt types are not copyable, and cannot be constructed by the client. The\n+pointers returned by libtorrent are short lived (the details are described\n+under _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bh_\ba_\bn_\bd_\bl_\be_\b:_\b:_\bp_\bo_\bp_\b__\ba_\bl_\be_\br_\bt_\bs_\b(_\b))\n+struct alert\n+{\n+ time_point t\bti\bim\bme\bes\bst\bta\bam\bmp\bp () const;\n+ virtual int t\bty\byp\bpe\be () const noexcept = 0;\n+ virtual char const* w\bwh\bha\bat\bt () const noexcept = 0;\n+ virtual std::string m\bme\bes\bss\bsa\bag\bge\be () const = 0;\n+ virtual alert_category_t c\bca\bat\bte\beg\bgo\bor\bry\by () const noexcept = 0;\n+\n+ static constexpr alert_category_t e\ber\brr\bro\bor\br_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 0_bit;\n+ static constexpr alert_category_t p\bpe\bee\ber\br_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 1_bit;\n+ static constexpr alert_category_t p\bpo\bor\brt\bt_\b_m\bma\bap\bpp\bpi\bin\bng\bg_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 2_bit;\n+ static constexpr alert_category_t s\bst\bto\bor\bra\bag\bge\be_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 3_bit;\n+ static constexpr alert_category_t t\btr\bra\bac\bck\bke\ber\br_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 4_bit;\n+ static constexpr alert_category_t c\bco\bon\bnn\bne\bec\bct\bt_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 5_bit;\n+ static constexpr alert_category_t s\bst\bta\bat\btu\bus\bs_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 6_bit;\n+ static constexpr alert_category_t i\bip\bp_\b_b\bbl\blo\boc\bck\bk_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 8_bit;\n+ static constexpr alert_category_t p\bpe\ber\brf\bfo\bor\brm\bma\ban\bnc\bce\be_\b_w\bwa\bar\brn\bni\bin\bng\bg = 9_bit;\n+ static constexpr alert_category_t d\bdh\bht\bt_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 10_bit;\n+ static constexpr alert_category_t s\bse\bes\bss\bsi\bio\bon\bn_\b_l\blo\bog\bg_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 13_bit;\n+ static constexpr alert_category_t t\bto\bor\brr\bre\ben\bnt\bt_\b_l\blo\bog\bg_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 14_bit;\n+ static constexpr alert_category_t p\bpe\bee\ber\br_\b_l\blo\bog\bg_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 15_bit;\n+ static constexpr alert_category_t i\bin\bnc\bco\bom\bmi\bin\bng\bg_\b_r\bre\beq\bqu\bue\bes\bst\bt_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 16_bit;\n+ static constexpr alert_category_t d\bdh\bht\bt_\b_l\blo\bog\bg_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 17_bit;\n+ static constexpr alert_category_t d\bdh\bht\bt_\b_o\bop\bpe\ber\bra\bat\bti\bio\bon\bn_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 18_bit;\n+ static constexpr alert_category_t p\bpo\bor\brt\bt_\b_m\bma\bap\bpp\bpi\bin\bng\bg_\b_l\blo\bog\bg_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 19_bit;\n+ static constexpr alert_category_t p\bpi\bic\bck\bke\ber\br_\b_l\blo\bog\bg_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 20_bit;\n+ static constexpr alert_category_t f\bfi\bil\ble\be_\b_p\bpr\bro\bog\bgr\bre\bes\bss\bs_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 21_bit;\n+ static constexpr alert_category_t p\bpi\bie\bec\bce\be_\b_p\bpr\bro\bog\bgr\bre\bes\bss\bs_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 22_bit;\n+ static constexpr alert_category_t u\bup\bpl\blo\boa\bad\bd_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 23_bit;\n+ static constexpr alert_category_t b\bbl\blo\boc\bck\bk_\b_p\bpr\bro\bog\bgr\bre\bes\bss\bs_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 24_bit;\n+ static constexpr alert_category_t a\bal\bll\bl_\b_c\bca\bat\bte\beg\bgo\bor\bri\bie\bes\bs = alert_category_t::all();\n+};\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* t\bti\bim\bme\bes\bst\bta\bam\bmp\bp(\b()\b) *\b**\b**\b**\b**\b*\n+time_point t\bti\bim\bme\bes\bst\bta\bam\bmp\bp () const;\n+a timestamp is automatically created in the constructor\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* t\bty\byp\bpe\be(\b()\b) *\b**\b**\b**\b**\b*\n+virtual int t\bty\byp\bpe\be () const noexcept = 0;\n+returns an integer that is unique to this _\ba_\bl_\be_\br_\bt type. It can be compared\n+against a specific _\ba_\bl_\be_\br_\bt by querying a static constant called alert_type in the\n+_\ba_\bl_\be_\br_\bt. It can be used to determine the run-time type of an alert* in order to\n+cast to that _\ba_\bl_\be_\br_\bt type and access specific members.\n+e.g:\n+std::vector alerts;\n+ses.pop_alerts(&alerts);\n+for (alert* a : alerts) {\n+ switch (a->type()) {\n+\n+ case read_piece_alert::alert_type:\n+ {\n+ auto* p = static_cast(a);\n+ if (p->ec) {\n+ // read_piece failed\n+ break;\n+ }\n+ // use p\n+ break;\n+ }\n+ case file_renamed_alert::alert_type:\n+ {\n+ // etc...\n+ }\n+ }\n+}\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* w\bwh\bha\bat\bt(\b()\b) *\b**\b**\b**\b**\b*\n+virtual char const* w\bwh\bha\bat\bt () const noexcept = 0;\n+returns a string literal describing the type of the _\ba_\bl_\be_\br_\bt. It does not include\n+any information that might be bundled with the _\ba_\bl_\be_\br_\bt.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* m\bme\bes\bss\bsa\bag\bge\be(\b()\b) *\b**\b**\b**\b**\b*\n+virtual std::string m\bme\bes\bss\bsa\bag\bge\be () const = 0;\n+generate a string describing the _\ba_\bl_\be_\br_\bt and the information bundled with it.\n+This is mainly intended for debug and development use. It is not suitable to\n+use this for applications that may be localized. Instead, handle each _\ba_\bl_\be_\br_\bt\n+type individually and extract and render the information from the _\ba_\bl_\be_\br_\bt\n+depending on the locale.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* c\bca\bat\bte\beg\bgo\bor\bry\by(\b()\b) *\b**\b**\b**\b**\b*\n+virtual alert_category_t c\bca\bat\bte\beg\bgo\bor\bry\by () const noexcept = 0;\n+returns a bitmask specifying which categories this _\ba_\bl_\be_\br_\bt belong to.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* d\bdh\bht\bt_\b_r\bro\bou\but\bti\bin\bng\bg_\b_b\bbu\buc\bck\bke\bet\bt *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bl_\be_\br_\bt_\b__\bt_\by_\bp_\be_\bs_\b._\bh_\bp_\bp\"\n struct to hold information about a single DHT routing table bucket\n struct dht_routing_bucket\n {\n int num_nodes;\n int num_replacements;\n@@ -311,25 +400,25 @@\n *\b**\b**\b**\b**\b**\b* f\bfi\bil\ble\be_\b_r\bre\ben\bna\bam\bme\bed\bd_\b_a\bal\ble\ber\brt\bt *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bl_\be_\br_\bt_\b__\bt_\by_\bp_\be_\bs_\b._\bh_\bp_\bp\"\n This is posted as a response to a _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be_\b:_\b:_\br_\be_\bn_\ba_\bm_\be_\b__\bf_\bi_\bl_\be_\b(_\b) call, if the\n rename operation succeeds.\n struct file_renamed_alert final : torrent_alert\n {\n std::string m\bme\bes\bss\bsa\bag\bge\be () const override;\n- char const* n\bne\bew\bw_\b_n\bna\bam\bme\be () const;\n char const* o\bol\bld\bd_\b_n\bna\bam\bme\be () const;\n+ char const* n\bne\bew\bw_\b_n\bna\bam\bme\be () const;\n \n static constexpr alert_category_t s\bst\bta\bat\bti\bic\bc_\b_c\bca\bat\bte\beg\bgo\bor\bry\by = alert_category::\n storage;\n file_index_t const index;\n };\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* o\bol\bld\bd_\b_n\bna\bam\bme\be(\b()\b) n\bne\bew\bw_\b_n\bna\bam\bme\be(\b()\b) *\b**\b**\b**\b**\b*\n-char const* n\bne\bew\bw_\b_n\bna\bam\bme\be () const;\n+*\b**\b**\b**\b**\b* n\bne\bew\bw_\b_n\bna\bam\bme\be(\b()\b) o\bol\bld\bd_\b_n\bna\bam\bme\be(\b()\b) *\b**\b**\b**\b**\b*\n char const* o\bol\bld\bd_\b_n\bna\bam\bme\be () const;\n+char const* n\bne\bew\bw_\b_n\bna\bam\bme\be () const;\n returns the new and previous file name, respectively.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n index\n refers to the index of the file that was renamed,\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* f\bfi\bil\ble\be_\b_r\bre\ben\bna\bam\bme\be_\b_f\bfa\bai\bil\ble\bed\bd_\b_a\bal\ble\ber\brt\bt *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bl_\be_\br_\bt_\b__\bt_\by_\bp_\be_\bs_\b._\bh_\bp_\bp\"\n@@ -946,24 +1035,24 @@\n The storage_moved_alert is generated when all the disk IO has completed and the\n files have been moved, as an effect of a call to torrent_handle::move_storage.\n This is useful to synchronize with the actual disk. The storage_path() member\n return the new path of the storage.\n struct storage_moved_alert final : torrent_alert\n {\n std::string m\bme\bes\bss\bsa\bag\bge\be () const override;\n- char const* s\bst\bto\bor\bra\bag\bge\be_\b_p\bpa\bat\bth\bh () const;\n char const* o\bol\bld\bd_\b_p\bpa\bat\bth\bh () const;\n+ char const* s\bst\bto\bor\bra\bag\bge\be_\b_p\bpa\bat\bth\bh () const;\n \n static constexpr alert_category_t s\bst\bta\bat\bti\bic\bc_\b_c\bca\bat\bte\beg\bgo\bor\bry\by = alert_category::\n storage;\n };\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* s\bst\bto\bor\bra\bag\bge\be_\b_p\bpa\bat\bth\bh(\b()\b) o\bol\bld\bd_\b_p\bpa\bat\bth\bh(\b()\b) *\b**\b**\b**\b**\b*\n-char const* s\bst\bto\bor\bra\bag\bge\be_\b_p\bpa\bat\bth\bh () const;\n+*\b**\b**\b**\b**\b* o\bol\bld\bd_\b_p\bpa\bat\bth\bh(\b()\b) s\bst\bto\bor\bra\bag\bge\be_\b_p\bpa\bat\bth\bh(\b()\b) *\b**\b**\b**\b**\b*\n char const* o\bol\bld\bd_\b_p\bpa\bat\bth\bh () const;\n+char const* s\bst\bto\bor\bra\bag\bge\be_\b_p\bpa\bat\bth\bh () const;\n the path the torrent was moved to and from, respectively.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* s\bst\bto\bor\bra\bag\bge\be_\b_m\bmo\bov\bve\bed\bd_\b_f\bfa\bai\bil\ble\bed\bd_\b_a\bal\ble\ber\brt\bt *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bl_\be_\br_\bt_\b__\bt_\by_\bp_\be_\bs_\b._\bh_\bp_\bp\"\n The storage_moved_failed_alert is generated when an attempt to move the\n storage, via _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be_\b:_\b:_\bm_\bo_\bv_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b(_\b), fails.\n struct storage_moved_failed_alert final : torrent_alert\n@@ -2250,15 +2339,15 @@\n dht_operation;\n sha1_hash node_id;\n aux::noexcept_movable endpoint;\n time_duration const interval;\n int const num_infohashes;\n };\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* s\bsa\bam\bmp\bpl\ble\bes\bs(\b()\b) n\bnu\bum\bm_\b_s\bsa\bam\bmp\bpl\ble\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n+*\b**\b**\b**\b**\b* n\bnu\bum\bm_\b_s\bsa\bam\bmp\bpl\ble\bes\bs(\b()\b) s\bsa\bam\bmp\bpl\ble\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n int n\bnu\bum\bm_\b_s\bsa\bam\bmp\bpl\ble\bes\bs () const;\n std::vector s\bsa\bam\bmp\bpl\ble\bes\bs () const;\n returns the number of info-hashes returned by the node, as well as the actual\n info-hashes. num_samples() is more efficient than samples().size().\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* n\bnu\bum\bm_\b_n\bno\bod\bde\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n int n\bnu\bum\bm_\b_n\bno\bod\bde\bes\bs () const;\n@@ -2305,17 +2394,17 @@\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bl_\be_\br_\bt_\b__\bt_\by_\bp_\be_\bs_\b._\bh_\bp_\bp\"\n this _\ba_\bl_\be_\br_\bt is posted to indicate to the client that some alerts were dropped.\n Dropped meaning that the _\ba_\bl_\be_\br_\bt failed to be delivered to the client. The most\n common cause of such failure is that the internal _\ba_\bl_\be_\br_\bt queue grew too big\n (controlled by alert_queue_size).\n struct alerts_dropped_alert final : alert\n {\n+ std::string m\bme\bes\bss\bsa\bag\bge\be () const override;\n s\bst\bta\bat\bti\bic\bc_\b_a\bas\bss\bse\ber\brt\bt (num_alert_types <= abi_alert_count, \"need to increase bitset.\n This is an ABI break\");\n- std::string m\bme\bes\bss\bsa\bag\bge\be () const override;\n \n static constexpr alert_category_t s\bst\bta\bat\bti\bic\bc_\b_c\bca\bat\bte\beg\bgo\bor\bry\by = alert_category::error;\n std::bitset dropped_alerts;\n };\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n dropped_alerts\n a bitmask indicating which alerts were dropped. Each bit represents the\n@@ -2483,118 +2572,29 @@\n static constexpr alert_category_t s\bst\bta\bat\bti\bic\bc_\b_c\bca\bat\bte\beg\bgo\bor\bry\by = alert_category::status;\n std::vector trackers;\n };\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n trackers\n list of trackers and their status for the torrent\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* a\bal\ble\ber\brt\bt *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bl_\be_\br_\bt_\b._\bh_\bp_\bp\"\n-The alert class is the base class that specific messages are derived from.\n-_\ba_\bl_\be_\br_\bt types are not copyable, and cannot be constructed by the client. The\n-pointers returned by libtorrent are short lived (the details are described\n-under _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bh_\ba_\bn_\bd_\bl_\be_\b:_\b:_\bp_\bo_\bp_\b__\ba_\bl_\be_\br_\bt_\bs_\b(_\b))\n-struct alert\n-{\n- time_point t\bti\bim\bme\bes\bst\bta\bam\bmp\bp () const;\n- virtual int t\bty\byp\bpe\be () const noexcept = 0;\n- virtual char const* w\bwh\bha\bat\bt () const noexcept = 0;\n- virtual std::string m\bme\bes\bss\bsa\bag\bge\be () const = 0;\n- virtual alert_category_t c\bca\bat\bte\beg\bgo\bor\bry\by () const noexcept = 0;\n-\n- static constexpr alert_category_t e\ber\brr\bro\bor\br_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 0_bit;\n- static constexpr alert_category_t p\bpe\bee\ber\br_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 1_bit;\n- static constexpr alert_category_t p\bpo\bor\brt\bt_\b_m\bma\bap\bpp\bpi\bin\bng\bg_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 2_bit;\n- static constexpr alert_category_t s\bst\bto\bor\bra\bag\bge\be_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 3_bit;\n- static constexpr alert_category_t t\btr\bra\bac\bck\bke\ber\br_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 4_bit;\n- static constexpr alert_category_t c\bco\bon\bnn\bne\bec\bct\bt_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 5_bit;\n- static constexpr alert_category_t s\bst\bta\bat\btu\bus\bs_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 6_bit;\n- static constexpr alert_category_t i\bip\bp_\b_b\bbl\blo\boc\bck\bk_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 8_bit;\n- static constexpr alert_category_t p\bpe\ber\brf\bfo\bor\brm\bma\ban\bnc\bce\be_\b_w\bwa\bar\brn\bni\bin\bng\bg = 9_bit;\n- static constexpr alert_category_t d\bdh\bht\bt_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 10_bit;\n- static constexpr alert_category_t s\bse\bes\bss\bsi\bio\bon\bn_\b_l\blo\bog\bg_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 13_bit;\n- static constexpr alert_category_t t\bto\bor\brr\bre\ben\bnt\bt_\b_l\blo\bog\bg_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 14_bit;\n- static constexpr alert_category_t p\bpe\bee\ber\br_\b_l\blo\bog\bg_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 15_bit;\n- static constexpr alert_category_t i\bin\bnc\bco\bom\bmi\bin\bng\bg_\b_r\bre\beq\bqu\bue\bes\bst\bt_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 16_bit;\n- static constexpr alert_category_t d\bdh\bht\bt_\b_l\blo\bog\bg_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 17_bit;\n- static constexpr alert_category_t d\bdh\bht\bt_\b_o\bop\bpe\ber\bra\bat\bti\bio\bon\bn_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 18_bit;\n- static constexpr alert_category_t p\bpo\bor\brt\bt_\b_m\bma\bap\bpp\bpi\bin\bng\bg_\b_l\blo\bog\bg_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 19_bit;\n- static constexpr alert_category_t p\bpi\bic\bck\bke\ber\br_\b_l\blo\bog\bg_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 20_bit;\n- static constexpr alert_category_t f\bfi\bil\ble\be_\b_p\bpr\bro\bog\bgr\bre\bes\bss\bs_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 21_bit;\n- static constexpr alert_category_t p\bpi\bie\bec\bce\be_\b_p\bpr\bro\bog\bgr\bre\bes\bss\bs_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 22_bit;\n- static constexpr alert_category_t u\bup\bpl\blo\boa\bad\bd_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 23_bit;\n- static constexpr alert_category_t b\bbl\blo\boc\bck\bk_\b_p\bpr\bro\bog\bgr\bre\bes\bss\bs_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 24_bit;\n- static constexpr alert_category_t a\bal\bll\bl_\b_c\bca\bat\bte\beg\bgo\bor\bri\bie\bes\bs = alert_category_t::all();\n-};\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* t\bti\bim\bme\bes\bst\bta\bam\bmp\bp(\b()\b) *\b**\b**\b**\b**\b*\n-time_point t\bti\bim\bme\bes\bst\bta\bam\bmp\bp () const;\n-a timestamp is automatically created in the constructor\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* t\bty\byp\bpe\be(\b()\b) *\b**\b**\b**\b**\b*\n-virtual int t\bty\byp\bpe\be () const noexcept = 0;\n-returns an integer that is unique to this _\ba_\bl_\be_\br_\bt type. It can be compared\n-against a specific _\ba_\bl_\be_\br_\bt by querying a static constant called alert_type in the\n-_\ba_\bl_\be_\br_\bt. It can be used to determine the run-time type of an alert* in order to\n-cast to that _\ba_\bl_\be_\br_\bt type and access specific members.\n-e.g:\n-std::vector alerts;\n-ses.pop_alerts(&alerts);\n-for (alert* a : alerts) {\n- switch (a->type()) {\n-\n- case read_piece_alert::alert_type:\n- {\n- auto* p = static_cast(a);\n- if (p->ec) {\n- // read_piece failed\n- break;\n- }\n- // use p\n- break;\n- }\n- case file_renamed_alert::alert_type:\n- {\n- // etc...\n- }\n- }\n-}\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* w\bwh\bha\bat\bt(\b()\b) *\b**\b**\b**\b**\b*\n-virtual char const* w\bwh\bha\bat\bt () const noexcept = 0;\n-returns a string literal describing the type of the _\ba_\bl_\be_\br_\bt. It does not include\n-any information that might be bundled with the _\ba_\bl_\be_\br_\bt.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* m\bme\bes\bss\bsa\bag\bge\be(\b()\b) *\b**\b**\b**\b**\b*\n-virtual std::string m\bme\bes\bss\bsa\bag\bge\be () const = 0;\n-generate a string describing the _\ba_\bl_\be_\br_\bt and the information bundled with it.\n-This is mainly intended for debug and development use. It is not suitable to\n-use this for applications that may be localized. Instead, handle each _\ba_\bl_\be_\br_\bt\n-type individually and extract and render the information from the _\ba_\bl_\be_\br_\bt\n-depending on the locale.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* c\bca\bat\bte\beg\bgo\bor\bry\by(\b()\b) *\b**\b**\b**\b**\b*\n-virtual alert_category_t c\bca\bat\bte\beg\bgo\bor\bry\by () const noexcept = 0;\n-returns a bitmask specifying which categories this _\ba_\bl_\be_\br_\bt belong to.\n+*\b**\b**\b**\b**\b**\b* o\bop\bpe\ber\bra\bat\bti\bio\bon\bn_\b_n\bna\bam\bme\be(\b()\b) *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bo_\bp_\be_\br_\ba_\bt_\bi_\bo_\bn_\bs_\b._\bh_\bp_\bp\"\n+char const* o\bop\bpe\ber\bra\bat\bti\bio\bon\bn_\b_n\bna\bam\bme\be (operation_t op);\n+maps an operation id (from _\bp_\be_\be_\br_\b__\be_\br_\br_\bo_\br_\b__\ba_\bl_\be_\br_\bt and _\bp_\be_\be_\br_\b__\bd_\bi_\bs_\bc_\bo_\bn_\bn_\be_\bc_\bt_\be_\bd_\b__\ba_\bl_\be_\br_\bt) to its\n+name. See _\bo_\bp_\be_\br_\ba_\bt_\bi_\bo_\bn_\b__\bt for the constants\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* a\bal\ble\ber\brt\bt_\b_c\bca\bas\bst\bt(\b()\b) *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bl_\be_\br_\bt_\b._\bh_\bp_\bp\"\n-template T* a\bal\ble\ber\brt\bt_\b_c\bca\bas\bst\bt (alert* a);\n template T const* a\bal\ble\ber\brt\bt_\b_c\bca\bas\bst\bt (alert const* a);\n+template T* a\bal\ble\ber\brt\bt_\b_c\bca\bas\bst\bt (alert* a);\n When you get an _\ba_\bl_\be_\br_\bt, you can use alert_cast<> to attempt to cast the pointer\n to a specific _\ba_\bl_\be_\br_\bt type, in order to query it for more information.\n Note\n alert_cast<> can only cast to an exact _\ba_\bl_\be_\br_\bt type, not a base class\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* o\bop\bpe\ber\bra\bat\bti\bio\bon\bn_\b_n\bna\bam\bme\be(\b()\b) *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bo_\bp_\be_\br_\ba_\bt_\bi_\bo_\bn_\bs_\b._\bh_\bp_\bp\"\n-char const* o\bop\bpe\ber\bra\bat\bti\bio\bon\bn_\b_n\bna\bam\bme\be (operation_t op);\n-maps an operation id (from _\bp_\be_\be_\br_\b__\be_\br_\br_\bo_\br_\b__\ba_\bl_\be_\br_\bt and _\bp_\be_\be_\br_\b__\bd_\bi_\bs_\bc_\bo_\bn_\bn_\be_\bc_\bt_\be_\bd_\b__\ba_\bl_\be_\br_\bt) to its\n-name. See _\bo_\bp_\be_\br_\ba_\bt_\bi_\bo_\bn_\b__\bt for the constants\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* e\ben\bnu\bum\bm o\bop\bpe\ber\bra\bat\bti\bio\bon\bn_\b_t\bt *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bo_\bp_\be_\br_\ba_\bt_\bi_\bo_\bn_\bs_\b._\bh_\bp_\bp\"\n _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n |_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |unknown |0 |the error was unexpected and it is unknown which |\n |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bo_\bp_\be_\br_\ba_\bt_\bi_\bo_\bn_\b _\bc_\ba_\bu_\bs_\be_\bd_\b _\bi_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |bittorrent |1 |this is used when the bittorrent logic determines |\n@@ -2648,21 +2648,14 @@\n |_\be_\bn_\bu_\bm_\b__\br_\bo_\bu_\bt_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b4_\b2_\b _\b _\b _\b|_\be_\bn_\bu_\bm_\be_\br_\ba_\bt_\bi_\bo_\bn_\b _\bo_\bf_\b _\bn_\be_\bt_\bw_\bo_\br_\bk_\b _\br_\bo_\bu_\bt_\be_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |file_seek |43 |moving read/write position in a file, _\bo_\bp_\be_\br_\ba_\bt_\bi_\bo_\bn_\b__\bt_\b:_\b:|\n |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bh_\bo_\bs_\bt_\bn_\ba_\bm_\be_\b__\bl_\bo_\bo_\bk_\bu_\bp_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |_\bt_\bi_\bm_\be_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b4_\b4_\b _\b _\b _\b|_\ba_\bn_\b _\ba_\bs_\by_\bn_\bc_\b _\bw_\ba_\bi_\bt_\b _\bo_\bp_\be_\br_\ba_\bt_\bi_\bo_\bn_\b _\bo_\bn_\b _\ba_\b _\bt_\bi_\bm_\be_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |_\bf_\bi_\bl_\be_\b__\bm_\bm_\ba_\bp_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b4_\b5_\b _\b _\b _\b|_\bc_\ba_\bl_\bl_\b _\bt_\bo_\b _\bm_\bm_\ba_\bp_\b(_\b)_\b _\b(_\bo_\br_\b _\bw_\bi_\bn_\bd_\bo_\bw_\bs_\b _\bc_\bo_\bu_\bn_\bt_\be_\br_\bp_\ba_\br_\bt_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |_\bf_\bi_\bl_\be_\b__\bt_\br_\bu_\bn_\bc_\ba_\bt_\be_\b _\b _\b _\b _\b _\b _\b|_\b4_\b6_\b _\b _\b _\b|_\bc_\ba_\bl_\bl_\b _\bt_\bo_\b _\bf_\bt_\br_\bu_\bn_\bc_\ba_\bt_\be_\b(_\b)_\b _\b(_\bo_\br_\b _\bS_\be_\bt_\bE_\bn_\bd_\bO_\bf_\bF_\bi_\bl_\be_\b(_\b)_\b _\bo_\bn_\b _\bw_\bi_\bn_\bd_\bo_\bw_\bs_\b)_\b |\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* i\bin\bnt\bt *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bl_\be_\br_\bt_\b__\bt_\by_\bp_\be_\bs_\b._\bh_\bp_\bp\"\n- user_alert_id\n- user defined alerts should use IDs greater than this\n- num_alert_types\n- this constant represents \"max_alert_index\" + 1\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* a\bal\ble\ber\brt\bt_\b_c\bca\bat\bte\beg\bgo\bor\bry\by_\b_t\bt *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bl_\be_\br_\bt_\b._\bh_\bp_\bp\"\n error\n Enables alerts that report an error. This includes:\n * tracker errors\n * tracker warnings\n * file errors\n@@ -2733,14 +2726,21 @@\n rejected, time-out and cancelled. This is likely to post alerts at a high\n rate.\n all\n The full bitmask, representing all available categories.\n since the enum is signed, make sure this isn't interpreted as -1. For\n instance, boost.python does that and fails when assigning it to an\n unsigned parameter.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* i\bin\bnt\bt *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bl_\be_\br_\bt_\b__\bt_\by_\bp_\be_\bs_\b._\bh_\bp_\bp\"\n+ user_alert_id\n+ user defined alerts should use IDs greater than this\n+ num_alert_types\n+ this constant represents \"max_alert_index\" + 1\n _\bh_\bo_\bm_\be\n _\bb_\bl_\bo_\bg\n _\bu_\bT_\bP\n _\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd\n _\bd_\bo_\bc_\bu_\bm_\be_\bn_\bt_\ba_\bt_\bi_\bo_\bn\n _\bD_\bH_\bT_\b _\bp_\bu_\bt_\b _\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn\n _\bp_\by_\bt_\bh_\bo_\bn_\b _\bb_\bi_\bn_\bd_\bi_\bn_\bg_\bs\n"}]}, {"source1": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Bdecoding.html", "source2": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Bdecoding.html", "unified_diff": "@@ -35,18 +35,18 @@\n
  • bdecode_node\n@@ -62,46 +62,46 @@\n to be able to copy it as a reference for instance). For that, use the\n non_owning() member function.

    \n

    There are 5 different types of nodes, see type_t.

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

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

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

    bdecode_node() operator=()

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

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

    \n [report issue]
    \n
    \n

    type()

    \n
    \n@@ -164,57 +164,57 @@\n 
    \n

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

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

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

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

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

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

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

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

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

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

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

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

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

    \n@@ -230,24 +230,24 @@\n

    int_value()

    \n
    \n std::int64_t int_value () const;\n 
    \n

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

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

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

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

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

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

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

    \n [report issue]
    \n@@ -345,20 +345,20 @@\n

    print the bencoded structure in a human-readable format to a string\n that's returned.

    \n [report issue]
    \n
    \n

    bdecode()

    \n

    Declared in "libtorrent/bdecode.hpp"

    \n
    \n-bdecode_node bdecode (span<char const> buffer\n+int bdecode (char const* start, char const* end, bdecode_node& ret\n    , error_code& ec, int* error_pos = nullptr, int depth_limit = 100\n    , int token_limit = 2000000);\n bdecode_node bdecode (span<char const> buffer\n    , int depth_limit = 100, int token_limit = 2000000);\n-int bdecode (char const* start, char const* end, bdecode_node& ret\n+bdecode_node bdecode (span<char const> buffer\n    , error_code& ec, int* error_pos = nullptr, int depth_limit = 100\n    , int token_limit = 2000000);\n 
    \n

    This function decodes/parses bdecoded data (for example a .torrent file).\n The data structure is returned in the ret argument. the buffer to parse\n is specified by the start of the buffer as well as the end, i.e. one\n byte past the end. If the buffer fails to parse, the function returns a\n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -6,20 +6,20 @@\n * _\bb_\bd_\be_\bc_\bo_\bd_\be_\b__\bn_\bo_\bd_\be\n o _\bb_\bd_\be_\bc_\bo_\bd_\be_\b__\bn_\bo_\bd_\be_\b(_\b)\n o _\bb_\bd_\be_\bc_\bo_\bd_\be_\b__\bn_\bo_\bd_\be_\b(_\b)_\b _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b=_\b(_\b)\n o _\bt_\by_\bp_\be_\b(_\b)\n o _\bb_\bo_\bo_\bl_\b(_\b)\n o _\bn_\bo_\bn_\b__\bo_\bw_\bn_\bi_\bn_\bg_\b(_\b)\n o _\bd_\ba_\bt_\ba_\b__\bs_\be_\bc_\bt_\bi_\bo_\bn_\b(_\b)_\b _\bd_\ba_\bt_\ba_\b__\bo_\bf_\bf_\bs_\be_\bt_\b(_\b)\n- o _\bl_\bi_\bs_\bt_\b__\bs_\bt_\br_\bi_\bn_\bg_\b__\bv_\ba_\bl_\bu_\be_\b__\ba_\bt_\b(_\b)_\b _\bl_\bi_\bs_\bt_\b__\bi_\bn_\bt_\b__\bv_\ba_\bl_\bu_\be_\b__\ba_\bt_\b(_\b)_\b _\bl_\bi_\bs_\bt_\b__\ba_\bt_\b(_\b)_\b _\bl_\bi_\bs_\bt_\b__\bs_\bi_\bz_\be_\b(_\b)\n- o _\bd_\bi_\bc_\bt_\b__\bf_\bi_\bn_\bd_\b__\bi_\bn_\bt_\b__\bv_\ba_\bl_\bu_\be_\b(_\b)_\b _\bd_\bi_\bc_\bt_\b__\bf_\bi_\bn_\bd_\b__\bs_\bt_\br_\bi_\bn_\bg_\b__\bv_\ba_\bl_\bu_\be_\b(_\b)_\b _\bd_\bi_\bc_\bt_\b__\bf_\bi_\bn_\bd_\b(_\b)\n- _\bd_\bi_\bc_\bt_\b__\bf_\bi_\bn_\bd_\b__\bi_\bn_\bt_\b(_\b)_\b _\bd_\bi_\bc_\bt_\b__\bf_\bi_\bn_\bd_\b__\bl_\bi_\bs_\bt_\b(_\b)_\b _\bd_\bi_\bc_\bt_\b__\ba_\bt_\b__\bn_\bo_\bd_\be_\b(_\b)_\b _\bd_\bi_\bc_\bt_\b__\ba_\bt_\b(_\b)\n- _\bd_\bi_\bc_\bt_\b__\bf_\bi_\bn_\bd_\b__\bs_\bt_\br_\bi_\bn_\bg_\b(_\b)_\b _\bd_\bi_\bc_\bt_\b__\bf_\bi_\bn_\bd_\b__\bd_\bi_\bc_\bt_\b(_\b)_\b _\bd_\bi_\bc_\bt_\b__\bs_\bi_\bz_\be_\b(_\b)\n+ o _\bl_\bi_\bs_\bt_\b__\bs_\bi_\bz_\be_\b(_\b)_\b _\bl_\bi_\bs_\bt_\b__\ba_\bt_\b(_\b)_\b _\bl_\bi_\bs_\bt_\b__\bi_\bn_\bt_\b__\bv_\ba_\bl_\bu_\be_\b__\ba_\bt_\b(_\b)_\b _\bl_\bi_\bs_\bt_\b__\bs_\bt_\br_\bi_\bn_\bg_\b__\bv_\ba_\bl_\bu_\be_\b__\ba_\bt_\b(_\b)\n+ o _\bd_\bi_\bc_\bt_\b__\bf_\bi_\bn_\bd_\b(_\b)_\b _\bd_\bi_\bc_\bt_\b__\bf_\bi_\bn_\bd_\b__\bs_\bt_\br_\bi_\bn_\bg_\b(_\b)_\b _\bd_\bi_\bc_\bt_\b__\bf_\bi_\bn_\bd_\b__\bl_\bi_\bs_\bt_\b(_\b)_\b _\bd_\bi_\bc_\bt_\b__\bs_\bi_\bz_\be_\b(_\b)\n+ _\bd_\bi_\bc_\bt_\b__\bf_\bi_\bn_\bd_\b__\bi_\bn_\bt_\b__\bv_\ba_\bl_\bu_\be_\b(_\b)_\b _\bd_\bi_\bc_\bt_\b__\ba_\bt_\b__\bn_\bo_\bd_\be_\b(_\b)_\b _\bd_\bi_\bc_\bt_\b__\bf_\bi_\bn_\bd_\b__\bd_\bi_\bc_\bt_\b(_\b)_\b _\bd_\bi_\bc_\bt_\b__\ba_\bt_\b(_\b)\n+ _\bd_\bi_\bc_\bt_\b__\bf_\bi_\bn_\bd_\b__\bi_\bn_\bt_\b(_\b)_\b _\bd_\bi_\bc_\bt_\b__\bf_\bi_\bn_\bd_\b__\bs_\bt_\br_\bi_\bn_\bg_\b__\bv_\ba_\bl_\bu_\be_\b(_\b)\n o _\bi_\bn_\bt_\b__\bv_\ba_\bl_\bu_\be_\b(_\b)\n- o _\bs_\bt_\br_\bi_\bn_\bg_\b__\bo_\bf_\bf_\bs_\be_\bt_\b(_\b)_\b _\bs_\bt_\br_\bi_\bn_\bg_\b__\bv_\ba_\bl_\bu_\be_\b(_\b)_\b _\bs_\bt_\br_\bi_\bn_\bg_\b__\bl_\be_\bn_\bg_\bt_\bh_\b(_\b)_\b _\bs_\bt_\br_\bi_\bn_\bg_\b__\bp_\bt_\br_\b(_\b)\n+ o _\bs_\bt_\br_\bi_\bn_\bg_\b__\bo_\bf_\bf_\bs_\be_\bt_\b(_\b)_\b _\bs_\bt_\br_\bi_\bn_\bg_\b__\bp_\bt_\br_\b(_\b)_\b _\bs_\bt_\br_\bi_\bn_\bg_\b__\bl_\be_\bn_\bg_\bt_\bh_\b(_\b)_\b _\bs_\bt_\br_\bi_\bn_\bg_\b__\bv_\ba_\bl_\bu_\be_\b(_\b)\n o _\bc_\bl_\be_\ba_\br_\b(_\b)\n o _\bs_\bw_\ba_\bp_\b(_\b)\n o _\br_\be_\bs_\be_\br_\bv_\be_\b(_\b)\n o _\bs_\bw_\bi_\bt_\bc_\bh_\b__\bu_\bn_\bd_\be_\br_\bl_\by_\bi_\bn_\bg_\b__\bb_\bu_\bf_\bf_\be_\br_\b(_\b)\n o _\bh_\ba_\bs_\b__\bs_\bo_\bf_\bt_\b__\be_\br_\br_\bo_\br_\b(_\b)\n o _\be_\bn_\bu_\bm_\b _\bt_\by_\bp_\be_\b__\bt\n * _\bp_\br_\bi_\bn_\bt_\b__\be_\bn_\bt_\br_\by_\b(_\b)\n@@ -30,46 +30,46 @@\n Sometimes it's important to get a non-owning reference to the root node ( to be\n able to copy it as a reference for instance). For that, use the _\bn_\bo_\bn_\b__\bo_\bw_\bn_\bi_\bn_\bg_\b(_\b)\n member function.\n There are 5 different types of nodes, see _\bt_\by_\bp_\be_\b__\bt.\n struct bdecode_node\n {\n b\bbd\bde\bec\bco\bod\bde\be_\b_n\bno\bod\bde\be () = default;\n- bdecode_node& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (bdecode_node const&) &;\n- b\bbd\bde\bec\bco\bod\bde\be_\b_n\bno\bod\bde\be (bdecode_node&&) noexcept;\n bdecode_node& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (bdecode_node&&) & = default;\n+ b\bbd\bde\bec\bco\bod\bde\be_\b_n\bno\bod\bde\be (bdecode_node&&) noexcept;\n b\bbd\bde\bec\bco\bod\bde\be_\b_n\bno\bod\bde\be (bdecode_node const&);\n+ bdecode_node& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (bdecode_node const&) &;\n type_t t\bty\byp\bpe\be () const noexcept;\n explicit operator b\bbo\boo\bol\bl () const noexcept;\n bdecode_node n\bno\bon\bn_\b_o\bow\bwn\bni\bin\bng\bg () const;\n span d\bda\bat\bta\ba_\b_s\bse\bec\bct\bti\bio\bon\bn () const noexcept;\n std::ptrdiff_t d\bda\bat\bta\ba_\b_o\bof\bff\bfs\bse\bet\bt () const noexcept;\n- int l\bli\bis\bst\bt_\b_s\bsi\biz\bze\be () const;\n+ bdecode_node l\bli\bis\bst\bt_\b_a\bat\bt (int i) const;\n string_view l\bli\bis\bst\bt_\b_s\bst\btr\bri\bin\bng\bg_\b_v\bva\bal\blu\bue\be_\b_a\bat\bt (int i\n , string_view default_val = string_view()) const;\n+ int l\bli\bis\bst\bt_\b_s\bsi\biz\bze\be () const;\n std::int64_t l\bli\bis\bst\bt_\b_i\bin\bnt\bt_\b_v\bva\bal\blu\bue\be_\b_a\bat\bt (int i\n , std::int64_t default_val = 0) const;\n- bdecode_node l\bli\bis\bst\bt_\b_a\bat\bt (int i) const;\n- string_view d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_s\bst\btr\bri\bin\bng\bg_\b_v\bva\bal\blu\bue\be (string_view key\n- , string_view default_value = string_view()) const;\n- int d\bdi\bic\bct\bt_\b_s\bsi\biz\bze\be () const;\n+ bdecode_node d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_l\bli\bis\bst\bt (string_view key) const;\n bdecode_node d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_d\bdi\bic\bct\bt (string_view key) const;\n+ int d\bdi\bic\bct\bt_\b_s\bsi\biz\bze\be () const;\n+ bdecode_node d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_s\bst\btr\bri\bin\bng\bg (string_view key) const;\n+ bdecode_node d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd (string_view key) const;\n+ std::pair d\bdi\bic\bct\bt_\b_a\bat\bt (int i) const;\n bdecode_node d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_i\bin\bnt\bt (string_view key) const;\n- bdecode_node d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_l\bli\bis\bst\bt (string_view key) const;\n+ std::pair d\bdi\bic\bct\bt_\b_a\bat\bt_\b_n\bno\bod\bde\be (int i) const;\n std::int64_t d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_i\bin\bnt\bt_\b_v\bva\bal\blu\bue\be (string_view key\n , std::int64_t default_val = 0) const;\n- std::pair d\bdi\bic\bct\bt_\b_a\bat\bt (int i) const;\n- std::pair d\bdi\bic\bct\bt_\b_a\bat\bt_\b_n\bno\bod\bde\be (int i) const;\n- bdecode_node d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_s\bst\btr\bri\bin\bng\bg (string_view key) const;\n- bdecode_node d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd (string_view key) const;\n+ string_view d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_s\bst\btr\bri\bin\bng\bg_\b_v\bva\bal\blu\bue\be (string_view key\n+ , string_view default_value = string_view()) const;\n std::int64_t i\bin\bnt\bt_\b_v\bva\bal\blu\bue\be () const;\n- int s\bst\btr\bri\bin\bng\bg_\b_l\ble\ben\bng\bgt\bth\bh () const;\n- char const* s\bst\btr\bri\bin\bng\bg_\b_p\bpt\btr\br () const;\n std::ptrdiff_t s\bst\btr\bri\bin\bng\bg_\b_o\bof\bff\bfs\bse\bet\bt () const;\n+ int s\bst\btr\bri\bin\bng\bg_\b_l\ble\ben\bng\bgt\bth\bh () const;\n string_view s\bst\btr\bri\bin\bng\bg_\b_v\bva\bal\blu\bue\be () const;\n+ char const* s\bst\btr\bri\bin\bng\bg_\b_p\bpt\btr\br () const;\n void c\bcl\ble\bea\bar\br ();\n void s\bsw\bwa\bap\bp (bdecode_node& n);\n void r\bre\bes\bse\ber\brv\bve\be (int tokens);\n void s\bsw\bwi\bit\btc\bch\bh_\b_u\bun\bnd\bde\ber\brl\bly\byi\bin\bng\bg_\b_b\bbu\buf\bff\bfe\ber\br (char const* buf) noexcept;\n bool h\bha\bas\bs_\b_s\bso\bof\bft\bt_\b_e\ber\brr\bro\bor\br (span error) const;\n \n enum type_t\n@@ -83,18 +83,18 @@\n };\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* b\bbd\bde\bec\bco\bod\bde\be_\b_n\bno\bod\bde\be(\b()\b) *\b**\b**\b**\b**\b*\n b\bbd\bde\bec\bco\bod\bde\be_\b_n\bno\bod\bde\be () = default;\n creates a default constructed node, it will have the type none_t.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* b\bbd\bde\bec\bco\bod\bde\be_\b_n\bno\bod\bde\be(\b()\b) o\bop\bpe\ber\bra\bat\bto\bor\br=\b=(\b()\b) *\b**\b**\b**\b**\b*\n-bdecode_node& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (bdecode_node const&) &;\n-b\bbd\bde\bec\bco\bod\bde\be_\b_n\bno\bod\bde\be (bdecode_node&&) noexcept;\n bdecode_node& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (bdecode_node&&) & = default;\n+b\bbd\bde\bec\bco\bod\bde\be_\b_n\bno\bod\bde\be (bdecode_node&&) noexcept;\n b\bbd\bde\bec\bco\bod\bde\be_\b_n\bno\bod\bde\be (bdecode_node const&);\n+bdecode_node& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (bdecode_node const&) &;\n For owning nodes, the copy will create a copy of the tree, but the underlying\n buffer remains the same.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* t\bty\byp\bpe\be(\b()\b) *\b**\b**\b**\b**\b*\n type_t t\bty\byp\bpe\be () const noexcept;\n the type of this node. See _\bt_\by_\bp_\be_\b__\bt.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n@@ -112,41 +112,41 @@\n std::ptrdiff_t d\bda\bat\bta\ba_\b_o\bof\bff\bfs\bse\bet\bt () const noexcept;\n returns the buffer and length of the section in the original bencoded buffer\n where this node is defined. For a dictionary for instance, this starts with d\n and ends with e, and has all the content of the dictionary in between. the\n data_offset() function returns the byte-offset to this node in, starting from\n the beginning of the buffer that was parsed.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* l\bli\bis\bst\bt_\b_s\bst\btr\bri\bin\bng\bg_\b_v\bva\bal\blu\bue\be_\b_a\bat\bt(\b()\b) l\bli\bis\bst\bt_\b_i\bin\bnt\bt_\b_v\bva\bal\blu\bue\be_\b_a\bat\bt(\b()\b) l\bli\bis\bst\bt_\b_a\bat\bt(\b()\b) l\bli\bis\bst\bt_\b_s\bsi\biz\bze\be(\b()\b) *\b**\b**\b**\b**\b*\n-int l\bli\bis\bst\bt_\b_s\bsi\biz\bze\be () const;\n+*\b**\b**\b**\b**\b* l\bli\bis\bst\bt_\b_s\bsi\biz\bze\be(\b()\b) l\bli\bis\bst\bt_\b_a\bat\bt(\b()\b) l\bli\bis\bst\bt_\b_i\bin\bnt\bt_\b_v\bva\bal\blu\bue\be_\b_a\bat\bt(\b()\b) l\bli\bis\bst\bt_\b_s\bst\btr\bri\bin\bng\bg_\b_v\bva\bal\blu\bue\be_\b_a\bat\bt(\b()\b) *\b**\b**\b**\b**\b*\n+bdecode_node l\bli\bis\bst\bt_\b_a\bat\bt (int i) const;\n string_view l\bli\bis\bst\bt_\b_s\bst\btr\bri\bin\bng\bg_\b_v\bva\bal\blu\bue\be_\b_a\bat\bt (int i\n , string_view default_val = string_view()) const;\n+int l\bli\bis\bst\bt_\b_s\bsi\biz\bze\be () const;\n std::int64_t l\bli\bis\bst\bt_\b_i\bin\bnt\bt_\b_v\bva\bal\blu\bue\be_\b_a\bat\bt (int i\n , std::int64_t default_val = 0) const;\n-bdecode_node l\bli\bis\bst\bt_\b_a\bat\bt (int i) const;\n functions with the list_ prefix operate on lists. These functions are only\n valid if type() == list_t. list_at() returns the item in the list at index i. i\n may not be greater than or equal to the size of the list. size() returns the\n size of the list.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_i\bin\bnt\bt_\b_v\bva\bal\blu\bue\be(\b()\b) d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_s\bst\btr\bri\bin\bng\bg_\b_v\bva\bal\blu\bue\be(\b()\b) d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd(\b()\b) d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_i\bin\bnt\bt\n-(\b()\b) d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_l\bli\bis\bst\bt(\b()\b) d\bdi\bic\bct\bt_\b_a\bat\bt_\b_n\bno\bod\bde\be(\b()\b) d\bdi\bic\bct\bt_\b_a\bat\bt(\b()\b) d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_s\bst\btr\bri\bin\bng\bg(\b()\b) d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_d\bdi\bic\bct\bt\n-(\b()\b) d\bdi\bic\bct\bt_\b_s\bsi\biz\bze\be(\b()\b) *\b**\b**\b**\b**\b*\n-string_view d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_s\bst\btr\bri\bin\bng\bg_\b_v\bva\bal\blu\bue\be (string_view key\n- , string_view default_value = string_view()) const;\n-int d\bdi\bic\bct\bt_\b_s\bsi\biz\bze\be () const;\n+*\b**\b**\b**\b**\b* d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd(\b()\b) d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_s\bst\btr\bri\bin\bng\bg(\b()\b) d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_l\bli\bis\bst\bt(\b()\b) d\bdi\bic\bct\bt_\b_s\bsi\biz\bze\be(\b()\b)\n+d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_i\bin\bnt\bt_\b_v\bva\bal\blu\bue\be(\b()\b) d\bdi\bic\bct\bt_\b_a\bat\bt_\b_n\bno\bod\bde\be(\b()\b) d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_d\bdi\bic\bct\bt(\b()\b) d\bdi\bic\bct\bt_\b_a\bat\bt(\b()\b) d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_i\bin\bnt\bt(\b()\b)\n+d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_s\bst\btr\bri\bin\bng\bg_\b_v\bva\bal\blu\bue\be(\b()\b) *\b**\b**\b**\b**\b*\n+bdecode_node d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_l\bli\bis\bst\bt (string_view key) const;\n bdecode_node d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_d\bdi\bic\bct\bt (string_view key) const;\n+int d\bdi\bic\bct\bt_\b_s\bsi\biz\bze\be () const;\n+bdecode_node d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_s\bst\btr\bri\bin\bng\bg (string_view key) const;\n+bdecode_node d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd (string_view key) const;\n+std::pair d\bdi\bic\bct\bt_\b_a\bat\bt (int i) const;\n bdecode_node d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_i\bin\bnt\bt (string_view key) const;\n-bdecode_node d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_l\bli\bis\bst\bt (string_view key) const;\n+std::pair d\bdi\bic\bct\bt_\b_a\bat\bt_\b_n\bno\bod\bde\be (int i) const;\n std::int64_t d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_i\bin\bnt\bt_\b_v\bva\bal\blu\bue\be (string_view key\n , std::int64_t default_val = 0) const;\n-std::pair d\bdi\bic\bct\bt_\b_a\bat\bt (int i) const;\n-std::pair d\bdi\bic\bct\bt_\b_a\bat\bt_\b_n\bno\bod\bde\be (int i) const;\n-bdecode_node d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_s\bst\btr\bri\bin\bng\bg (string_view key) const;\n-bdecode_node d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd (string_view key) const;\n+string_view d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_s\bst\btr\bri\bin\bng\bg_\b_v\bva\bal\blu\bue\be (string_view key\n+ , string_view default_value = string_view()) const;\n Functions with the dict_ prefix operates on dictionaries. They are only valid\n if type() == dict_t. In case a key you're looking up contains a 0 byte, you\n cannot use the 0-terminated string overloads, but have to use string_view\n instead. dict_find_list will return a valid bdecode_node if the key is found\n _and_ it is a list. Otherwise it will return a default-constructed\n _\bb_\bd_\be_\bc_\bo_\bd_\be_\b__\bn_\bo_\bd_\be.\n Functions with the _value suffix return the value of the node directly, rather\n@@ -158,19 +158,19 @@\n string).\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* i\bin\bnt\bt_\b_v\bva\bal\blu\bue\be(\b()\b) *\b**\b**\b**\b**\b*\n std::int64_t i\bin\bnt\bt_\b_v\bva\bal\blu\bue\be () const;\n this function is only valid if type() == int_t. It returns the value of the\n integer.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* s\bst\btr\bri\bin\bng\bg_\b_o\bof\bff\bfs\bse\bet\bt(\b()\b) s\bst\btr\bri\bin\bng\bg_\b_v\bva\bal\blu\bue\be(\b()\b) s\bst\btr\bri\bin\bng\bg_\b_l\ble\ben\bng\bgt\bth\bh(\b()\b) s\bst\btr\bri\bin\bng\bg_\b_p\bpt\btr\br(\b()\b) *\b**\b**\b**\b**\b*\n-int s\bst\btr\bri\bin\bng\bg_\b_l\ble\ben\bng\bgt\bth\bh () const;\n-char const* s\bst\btr\bri\bin\bng\bg_\b_p\bpt\btr\br () const;\n+*\b**\b**\b**\b**\b* s\bst\btr\bri\bin\bng\bg_\b_o\bof\bff\bfs\bse\bet\bt(\b()\b) s\bst\btr\bri\bin\bng\bg_\b_p\bpt\btr\br(\b()\b) s\bst\btr\bri\bin\bng\bg_\b_l\ble\ben\bng\bgt\bth\bh(\b()\b) s\bst\btr\bri\bin\bng\bg_\b_v\bva\bal\blu\bue\be(\b()\b) *\b**\b**\b**\b**\b*\n std::ptrdiff_t s\bst\btr\bri\bin\bng\bg_\b_o\bof\bff\bfs\bse\bet\bt () const;\n+int s\bst\btr\bri\bin\bng\bg_\b_l\ble\ben\bng\bgt\bth\bh () const;\n string_view s\bst\btr\bri\bin\bng\bg_\b_v\bva\bal\blu\bue\be () const;\n+char const* s\bst\btr\bri\bin\bng\bg_\b_p\bpt\btr\br () const;\n these functions are only valid if type() == string_t. They return the string\n values. Note that string_ptr() is n\bno\bot\bt 0-terminated. string_length() returns the\n number of bytes in the string. string_offset() returns the byte offset from the\n start of the parsed bencoded buffer this string can be found.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* c\bcl\ble\bea\bar\br(\b()\b) *\b**\b**\b**\b**\b*\n void c\bcl\ble\bea\bar\br ();\n@@ -214,20 +214,20 @@\n std::string p\bpr\bri\bin\bnt\bt_\b_e\ben\bnt\btr\bry\by (bdecode_node const& e\n , bool single_line = false, int indent = 0);\n print the bencoded structure in a human-readable format to a string that's\n returned.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* b\bbd\bde\bec\bco\bod\bde\be(\b()\b) *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bb_\bd_\be_\bc_\bo_\bd_\be_\b._\bh_\bp_\bp\"\n-bdecode_node b\bbd\bde\bec\bco\bod\bde\be (span buffer\n+int b\bbd\bde\bec\bco\bod\bde\be (char const* start, char const* end, bdecode_node& ret\n , error_code& ec, int* error_pos = nullptr, int depth_limit = 100\n , int token_limit = 2000000);\n bdecode_node b\bbd\bde\bec\bco\bod\bde\be (span buffer\n , int depth_limit = 100, int token_limit = 2000000);\n-int b\bbd\bde\bec\bco\bod\bde\be (char const* start, char const* end, bdecode_node& ret\n+bdecode_node b\bbd\bde\bec\bco\bod\bde\be (span buffer\n , error_code& ec, int* error_pos = nullptr, int depth_limit = 100\n , int token_limit = 2000000);\n This function decodes/parses bdecoded data (for example a .torrent file). The\n data structure is returned in the ret argument. the buffer to parse is\n specified by the start of the buffer as well as the end, i.e. one byte past the\n end. If the buffer fails to parse, the function returns a non-zero value and\n fills in ec with the error code. The optional argument error_pos, if set to\n"}]}, {"source1": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Bencoding.html", "source2": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Bencoding.html", "unified_diff": "@@ -34,28 +34,28 @@\n

    \n
    \n

    Bencoding is a common representation in bittorrent used for dictionary,\n-list, int and string hierarchies. It's used to encode .torrent files and\n+list, int and string hierarchies. It's used to encode .torrent files and\n some messages in the network protocol. libtorrent also uses it to store\n settings, resume data and other session state.

    \n

    Strings in bencoded structures do not necessarily represent text.\n Strings are raw byte buffers of a certain length. If a string is meant to be\n interpreted as text, it is required to be UTF-8 encoded. See BEP 3.

    \n

    The function for decoding bencoded data bdecode(), returning a bdecode_node.\n This function builds a tree that points back into the original buffer. The\n@@ -71,39 +71,39 @@\n or a string.

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

    returns the concrete type of the entry

    \n [report issue]
    \n
    \n

    entry()

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

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

    \n [report issue]
    \n
    \n

    entry()

    \n@@ -153,42 +153,42 @@\n \n

    construct from bdecode_node parsed form (see bdecode())

    \n [report issue]
    \n
    \n

    operator=()

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

    copies the structure of the right hand side into this\n entry.

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

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

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

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

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

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

    \n

    If you want to create an entry you give it the type you want it to\n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -5,15 +5,15 @@\n Table of contents\n * _\be_\bn_\bt_\br_\by\n o _\bt_\by_\bp_\be_\b(_\b)\n o _\be_\bn_\bt_\br_\by_\b(_\b)\n o _\be_\bn_\bt_\br_\by_\b(_\b)\n o _\be_\bn_\bt_\br_\by_\b(_\b)\n o _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b=_\b(_\b)\n- o _\bp_\br_\be_\bf_\bo_\br_\bm_\ba_\bt_\bt_\be_\bd_\b(_\b)_\b _\bd_\bi_\bc_\bt_\b(_\b)_\b _\bi_\bn_\bt_\be_\bg_\be_\br_\b(_\b)_\b _\bs_\bt_\br_\bi_\bn_\bg_\b(_\b)_\b _\bl_\bi_\bs_\bt_\b(_\b)\n+ o _\bi_\bn_\bt_\be_\bg_\be_\br_\b(_\b)_\b _\bs_\bt_\br_\bi_\bn_\bg_\b(_\b)_\b _\bp_\br_\be_\bf_\bo_\br_\bm_\ba_\bt_\bt_\be_\bd_\b(_\b)_\b _\bl_\bi_\bs_\bt_\b(_\b)_\b _\bd_\bi_\bc_\bt_\b(_\b)\n o _\bs_\bw_\ba_\bp_\b(_\b)\n o _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b[_\b]_\b(_\b)\n o _\bf_\bi_\bn_\bd_\b__\bk_\be_\by_\b(_\b)\n o _\bt_\bo_\b__\bs_\bt_\br_\bi_\bn_\bg_\b(_\b)\n o _\be_\bn_\bu_\bm_\b _\bd_\ba_\bt_\ba_\b__\bt_\by_\bp_\be\n * _\bb_\be_\bn_\bc_\bo_\bd_\be_\b(_\b)\n * _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b<_\b<_\b(_\b)\n@@ -37,39 +37,39 @@\n variant type, it can be either a list, a dictionary (std::map), an integer or a\n string.\n class entry\n {\n data_type t\bty\byp\bpe\be () const;\n e\ben\bnt\btr\bry\by (span);\n e\ben\bnt\btr\bry\by (integer_type);\n+ e\ben\bnt\btr\bry\by (list_type);\n e\ben\bnt\btr\bry\by (preformatted_type);\n e\ben\bnt\btr\bry\by (dictionary_type);\n- e\ben\bnt\btr\bry\by (list_type);\n e\ben\bnt\btr\bry\by (U v);\n e\ben\bnt\btr\bry\by (data_type t);\n e\ben\bnt\btr\bry\by (bdecode_node const& n);\n entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (list_type) &;\n- entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (entry const&) &;\n entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (bdecode_node const&) &;\n+ entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (entry const&) &;\n+ entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (preformatted_type) &;\n entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (entry&&) & noexcept;\n- entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (span) &;\n entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (integer_type) &;\n+ entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (span) &;\n entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (dictionary_type) &;\n- entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (preformatted_type) &;\n entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (U v) &;\n- integer_type& i\bin\bnt\bte\beg\bge\ber\br ();\n+ preformatted_type& p\bpr\bre\bef\bfo\bor\brm\bma\bat\btt\bte\bed\bd ();\n+ dictionary_type const& d\bdi\bic\bct\bt () const;\n+ list_type const& l\bli\bis\bst\bt () const;\n+ list_type& l\bli\bis\bst\bt ();\n+ integer_type const& i\bin\bnt\bte\beg\bge\ber\br () const;\n dictionary_type& d\bdi\bic\bct\bt ();\n string_type const& s\bst\btr\bri\bin\bng\bg () const;\n preformatted_type const& p\bpr\bre\bef\bfo\bor\brm\bma\bat\btt\bte\bed\bd () const;\n- preformatted_type& p\bpr\bre\bef\bfo\bor\brm\bma\bat\btt\bte\bed\bd ();\n- integer_type const& i\bin\bnt\bte\beg\bge\ber\br () const;\n+ integer_type& i\bin\bnt\bte\beg\bge\ber\br ();\n string_type& s\bst\btr\bri\bin\bng\bg ();\n- list_type& l\bli\bis\bst\bt ();\n- dictionary_type const& d\bdi\bic\bct\bt () const;\n- list_type const& l\bli\bis\bst\bt () const;\n void s\bsw\bwa\bap\bp (entry& e);\n entry& o\bop\bpe\ber\bra\bat\bto\bor\br[\b[]\b] (string_view key);\n entry const& o\bop\bpe\ber\bra\bat\bto\bor\br[\b[]\b] (string_view key) const;\n entry* f\bfi\bin\bnd\bd_\b_k\bke\bey\by (string_view key);\n entry const* f\bfi\bin\bnd\bd_\b_k\bke\bey\by (string_view key) const;\n std::string t\bto\bo_\b_s\bst\btr\bri\bin\bng\bg (bool single_line = false) const;\n \n@@ -87,50 +87,50 @@\n *\b**\b**\b**\b**\b* t\bty\byp\bpe\be(\b()\b) *\b**\b**\b**\b**\b*\n data_type t\bty\byp\bpe\be () const;\n returns the concrete type of the _\be_\bn_\bt_\br_\by\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* e\ben\bnt\btr\bry\by(\b()\b) *\b**\b**\b**\b**\b*\n e\ben\bnt\btr\bry\by (span);\n e\ben\bnt\btr\bry\by (integer_type);\n+e\ben\bnt\btr\bry\by (list_type);\n e\ben\bnt\btr\bry\by (preformatted_type);\n e\ben\bnt\btr\bry\by (dictionary_type);\n-e\ben\bnt\btr\bry\by (list_type);\n constructors directly from a specific type. The content of the argument is\n copied into the newly constructed _\be_\bn_\bt_\br_\by\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* e\ben\bnt\btr\bry\by(\b()\b) *\b**\b**\b**\b**\b*\n e\ben\bnt\btr\bry\by (data_type t);\n construct an empty _\be_\bn_\bt_\br_\by of the specified type. see _\bd_\ba_\bt_\ba_\b__\bt_\by_\bp_\be enum.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* e\ben\bnt\btr\bry\by(\b()\b) *\b**\b**\b**\b**\b*\n e\ben\bnt\btr\bry\by (bdecode_node const& n);\n construct from _\bb_\bd_\be_\bc_\bo_\bd_\be_\b__\bn_\bo_\bd_\be parsed form (see _\bb_\bd_\be_\bc_\bo_\bd_\be_\b(_\b))\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* o\bop\bpe\ber\bra\bat\bto\bor\br=\b=(\b()\b) *\b**\b**\b**\b**\b*\n entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (list_type) &;\n-entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (entry const&) &;\n entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (bdecode_node const&) &;\n+entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (entry const&) &;\n+entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (preformatted_type) &;\n entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (entry&&) & noexcept;\n-entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (span) &;\n entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (integer_type) &;\n+entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (span) &;\n entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (dictionary_type) &;\n-entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (preformatted_type) &;\n copies the structure of the right hand side into this _\be_\bn_\bt_\br_\by.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* p\bpr\bre\bef\bfo\bor\brm\bma\bat\btt\bte\bed\bd(\b()\b) d\bdi\bic\bct\bt(\b()\b) i\bin\bnt\bte\beg\bge\ber\br(\b()\b) s\bst\btr\bri\bin\bng\bg(\b()\b) l\bli\bis\bst\bt(\b()\b) *\b**\b**\b**\b**\b*\n-integer_type& i\bin\bnt\bte\beg\bge\ber\br ();\n+*\b**\b**\b**\b**\b* i\bin\bnt\bte\beg\bge\ber\br(\b()\b) s\bst\btr\bri\bin\bng\bg(\b()\b) p\bpr\bre\bef\bfo\bor\brm\bma\bat\btt\bte\bed\bd(\b()\b) l\bli\bis\bst\bt(\b()\b) d\bdi\bic\bct\bt(\b()\b) *\b**\b**\b**\b**\b*\n+preformatted_type& p\bpr\bre\bef\bfo\bor\brm\bma\bat\btt\bte\bed\bd ();\n+dictionary_type const& d\bdi\bic\bct\bt () const;\n+list_type const& l\bli\bis\bst\bt () const;\n+list_type& l\bli\bis\bst\bt ();\n+integer_type const& i\bin\bnt\bte\beg\bge\ber\br () const;\n dictionary_type& d\bdi\bic\bct\bt ();\n string_type const& s\bst\btr\bri\bin\bng\bg () const;\n preformatted_type const& p\bpr\bre\bef\bfo\bor\brm\bma\bat\btt\bte\bed\bd () const;\n-preformatted_type& p\bpr\bre\bef\bfo\bor\brm\bma\bat\btt\bte\bed\bd ();\n-integer_type const& i\bin\bnt\bte\beg\bge\ber\br () const;\n+integer_type& i\bin\bnt\bte\beg\bge\ber\br ();\n string_type& s\bst\btr\bri\bin\bng\bg ();\n-list_type& l\bli\bis\bst\bt ();\n-dictionary_type const& d\bdi\bic\bct\bt () const;\n-list_type const& l\bli\bis\bst\bt () const;\n The integer(), string(), list() and dict() functions are accessors that return\n the respective type. If the entry object isn't of the type you request, the\n accessor will throw system_error. You can ask an entry for its type through the\n type() function.\n If you want to create an entry you give it the type you want it to have in its\n constructor, and then use one of the non-const accessors to get a reference\n which you then can assign the value you want it to have.\n"}]}, {"source1": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Core.html", "source2": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Core.html", "unified_diff": "@@ -28,125 +28,71 @@\n 2.0.11\n \n \n

    home

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

    peer_request

    \n-

    Declared in "libtorrent/peer_request.hpp"

    \n-

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

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

    operator==()

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

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

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

    piece_block

    \n-

    Declared in "libtorrent/piece_block.hpp"

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

    info_hash_t

    \n

    Declared in "libtorrent/info_hash.hpp"

    \n

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

    \n
    \n

    Note

    \n

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

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

    info_hash_t()

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

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

    \n

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

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

    has() has_v2() has_v1()

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

    has_v1() has() has_v2()

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

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

    \n [report issue]
    \n
    \n

    get()

    \n
    \n@@ -202,14 +148,68 @@\n template <typename F> void for_each (F f) const;\n 
    \n

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

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

    piece_block

    \n+

    Declared in "libtorrent/piece_block.hpp"

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

    peer_request

    \n+

    Declared in "libtorrent/peer_request.hpp"

    \n+

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

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

    operator==()

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

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

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

    peer_info

    \n

    Declared in "libtorrent/peer_info.hpp"

    \n

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

    \n@@ -689,29 +689,47 @@\n [report issue]
    \n
    read_state write_state
    \n
    bitmasks indicating what state this peer\n is in with regards to sending and receiving data. The states are\n defined as independent flags of type bandwidth_state_flags_t, in this\n class.
    \n
    \n-[report issue]
    \n+[report issue]
    \n
    \n+
    \n+

    version()

    \n+

    Declared in "libtorrent/version.hpp"

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

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

    \n+[report issue]
    \n
    \n

    torrent_peer_equal()

    \n

    Declared in "libtorrent/torrent_peer.hpp"

    \n
    \n inline bool torrent_peer_equal (torrent_peer const* lhs, torrent_peer const* rhs);\n 
    \n+[report issue]
    \n+
    \n+

    truncate_files()

    \n+

    Declared in "libtorrent/truncate.hpp"

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

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

    \n [report issue]
    \n
    \n

    make_magnet_uri()

    \n

    Declared in "libtorrent/magnet_uri.hpp"

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

    Generates a magnet URI from the specified torrent.

    \n

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

    \n
    \n@@ -741,160 +759,170 @@\n add_torrent_params parse_magnet_uri (string_view uri, error_code& ec);\n \n

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

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

    truncate_files()

    \n-

    Declared in "libtorrent/truncate.hpp"

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

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

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

    version()

    \n-

    Declared in "libtorrent/version.hpp"

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

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

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

    load_torrent_file() load_torrent_buffer() load_torrent_parsed()

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

    load_torrent_parsed() load_torrent_buffer() load_torrent_file()

    \n

    Declared in "libtorrent/load_torrent.hpp"

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

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

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

    enum event_t

    \n-

    Declared in "libtorrent/tracker_manager.hpp"

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

    enum socket_type_t

    \n+

    Declared in "libtorrent/socket_type.hpp"

    \n \n \n-\n-\n-\n+\n+\n+\n \n \n \n \n \n \n \n \n-\n+\n \n \n \n-\n+\n \n \n \n-\n+\n \n \n \n-\n+\n \n \n \n-\n+\n \n \n \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n \n
    namevaluedescription
    none
    tcp0 
    completed
    socks51 
    started
    http2 
    stopped
    utp3 
    paused
    i2p4 
    tcp_ssl5 
    socks5_ssl6 
    http_ssl7 
    utp_ssl8 
    \n-[report issue]
    \n-
    \n-

    enum portmap_transport

    \n-

    Declared in "libtorrent/portmap.hpp"

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

    enum protocol_version

    \n+

    Declared in "libtorrent/info_hash.hpp"

    \n \n \n-\n-\n-\n+\n+\n+\n \n \n \n \n \n \n \n \n-\n+\n \n-\n+\n \n-\n+\n \n+\n+\n+\n+\n \n \n \n
    namevaluedescription
    natpmp
    V10natpmp can be NAT-PMP or PCPThe original BitTorrent version, using SHA-1 hashes
    upnp
    V21Version 2 of the BitTorrent protocol, using SHA-256 hashes
    NUM2 
    \n-[report issue]
    \n-
    \n-

    enum portmap_protocol

    \n-

    Declared in "libtorrent/portmap.hpp"

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

    enum event_t

    \n+

    Declared in "libtorrent/tracker_manager.hpp"

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

    enum connection_type

    \n

    Declared in "libtorrent/peer_connection.hpp"

    \n \n@@ -920,100 +948,99 @@\n \n \n \n \n \n \n
    http_seed2 
    \n-[report issue]
    \n-
    \n-

    enum protocol_version

    \n-

    Declared in "libtorrent/info_hash.hpp"

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

    enum portmap_transport

    \n+

    Declared in "libtorrent/portmap.hpp"

    \n \n \n-\n-\n-\n+\n+\n+\n \n \n \n \n \n \n \n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n-\n-\n-\n \n \n \n
    namevaluedescription
    V1
    natpmp0The original BitTorrent version, using SHA-1 hashesnatpmp can be NAT-PMP or PCP
    V2
    upnp1Version 2 of the BitTorrent protocol, using SHA-256 hashes
    NUM2 
    \n-[report issue]
    \n-
    \n-

    enum socket_type_t

    \n-

    Declared in "libtorrent/socket_type.hpp"

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

    enum portmap_protocol

    \n+

    Declared in "libtorrent/portmap.hpp"

    \n \n \n-\n-\n-\n+\n+\n+\n \n \n \n \n \n \n \n \n-\n+\n \n \n \n-\n+\n \n \n \n-\n+\n \n \n \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n \n
    namevaluedescription
    tcp
    none0 
    socks5
    tcp1 
    http
    udp2 
    utp3 
    i2p4 
    tcp_ssl5 
    socks5_ssl6 
    http_ssl7 
    utp_ssl8 
    \n+[report issue]
    \n+
    \n+

    pex_flags_t

    \n+

    Declared in "libtorrent/pex_flags.hpp"

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

    torrent_flags_t

    \n

    Declared in "libtorrent/torrent_flags.hpp"

    \n
    \n
    seed_mode
    \n

    If seed_mode is set, libtorrent will assume that all files\n@@ -1240,62 +1267,14 @@\n URL.

    \n
    \n
    \n
    all
    \n
    all torrent flags combined. Can conveniently be used when creating masks\n for flags
    \n
    \n-[report issue]
    \n-
    \n-

    download_priority_t

    \n-

    Declared in "libtorrent/download_priority.hpp"

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

    pex_flags_t

    \n-

    Declared in "libtorrent/pex_flags.hpp"

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

    int

    \n

    Declared in "libtorrent/version.hpp"

    \n
    \n
    version_major
    \n
    the major, minor and tiny versions of libtorrent
    \n@@ -1320,14 +1299,35 @@\n
    \n

    std::uint64_t

    \n

    Declared in "libtorrent/version.hpp"

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

    download_priority_t

    \n+

    Declared in "libtorrent/download_priority.hpp"

    \n+
    \n+
    dont_download
    \n+
    Don't download the file or piece. Partial pieces may still be downloaded when\n+setting file priorities.
    \n+
    \n+
    \n+
    default_priority
    \n+
    The default priority for files and pieces.
    \n+
    \n+
    \n+
    low_priority
    \n+
    The lowest priority for files and pieces.
    \n+
    \n+
    \n+
    top_priority
    \n+
    The highest priority for files and pieces.
    \n+
    \n
    \n \n
    \n
    \n
    \n
    \n
    \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,99 +1,57 @@\n >\n _\b[_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b _\bl_\bo_\bg_\bo_\b]\n V\bVe\ber\brs\bsi\bio\bon\bn:\b: 2.0.11\n _\bh_\bo_\bm_\be\n Table of contents\n- * _\bp_\be_\be_\br_\b__\br_\be_\bq_\bu_\be_\bs_\bt\n- o _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b=_\b=_\b(_\b)\n- * _\bp_\bi_\be_\bc_\be_\b__\bb_\bl_\bo_\bc_\bk\n * _\bi_\bn_\bf_\bo_\b__\bh_\ba_\bs_\bh_\b__\bt\n o _\bi_\bn_\bf_\bo_\b__\bh_\ba_\bs_\bh_\b__\bt_\b(_\b)\n- o _\bh_\ba_\bs_\b(_\b)_\b _\bh_\ba_\bs_\b__\bv_\b2_\b(_\b)_\b _\bh_\ba_\bs_\b__\bv_\b1_\b(_\b)\n+ o _\bh_\ba_\bs_\b__\bv_\b1_\b(_\b)_\b _\bh_\ba_\bs_\b(_\b)_\b _\bh_\ba_\bs_\b__\bv_\b2_\b(_\b)\n o _\bg_\be_\bt_\b(_\b)\n o _\bg_\be_\bt_\b__\bb_\be_\bs_\bt_\b(_\b)\n o _\bf_\bo_\br_\b__\be_\ba_\bc_\bh_\b(_\b)\n+ * _\bp_\bi_\be_\bc_\be_\b__\bb_\bl_\bo_\bc_\bk\n+ * _\bp_\be_\be_\br_\b__\br_\be_\bq_\bu_\be_\bs_\bt\n+ o _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b=_\b=_\b(_\b)\n * _\bp_\be_\be_\br_\b__\bi_\bn_\bf_\bo\n o _\bi_\b2_\bp_\b__\bd_\be_\bs_\bt_\bi_\bn_\ba_\bt_\bi_\bo_\bn_\b(_\b)\n+ * _\bv_\be_\br_\bs_\bi_\bo_\bn_\b(_\b)\n * _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\be_\be_\br_\b__\be_\bq_\bu_\ba_\bl_\b(_\b)\n+ * _\bt_\br_\bu_\bn_\bc_\ba_\bt_\be_\b__\bf_\bi_\bl_\be_\bs_\b(_\b)\n * _\bm_\ba_\bk_\be_\b__\bm_\ba_\bg_\bn_\be_\bt_\b__\bu_\br_\bi_\b(_\b)\n * _\bp_\ba_\br_\bs_\be_\b__\bm_\ba_\bg_\bn_\be_\bt_\b__\bu_\br_\bi_\b(_\b)\n- * _\bt_\br_\bu_\bn_\bc_\ba_\bt_\be_\b__\bf_\bi_\bl_\be_\bs_\b(_\b)\n- * _\bv_\be_\br_\bs_\bi_\bo_\bn_\b(_\b)\n- * _\bl_\bo_\ba_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bi_\bl_\be_\b(_\b)_\b _\bl_\bo_\ba_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bb_\bu_\bf_\bf_\be_\br_\b(_\b)_\b _\bl_\bo_\ba_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\bs_\be_\bd_\b(_\b)\n+ * _\bl_\bo_\ba_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\bs_\be_\bd_\b(_\b)_\b _\bl_\bo_\ba_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bb_\bu_\bf_\bf_\be_\br_\b(_\b)_\b _\bl_\bo_\ba_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bi_\bl_\be_\b(_\b)\n+ * _\be_\bn_\bu_\bm_\b _\bs_\bo_\bc_\bk_\be_\bt_\b__\bt_\by_\bp_\be_\b__\bt\n+ * _\be_\bn_\bu_\bm_\b _\bp_\br_\bo_\bt_\bo_\bc_\bo_\bl_\b__\bv_\be_\br_\bs_\bi_\bo_\bn\n * _\be_\bn_\bu_\bm_\b _\be_\bv_\be_\bn_\bt_\b__\bt\n+ * _\be_\bn_\bu_\bm_\b _\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b__\bt_\by_\bp_\be\n * _\be_\bn_\bu_\bm_\b _\bp_\bo_\br_\bt_\bm_\ba_\bp_\b__\bt_\br_\ba_\bn_\bs_\bp_\bo_\br_\bt\n * _\be_\bn_\bu_\bm_\b _\bp_\bo_\br_\bt_\bm_\ba_\bp_\b__\bp_\br_\bo_\bt_\bo_\bc_\bo_\bl\n- * _\be_\bn_\bu_\bm_\b _\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b__\bt_\by_\bp_\be\n- * _\be_\bn_\bu_\bm_\b _\bp_\br_\bo_\bt_\bo_\bc_\bo_\bl_\b__\bv_\be_\br_\bs_\bi_\bo_\bn\n- * _\be_\bn_\bu_\bm_\b _\bs_\bo_\bc_\bk_\be_\bt_\b__\bt_\by_\bp_\be_\b__\bt\n- * _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bl_\ba_\bg_\bs_\b__\bt\n- * _\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\b__\bp_\br_\bi_\bo_\br_\bi_\bt_\by_\b__\bt\n * _\bp_\be_\bx_\b__\bf_\bl_\ba_\bg_\bs_\b__\bt\n+ * _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bl_\ba_\bg_\bs_\b__\bt\n * _\bi_\bn_\bt\n * _\bc_\bh_\ba_\br_\b _\bc_\bo_\bn_\bs_\bt_\b*\n * _\bs_\bt_\bd_\b:_\b:_\bu_\bi_\bn_\bt_\b6_\b4_\b__\bt\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* p\bpe\bee\ber\br_\b_r\bre\beq\bqu\bue\bes\bst\bt *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bp_\be_\be_\br_\b__\br_\be_\bq_\bu_\be_\bs_\bt_\b._\bh_\bp_\bp\"\n-represents a byte range within a piece. Internally this is is used for incoming\n-piece requests.\n-struct peer_request\n-{\n- bool o\bop\bpe\ber\bra\bat\bto\bor\br=\b==\b= (peer_request const& r) const;\n-\n- piece_index_t piece;\n- int start;\n- int length;\n-};\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* o\bop\bpe\ber\bra\bat\bto\bor\br=\b==\b=(\b()\b) *\b**\b**\b**\b**\b*\n-bool o\bop\bpe\ber\bra\bat\bto\bor\br=\b==\b= (peer_request const& r) const;\n-returns true if the right hand side _\bp_\be_\be_\br_\b__\br_\be_\bq_\bu_\be_\bs_\bt refers to the same range as\n-this does.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- piece\n- The index of the piece in which the range starts.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- start\n- The byte offset within that piece where the range starts.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- length\n- The size of the range, in bytes.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* p\bpi\bie\bec\bce\be_\b_b\bbl\blo\boc\bck\bk *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bp_\bi_\be_\bc_\be_\b__\bb_\bl_\bo_\bc_\bk_\b._\bh_\bp_\bp\"\n-struct piece_block\n-{\n- p\bpi\bie\bec\bce\be_\b_b\bbl\blo\boc\bck\bk (piece_index_t p_index, int b_index);\n- p\bpi\bie\bec\bce\be_\b_b\bbl\blo\boc\bck\bk () = default;\n- bool o\bop\bpe\ber\bra\bat\bto\bor\br<\b< (piece_block const& b) const;\n- bool o\bop\bpe\ber\bra\bat\bto\bor\br=\b==\b= (piece_block const& b) const;\n- bool o\bop\bpe\ber\bra\bat\bto\bor\br!\b!=\b= (piece_block const& b) const;\n-\n- static const piece_block invalid;\n- piece_index_t piece_index {0};\n- int b\bbl\blo\boc\bck\bk_\b_i\bin\bnd\bde\bex\bx = 0;\n-};\n+ * _\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\b__\bp_\br_\bi_\bo_\br_\bi_\bt_\by_\b__\bt\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh_\b_t\bt *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bi_\bn_\bf_\bo_\b__\bh_\ba_\bs_\bh_\b._\bh_\bp_\bp\"\n class holding the info-hash of a torrent. It can hold a v1 info-hash (SHA-1) or\n a v2 info-hash (SHA-256) or both.\n Note\n If has_v2() is false then the v1 hash might actually be a truncated v2 hash\n struct info_hash_t\n {\n i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh_\b_t\bt () noexcept = default;\n explicit i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh_\b_t\bt (sha256_hash h2) noexcept;\n- explicit i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh_\b_t\bt (sha1_hash h1) noexcept;\n i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh_\b_t\bt (sha1_hash h1, sha256_hash h2) noexcept;\n- bool h\bha\bas\bs (protocol_version v) const;\n- bool h\bha\bas\bs_\b_v\bv2\b2 () const;\n+ explicit i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh_\b_t\bt (sha1_hash h1) noexcept;\n bool h\bha\bas\bs_\b_v\bv1\b1 () const;\n+ bool h\bha\bas\bs_\b_v\bv2\b2 () const;\n+ bool h\bha\bas\bs (protocol_version v) const;\n sha1_hash g\bge\bet\bt (protocol_version v) const;\n sha1_hash g\bge\bet\bt_\b_b\bbe\bes\bst\bt () const;\n friend bool o\bop\bpe\ber\bra\bat\bto\bor\br!\b!=\b= (info_hash_t const& lhs, info_hash_t const& rhs);\n friend bool o\bop\bpe\ber\bra\bat\bto\bor\br=\b==\b= (info_hash_t const& lhs, info_hash_t const& rhs)\n noexcept;\n template void f\bfo\bor\br_\b_e\bea\bac\bch\bh (F f) const;\n bool o\bop\bpe\ber\bra\bat\bto\bor\br<\b< (info_hash_t const& o) const;\n@@ -102,25 +60,25 @@\n sha1_hash v1;\n sha256_hash v2;\n };\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh_\b_t\bt(\b()\b) *\b**\b**\b**\b**\b*\n i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh_\b_t\bt () noexcept = default;\n explicit i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh_\b_t\bt (sha256_hash h2) noexcept;\n-explicit i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh_\b_t\bt (sha1_hash h1) noexcept;\n i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh_\b_t\bt (sha1_hash h1, sha256_hash h2) noexcept;\n+explicit i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh_\b_t\bt (sha1_hash h1) noexcept;\n The default constructor creates an object that has neither a v1 or v2 hash.\n For backwards compatibility, make it possible to construct directly from a v1\n hash. This constructor allows i\bim\bmp\bpl\bli\bic\bci\bit\bt conversion from a v1 hash, but the\n implicitness is deprecated.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* h\bha\bas\bs(\b()\b) h\bha\bas\bs_\b_v\bv2\b2(\b()\b) h\bha\bas\bs_\b_v\bv1\b1(\b()\b) *\b**\b**\b**\b**\b*\n-bool h\bha\bas\bs (protocol_version v) const;\n-bool h\bha\bas\bs_\b_v\bv2\b2 () const;\n+*\b**\b**\b**\b**\b* h\bha\bas\bs_\b_v\bv1\b1(\b()\b) h\bha\bas\bs(\b()\b) h\bha\bas\bs_\b_v\bv2\b2(\b()\b) *\b**\b**\b**\b**\b*\n bool h\bha\bas\bs_\b_v\bv1\b1 () const;\n+bool h\bha\bas\bs_\b_v\bv2\b2 () const;\n+bool h\bha\bas\bs (protocol_version v) const;\n returns true if the corresponding info hash is present in this object.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* g\bge\bet\bt(\b()\b) *\b**\b**\b**\b**\b*\n sha1_hash g\bge\bet\bt (protocol_version v) const;\n returns the has for the specified protocol version\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* g\bge\bet\bt_\b_b\bbe\bes\bst\bt(\b()\b) *\b**\b**\b**\b**\b*\n@@ -130,14 +88,56 @@\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* f\bfo\bor\br_\b_e\bea\bac\bch\bh(\b()\b) *\b**\b**\b**\b**\b*\n template void f\bfo\bor\br_\b_e\bea\bac\bch\bh (F f) const;\n calls the function object f for each hash that is available. starting with v1.\n The signature of F is:\n void(sha1_hash const&, protocol_version);\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* p\bpi\bie\bec\bce\be_\b_b\bbl\blo\boc\bck\bk *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bp_\bi_\be_\bc_\be_\b__\bb_\bl_\bo_\bc_\bk_\b._\bh_\bp_\bp\"\n+struct piece_block\n+{\n+ p\bpi\bie\bec\bce\be_\b_b\bbl\blo\boc\bck\bk (piece_index_t p_index, int b_index);\n+ p\bpi\bie\bec\bce\be_\b_b\bbl\blo\boc\bck\bk () = default;\n+ bool o\bop\bpe\ber\bra\bat\bto\bor\br<\b< (piece_block const& b) const;\n+ bool o\bop\bpe\ber\bra\bat\bto\bor\br=\b==\b= (piece_block const& b) const;\n+ bool o\bop\bpe\ber\bra\bat\bto\bor\br!\b!=\b= (piece_block const& b) const;\n+\n+ static const piece_block invalid;\n+ piece_index_t piece_index {0};\n+ int b\bbl\blo\boc\bck\bk_\b_i\bin\bnd\bde\bex\bx = 0;\n+};\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* p\bpe\bee\ber\br_\b_r\bre\beq\bqu\bue\bes\bst\bt *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bp_\be_\be_\br_\b__\br_\be_\bq_\bu_\be_\bs_\bt_\b._\bh_\bp_\bp\"\n+represents a byte range within a piece. Internally this is is used for incoming\n+piece requests.\n+struct peer_request\n+{\n+ bool o\bop\bpe\ber\bra\bat\bto\bor\br=\b==\b= (peer_request const& r) const;\n+\n+ piece_index_t piece;\n+ int start;\n+ int length;\n+};\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* o\bop\bpe\ber\bra\bat\bto\bor\br=\b==\b=(\b()\b) *\b**\b**\b**\b**\b*\n+bool o\bop\bpe\ber\bra\bat\bto\bor\br=\b==\b= (peer_request const& r) const;\n+returns true if the right hand side _\bp_\be_\be_\br_\b__\br_\be_\bq_\bu_\be_\bs_\bt refers to the same range as\n+this does.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ piece\n+ The index of the piece in which the range starts.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ start\n+ The byte offset within that piece where the range starts.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ length\n+ The size of the range, in bytes.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* p\bpe\bee\ber\br_\b_i\bin\bnf\bfo\bo *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bp_\be_\be_\br_\b__\bi_\bn_\bf_\bo_\b._\bh_\bp_\bp\"\n holds information and statistics about one peer that libtorrent is connected to\n struct peer_info\n {\n sha256_hash i\bi2\b2p\bp_\b_d\bde\bes\bst\bti\bin\bna\bat\bti\bio\bon\bn () const;\n \n@@ -506,23 +506,36 @@\n to disk before downloading more.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n read_state write_state\n bitmasks indicating what state this peer is in with regards to sending\n and receiving data. The states are defined as independent flags of type\n bandwidth_state_flags_t, in this class.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* v\bve\ber\brs\bsi\bio\bon\bn(\b()\b) *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bv_\be_\br_\bs_\bi_\bo_\bn_\b._\bh_\bp_\bp\"\n+char const* v\bve\ber\brs\bsi\bio\bon\bn ();\n+returns the libtorrent version as string form in this format:\n+\"...\"\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* t\bto\bor\brr\bre\ben\bnt\bt_\b_p\bpe\bee\ber\br_\b_e\beq\bqu\bua\bal\bl(\b()\b) *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\be_\be_\br_\b._\bh_\bp_\bp\"\n inline bool t\bto\bor\brr\bre\ben\bnt\bt_\b_p\bpe\bee\ber\br_\b_e\beq\bqu\bua\bal\bl (torrent_peer const* lhs, torrent_peer const*\n rhs);\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* t\btr\bru\bun\bnc\bca\bat\bte\be_\b_f\bfi\bil\ble\bes\bs(\b()\b) *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bt_\br_\bu_\bn_\bc_\ba_\bt_\be_\b._\bh_\bp_\bp\"\n+void t\btr\bru\bun\bnc\bca\bat\bte\be_\b_f\bfi\bil\ble\bes\bs (file_storage const& fs, std::string const& save_path,\n+storage_error& ec);\n+Truncates files larger than specified in the _\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be, saved under the\n+specified save_path.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* m\bma\bak\bke\be_\b_m\bma\bag\bgn\bne\bet\bt_\b_u\bur\bri\bi(\b()\b) *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bm_\ba_\bg_\bn_\be_\bt_\b__\bu_\br_\bi_\b._\bh_\bp_\bp\"\n-std::string m\bma\bak\bke\be_\b_m\bma\bag\bgn\bne\bet\bt_\b_u\bur\bri\bi (torrent_handle const& handle);\n std::string m\bma\bak\bke\be_\b_m\bma\bag\bgn\bne\bet\bt_\b_u\bur\bri\bi (torrent_info const& info);\n+std::string m\bma\bak\bke\be_\b_m\bma\bag\bgn\bne\bet\bt_\b_u\bur\bri\bi (torrent_handle const& handle);\n std::string m\bma\bak\bke\be_\b_m\bma\bag\bgn\bne\bet\bt_\b_u\bur\bri\bi (add_torrent_params const& atp);\n Generates a magnet URI from the specified torrent.\n Several fields from the _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs objects are recorded in the magnet\n link. In order to not include them, they have to be cleared before calling\n _\bm_\ba_\bk_\be_\b__\bm_\ba_\bg_\bn_\be_\bt_\b__\bu_\br_\bi_\b(_\b). These fields are used:\n ti, info_hashes, url_seeds, dht_nodes, file_priorities, trackers,\n name, peers.\n@@ -547,59 +560,76 @@\n add_torrent_params p\bpa\bar\brs\bse\be_\b_m\bma\bag\bgn\bne\bet\bt_\b_u\bur\bri\bi (string_view uri, error_code& ec);\n This function parses out information from the magnet link and populates the\n _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs object. The overload that does not take an error_code\n reference will throw a system_error on error The overload taking an\n add_torrent_params reference will fill in the fields specified in the magnet\n URI.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* t\btr\bru\bun\bnc\bca\bat\bte\be_\b_f\bfi\bil\ble\bes\bs(\b()\b) *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bt_\br_\bu_\bn_\bc_\ba_\bt_\be_\b._\bh_\bp_\bp\"\n-void t\btr\bru\bun\bnc\bca\bat\bte\be_\b_f\bfi\bil\ble\bes\bs (file_storage const& fs, std::string const& save_path,\n-storage_error& ec);\n-Truncates files larger than specified in the _\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be, saved under the\n-specified save_path.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* v\bve\ber\brs\bsi\bio\bon\bn(\b()\b) *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bv_\be_\br_\bs_\bi_\bo_\bn_\b._\bh_\bp_\bp\"\n-char const* v\bve\ber\brs\bsi\bio\bon\bn ();\n-returns the libtorrent version as string form in this format:\n-\"...\"\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* l\blo\boa\bad\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be(\b()\b) l\blo\boa\bad\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_b\bbu\buf\bff\bfe\ber\br(\b()\b) l\blo\boa\bad\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_p\bpa\bar\brs\bse\bed\bd(\b()\b) *\b**\b**\b**\b**\b**\b*\n+*\b**\b**\b**\b**\b**\b* l\blo\boa\bad\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_p\bpa\bar\brs\bse\bed\bd(\b()\b) l\blo\boa\bad\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_b\bbu\buf\bff\bfe\ber\br(\b()\b) l\blo\boa\bad\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be(\b()\b) *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bl_\bo_\ba_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bh_\bp_\bp\"\n+add_torrent_params l\blo\boa\bad\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be (\n+ std::string const& filename, load_torrent_limits const& cfg);\n add_torrent_params l\blo\boa\bad\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_p\bpa\bar\brs\bse\bed\bd (\n bdecode_node const& torrent_file);\n add_torrent_params l\blo\boa\bad\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_b\bbu\buf\bff\bfe\ber\br (\n span buffer);\n-add_torrent_params l\blo\boa\bad\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_p\bpa\bar\brs\bse\bed\bd (\n- bdecode_node const& torrent_file, load_torrent_limits const& cfg);\n add_torrent_params l\blo\boa\bad\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_b\bbu\buf\bff\bfe\ber\br (\n span buffer, load_torrent_limits const& cfg);\n+add_torrent_params l\blo\boa\bad\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_p\bpa\bar\brs\bse\bed\bd (\n+ bdecode_node const& torrent_file, load_torrent_limits const& cfg);\n add_torrent_params l\blo\boa\bad\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be (\n std::string const& filename);\n-add_torrent_params l\blo\boa\bad\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be (\n- std::string const& filename, load_torrent_limits const& cfg);\n These functions load the content of a .torrent file into an _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs\n object. The immutable part of a torrent file (the info-dictionary) is stored in\n the ti field in the _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs object (as a _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo object). The\n returned object is suitable to be:\n * added to a _\bs_\be_\bs_\bs_\bi_\bo_\bn via _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b) or _\ba_\bs_\by_\bn_\bc_\b__\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b)\n * saved as a .torrent_file via _\bw_\br_\bi_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bi_\bl_\be_\b(_\b)\n * turned into a magnet link via _\bm_\ba_\bk_\be_\b__\bm_\ba_\bg_\bn_\be_\bt_\b__\bu_\br_\bi_\b(_\b)\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* e\ben\bnu\bum\bm s\bso\boc\bck\bke\bet\bt_\b_t\bty\byp\bpe\be_\b_t\bt *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\bo_\bc_\bk_\be_\bt_\b__\bt_\by_\bp_\be_\b._\bh_\bp_\bp\"\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n+|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn|\n+|_\bt_\bc_\bp_\b _\b _\b _\b _\b _\b _\b _\b|_\b0_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bs_\bo_\bc_\bk_\bs_\b5_\b _\b _\b _\b _\b|_\b1_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bh_\bt_\bt_\bp_\b _\b _\b _\b _\b _\b _\b|_\b2_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bu_\bt_\bp_\b _\b _\b _\b _\b _\b _\b _\b|_\b3_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bi_\b2_\bp_\b _\b _\b _\b _\b _\b _\b _\b|_\b4_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bt_\bc_\bp_\b__\bs_\bs_\bl_\b _\b _\b _\b|_\b5_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bs_\bo_\bc_\bk_\bs_\b5_\b__\bs_\bs_\bl_\b|_\b6_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bh_\bt_\bt_\bp_\b__\bs_\bs_\bl_\b _\b _\b|_\b7_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bu_\bt_\bp_\b__\bs_\bs_\bl_\b _\b _\b _\b|_\b8_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* e\ben\bnu\bum\bm p\bpr\bro\bot\bto\boc\bco\bol\bl_\b_v\bve\ber\brs\bsi\bio\bon\bn *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bi_\bn_\bf_\bo_\b__\bh_\ba_\bs_\bh_\b._\bh_\bp_\bp\"\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n+|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bV_\b1_\b _\b _\b|_\b0_\b _\b _\b _\b _\b|_\bT_\bh_\be_\b _\bo_\br_\bi_\bg_\bi_\bn_\ba_\bl_\b _\bB_\bi_\bt_\bT_\bo_\br_\br_\be_\bn_\bt_\b _\bv_\be_\br_\bs_\bi_\bo_\bn_\b,_\b _\bu_\bs_\bi_\bn_\bg_\b _\bS_\bH_\bA_\b-_\b1_\b _\bh_\ba_\bs_\bh_\be_\bs_\b _\b _\b _\b _\b _\b _\b |\n+|_\bV_\b2_\b _\b _\b|_\b1_\b _\b _\b _\b _\b|_\bV_\be_\br_\bs_\bi_\bo_\bn_\b _\b2_\b _\bo_\bf_\b _\bt_\bh_\be_\b _\bB_\bi_\bt_\bT_\bo_\br_\br_\be_\bn_\bt_\b _\bp_\br_\bo_\bt_\bo_\bc_\bo_\bl_\b,_\b _\bu_\bs_\bi_\bn_\bg_\b _\bS_\bH_\bA_\b-_\b2_\b5_\b6_\b _\bh_\ba_\bs_\bh_\be_\bs|\n+|_\bN_\bU_\bM_\b _\b|_\b2_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* e\ben\bnu\bum\bm e\bev\bve\ben\bnt\bt_\b_t\bt *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bt_\br_\ba_\bc_\bk_\be_\br_\b__\bm_\ba_\bn_\ba_\bg_\be_\br_\b._\bh_\bp_\bp\"\n _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n |_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn|\n |_\bn_\bo_\bn_\be_\b _\b _\b _\b _\b _\b|_\b0_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |_\bc_\bo_\bm_\bp_\bl_\be_\bt_\be_\bd_\b|_\b1_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |_\bs_\bt_\ba_\br_\bt_\be_\bd_\b _\b _\b|_\b2_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |_\bs_\bt_\bo_\bp_\bp_\be_\bd_\b _\b _\b|_\b3_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |_\bp_\ba_\bu_\bs_\be_\bd_\b _\b _\b _\b|_\b4_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* e\ben\bnu\bum\bm c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn_\b_t\bty\byp\bpe\be *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bp_\be_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b._\bh_\bp_\bp\"\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n+|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn|\n+|_\bb_\bi_\bt_\bt_\bo_\br_\br_\be_\bn_\bt_\b|_\b0_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bu_\br_\bl_\b__\bs_\be_\be_\bd_\b _\b _\b|_\b1_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bh_\bt_\bt_\bp_\b__\bs_\be_\be_\bd_\b _\b|_\b2_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* e\ben\bnu\bum\bm p\bpo\bor\brt\btm\bma\bap\bp_\b_t\btr\bra\ban\bns\bsp\bpo\bor\brt\bt *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bp_\bo_\br_\bt_\bm_\ba_\bp_\b._\bh_\bp_\bp\"\n _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n |_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |_\bn_\ba_\bt_\bp_\bm_\bp_\b|_\b0_\b _\b _\b _\b _\b|_\bn_\ba_\bt_\bp_\bm_\bp_\b _\bc_\ba_\bn_\b _\bb_\be_\b _\bN_\bA_\bT_\b-_\bP_\bM_\bP_\b _\bo_\br_\b _\bP_\bC_\bP|\n |_\bu_\bp_\bn_\bp_\b _\b _\b|_\b1_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n@@ -607,43 +637,28 @@\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bp_\bo_\br_\bt_\bm_\ba_\bp_\b._\bh_\bp_\bp\"\n _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n |_\bn\bn_\ba\ba_\bm\bm_\be\be_\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn|\n |_\bn_\bo_\bn_\be_\b|_\b0_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |_\bt_\bc_\bp_\b _\b|_\b1_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |_\bu_\bd_\bp_\b _\b|_\b2_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* e\ben\bnu\bum\bm c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn_\b_t\bty\byp\bpe\be *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bp_\be_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b._\bh_\bp_\bp\"\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n-|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn|\n-|_\bb_\bi_\bt_\bt_\bo_\br_\br_\be_\bn_\bt_\b|_\b0_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bu_\br_\bl_\b__\bs_\be_\be_\bd_\b _\b _\b|_\b1_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bh_\bt_\bt_\bp_\b__\bs_\be_\be_\bd_\b _\b|_\b2_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* e\ben\bnu\bum\bm p\bpr\bro\bot\bto\boc\bco\bol\bl_\b_v\bve\ber\brs\bsi\bio\bon\bn *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bi_\bn_\bf_\bo_\b__\bh_\ba_\bs_\bh_\b._\bh_\bp_\bp\"\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n-|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bV_\b1_\b _\b _\b|_\b0_\b _\b _\b _\b _\b|_\bT_\bh_\be_\b _\bo_\br_\bi_\bg_\bi_\bn_\ba_\bl_\b _\bB_\bi_\bt_\bT_\bo_\br_\br_\be_\bn_\bt_\b _\bv_\be_\br_\bs_\bi_\bo_\bn_\b,_\b _\bu_\bs_\bi_\bn_\bg_\b _\bS_\bH_\bA_\b-_\b1_\b _\bh_\ba_\bs_\bh_\be_\bs_\b _\b _\b _\b _\b _\b _\b |\n-|_\bV_\b2_\b _\b _\b|_\b1_\b _\b _\b _\b _\b|_\bV_\be_\br_\bs_\bi_\bo_\bn_\b _\b2_\b _\bo_\bf_\b _\bt_\bh_\be_\b _\bB_\bi_\bt_\bT_\bo_\br_\br_\be_\bn_\bt_\b _\bp_\br_\bo_\bt_\bo_\bc_\bo_\bl_\b,_\b _\bu_\bs_\bi_\bn_\bg_\b _\bS_\bH_\bA_\b-_\b2_\b5_\b6_\b _\bh_\ba_\bs_\bh_\be_\bs|\n-|_\bN_\bU_\bM_\b _\b|_\b2_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* e\ben\bnu\bum\bm s\bso\boc\bck\bke\bet\bt_\b_t\bty\byp\bpe\be_\b_t\bt *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\bo_\bc_\bk_\be_\bt_\b__\bt_\by_\bp_\be_\b._\bh_\bp_\bp\"\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n-|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn|\n-|_\bt_\bc_\bp_\b _\b _\b _\b _\b _\b _\b _\b|_\b0_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bs_\bo_\bc_\bk_\bs_\b5_\b _\b _\b _\b _\b|_\b1_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bh_\bt_\bt_\bp_\b _\b _\b _\b _\b _\b _\b|_\b2_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bu_\bt_\bp_\b _\b _\b _\b _\b _\b _\b _\b|_\b3_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bi_\b2_\bp_\b _\b _\b _\b _\b _\b _\b _\b|_\b4_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bt_\bc_\bp_\b__\bs_\bs_\bl_\b _\b _\b _\b|_\b5_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bs_\bo_\bc_\bk_\bs_\b5_\b__\bs_\bs_\bl_\b|_\b6_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bh_\bt_\bt_\bp_\b__\bs_\bs_\bl_\b _\b _\b|_\b7_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bu_\bt_\bp_\b__\bs_\bs_\bl_\b _\b _\b _\b|_\b8_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+*\b**\b**\b**\b**\b**\b* p\bpe\bex\bx_\b_f\bfl\bla\bag\bgs\bs_\b_t\bt *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bp_\be_\bx_\b__\bf_\bl_\ba_\bg_\bs_\b._\bh_\bp_\bp\"\n+ pex_encryption\n+ the peer supports protocol encryption\n+ pex_seed\n+ the peer is a seed\n+ pex_utp\n+ the peer supports the uTP, transport protocol over UDP.\n+ pex_holepunch\n+ the peer supports the holepunch extension If this flag is received from a\n+ peer, it can be used as a rendezvous point in case direct connections to\n+ the peer fail\n+ pex_lt_v2\n+ protocol v2 this is not a standard flag, it is only used internally\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfl\bla\bag\bgs\bs_\b_t\bt *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bl_\ba_\bg_\bs_\b._\bh_\bp_\bp\"\n seed_mode\n If seed_mode is set, libtorrent will assume that all files are present\n for this torrent and that they all match the hashes in the torrent file.\n Each time a peer requests to download a block, the piece is verified\n@@ -813,41 +828,14 @@\n This flag is set automatically when adding a torrent that has at least\n one tracker whose hostname ends with .i2p. It's also set by\n _\bp_\ba_\br_\bs_\be_\b__\bm_\ba_\bg_\bn_\be_\bt_\b__\bu_\br_\bi_\b(_\b) if the tracker list contains such URL.\n all\n all torrent flags combined. Can conveniently be used when creating masks\n for flags\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_p\bpr\bri\bio\bor\bri\bit\bty\by_\b_t\bt *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\b__\bp_\br_\bi_\bo_\br_\bi_\bt_\by_\b._\bh_\bp_\bp\"\n- dont_download\n- Don't download the file or piece. Partial pieces may still be downloaded\n- when setting file priorities.\n- default_priority\n- The default priority for files and pieces.\n- low_priority\n- The lowest priority for files and pieces.\n- top_priority\n- The highest priority for files and pieces.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* p\bpe\bex\bx_\b_f\bfl\bla\bag\bgs\bs_\b_t\bt *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bp_\be_\bx_\b__\bf_\bl_\ba_\bg_\bs_\b._\bh_\bp_\bp\"\n- pex_encryption\n- the peer supports protocol encryption\n- pex_seed\n- the peer is a seed\n- pex_utp\n- the peer supports the uTP, transport protocol over UDP.\n- pex_holepunch\n- the peer supports the holepunch extension If this flag is received from a\n- peer, it can be used as a rendezvous point in case direct connections to\n- the peer fail\n- pex_lt_v2\n- protocol v2 this is not a standard flag, it is only used internally\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* i\bin\bnt\bt *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bv_\be_\br_\bs_\bi_\bo_\bn_\b._\bh_\bp_\bp\"\n version_major\n the major, minor and tiny versions of libtorrent\n version_minor\n the major, minor and tiny versions of libtorrent\n version_tiny\n@@ -858,14 +846,26 @@\n version_str\n the libtorrent version in string form\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* s\bst\btd\bd:\b::\b:u\bui\bin\bnt\bt6\b64\b4_\b_t\bt *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bv_\be_\br_\bs_\bi_\bo_\bn_\b._\bh_\bp_\bp\"\n version_revision\n the git commit of this libtorrent version\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_p\bpr\bri\bio\bor\bri\bit\bty\by_\b_t\bt *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\b__\bp_\br_\bi_\bo_\br_\bi_\bt_\by_\b._\bh_\bp_\bp\"\n+ dont_download\n+ Don't download the file or piece. Partial pieces may still be downloaded\n+ when setting file priorities.\n+ default_priority\n+ The default priority for files and pieces.\n+ low_priority\n+ The lowest priority for files and pieces.\n+ top_priority\n+ The highest priority for files and pieces.\n _\bh_\bo_\bm_\be\n _\bb_\bl_\bo_\bg\n _\bu_\bT_\bP\n _\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd\n _\bd_\bo_\bc_\bu_\bm_\be_\bn_\bt_\ba_\bt_\bi_\bo_\bn\n _\bD_\bH_\bT_\b _\bp_\bu_\bt_\b _\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn\n _\bp_\by_\bt_\bh_\bo_\bn_\b _\bb_\bi_\bn_\bd_\bi_\bn_\bg_\bs\n"}]}, {"source1": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Create_Torrents.html", "source2": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Create_Torrents.html", "unified_diff": "@@ -41,15 +41,15 @@\n
  • set_creation_date()
  • \n
  • set_hash()
  • \n
  • set_hash2()
  • \n
  • add_url_seed() add_http_seed()
  • \n
  • add_node()
  • \n
  • add_tracker()
  • \n
  • set_root_cert()
  • \n-
  • priv() set_priv()
  • \n+
  • set_priv() priv()
  • \n
  • num_pieces()
  • \n
  • piece_range()
  • \n
  • file_range()
  • \n
  • file_piece_range()
  • \n
  • total_size()
  • \n
  • piece_size() piece_length()
  • \n
  • add_similar_torrent() add_collection()
  • \n@@ -123,27 +123,27 @@\n void add_url_seed (string_view url);\n void add_http_seed (string_view url);\n void add_node (std::pair<std::string, int> node);\n void add_tracker (string_view url, int tier = 0);\n void set_root_cert (string_view cert);\n bool priv () const;\n void set_priv (bool p);\n- bool is_v1_only () const;\n bool is_v2_only () const;\n+ bool is_v1_only () const;\n int num_pieces () const;\n piece_index_t end_piece () const;\n index_range<piece_index_t> piece_range () const noexcept;\n file_index_t end_file () const;\n index_range<file_index_t> file_range () const noexcept;\n index_range<piece_index_t::diff_type> file_piece_range (file_index_t f);\n std::int64_t total_size () const;\n- int piece_size (piece_index_t i) const;\n int piece_length () const;\n- void add_similar_torrent (sha1_hash ih);\n+ int piece_size (piece_index_t i) const;\n void add_collection (string_view c);\n+ void add_similar_torrent (sha1_hash ih);\n \n static constexpr create_flags_t modification_time = 2_bit;\n static constexpr create_flags_t symlinks = 3_bit;\n static constexpr create_flags_t v2_only = 5_bit;\n static constexpr create_flags_t v1_only = 6_bit;\n static constexpr create_flags_t canonical_files = 7_bit;\n static constexpr create_flags_t no_attributes = 8_bit;\n@@ -320,18 +320,18 @@\n \n

    This function sets an X.509 certificate in PEM format to the torrent. This makes the\n torrent an SSL torrent. An SSL torrent requires that each peer has a valid certificate\n signed by this root certificate. For SSL torrents, all peers are connecting over SSL\n connections. For more information, see the section on ssl torrents.

    \n

    The string is not the path to the cert, it's the actual content of the\n certificate.

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

    priv() set_priv()

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

    set_priv() priv()

    \n
    \n bool priv () const;\n void set_priv (bool p);\n 
    \n

    Sets and queries the private flag of the torrent.\n Torrents with the private flag set ask the client to not use any other\n sources than the tracker for peers, and to not use DHT to advertise itself publicly,\n@@ -374,27 +374,27 @@\n \n

    the total number of bytes of all files and pad files

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

    piece_size() piece_length()

    \n
    \n-int piece_size (piece_index_t i) const;\n int piece_length () const;\n+int piece_size (piece_index_t i) const;\n 
    \n

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

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

    add_similar_torrent() add_collection()

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

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

    \n@@ -459,17 +459,17 @@\n [report issue]
    \n
    \n
    \n

    add_files()

    \n

    Declared in "libtorrent/create_torrent.hpp"

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

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

    \n

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

    \n
    \n@@ -482,26 +482,26 @@\n 

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

    \n [report issue]
    \n
    \n

    set_piece_hashes()

    \n

    Declared in "libtorrent/create_torrent.hpp"

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

    This function will assume that the files added to the torrent file exists at path\n p, read those files and hash the content and set the hashes in the create_torrent\n object. The optional function f is called in between every hash that is set. f\n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -12,15 +12,15 @@\n o _\bs_\be_\bt_\b__\bc_\br_\be_\ba_\bt_\bi_\bo_\bn_\b__\bd_\ba_\bt_\be_\b(_\b)\n o _\bs_\be_\bt_\b__\bh_\ba_\bs_\bh_\b(_\b)\n o _\bs_\be_\bt_\b__\bh_\ba_\bs_\bh_\b2_\b(_\b)\n o _\ba_\bd_\bd_\b__\bu_\br_\bl_\b__\bs_\be_\be_\bd_\b(_\b)_\b _\ba_\bd_\bd_\b__\bh_\bt_\bt_\bp_\b__\bs_\be_\be_\bd_\b(_\b)\n o _\ba_\bd_\bd_\b__\bn_\bo_\bd_\be_\b(_\b)\n o _\ba_\bd_\bd_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\b(_\b)\n o _\bs_\be_\bt_\b__\br_\bo_\bo_\bt_\b__\bc_\be_\br_\bt_\b(_\b)\n- o _\bp_\br_\bi_\bv_\b(_\b)_\b _\bs_\be_\bt_\b__\bp_\br_\bi_\bv_\b(_\b)\n+ o _\bs_\be_\bt_\b__\bp_\br_\bi_\bv_\b(_\b)_\b _\bp_\br_\bi_\bv_\b(_\b)\n o _\bn_\bu_\bm_\b__\bp_\bi_\be_\bc_\be_\bs_\b(_\b)\n o _\bp_\bi_\be_\bc_\be_\b__\br_\ba_\bn_\bg_\be_\b(_\b)\n o _\bf_\bi_\bl_\be_\b__\br_\ba_\bn_\bg_\be_\b(_\b)\n o _\bf_\bi_\bl_\be_\b__\bp_\bi_\be_\bc_\be_\b__\br_\ba_\bn_\bg_\be_\b(_\b)\n o _\bt_\bo_\bt_\ba_\bl_\b__\bs_\bi_\bz_\be_\b(_\b)\n o _\bp_\bi_\be_\bc_\be_\b__\bs_\bi_\bz_\be_\b(_\b)_\b _\bp_\bi_\be_\bc_\be_\b__\bl_\be_\bn_\bg_\bt_\bh_\b(_\b)\n o _\ba_\bd_\bd_\b__\bs_\bi_\bm_\bi_\bl_\ba_\br_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b)_\b _\ba_\bd_\bd_\b__\bc_\bo_\bl_\bl_\be_\bc_\bt_\bi_\bo_\bn_\b(_\b)\n@@ -85,27 +85,27 @@\n void a\bad\bdd\bd_\b_u\bur\brl\bl_\b_s\bse\bee\bed\bd (string_view url);\n void a\bad\bdd\bd_\b_h\bht\btt\btp\bp_\b_s\bse\bee\bed\bd (string_view url);\n void a\bad\bdd\bd_\b_n\bno\bod\bde\be (std::pair node);\n void a\bad\bdd\bd_\b_t\btr\bra\bac\bck\bke\ber\br (string_view url, int tier = 0);\n void s\bse\bet\bt_\b_r\bro\boo\bot\bt_\b_c\bce\ber\brt\bt (string_view cert);\n bool p\bpr\bri\biv\bv () const;\n void s\bse\bet\bt_\b_p\bpr\bri\biv\bv (bool p);\n- bool i\bis\bs_\b_v\bv1\b1_\b_o\bon\bnl\bly\by () const;\n bool i\bis\bs_\b_v\bv2\b2_\b_o\bon\bnl\bly\by () const;\n+ bool i\bis\bs_\b_v\bv1\b1_\b_o\bon\bnl\bly\by () const;\n int n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs () const;\n piece_index_t e\ben\bnd\bd_\b_p\bpi\bie\bec\bce\be () const;\n index_range p\bpi\bie\bec\bce\be_\b_r\bra\ban\bng\bge\be () const noexcept;\n file_index_t e\ben\bnd\bd_\b_f\bfi\bil\ble\be () const;\n index_range f\bfi\bil\ble\be_\b_r\bra\ban\bng\bge\be () const noexcept;\n index_range f\bfi\bil\ble\be_\b_p\bpi\bie\bec\bce\be_\b_r\bra\ban\bng\bge\be (file_index_t f);\n std::int64_t t\bto\bot\bta\bal\bl_\b_s\bsi\biz\bze\be () const;\n- int p\bpi\bie\bec\bce\be_\b_s\bsi\biz\bze\be (piece_index_t i) const;\n int p\bpi\bie\bec\bce\be_\b_l\ble\ben\bng\bgt\bth\bh () const;\n- void a\bad\bdd\bd_\b_s\bsi\bim\bmi\bil\bla\bar\br_\b_t\bto\bor\brr\bre\ben\bnt\bt (sha1_hash ih);\n+ int p\bpi\bie\bec\bce\be_\b_s\bsi\biz\bze\be (piece_index_t i) const;\n void a\bad\bdd\bd_\b_c\bco\bol\bll\ble\bec\bct\bti\bio\bon\bn (string_view c);\n+ void a\bad\bdd\bd_\b_s\bsi\bim\bmi\bil\bla\bar\br_\b_t\bto\bor\brr\bre\ben\bnt\bt (sha1_hash ih);\n \n static constexpr create_flags_t m\bmo\bod\bdi\bif\bfi\bic\bca\bat\bti\bio\bon\bn_\b_t\bti\bim\bme\be = 2_bit;\n static constexpr create_flags_t s\bsy\bym\bml\bli\bin\bnk\bks\bs = 3_bit;\n static constexpr create_flags_t v\bv2\b2_\b_o\bon\bnl\bly\by = 5_bit;\n static constexpr create_flags_t v\bv1\b1_\b_o\bon\bnl\bly\by = 6_bit;\n static constexpr create_flags_t c\bca\ban\bno\bon\bni\bic\bca\bal\bl_\b_f\bfi\bil\ble\bes\bs = 7_bit;\n static constexpr create_flags_t n\bno\bo_\b_a\bat\btt\btr\bri\bib\bbu\but\bte\bes\bs = 8_bit;\n@@ -235,15 +235,15 @@\n makes the torrent an S\bSS\bSL\bL t\bto\bor\brr\bre\ben\bnt\bt. An SSL torrent requires that each peer has a\n valid certificate signed by this root certificate. For SSL torrents, all peers\n are connecting over SSL connections. For more information, see the section on\n _\bs_\bs_\bl_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\bs.\n The string is not the path to the cert, it's the actual content of the\n certificate.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* p\bpr\bri\biv\bv(\b()\b) s\bse\bet\bt_\b_p\bpr\bri\biv\bv(\b()\b) *\b**\b**\b**\b**\b*\n+*\b**\b**\b**\b**\b* s\bse\bet\bt_\b_p\bpr\bri\biv\bv(\b()\b) p\bpr\bri\biv\bv(\b()\b) *\b**\b**\b**\b**\b*\n bool p\bpr\bri\biv\bv () const;\n void s\bse\bet\bt_\b_p\bpr\bri\biv\bv (bool p);\n Sets and queries the private flag of the torrent. Torrents with the private\n flag set ask the client to not use any other sources than the tracker for\n peers, and to not use DHT to advertise itself publicly, only the tracker.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n@@ -264,23 +264,23 @@\n delta from the first piece in the file. i.e. the first index is 0.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* t\bto\bot\bta\bal\bl_\b_s\bsi\biz\bze\be(\b()\b) *\b**\b**\b**\b**\b*\n std::int64_t t\bto\bot\bta\bal\bl_\b_s\bsi\biz\bze\be () const;\n the total number of bytes of all files and pad files\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* p\bpi\bie\bec\bce\be_\b_s\bsi\biz\bze\be(\b()\b) p\bpi\bie\bec\bce\be_\b_l\ble\ben\bng\bgt\bth\bh(\b()\b) *\b**\b**\b**\b**\b*\n-int p\bpi\bie\bec\bce\be_\b_s\bsi\biz\bze\be (piece_index_t i) const;\n int p\bpi\bie\bec\bce\be_\b_l\ble\ben\bng\bgt\bth\bh () const;\n+int p\bpi\bie\bec\bce\be_\b_s\bsi\biz\bze\be (piece_index_t i) const;\n piece_length() returns the piece size of all pieces but the last one.\n piece_size() returns the size of the specified piece. these functions are just\n forwarding to the associated _\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_s\bsi\bim\bmi\bil\bla\bar\br_\b_t\bto\bor\brr\bre\ben\bnt\bt(\b()\b) a\bad\bdd\bd_\b_c\bco\bol\bll\ble\bec\bct\bti\bio\bon\bn(\b()\b) *\b**\b**\b**\b**\b*\n-void a\bad\bdd\bd_\b_s\bsi\bim\bmi\bil\bla\bar\br_\b_t\bto\bor\brr\bre\ben\bnt\bt (sha1_hash ih);\n void a\bad\bdd\bd_\b_c\bco\bol\bll\ble\bec\bct\bti\bio\bon\bn (string_view c);\n+void a\bad\bdd\bd_\b_s\bsi\bim\bmi\bil\bla\bar\br_\b_t\bto\bor\brr\bre\ben\bnt\bt (sha1_hash ih);\n Add similar torrents (by info-hash) or collections of similar torrents. Similar\n torrents are expected to share some files with this torrent. Torrents sharing a\n collection name with this torrent are also expected to share files with this\n torrent. A torrent may have more than one collection and more than one similar\n torrents. For more information, see _\bB_\bE_\bP_\b _\b3_\b8.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n modification_time\n@@ -330,17 +330,17 @@\n behavior deviates from the specification but was the way libtorrent\n created torrents in version up to and including 2.0.7. This flag is here\n for backwards compatibility.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_f\bfi\bil\ble\bes\bs(\b()\b) *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bc_\br_\be_\ba_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bh_\bp_\bp\"\n void a\bad\bdd\bd_\b_f\bfi\bil\ble\bes\bs (file_storage& fs, std::string const& file\n- , create_flags_t flags = {});\n-void a\bad\bdd\bd_\b_f\bfi\bil\ble\bes\bs (file_storage& fs, std::string const& file\n , std::function p, create_flags_t flags = {});\n+void a\bad\bdd\bd_\b_f\bfi\bil\ble\bes\bs (file_storage& fs, std::string const& file\n+ , create_flags_t flags = {});\n Adds the file specified by path to the _\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be object. In case path refers\n to a directory, files will be added recursively from the directory.\n If specified, the predicate p is called once for every file and directory that\n is encountered. Files for which p returns true are added, and directories for\n which p returns true are traversed. p must have the following signature:\n bool Pred(std::string const& p);\n The path that is passed in to the predicate is the full path of the file or\n@@ -348,27 +348,27 @@\n directories are traversed.\n The \"..\" directory is never traversed.\n The flags argument should be the same as the flags passed to the _\bc_\br_\be_\ba_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt\n constructor.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* s\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_h\bha\bas\bsh\bhe\bes\bs(\b()\b) *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bc_\br_\be_\ba_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bh_\bp_\bp\"\n+inline void s\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_h\bha\bas\bsh\bhe\bes\bs (create_torrent& t, std::string const& p,\n+error_code& ec);\n+inline void s\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_h\bha\bas\bsh\bhe\bes\bs (create_torrent& t, std::string const& p);\n+inline void s\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_h\bha\bas\bsh\bhe\bes\bs (create_torrent& t, std::string const& p\n+ , std::function const& f);\n void s\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_h\bha\bas\bsh\bhe\bes\bs (create_torrent& t, std::string const& p\n+ , settings_interface const& settings, disk_io_constructor_type disk_io\n , std::function const& f, error_code& ec);\n void s\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_h\bha\bas\bsh\bhe\bes\bs (create_torrent& t, std::string const& p\n- , settings_interface const& settings, disk_io_constructor_type disk_io\n , std::function const& f, error_code& ec);\n-inline void s\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_h\bha\bas\bsh\bhe\bes\bs (create_torrent& t, std::string const& p\n- , std::function const& f);\n void s\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_h\bha\bas\bsh\bhe\bes\bs (create_torrent& t, std::string const& p\n , settings_interface const& settings\n , std::function const& f, error_code& ec);\n-inline void s\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_h\bha\bas\bsh\bhe\bes\bs (create_torrent& t, std::string const& p,\n-error_code& ec);\n-inline void s\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_h\bha\bas\bsh\bhe\bes\bs (create_torrent& t, std::string const& p);\n inline void s\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_h\bha\bas\bsh\bhe\bes\bs (create_torrent& t, std::string const& p\n , settings_interface const& settings\n , std::function const& f);\n This function will assume that the files added to the torrent file exists at\n path p, read those files and hash the content and set the hashes in the\n create_torrent object. The optional function f is called in between every hash\n that is set. f must have the following signature:\n"}]}, {"source1": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Custom_Storage.html", "source2": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Custom_Storage.html", "unified_diff": "@@ -28,24 +28,24 @@\n 2.0.11\n \n \n

    home

    \n
    \n

    Table of contents

    \n
    \n+
    \n+

    settings_interface

    \n+

    Declared in "libtorrent/settings_pack.hpp"

    \n+

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

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

    open_file_state

    \n

    Declared in "libtorrent/disk_interface.hpp"

    \n

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

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

    \n
    \n struct disk_interface\n {\n    virtual storage_holder new_torrent (storage_params const& p\n       , std::shared_ptr<void> const& torrent) = 0;\n    virtual void remove_torrent (storage_index_t) = 0;\n+   virtual void async_read (storage_index_t storage, peer_request const& r\n+      , std::function<void(disk_buffer_holder, storage_error const&)> handler\n+      , disk_job_flags_t flags = {}) = 0;\n    virtual bool async_write (storage_index_t storage, peer_request const& r\n       , char const* buf, std::shared_ptr<disk_observer> o\n       , std::function<void(storage_error const&)> handler\n       , disk_job_flags_t flags = {}) = 0;\n-   virtual void async_read (storage_index_t storage, peer_request const& r\n-      , std::function<void(disk_buffer_holder, storage_error const&)> handler\n-      , disk_job_flags_t flags = {}) = 0;\n    virtual void async_hash (storage_index_t storage, piece_index_t piece, span<sha256_hash> v2\n       , disk_job_flags_t flags\n       , std::function<void(piece_index_t, sha1_hash const&, storage_error const&)> handler) = 0;\n    virtual void async_hash2 (storage_index_t storage, piece_index_t piece, int offset, disk_job_flags_t flags\n       , std::function<void(piece_index_t, sha256_hash const&, storage_error const&)> handler) = 0;\n    virtual void async_move_storage (storage_index_t storage, std::string p, move_flags_t flags\n       , std::function<void(status_t, std::string const&, storage_error const&)> handler) = 0;\n@@ -494,26 +494,26 @@\n 

    remove_torrent()

    \n
    \n virtual void remove_torrent (storage_index_t) = 0;\n 
    \n

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

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

    async_write() async_read()

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

    async_read() async_write()

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

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

    \n

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

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

    buffer_allocator_interface

    \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,20 +1,20 @@\n >\n _\b[_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b _\bl_\bo_\bg_\bo_\b]\n V\bVe\ber\brs\bsi\bio\bon\bn:\b: 2.0.11\n _\bh_\bo_\bm_\be\n Table of contents\n- * _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be\n * _\bd_\bi_\bs_\bk_\b__\bo_\bb_\bs_\be_\br_\bv_\be_\br\n o _\bo_\bn_\b__\bd_\bi_\bs_\bk_\b(_\b)\n+ * _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be\n * _\bo_\bp_\be_\bn_\b__\bf_\bi_\bl_\be_\b__\bs_\bt_\ba_\bt_\be\n * _\bd_\bi_\bs_\bk_\b__\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be\n o _\bn_\be_\bw_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b)\n o _\br_\be_\bm_\bo_\bv_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b)\n- o _\ba_\bs_\by_\bn_\bc_\b__\bw_\br_\bi_\bt_\be_\b(_\b)_\b _\ba_\bs_\by_\bn_\bc_\b__\br_\be_\ba_\bd_\b(_\b)\n+ o _\ba_\bs_\by_\bn_\bc_\b__\br_\be_\ba_\bd_\b(_\b)_\b _\ba_\bs_\by_\bn_\bc_\b__\bw_\br_\bi_\bt_\be_\b(_\b)\n o _\ba_\bs_\by_\bn_\bc_\b__\bh_\ba_\bs_\bh_\b(_\b)\n o _\ba_\bs_\by_\bn_\bc_\b__\bh_\ba_\bs_\bh_\b2_\b(_\b)\n o _\ba_\bs_\by_\bn_\bc_\b__\bm_\bo_\bv_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b(_\b)\n o _\ba_\bs_\by_\bn_\bc_\b__\br_\be_\bl_\be_\ba_\bs_\be_\b__\bf_\bi_\bl_\be_\bs_\b(_\b)\n o _\ba_\bs_\by_\bn_\bc_\b__\bc_\bh_\be_\bc_\bk_\b__\bf_\bi_\bl_\be_\bs_\b(_\b)\n o _\ba_\bs_\by_\bn_\bc_\b__\bs_\bt_\bo_\bp_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b)\n o _\ba_\bs_\by_\bn_\bc_\b__\br_\be_\bn_\ba_\bm_\be_\b__\bf_\bi_\bl_\be_\b(_\b)\n@@ -327,41 +327,41 @@\n \n std::unique_ptr temp_disk_constructor(\n lt::io_context& ioc, lt::settings_interface const&, lt::counters&)\n {\n return std::make_unique(ioc);\n }\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* d\bdi\bis\bsk\bk_\b_o\bob\bbs\bse\ber\brv\bve\ber\br *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bd_\bi_\bs_\bk_\b__\bo_\bb_\bs_\be_\br_\bv_\be_\br_\b._\bh_\bp_\bp\"\n+struct disk_observer\n+{\n+ virtual void o\bon\bn_\b_d\bdi\bis\bsk\bk () = 0;\n+};\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* o\bon\bn_\b_d\bdi\bis\bsk\bk(\b()\b) *\b**\b**\b**\b**\b*\n+virtual void o\bon\bn_\b_d\bdi\bis\bsk\bk () = 0;\n+called when the disk cache size has dropped below the low watermark again and\n+we can resume downloading from peers\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* s\bse\bet\btt\bti\bin\bng\bgs\bs_\b_i\bin\bnt\bte\ber\brf\bfa\bac\bce\be *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk_\b._\bh_\bp_\bp\"\n the common interface to _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk and the internal representation of\n settings.\n struct settings_interface\n {\n- virtual void s\bse\bet\bt_\b_b\bbo\boo\bol\bl (int name, bool val) = 0;\n- virtual bool h\bha\bas\bs_\b_v\bva\bal\bl (int name) const = 0;\n virtual void s\bse\bet\bt_\b_i\bin\bnt\bt (int name, int val) = 0;\n virtual void s\bse\bet\bt_\b_s\bst\btr\br (int name, std::string val) = 0;\n+ virtual void s\bse\bet\bt_\b_b\bbo\boo\bol\bl (int name, bool val) = 0;\n+ virtual bool h\bha\bas\bs_\b_v\bva\bal\bl (int name) const = 0;\n virtual std::string const& g\bge\bet\bt_\b_s\bst\btr\br (int name) const = 0;\n virtual bool g\bge\bet\bt_\b_b\bbo\boo\bol\bl (int name) const = 0;\n virtual int g\bge\bet\bt_\b_i\bin\bnt\bt (int name) const = 0;\n };\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* d\bdi\bis\bsk\bk_\b_o\bob\bbs\bse\ber\brv\bve\ber\br *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bd_\bi_\bs_\bk_\b__\bo_\bb_\bs_\be_\br_\bv_\be_\br_\b._\bh_\bp_\bp\"\n-struct disk_observer\n-{\n- virtual void o\bon\bn_\b_d\bdi\bis\bsk\bk () = 0;\n-};\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* o\bon\bn_\b_d\bdi\bis\bsk\bk(\b()\b) *\b**\b**\b**\b**\b*\n-virtual void o\bon\bn_\b_d\bdi\bis\bsk\bk () = 0;\n-called when the disk cache size has dropped below the low watermark again and\n-we can resume downloading from peers\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* o\bop\bpe\ben\bn_\b_f\bfi\bil\ble\be_\b_s\bst\bta\bat\bte\be *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bd_\bi_\bs_\bk_\b__\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be_\b._\bh_\bp_\bp\"\n this contains information about a file that's currently open by the libtorrent\n disk I/O subsystem. It's associated with a single torrent.\n struct open_file_state\n {\n file_index_t file_index;\n@@ -397,21 +397,21 @@\n thread via the io_context object passed into the constructor. The callbacks\n will be run in the network thread.\n struct disk_interface\n {\n virtual storage_holder n\bne\bew\bw_\b_t\bto\bor\brr\bre\ben\bnt\bt (storage_params const& p\n , std::shared_ptr const& torrent) = 0;\n virtual void r\bre\bem\bmo\bov\bve\be_\b_t\bto\bor\brr\bre\ben\bnt\bt (storage_index_t) = 0;\n+ virtual void a\bas\bsy\byn\bnc\bc_\b_r\bre\bea\bad\bd (storage_index_t storage, peer_request const& r\n+ , std::function handler\n+ , disk_job_flags_t flags = {}) = 0;\n virtual bool a\bas\bsy\byn\bnc\bc_\b_w\bwr\bri\bit\bte\be (storage_index_t storage, peer_request const& r\n , char const* buf, std::shared_ptr o\n , std::function handler\n , disk_job_flags_t flags = {}) = 0;\n- virtual void a\bas\bsy\byn\bnc\bc_\b_r\bre\bea\bad\bd (storage_index_t storage, peer_request const& r\n- , std::function handler\n- , disk_job_flags_t flags = {}) = 0;\n virtual void a\bas\bsy\byn\bnc\bc_\b_h\bha\bas\bsh\bh (storage_index_t storage, piece_index_t piece,\n span v2\n , disk_job_flags_t flags\n , std::function handler) = 0;\n virtual void a\bas\bsy\byn\bnc\bc_\b_h\bha\bas\bsh\bh2\b2 (storage_index_t storage, piece_index_t piece, int\n offset, disk_job_flags_t flags\n@@ -466,22 +466,22 @@\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* r\bre\bem\bmo\bov\bve\be_\b_t\bto\bor\brr\bre\ben\bnt\bt(\b()\b) *\b**\b**\b**\b**\b*\n virtual void r\bre\bem\bmo\bov\bve\be_\b_t\bto\bor\brr\bre\ben\bnt\bt (storage_index_t) = 0;\n remove the storage with the specified index. This is not expected to delete any\n files from disk, just to clean up any resources associated with the specified\n storage.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* a\bas\bsy\byn\bnc\bc_\b_w\bwr\bri\bit\bte\be(\b()\b) a\bas\bsy\byn\bnc\bc_\b_r\bre\bea\bad\bd(\b()\b) *\b**\b**\b**\b**\b*\n+*\b**\b**\b**\b**\b* a\bas\bsy\byn\bnc\bc_\b_r\bre\bea\bad\bd(\b()\b) a\bas\bsy\byn\bnc\bc_\b_w\bwr\bri\bit\bte\be(\b()\b) *\b**\b**\b**\b**\b*\n+virtual void a\bas\bsy\byn\bnc\bc_\b_r\bre\bea\bad\bd (storage_index_t storage, peer_request const& r\n+ , std::function handler\n+ , disk_job_flags_t flags = {}) = 0;\n virtual bool a\bas\bsy\byn\bnc\bc_\b_w\bwr\bri\bit\bte\be (storage_index_t storage, peer_request const& r\n , char const* buf, std::shared_ptr o\n , std::function handler\n , disk_job_flags_t flags = {}) = 0;\n-virtual void a\bas\bsy\byn\bnc\bc_\b_r\bre\bea\bad\bd (storage_index_t storage, peer_request const& r\n- , std::function handler\n- , disk_job_flags_t flags = {}) = 0;\n perform a read or write operation from/to the specified storage index and the\n specified request. When the operation completes, call handler possibly with a\n _\bd_\bi_\bs_\bk_\b__\bb_\bu_\bf_\bf_\be_\br_\b__\bh_\bo_\bl_\bd_\be_\br, holding the buffer with the result. Flags may be set to\n affect the read operation. See disk_job_flags_t.\n The _\bd_\bi_\bs_\bk_\b__\bo_\bb_\bs_\be_\br_\bv_\be_\br is a callback to indicate that the store buffer/disk write\n queue is below the watermark to let peers start writing buffers to disk again.\n When async_write() returns true, indicating the write queue is full, the peer\n@@ -668,22 +668,22 @@\n a unique, owning, reference to the storage of a torrent in a disk io subsystem\n (class that implements _\bd_\bi_\bs_\bk_\b__\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be). This is held by the internal libtorrent\n torrent object to tie the storage object allocated for a torrent to the\n lifetime of the internal torrent object. When a torrent is removed from the\n _\bs_\be_\bs_\bs_\bi_\bo_\bn, this holder is destructed and will inform the disk object.\n struct storage_holder\n {\n+ s\bst\bto\bor\bra\bag\bge\be_\b_h\bho\bol\bld\bde\ber\br () = default;\n ~\b~s\bst\bto\bor\bra\bag\bge\be_\b_h\bho\bol\bld\bde\ber\br ();\n s\bst\bto\bor\bra\bag\bge\be_\b_h\bho\bol\bld\bde\ber\br (storage_index_t idx, disk_interface& disk_io);\n- s\bst\bto\bor\bra\bag\bge\be_\b_h\bho\bol\bld\bde\ber\br () = default;\n explicit operator b\bbo\boo\bol\bl () const;\n operator s\bst\bto\bor\bra\bag\bge\be_\b_i\bin\bnd\bde\bex\bx_\b_t\bt () const;\n void r\bre\bes\bse\bet\bt ();\n- storage_holder& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (storage_holder const&) = delete;\n s\bst\bto\bor\bra\bag\bge\be_\b_h\bho\bol\bld\bde\ber\br (storage_holder const&) = delete;\n+ storage_holder& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (storage_holder const&) = delete;\n s\bst\bto\bor\bra\bag\bge\be_\b_h\bho\bol\bld\bde\ber\br (storage_holder&& rhs) noexcept;\n storage_holder& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (storage_holder&& rhs) noexcept;\n };\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* b\bbu\buf\bff\bfe\ber\br_\b_a\bal\bll\blo\boc\bca\bat\bto\bor\br_\b_i\bin\bnt\bte\ber\brf\bfa\bac\bce\be *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bd_\bi_\bs_\bk_\b__\bb_\bu_\bf_\bf_\be_\br_\b__\bh_\bo_\bl_\bd_\be_\br_\b._\bh_\bp_\bp\"\n the interface for freeing disk buffers, used by the _\bd_\bi_\bs_\bk_\b__\bb_\bu_\bf_\bf_\be_\br_\b__\bh_\bo_\bl_\bd_\be_\br. when\n"}]}, {"source1": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-DHT.html", "source2": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-DHT.html", "unified_diff": "@@ -47,16 +47,16 @@\n
  • get_mutable_item()
  • \n
  • put_mutable_item()
  • \n
  • get_infohashes_sample()
  • \n
  • tick()
  • \n
  • counters()
  • \n \n \n-
  • dht_default_storage_constructor()
  • \n-
  • sign_mutable_item()
  • \n+
  • sign_mutable_item()
  • \n+
  • dht_default_storage_constructor()
  • \n
  • announce_flags_t
  • \n \n
    \n [report issue]
    \n

    dht_state

    \n

    Declared in "libtorrent/kademlia/dht_state.hpp"

    \n

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

    \n
    \n

    counters()

    \n
    \n virtual dht_storage_counters counters () const = 0;\n 
    \n

    return stats counters for the store

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

    dht_default_storage_constructor()

    \n-

    Declared in "libtorrent/kademlia/dht_storage.hpp"

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

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

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

    sign_mutable_item()

    \n

    Declared in "libtorrent/kademlia/item.hpp"

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

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

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

    dht_default_storage_constructor()

    \n+

    Declared in "libtorrent/kademlia/dht_storage.hpp"

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

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

    \n [report issue]
    \n
    \n

    announce_flags_t

    \n

    Declared in "libtorrent/kademlia/announce_flags.hpp"

    \n
    \n
    seed
    \n
    announce to DHT as a seed
    \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -14,16 +14,16 @@\n o _\bp_\bu_\bt_\b__\bi_\bm_\bm_\bu_\bt_\ba_\bb_\bl_\be_\b__\bi_\bt_\be_\bm_\b(_\b)\n o _\bg_\be_\bt_\b__\bm_\bu_\bt_\ba_\bb_\bl_\be_\b__\bi_\bt_\be_\bm_\b__\bs_\be_\bq_\b(_\b)\n o _\bg_\be_\bt_\b__\bm_\bu_\bt_\ba_\bb_\bl_\be_\b__\bi_\bt_\be_\bm_\b(_\b)\n o _\bp_\bu_\bt_\b__\bm_\bu_\bt_\ba_\bb_\bl_\be_\b__\bi_\bt_\be_\bm_\b(_\b)\n o _\bg_\be_\bt_\b__\bi_\bn_\bf_\bo_\bh_\ba_\bs_\bh_\be_\bs_\b__\bs_\ba_\bm_\bp_\bl_\be_\b(_\b)\n o _\bt_\bi_\bc_\bk_\b(_\b)\n o _\bc_\bo_\bu_\bn_\bt_\be_\br_\bs_\b(_\b)\n- * _\bd_\bh_\bt_\b__\bd_\be_\bf_\ba_\bu_\bl_\bt_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bc_\bo_\bn_\bs_\bt_\br_\bu_\bc_\bt_\bo_\br_\b(_\b)\n * _\bs_\bi_\bg_\bn_\b__\bm_\bu_\bt_\ba_\bb_\bl_\be_\b__\bi_\bt_\be_\bm_\b(_\b)\n+ * _\bd_\bh_\bt_\b__\bd_\be_\bf_\ba_\bu_\bl_\bt_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bc_\bo_\bn_\bs_\bt_\br_\bu_\bc_\bt_\bo_\br_\b(_\b)\n * _\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\bf_\bl_\ba_\bg_\bs_\b__\bt\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* d\bdh\bht\bt_\b_s\bst\bta\bat\bte\be *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bk_\ba_\bd_\be_\bm_\bl_\bi_\ba_\b/_\bd_\bh_\bt_\b__\bs_\bt_\ba_\bt_\be_\b._\bh_\bp_\bp\"\n This structure helps to store and load the state of the dht_tracker. At this\n moment the library is only a dual stack implementation of the DHT. See _\bB_\bE_\bP_\b _\b3_\b2\n struct dht_state\n@@ -210,36 +210,36 @@\n For implementers: Use this functions for expire peers or items or any other\n storage cleanup.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* c\bco\bou\bun\bnt\bte\ber\brs\bs(\b()\b) *\b**\b**\b**\b**\b*\n virtual dht_storage_counters c\bco\bou\bun\bnt\bte\ber\brs\bs () const = 0;\n return stats _\bc_\bo_\bu_\bn_\bt_\be_\br_\bs for the store\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* d\bdh\bht\bt_\b_d\bde\bef\bfa\bau\bul\blt\bt_\b_s\bst\bto\bor\bra\bag\bge\be_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br(\b()\b) *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bk_\ba_\bd_\be_\bm_\bl_\bi_\ba_\b/_\bd_\bh_\bt_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b._\bh_\bp_\bp\"\n-std::unique_ptr d\bdh\bht\bt_\b_d\bde\bef\bfa\bau\bul\blt\bt_\b_s\bst\bto\bor\bra\bag\bge\be_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br (\n- settings_interface const& settings);\n-constructor for the default DHT storage. The DHT storage is responsible for\n-maintaining peers and mutable and immutable items announced and stored/put to\n-the DHT node.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* s\bsi\big\bgn\bn_\b_m\bmu\but\bta\bab\bbl\ble\be_\b_i\bit\bte\bem\bm(\b()\b) *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bk_\ba_\bd_\be_\bm_\bl_\bi_\ba_\b/_\bi_\bt_\be_\bm_\b._\bh_\bp_\bp\"\n signature s\bsi\big\bgn\bn_\b_m\bmu\but\bta\bab\bbl\ble\be_\b_i\bit\bte\bem\bm (\n span v\n , span salt\n , sequence_number seq\n , public_key const& pk\n , secret_key const& sk);\n given a byte range v and an optional byte range salt, a sequence number, public\n key pk (must be 32 bytes) and a secret key sk (must be 64 bytes), this function\n produces a signature which is written into a 64 byte buffer pointed to by sig.\n The caller is responsible for allocating the destination buffer that's passed\n in as the sig argument. Typically it would be allocated on the stack.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* d\bdh\bht\bt_\b_d\bde\bef\bfa\bau\bul\blt\bt_\b_s\bst\bto\bor\bra\bag\bge\be_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br(\b()\b) *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bk_\ba_\bd_\be_\bm_\bl_\bi_\ba_\b/_\bd_\bh_\bt_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b._\bh_\bp_\bp\"\n+std::unique_ptr d\bdh\bht\bt_\b_d\bde\bef\bfa\bau\bul\blt\bt_\b_s\bst\bto\bor\bra\bag\bge\be_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br (\n+ settings_interface const& settings);\n+constructor for the default DHT storage. The DHT storage is responsible for\n+maintaining peers and mutable and immutable items announced and stored/put to\n+the DHT node.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_f\bfl\bla\bag\bgs\bs_\b_t\bt *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bk_\ba_\bd_\be_\bm_\bl_\bi_\ba_\b/_\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\bf_\bl_\ba_\bg_\bs_\b._\bh_\bp_\bp\"\n seed\n announce to DHT as a seed\n implied_port\n announce to DHT with the implied-port flag set. This tells the network to\n use your source UDP port as your listen port, rather than the one\n"}]}, {"source1": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Error_Codes.html", "source2": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Error_Codes.html", "unified_diff": "@@ -34,27 +34,27 @@\n \n
    \n [report issue]
    \n

    storage_error

    \n

    Declared in "libtorrent/error_code.hpp"

    \n@@ -102,29 +102,37 @@\n
    \n
    \n

    pcp_category()

    \n

    Declared in "libtorrent/natpmp.hpp"

    \n
    \n boost::system::error_category& pcp_category ();\n 
    \n+[report issue]
    \n+
    \n+

    bdecode_category()

    \n+

    Declared in "libtorrent/bdecode.hpp"

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

    gzip_category()

    \n

    Declared in "libtorrent/gzip.hpp"

    \n
    \n boost::system::error_category& gzip_category ();\n 
    \n

    get the error_category for zip errors

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

    bdecode_category()

    \n-

    Declared in "libtorrent/bdecode.hpp"

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

    socks_category()

    \n+

    Declared in "libtorrent/socks5_stream.hpp"

    \n
    \n-boost::system::error_category& bdecode_category ();\n+boost::system::error_category& socks_category ();\n 
    \n+

    returns the error_category for SOCKS5 errors

    \n [report issue]
    \n
    \n

    upnp_category()

    \n

    Declared in "libtorrent/upnp.hpp"

    \n
    \n boost::system::error_category& upnp_category ();\n 
    \n@@ -133,22 +141,14 @@\n
    \n

    i2p_category()

    \n

    Declared in "libtorrent/i2p_stream.hpp"

    \n
    \n boost::system::error_category& i2p_category ();\n 
    \n

    returns the error category for I2P errors

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

    socks_category()

    \n-

    Declared in "libtorrent/socks5_stream.hpp"

    \n-
    \n-boost::system::error_category& socks_category ();\n-
    \n-

    returns the error_category for SOCKS5 errors

    \n [report issue]
    \n
    \n

    libtorrent_category()

    \n

    Declared in "libtorrent/error_code.hpp"

    \n
    \n boost::system::error_category& libtorrent_category ();\n 
    \n@@ -236,14 +236,69 @@\n  \n \n \n \n [report issue]
    \n
    \n

    enum error_code_enum

    \n+

    Declared in "libtorrent/bdecode.hpp"

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    namevaluedescription
    no_error0Not an error
    expected_digit1expected digit in bencoded string
    expected_colon2expected colon in bencoded string
    unexpected_eof3unexpected end of file in bencoded string
    expected_value4expected value (list, dict, int or string) in bencoded string
    depth_exceeded5bencoded recursion depth limit exceeded
    limit_exceeded6bencoded item count limit exceeded
    overflow7integer overflow
    error_code_max8the number of error codes
    \n+[report issue]
    \n+
    \n+

    enum error_code_enum

    \n

    Declared in "libtorrent/gzip.hpp"

    \n \n \n \n \n \n \n@@ -321,66 +376,74 @@\n \n \n \n \n \n \n
    error_code_max16the number of error codes
    \n-[report issue]
    \n-
    \n-

    enum error_code_enum

    \n-

    Declared in "libtorrent/bdecode.hpp"

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

    enum socks_error_code

    \n+

    Declared in "libtorrent/socks5_stream.hpp"

    \n \n \n-\n-\n-\n+\n+\n+\n \n \n \n \n \n \n \n \n \n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n+\n+\n+\n+\n+\n+\n+\n+\n \n \n
    namevaluedescription
    no_error0Not an error 
    expected_digit
    unsupported_version1expected digit in bencoded string 
    expected_colon
    unsupported_authentication_method2expected colon in bencoded string 
    unexpected_eof
    unsupported_authentication_version3unexpected end of file in bencoded string 
    expected_value
    authentication_error4expected value (list, dict, int or string) in bencoded string 
    depth_exceeded
    username_required5bencoded recursion depth limit exceeded 
    limit_exceeded
    general_failure6bencoded item count limit exceeded 
    overflow
    command_not_supported7integer overflow 
    error_code_max
    no_identd8the number of error codes 
    identd_error9 
    num_errors10 
    \n [report issue]
    \n
    \n

    enum error_code_enum

    \n

    Declared in "libtorrent/upnp.hpp"

    \n@@ -504,77 +567,14 @@\n \n num_errors\n 9\n  \n \n \n \n-[report issue]
    \n-
    \n-

    enum socks_error_code

    \n-

    Declared in "libtorrent/socks5_stream.hpp"

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-
    namevaluedescription
    no_error0 
    unsupported_version1 
    unsupported_authentication_method2 
    unsupported_authentication_version3 
    authentication_error4 
    username_required5 
    general_failure6 
    command_not_supported7 
    no_identd8 
    identd_error9 
    num_errors10 
    \n [report issue]
    \n
    \n

    enum error_code_enum

    \n

    Declared in "libtorrent/error_code.hpp"

    \n \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -3,27 +3,27 @@\n V\bVe\ber\brs\bsi\bio\bon\bn:\b: 2.0.11\n _\bh_\bo_\bm_\be\n Table of contents\n * _\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\be_\br_\br_\bo_\br\n o _\bb_\bo_\bo_\bl_\b(_\b)\n o _\bf_\bi_\bl_\be_\b(_\b)\n * _\bp_\bc_\bp_\b__\bc_\ba_\bt_\be_\bg_\bo_\br_\by_\b(_\b)\n- * _\bg_\bz_\bi_\bp_\b__\bc_\ba_\bt_\be_\bg_\bo_\br_\by_\b(_\b)\n * _\bb_\bd_\be_\bc_\bo_\bd_\be_\b__\bc_\ba_\bt_\be_\bg_\bo_\br_\by_\b(_\b)\n+ * _\bg_\bz_\bi_\bp_\b__\bc_\ba_\bt_\be_\bg_\bo_\br_\by_\b(_\b)\n+ * _\bs_\bo_\bc_\bk_\bs_\b__\bc_\ba_\bt_\be_\bg_\bo_\br_\by_\b(_\b)\n * _\bu_\bp_\bn_\bp_\b__\bc_\ba_\bt_\be_\bg_\bo_\br_\by_\b(_\b)\n * _\bi_\b2_\bp_\b__\bc_\ba_\bt_\be_\bg_\bo_\br_\by_\b(_\b)\n- * _\bs_\bo_\bc_\bk_\bs_\b__\bc_\ba_\bt_\be_\bg_\bo_\br_\by_\b(_\b)\n * _\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bc_\ba_\bt_\be_\bg_\bo_\br_\by_\b(_\b)\n * _\bh_\bt_\bt_\bp_\b__\bc_\ba_\bt_\be_\bg_\bo_\br_\by_\b(_\b)\n * _\be_\bn_\bu_\bm_\b _\bp_\bc_\bp_\b__\be_\br_\br_\bo_\br_\bs\n * _\be_\bn_\bu_\bm_\b _\be_\br_\br_\bo_\br_\b__\bc_\bo_\bd_\be_\b__\be_\bn_\bu_\bm\n * _\be_\bn_\bu_\bm_\b _\be_\br_\br_\bo_\br_\b__\bc_\bo_\bd_\be_\b__\be_\bn_\bu_\bm\n+ * _\be_\bn_\bu_\bm_\b _\bs_\bo_\bc_\bk_\bs_\b__\be_\br_\br_\bo_\br_\b__\bc_\bo_\bd_\be\n * _\be_\bn_\bu_\bm_\b _\be_\br_\br_\bo_\br_\b__\bc_\bo_\bd_\be_\b__\be_\bn_\bu_\bm\n * _\be_\bn_\bu_\bm_\b _\bi_\b2_\bp_\b__\be_\br_\br_\bo_\br_\b__\bc_\bo_\bd_\be\n- * _\be_\bn_\bu_\bm_\b _\bs_\bo_\bc_\bk_\bs_\b__\be_\br_\br_\bo_\br_\b__\bc_\bo_\bd_\be\n * _\be_\bn_\bu_\bm_\b _\be_\br_\br_\bo_\br_\b__\bc_\bo_\bd_\be_\b__\be_\bn_\bu_\bm\n * _\be_\bn_\bu_\bm_\b _\bh_\bt_\bt_\bp_\b__\be_\br_\br_\bo_\br_\bs\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* s\bst\bto\bor\bra\bag\bge\be_\b_e\ber\brr\bro\bor\br *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\be_\br_\br_\bo_\br_\b__\bc_\bo_\bd_\be_\b._\bh_\bp_\bp\"\n used by storage to return errors also includes which underlying file the error\n happened on\n@@ -54,38 +54,38 @@\n operation\n A code from _\bo_\bp_\be_\br_\ba_\bt_\bi_\bo_\bn_\b__\bt enum, indicating what kind of operation failed.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* p\bpc\bcp\bp_\b_c\bca\bat\bte\beg\bgo\bor\bry\by(\b()\b) *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bn_\ba_\bt_\bp_\bm_\bp_\b._\bh_\bp_\bp\"\n boost::system::error_category& p\bpc\bcp\bp_\b_c\bca\bat\bte\beg\bgo\bor\bry\by ();\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* b\bbd\bde\bec\bco\bod\bde\be_\b_c\bca\bat\bte\beg\bgo\bor\bry\by(\b()\b) *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bb_\bd_\be_\bc_\bo_\bd_\be_\b._\bh_\bp_\bp\"\n+boost::system::error_category& b\bbd\bde\bec\bco\bod\bde\be_\b_c\bca\bat\bte\beg\bgo\bor\bry\by ();\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* g\bgz\bzi\bip\bp_\b_c\bca\bat\bte\beg\bgo\bor\bry\by(\b()\b) *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bg_\bz_\bi_\bp_\b._\bh_\bp_\bp\"\n boost::system::error_category& g\bgz\bzi\bip\bp_\b_c\bca\bat\bte\beg\bgo\bor\bry\by ();\n get the error_category for zip errors\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* b\bbd\bde\bec\bco\bod\bde\be_\b_c\bca\bat\bte\beg\bgo\bor\bry\by(\b()\b) *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bb_\bd_\be_\bc_\bo_\bd_\be_\b._\bh_\bp_\bp\"\n-boost::system::error_category& b\bbd\bde\bec\bco\bod\bde\be_\b_c\bca\bat\bte\beg\bgo\bor\bry\by ();\n+*\b**\b**\b**\b**\b**\b* s\bso\boc\bck\bks\bs_\b_c\bca\bat\bte\beg\bgo\bor\bry\by(\b()\b) *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\bo_\bc_\bk_\bs_\b5_\b__\bs_\bt_\br_\be_\ba_\bm_\b._\bh_\bp_\bp\"\n+boost::system::error_category& s\bso\boc\bck\bks\bs_\b_c\bca\bat\bte\beg\bgo\bor\bry\by ();\n+returns the error_category for SOCKS5 errors\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* u\bup\bpn\bnp\bp_\b_c\bca\bat\bte\beg\bgo\bor\bry\by(\b()\b) *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bu_\bp_\bn_\bp_\b._\bh_\bp_\bp\"\n boost::system::error_category& u\bup\bpn\bnp\bp_\b_c\bca\bat\bte\beg\bgo\bor\bry\by ();\n the boost.system error category for UPnP errors\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* i\bi2\b2p\bp_\b_c\bca\bat\bte\beg\bgo\bor\bry\by(\b()\b) *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bi_\b2_\bp_\b__\bs_\bt_\br_\be_\ba_\bm_\b._\bh_\bp_\bp\"\n boost::system::error_category& i\bi2\b2p\bp_\b_c\bca\bat\bte\beg\bgo\bor\bry\by ();\n returns the error category for I2P errors\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* s\bso\boc\bck\bks\bs_\b_c\bca\bat\bte\beg\bgo\bor\bry\by(\b()\b) *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\bo_\bc_\bk_\bs_\b5_\b__\bs_\bt_\br_\be_\ba_\bm_\b._\bh_\bp_\bp\"\n-boost::system::error_category& s\bso\boc\bck\bks\bs_\b_c\bca\bat\bte\beg\bgo\bor\bry\by ();\n-returns the error_category for SOCKS5 errors\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt_\b_c\bca\bat\bte\beg\bgo\bor\bry\by(\b()\b) *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\be_\br_\br_\bo_\br_\b__\bc_\bo_\bd_\be_\b._\bh_\bp_\bp\"\n boost::system::error_category& l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt_\b_c\bca\bat\bte\beg\bgo\bor\bry\by ();\n return the instance of the libtorrent_error_category which maps libtorrent\n error codes to human readable error messages.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* h\bht\btt\btp\bp_\b_c\bca\bat\bte\beg\bgo\bor\bry\by(\b()\b) *\b**\b**\b**\b**\b**\b*\n@@ -109,14 +109,29 @@\n |_\bp_\bc_\bp_\b__\bu_\bn_\bs_\bu_\bp_\bp_\b__\bp_\br_\bo_\bt_\bo_\bc_\bo_\bl_\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b9_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |_\bp_\bc_\bp_\b__\bu_\bs_\be_\br_\b__\be_\bx_\b__\bq_\bu_\bo_\bt_\ba_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b0_\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |_\bp_\bc_\bp_\b__\bc_\ba_\bn_\bn_\bo_\bt_\b__\bp_\br_\bo_\bv_\bi_\bd_\be_\b__\be_\bx_\bt_\be_\br_\bn_\ba_\bl_\b|_\b1_\b1_\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |_\bp_\bc_\bp_\b__\ba_\bd_\bd_\br_\be_\bs_\bs_\b__\bm_\bi_\bs_\bm_\ba_\bt_\bc_\bh_\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b2_\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |_\bp_\bc_\bp_\b__\be_\bx_\bc_\be_\bs_\bs_\bi_\bv_\be_\b__\br_\be_\bm_\bo_\bt_\be_\b__\bp_\be_\be_\br_\bs_\b _\b|_\b1_\b3_\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* e\ben\bnu\bum\bm e\ber\brr\bro\bor\br_\b_c\bco\bod\bde\be_\b_e\ben\bnu\bum\bm *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bb_\bd_\be_\bc_\bo_\bd_\be_\b._\bh_\bp_\bp\"\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n+|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bn_\bo_\b__\be_\br_\br_\bo_\br_\b _\b _\b _\b _\b _\b _\b|_\b0_\b _\b _\b _\b _\b|_\bN_\bo_\bt_\b _\ba_\bn_\b _\be_\br_\br_\bo_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\be_\bx_\bp_\be_\bc_\bt_\be_\bd_\b__\bd_\bi_\bg_\bi_\bt_\b|_\b1_\b _\b _\b _\b _\b|_\be_\bx_\bp_\be_\bc_\bt_\be_\bd_\b _\bd_\bi_\bg_\bi_\bt_\b _\bi_\bn_\b _\bb_\be_\bn_\bc_\bo_\bd_\be_\bd_\b _\bs_\bt_\br_\bi_\bn_\bg_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\be_\bx_\bp_\be_\bc_\bt_\be_\bd_\b__\bc_\bo_\bl_\bo_\bn_\b|_\b2_\b _\b _\b _\b _\b|_\be_\bx_\bp_\be_\bc_\bt_\be_\bd_\b _\bc_\bo_\bl_\bo_\bn_\b _\bi_\bn_\b _\bb_\be_\bn_\bc_\bo_\bd_\be_\bd_\b _\bs_\bt_\br_\bi_\bn_\bg_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bu_\bn_\be_\bx_\bp_\be_\bc_\bt_\be_\bd_\b__\be_\bo_\bf_\b|_\b3_\b _\b _\b _\b _\b|_\bu_\bn_\be_\bx_\bp_\be_\bc_\bt_\be_\bd_\b _\be_\bn_\bd_\b _\bo_\bf_\b _\bf_\bi_\bl_\be_\b _\bi_\bn_\b _\bb_\be_\bn_\bc_\bo_\bd_\be_\bd_\b _\bs_\bt_\br_\bi_\bn_\bg_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|expected_value|4 |expected value (list, dict, _\bi_\bn_\bt or string) in bencoded|\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bs_\bt_\br_\bi_\bn_\bg_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bd_\be_\bp_\bt_\bh_\b__\be_\bx_\bc_\be_\be_\bd_\be_\bd_\b|_\b5_\b _\b _\b _\b _\b|_\bb_\be_\bn_\bc_\bo_\bd_\be_\bd_\b _\br_\be_\bc_\bu_\br_\bs_\bi_\bo_\bn_\b _\bd_\be_\bp_\bt_\bh_\b _\bl_\bi_\bm_\bi_\bt_\b _\be_\bx_\bc_\be_\be_\bd_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bl_\bi_\bm_\bi_\bt_\b__\be_\bx_\bc_\be_\be_\bd_\be_\bd_\b|_\b6_\b _\b _\b _\b _\b|_\bb_\be_\bn_\bc_\bo_\bd_\be_\bd_\b _\bi_\bt_\be_\bm_\b _\bc_\bo_\bu_\bn_\bt_\b _\bl_\bi_\bm_\bi_\bt_\b _\be_\bx_\bc_\be_\be_\bd_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bo_\bv_\be_\br_\bf_\bl_\bo_\bw_\b _\b _\b _\b _\b _\b _\b|_\b7_\b _\b _\b _\b _\b|_\bi_\bn_\bt_\be_\bg_\be_\br_\b _\bo_\bv_\be_\br_\bf_\bl_\bo_\bw_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\be_\br_\br_\bo_\br_\b__\bc_\bo_\bd_\be_\b__\bm_\ba_\bx_\b|_\b8_\b _\b _\b _\b _\b|_\bt_\bh_\be_\b _\bn_\bu_\bm_\bb_\be_\br_\b _\bo_\bf_\b _\be_\br_\br_\bo_\br_\b _\bc_\bo_\bd_\be_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* e\ben\bnu\bum\bm e\ber\brr\bro\bor\br_\b_c\bco\bod\bde\be_\b_e\ben\bnu\bum\bm *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bg_\bz_\bi_\bp_\b._\bh_\bp_\bp\"\n _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n |_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |_\bn_\bo_\b__\be_\br_\br_\bo_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b0_\b _\b _\b _\b _\b|_\bN_\bo_\bt_\b _\ba_\bn_\b _\be_\br_\br_\bo_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |invalid_gzip_header |1 |the supplied gzip buffer has |\n |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bi_\bn_\bv_\ba_\bl_\bi_\bd_\b _\bh_\be_\ba_\bd_\be_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n | | |the gzip buffer would inflate to |\n@@ -145,28 +160,29 @@\n |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bc_\bo_\bd_\be_\b _\bi_\bn_\b _\bf_\bi_\bx_\be_\bd_\b _\bo_\br_\b _\bd_\by_\bn_\ba_\bm_\bi_\bc_\b _\bb_\bl_\bo_\bc_\bk_\b _\b _\b _\b _\b |\n |distance_too_far_back_in_block |14 |distance is too far back in fixed |\n |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bo_\br_\b _\bd_\by_\bn_\ba_\bm_\bi_\bc_\b _\bb_\bl_\bo_\bc_\bk_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |unknown_gzip_error |15 |an unknown error occurred during |\n |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bg_\bz_\bi_\bp_\b _\bi_\bn_\bf_\bl_\ba_\bt_\bi_\bo_\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |_\be_\br_\br_\bo_\br_\b__\bc_\bo_\bd_\be_\b__\bm_\ba_\bx_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b6_\b _\b _\b _\b|_\bt_\bh_\be_\b _\bn_\bu_\bm_\bb_\be_\br_\b _\bo_\bf_\b _\be_\br_\br_\bo_\br_\b _\bc_\bo_\bd_\be_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* e\ben\bnu\bum\bm e\ber\brr\bro\bor\br_\b_c\bco\bod\bde\be_\b_e\ben\bnu\bum\bm *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bb_\bd_\be_\bc_\bo_\bd_\be_\b._\bh_\bp_\bp\"\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n-|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bn_\bo_\b__\be_\br_\br_\bo_\br_\b _\b _\b _\b _\b _\b _\b|_\b0_\b _\b _\b _\b _\b|_\bN_\bo_\bt_\b _\ba_\bn_\b _\be_\br_\br_\bo_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\be_\bx_\bp_\be_\bc_\bt_\be_\bd_\b__\bd_\bi_\bg_\bi_\bt_\b|_\b1_\b _\b _\b _\b _\b|_\be_\bx_\bp_\be_\bc_\bt_\be_\bd_\b _\bd_\bi_\bg_\bi_\bt_\b _\bi_\bn_\b _\bb_\be_\bn_\bc_\bo_\bd_\be_\bd_\b _\bs_\bt_\br_\bi_\bn_\bg_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\be_\bx_\bp_\be_\bc_\bt_\be_\bd_\b__\bc_\bo_\bl_\bo_\bn_\b|_\b2_\b _\b _\b _\b _\b|_\be_\bx_\bp_\be_\bc_\bt_\be_\bd_\b _\bc_\bo_\bl_\bo_\bn_\b _\bi_\bn_\b _\bb_\be_\bn_\bc_\bo_\bd_\be_\bd_\b _\bs_\bt_\br_\bi_\bn_\bg_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bu_\bn_\be_\bx_\bp_\be_\bc_\bt_\be_\bd_\b__\be_\bo_\bf_\b|_\b3_\b _\b _\b _\b _\b|_\bu_\bn_\be_\bx_\bp_\be_\bc_\bt_\be_\bd_\b _\be_\bn_\bd_\b _\bo_\bf_\b _\bf_\bi_\bl_\be_\b _\bi_\bn_\b _\bb_\be_\bn_\bc_\bo_\bd_\be_\bd_\b _\bs_\bt_\br_\bi_\bn_\bg_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|expected_value|4 |expected value (list, dict, _\bi_\bn_\bt or string) in bencoded|\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bs_\bt_\br_\bi_\bn_\bg_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bd_\be_\bp_\bt_\bh_\b__\be_\bx_\bc_\be_\be_\bd_\be_\bd_\b|_\b5_\b _\b _\b _\b _\b|_\bb_\be_\bn_\bc_\bo_\bd_\be_\bd_\b _\br_\be_\bc_\bu_\br_\bs_\bi_\bo_\bn_\b _\bd_\be_\bp_\bt_\bh_\b _\bl_\bi_\bm_\bi_\bt_\b _\be_\bx_\bc_\be_\be_\bd_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bl_\bi_\bm_\bi_\bt_\b__\be_\bx_\bc_\be_\be_\bd_\be_\bd_\b|_\b6_\b _\b _\b _\b _\b|_\bb_\be_\bn_\bc_\bo_\bd_\be_\bd_\b _\bi_\bt_\be_\bm_\b _\bc_\bo_\bu_\bn_\bt_\b _\bl_\bi_\bm_\bi_\bt_\b _\be_\bx_\bc_\be_\be_\bd_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bo_\bv_\be_\br_\bf_\bl_\bo_\bw_\b _\b _\b _\b _\b _\b _\b|_\b7_\b _\b _\b _\b _\b|_\bi_\bn_\bt_\be_\bg_\be_\br_\b _\bo_\bv_\be_\br_\bf_\bl_\bo_\bw_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\be_\br_\br_\bo_\br_\b__\bc_\bo_\bd_\be_\b__\bm_\ba_\bx_\b|_\b8_\b _\b _\b _\b _\b|_\bt_\bh_\be_\b _\bn_\bu_\bm_\bb_\be_\br_\b _\bo_\bf_\b _\be_\br_\br_\bo_\br_\b _\bc_\bo_\bd_\be_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+*\b**\b**\b**\b**\b**\b* e\ben\bnu\bum\bm s\bso\boc\bck\bks\bs_\b_e\ber\brr\bro\bor\br_\b_c\bco\bod\bde\be *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\bo_\bc_\bk_\bs_\b5_\b__\bs_\bt_\br_\be_\ba_\bm_\b._\bh_\bp_\bp\"\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n+|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn|\n+|_\bn_\bo_\b__\be_\br_\br_\bo_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b0_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bu_\bn_\bs_\bu_\bp_\bp_\bo_\br_\bt_\be_\bd_\b__\bv_\be_\br_\bs_\bi_\bo_\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bu_\bn_\bs_\bu_\bp_\bp_\bo_\br_\bt_\be_\bd_\b__\ba_\bu_\bt_\bh_\be_\bn_\bt_\bi_\bc_\ba_\bt_\bi_\bo_\bn_\b__\bm_\be_\bt_\bh_\bo_\bd_\b _\b|_\b2_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bu_\bn_\bs_\bu_\bp_\bp_\bo_\br_\bt_\be_\bd_\b__\ba_\bu_\bt_\bh_\be_\bn_\bt_\bi_\bc_\ba_\bt_\bi_\bo_\bn_\b__\bv_\be_\br_\bs_\bi_\bo_\bn_\b|_\b3_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\ba_\bu_\bt_\bh_\be_\bn_\bt_\bi_\bc_\ba_\bt_\bi_\bo_\bn_\b__\be_\br_\br_\bo_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b4_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bu_\bs_\be_\br_\bn_\ba_\bm_\be_\b__\br_\be_\bq_\bu_\bi_\br_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b5_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bg_\be_\bn_\be_\br_\ba_\bl_\b__\bf_\ba_\bi_\bl_\bu_\br_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b6_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bc_\bo_\bm_\bm_\ba_\bn_\bd_\b__\bn_\bo_\bt_\b__\bs_\bu_\bp_\bp_\bo_\br_\bt_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b7_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bn_\bo_\b__\bi_\bd_\be_\bn_\bt_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b8_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bi_\bd_\be_\bn_\bt_\bd_\b__\be_\br_\br_\bo_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b9_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bn_\bu_\bm_\b__\be_\br_\br_\bo_\br_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b0_\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* e\ben\bnu\bum\bm e\ber\brr\bro\bor\br_\b_c\bco\bod\bde\be_\b_e\ben\bnu\bum\bm *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bu_\bp_\bn_\bp_\b._\bh_\bp_\bp\"\n _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n |_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |_\bn_\bo_\b__\be_\br_\br_\bo_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b0_\b _\b _\b _\b _\b|_\bN_\bo_\b _\be_\br_\br_\bo_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |invalid_argument |402 |One of the arguments in the request |\n@@ -204,30 +220,14 @@\n |_\bi_\bn_\bv_\ba_\bl_\bi_\bd_\b__\bk_\be_\by_\b _\b _\b _\b _\b|_\b4_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |_\bi_\bn_\bv_\ba_\bl_\bi_\bd_\b__\bi_\bd_\b _\b _\b _\b _\b _\b|_\b5_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |_\bt_\bi_\bm_\be_\bo_\bu_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b6_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |_\bk_\be_\by_\b__\bn_\bo_\bt_\b__\bf_\bo_\bu_\bn_\bd_\b _\b _\b|_\b7_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |_\bd_\bu_\bp_\bl_\bi_\bc_\ba_\bt_\be_\bd_\b__\bi_\bd_\b _\b _\b|_\b8_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |_\bn_\bu_\bm_\b__\be_\br_\br_\bo_\br_\bs_\b _\b _\b _\b _\b _\b|_\b9_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* e\ben\bnu\bum\bm s\bso\boc\bck\bks\bs_\b_e\ber\brr\bro\bor\br_\b_c\bco\bod\bde\be *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\bo_\bc_\bk_\bs_\b5_\b__\bs_\bt_\br_\be_\ba_\bm_\b._\bh_\bp_\bp\"\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n-|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn|\n-|_\bn_\bo_\b__\be_\br_\br_\bo_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b0_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bu_\bn_\bs_\bu_\bp_\bp_\bo_\br_\bt_\be_\bd_\b__\bv_\be_\br_\bs_\bi_\bo_\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bu_\bn_\bs_\bu_\bp_\bp_\bo_\br_\bt_\be_\bd_\b__\ba_\bu_\bt_\bh_\be_\bn_\bt_\bi_\bc_\ba_\bt_\bi_\bo_\bn_\b__\bm_\be_\bt_\bh_\bo_\bd_\b _\b|_\b2_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bu_\bn_\bs_\bu_\bp_\bp_\bo_\br_\bt_\be_\bd_\b__\ba_\bu_\bt_\bh_\be_\bn_\bt_\bi_\bc_\ba_\bt_\bi_\bo_\bn_\b__\bv_\be_\br_\bs_\bi_\bo_\bn_\b|_\b3_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\ba_\bu_\bt_\bh_\be_\bn_\bt_\bi_\bc_\ba_\bt_\bi_\bo_\bn_\b__\be_\br_\br_\bo_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b4_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bu_\bs_\be_\br_\bn_\ba_\bm_\be_\b__\br_\be_\bq_\bu_\bi_\br_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b5_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bg_\be_\bn_\be_\br_\ba_\bl_\b__\bf_\ba_\bi_\bl_\bu_\br_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b6_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bc_\bo_\bm_\bm_\ba_\bn_\bd_\b__\bn_\bo_\bt_\b__\bs_\bu_\bp_\bp_\bo_\br_\bt_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b7_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bn_\bo_\b__\bi_\bd_\be_\bn_\bt_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b8_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bi_\bd_\be_\bn_\bt_\bd_\b__\be_\br_\br_\bo_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b9_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bn_\bu_\bm_\b__\be_\br_\br_\bo_\br_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b0_\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* e\ben\bnu\bum\bm e\ber\brr\bro\bor\br_\b_c\bco\bod\bde\be_\b_e\ben\bnu\bum\bm *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\be_\br_\br_\bo_\br_\b__\bc_\bo_\bd_\be_\b._\bh_\bp_\bp\"\n _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n |_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |_\bn_\bo_\b__\be_\br_\br_\bo_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b0_\b _\b _\b _\b _\b|_\bN_\bo_\bt_\b _\ba_\bn_\b _\be_\br_\br_\bo_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |file_collision |1 |Two torrents has files which end |\n |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bu_\bp_\b _\bo_\bv_\be_\br_\bw_\br_\bi_\bt_\bi_\bn_\bg_\b _\be_\ba_\bc_\bh_\b _\bo_\bt_\bh_\be_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b |\n"}]}, {"source1": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Filter.html", "source2": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Filter.html", "comments": ["Ordering differences only"], "unified_diff": "@@ -56,20 +56,20 @@\n a single rule that allows all addresses (0.0.0.0 - 255.255.255.255 for\n the IPv4 range, and the equivalent range covering all addresses for the\n IPv6 range).

    \n

    A default constructed ip_filter does not filter any address.

    \n
    \n struct ip_filter\n {\n+   ip_filter ();\n    ip_filter& operator= (ip_filter const&);\n-   ip_filter& operator= (ip_filter&&);\n-   ~ip_filter ();\n    ip_filter (ip_filter&&);\n-   ip_filter ();\n    ip_filter (ip_filter const&);\n+   ~ip_filter ();\n+   ip_filter& operator= (ip_filter&&);\n    bool empty () const;\n    void add_rule (address const& first, address const& last, std::uint32_t flags);\n    std::uint32_t access (address const& addr) const;\n    filter_tuple_t export_filter () const;\n \n    enum access_flags\n    {\n@@ -153,20 +153,20 @@\n 

    the port filter maps non-overlapping port ranges to flags. This\n is primarily used to indicate whether a range of ports should\n be connected to or not. The default is to have the full port\n range (0-65535) set to flag 0.

    \n
    \n class port_filter\n {\n-   port_filter ();\n-   port_filter (port_filter&&);\n+   port_filter& operator= (port_filter&&);\n    ~port_filter ();\n+   port_filter ();\n    port_filter (port_filter const&);\n    port_filter& operator= (port_filter const&);\n-   port_filter& operator= (port_filter&&);\n+   port_filter (port_filter&&);\n    void add_rule (std::uint16_t first, std::uint16_t last, std::uint32_t flags);\n    std::uint32_t access (std::uint16_t port) const;\n \n    enum access_flags\n    {\n       blocked,\n    };\n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -19,20 +19,20 @@\n The ip_filter class is a set of rules that uniquely categorizes all ip\n addresses as allowed or disallowed. The default constructor creates a single\n rule that allows all addresses (0.0.0.0 - 255.255.255.255 for the IPv4 range,\n and the equivalent range covering all addresses for the IPv6 range).\n A default constructed _\bi_\bp_\b__\bf_\bi_\bl_\bt_\be_\br does not filter any address.\n struct ip_filter\n {\n+   i\bip\bp_\b_f\bfi\bil\blt\bte\ber\br ();\n    ip_filter& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (ip_filter const&);\n-   ip_filter& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (ip_filter&&);\n-   ~\b~i\bip\bp_\b_f\bfi\bil\blt\bte\ber\br ();\n    i\bip\bp_\b_f\bfi\bil\blt\bte\ber\br (ip_filter&&);\n-   i\bip\bp_\b_f\bfi\bil\blt\bte\ber\br ();\n    i\bip\bp_\b_f\bfi\bil\blt\bte\ber\br (ip_filter const&);\n+   ~\b~i\bip\bp_\b_f\bfi\bil\blt\bte\ber\br ();\n+   ip_filter& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (ip_filter&&);\n    bool e\bem\bmp\bpt\bty\by () const;\n    void a\bad\bdd\bd_\b_r\bru\bul\ble\be (address const& first, address const& last, std::uint32_t\n flags);\n    std::uint32_t a\bac\bcc\bce\bes\bss\bs (address const& addr) const;\n    filter_tuple_t e\bex\bxp\bpo\bor\brt\bt_\b_f\bfi\bil\blt\bte\ber\br () const;\n \n    enum access_flags\n@@ -81,20 +81,20 @@\n *\b**\b**\b**\b**\b**\b* p\bpo\bor\brt\bt_\b_f\bfi\bil\blt\bte\ber\br *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bi_\bp_\b__\bf_\bi_\bl_\bt_\be_\br_\b._\bh_\bp_\bp\"\n the port filter maps non-overlapping port ranges to flags. This is primarily\n used to indicate whether a range of ports should be connected to or not. The\n default is to have the full port range (0-65535) set to flag 0.\n class port_filter\n {\n-   p\bpo\bor\brt\bt_\b_f\bfi\bil\blt\bte\ber\br ();\n-   p\bpo\bor\brt\bt_\b_f\bfi\bil\blt\bte\ber\br (port_filter&&);\n+   port_filter& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (port_filter&&);\n    ~\b~p\bpo\bor\brt\bt_\b_f\bfi\bil\blt\bte\ber\br ();\n+   p\bpo\bor\brt\bt_\b_f\bfi\bil\blt\bte\ber\br ();\n    p\bpo\bor\brt\bt_\b_f\bfi\bil\blt\bte\ber\br (port_filter const&);\n    port_filter& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (port_filter const&);\n-   port_filter& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (port_filter&&);\n+   p\bpo\bor\brt\bt_\b_f\bfi\bil\blt\bte\ber\br (port_filter&&);\n    void a\bad\bdd\bd_\b_r\bru\bul\ble\be (std::uint16_t first, std::uint16_t last, std::uint32_t\n flags);\n    std::uint32_t a\bac\bcc\bce\bes\bss\bs (std::uint16_t port) const;\n \n    enum access_flags\n    {\n       blocked,\n"}]}, {"source1": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-PeerClass.html", "source2": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-PeerClass.html", "unified_diff": "@@ -28,92 +28,35 @@\n 
    \n \n
    2.0.11
    \n

    home

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

    peer_class_info

    \n-

    Declared in "libtorrent/peer_class.hpp"

    \n-

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

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

    peer_class_type_filter

    \n

    Declared in "libtorrent/peer_class_type_filter.hpp"

    \n

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

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

    add() remove()

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

    remove() add()

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

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

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

    allow() disallow()

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

    disallow() allow()

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

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

    \n

    The peer_class argument cannot be greater than 31. The bitmasks representing\n@@ -197,15 +140,72 @@\n \n num_socket_types\n 5\n  \n \n \n \n+[report issue]

    \n
    \n+
    \n+

    peer_class_info

    \n+

    Declared in "libtorrent/peer_class.hpp"

    \n+

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

    \n+
    \n+struct peer_class_info\n+{\n+   bool ignore_unchoke_slots;\n+   int connection_limit_factor;\n+   std::string label;\n+   int upload_limit;\n+   int download_limit;\n+   int upload_priority;\n+   int download_priority;\n+};\n+
    \n+[report issue]
    \n+
    ignore_unchoke_slots
    \n+
    ignore_unchoke_slots determines whether peers should always\n+unchoke a peer, regardless of the choking algorithm, or if it should\n+honor the unchoke slot limits. It's used for local peers by default.\n+If any of the peer classes a peer belongs to has this set to true,\n+that peer will be unchoked at all times.
    \n+
    \n+[report issue]
    \n+
    connection_limit_factor
    \n+
    adjusts the connection limit (global and per torrent) that applies to\n+this peer class. By default, local peers are allowed to exceed the\n+normal connection limit for instance. This is specified as a percent\n+factor. 100 makes the peer class apply normally to the limit. 200\n+means as long as there are fewer connections than twice the limit, we\n+accept this peer. This factor applies both to the global connection\n+limit and the per-torrent limit. Note that if not used carefully one\n+peer class can potentially completely starve out all other over time.
    \n+
    \n+[report issue]
    \n+
    label
    \n+
    not used by libtorrent. It's intended as a potentially user-facing\n+identifier of this peer class.
    \n+
    \n+\n+[report issue]
    \n+
    upload_limit download_limit
    \n+
    transfer rates limits for the whole peer class. They are specified in\n+bytes per second and apply to the sum of all peers that are members of\n+this class.
    \n+
    \n+\n+[report issue]
    \n+
    upload_priority download_priority
    \n+
    relative priorities used by the bandwidth allocator in the rate\n+limiter. If no rate limits are in use, the priority is not used\n+either. Priorities start at 1 (0 is not a valid priority) and may not\n+exceed 255.
    \n+
    \n
    \n \n
    \n
    \n
    \n
    \n
    \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,74 +1,28 @@\n >\n _\b[_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b _\bl_\bo_\bg_\bo_\b]\n V\bVe\ber\brs\bsi\bio\bon\bn:\b: 2.0.11\n _\bh_\bo_\bm_\be\n Table of contents\n- * _\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b__\bi_\bn_\bf_\bo\n * _\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b__\bt_\by_\bp_\be_\b__\bf_\bi_\bl_\bt_\be_\br\n- o _\ba_\bd_\bd_\b(_\b)_\b _\br_\be_\bm_\bo_\bv_\be_\b(_\b)\n- o _\ba_\bl_\bl_\bo_\bw_\b(_\b)_\b _\bd_\bi_\bs_\ba_\bl_\bl_\bo_\bw_\b(_\b)\n+ o _\br_\be_\bm_\bo_\bv_\be_\b(_\b)_\b _\ba_\bd_\bd_\b(_\b)\n+ o _\bd_\bi_\bs_\ba_\bl_\bl_\bo_\bw_\b(_\b)_\b _\ba_\bl_\bl_\bo_\bw_\b(_\b)\n o _\ba_\bp_\bp_\bl_\by_\b(_\b)\n o _\be_\bn_\bu_\bm_\b _\bs_\bo_\bc_\bk_\be_\bt_\b__\bt_\by_\bp_\be_\b__\bt\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_i\bin\bnf\bfo\bo *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b._\bh_\bp_\bp\"\n-holds settings for a peer class. Used in _\bs_\be_\bt_\b__\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b(_\b) and _\bg_\be_\bt_\b__\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b(_\b)\n-calls.\n-struct peer_class_info\n-{\n- bool ignore_unchoke_slots;\n- int connection_limit_factor;\n- std::string label;\n- int upload_limit;\n- int download_limit;\n- int upload_priority;\n- int download_priority;\n-};\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- ignore_unchoke_slots\n- ignore_unchoke_slots determines whether peers should always unchoke a\n- peer, regardless of the choking algorithm, or if it should honor the\n- unchoke slot limits. It's used for local peers by default. If a\ban\bny\by of the\n- peer classes a peer belongs to has this set to true, that peer will be\n- unchoked at all times.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- connection_limit_factor\n- adjusts the connection limit (global and per torrent) that applies to\n- this peer class. By default, local peers are allowed to exceed the normal\n- connection limit for instance. This is specified as a percent factor. 100\n- makes the peer class apply normally to the limit. 200 means as long as\n- there are fewer connections than twice the limit, we accept this peer.\n- This factor applies both to the global connection limit and the per-\n- torrent limit. Note that if not used carefully one peer class can\n- potentially completely starve out all other over time.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- label\n- not used by libtorrent. It's intended as a potentially user-facing\n- identifier of this peer class.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- upload_limit download_limit\n- transfer rates limits for the whole peer class. They are specified in\n- bytes per second and apply to the sum of all peers that are members of\n- this class.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- upload_priority download_priority\n- relative priorities used by the bandwidth allocator in the rate limiter.\n- If no rate limits are in use, the priority is not used either. Priorities\n- start at 1 (0 is not a valid priority) and may not exceed 255.\n+ * _\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b__\bi_\bn_\bf_\bo\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_t\bty\byp\bpe\be_\b_f\bfi\bil\blt\bte\ber\br *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b__\bt_\by_\bp_\be_\b__\bf_\bi_\bl_\bt_\be_\br_\b._\bh_\bp_\bp\"\n peer_class_type_filter is a simple container for rules for adding and\n subtracting peer-classes from peers. It is applied a\baf\bft\bte\ber\br the peer class filter\n is applied (which is based on the peer's IP address).\n struct peer_class_type_filter\n {\n- void a\bad\bdd\bd (socket_type_t const st, peer_class_t const peer_class);\n void r\bre\bem\bmo\bov\bve\be (socket_type_t const st, peer_class_t const peer_class);\n+ void a\bad\bdd\bd (socket_type_t const st, peer_class_t const peer_class);\n void d\bdi\bis\bsa\bal\bll\blo\bow\bw (socket_type_t const st, peer_class_t const peer_class);\n void a\bal\bll\blo\bow\bw (socket_type_t const st, peer_class_t const peer_class);\n std::uint32_t a\bap\bpp\bpl\bly\by (socket_type_t const st, std::uint32_t peer_class_mask);\n friend bool o\bop\bpe\ber\bra\bat\bto\bor\br=\b==\b= (peer_class_type_filter const& lhs\n , peer_class_type_filter const& rhs);\n \n enum socket_type_t\n@@ -78,21 +32,21 @@\n ssl_tcp_socket,\n ssl_utp_socket,\n i2p_socket,\n num_socket_types,\n };\n };\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* a\bad\bdd\bd(\b()\b) r\bre\bem\bmo\bov\bve\be(\b()\b) *\b**\b**\b**\b**\b*\n-void a\bad\bdd\bd (socket_type_t const st, peer_class_t const peer_class);\n+*\b**\b**\b**\b**\b* r\bre\bem\bmo\bov\bve\be(\b()\b) a\bad\bdd\bd(\b()\b) *\b**\b**\b**\b**\b*\n void r\bre\bem\bmo\bov\bve\be (socket_type_t const st, peer_class_t const peer_class);\n+void a\bad\bdd\bd (socket_type_t const st, peer_class_t const peer_class);\n add() and remove() adds and removes a peer class to be added to new peers based\n on socket type.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* a\bal\bll\blo\bow\bw(\b()\b) d\bdi\bis\bsa\bal\bll\blo\bow\bw(\b()\b) *\b**\b**\b**\b**\b*\n+*\b**\b**\b**\b**\b* d\bdi\bis\bsa\bal\bll\blo\bow\bw(\b()\b) a\bal\bll\blo\bow\bw(\b()\b) *\b**\b**\b**\b**\b*\n void d\bdi\bis\bsa\bal\bll\blo\bow\bw (socket_type_t const st, peer_class_t const peer_class);\n void a\bal\bll\blo\bow\bw (socket_type_t const st, peer_class_t const peer_class);\n disallow() and allow() adds and removes a peer class to be removed from new\n peers based on socket type.\n The peer_class argument cannot be greater than 31. The bitmasks representing\n peer classes in the peer_class_type_filter are 32 bits.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n@@ -108,14 +62,60 @@\n |tcp_socket |0 |these match the socket types from socket_type.hpp|\n |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bs_\bh_\bi_\bf_\bt_\be_\bd_\b _\bo_\bn_\be_\b _\bd_\bo_\bw_\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |_\bu_\bt_\bp_\b__\bs_\bo_\bc_\bk_\be_\bt_\b _\b _\b _\b _\b _\b _\b|_\b1_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |_\bs_\bs_\bl_\b__\bt_\bc_\bp_\b__\bs_\bo_\bc_\bk_\be_\bt_\b _\b _\b|_\b2_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |_\bs_\bs_\bl_\b__\bu_\bt_\bp_\b__\bs_\bo_\bc_\bk_\be_\bt_\b _\b _\b|_\b3_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |_\bi_\b2_\bp_\b__\bs_\bo_\bc_\bk_\be_\bt_\b _\b _\b _\b _\b _\b _\b|_\b4_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |_\bn_\bu_\bm_\b__\bs_\bo_\bc_\bk_\be_\bt_\b__\bt_\by_\bp_\be_\bs_\b|_\b5_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_i\bin\bnf\bfo\bo *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b._\bh_\bp_\bp\"\n+holds settings for a peer class. Used in _\bs_\be_\bt_\b__\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b(_\b) and _\bg_\be_\bt_\b__\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b(_\b)\n+calls.\n+struct peer_class_info\n+{\n+ bool ignore_unchoke_slots;\n+ int connection_limit_factor;\n+ std::string label;\n+ int upload_limit;\n+ int download_limit;\n+ int upload_priority;\n+ int download_priority;\n+};\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ ignore_unchoke_slots\n+ ignore_unchoke_slots determines whether peers should always unchoke a\n+ peer, regardless of the choking algorithm, or if it should honor the\n+ unchoke slot limits. It's used for local peers by default. If a\ban\bny\by of the\n+ peer classes a peer belongs to has this set to true, that peer will be\n+ unchoked at all times.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ connection_limit_factor\n+ adjusts the connection limit (global and per torrent) that applies to\n+ this peer class. By default, local peers are allowed to exceed the normal\n+ connection limit for instance. This is specified as a percent factor. 100\n+ makes the peer class apply normally to the limit. 200 means as long as\n+ there are fewer connections than twice the limit, we accept this peer.\n+ This factor applies both to the global connection limit and the per-\n+ torrent limit. Note that if not used carefully one peer class can\n+ potentially completely starve out all other over time.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ label\n+ not used by libtorrent. It's intended as a potentially user-facing\n+ identifier of this peer class.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ upload_limit download_limit\n+ transfer rates limits for the whole peer class. They are specified in\n+ bytes per second and apply to the sum of all peers that are members of\n+ this class.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ upload_priority download_priority\n+ relative priorities used by the bandwidth allocator in the rate limiter.\n+ If no rate limits are in use, the priority is not used either. Priorities\n+ start at 1 (0 is not a valid priority) and may not exceed 255.\n _\bh_\bo_\bm_\be\n _\bb_\bl_\bo_\bg\n _\bu_\bT_\bP\n _\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd\n _\bd_\bo_\bc_\bu_\bm_\be_\bn_\bt_\ba_\bt_\bi_\bo_\bn\n _\bD_\bH_\bT_\b _\bp_\bu_\bt_\b _\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn\n _\bp_\by_\bt_\bh_\bo_\bn_\b _\bb_\bi_\bn_\bd_\bi_\bn_\bg_\bs\n"}]}, {"source1": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Plugins.html", "source2": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Plugins.html", "unified_diff": "@@ -46,49 +46,49 @@\n
  • on_tick()
  • \n
  • get_unchoke_priority()
  • \n
  • load_state()
  • \n \n \n
  • torrent_plugin\n
  • \n
  • peer_plugin\n
  • \n
  • crypto_plugin\n
  • \n
  • peer_connection_handle
  • \n
  • bt_peer_connection_handle
  • \n-
  • create_ut_pex_plugin()
  • \n-
  • create_ut_metadata_plugin()
  • \n+
  • create_ut_metadata_plugin()
  • \n+
  • create_ut_pex_plugin()
  • \n
  • create_smart_ban_plugin()
  • \n \n
    \n

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

    \n@@ -376,18 +376,18 @@\n are supposed to return an instance of your peer_plugin class. Which in\n turn will have its hook functions called on event specific to that peer.

    \n

    The peer_connection_handle will be valid as long as the shared_ptr\n is being held by the torrent object. So, it is generally a good idea to not\n keep a shared_ptr to your own peer_plugin. If you want to keep references\n to it, use weak_ptr.

    \n

    If this function throws an exception, the connection will be closed.

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

    on_piece_failed() on_piece_pass()

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

    on_piece_pass() on_piece_failed()

    \n
    \n virtual void on_piece_failed (piece_index_t);\n virtual void on_piece_pass (piece_index_t);\n 
    \n

    These hooks are called when a piece passes the hash check or fails the hash\n check, respectively. The index is the piece index that was downloaded.\n It is possible to access the list of peers that participated in sending the\n@@ -475,42 +475,42 @@\n {\n virtual string_view type () const;\n virtual void add_handshake (entry&);\n virtual void on_disconnect (error_code const&);\n virtual void on_connected ();\n virtual bool on_handshake (span<char const>);\n virtual bool on_extension_handshake (bdecode_node const&);\n+ virtual bool on_have_all ();\n virtual bool on_have_none ();\n- virtual bool on_allowed_fast (piece_index_t);\n- virtual bool on_not_interested ();\n- virtual bool on_have (piece_index_t);\n- virtual bool on_dont_have (piece_index_t);\n- virtual bool on_choke ();\n virtual bool on_request (peer_request const&);\n- virtual bool on_bitfield (bitfield const& /*bitfield*/);\n+ virtual bool on_have (piece_index_t);\n+ virtual bool on_allowed_fast (piece_index_t);\n virtual bool on_interested ();\n- virtual bool on_have_all ();\n+ virtual bool on_choke ();\n+ virtual bool on_not_interested ();\n virtual bool on_unchoke ();\n+ virtual bool on_bitfield (bitfield const& /*bitfield*/);\n+ virtual bool on_dont_have (piece_index_t);\n virtual bool on_piece (peer_request const& /*piece*/\n , span<char const> /*buf*/);\n- virtual bool on_reject (peer_request const&);\n virtual bool on_cancel (peer_request const&);\n virtual bool on_suggest (piece_index_t);\n+ virtual bool on_reject (peer_request const&);\n+ virtual void sent_allow_fast (piece_index_t);\n virtual void sent_have_none ();\n- virtual void sent_cancel (peer_request const&);\n- virtual void sent_have_all ();\n+ virtual void sent_suggest (piece_index_t);\n+ virtual void sent_request (peer_request const&);\n virtual void sent_choke ();\n virtual void sent_reject_request (peer_request const&);\n- virtual void sent_request (peer_request const&);\n- virtual void sent_allow_fast (piece_index_t);\n- virtual void sent_suggest (piece_index_t);\n+ virtual void sent_cancel (peer_request const&);\n+ virtual void sent_have_all ();\n virtual void sent_not_interested ();\n+ virtual void sent_unchoke ();\n virtual void sent_interested ();\n virtual void sent_have (piece_index_t);\n- virtual void sent_unchoke ();\n virtual void sent_piece (peer_request const&);\n virtual void sent_payload (int /* bytes */);\n virtual bool can_disconnect (error_code const& /*ec*/);\n virtual bool on_extended (int /*length*/, int /*msg*/,\n span<char const> /*body*/);\n virtual bool on_unknown_message (int /*length*/, int /*msg*/,\n span<char const> /*body*/);\n@@ -569,39 +569,39 @@\n virtual bool on_extension_handshake (bdecode_node const&);\n \n

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

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

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

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

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

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

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

    \n [report issue]
    \n@@ -613,26 +613,26 @@\n \n

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

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

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

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

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

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

    called after a choke message has been sent to the peer

    \n [report issue]
    \n
    \n

    sent_payload()

    \n
    \n@@ -669,18 +669,18 @@\n 
    \n

    on_unknown_message()

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

    this is not called for web seeds

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

    on_piece_failed() on_piece_pass()

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

    on_piece_pass() on_piece_failed()

    \n
    \n virtual void on_piece_failed (piece_index_t);\n virtual void on_piece_pass (piece_index_t);\n 
    \n

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

    \n [report issue]
    \n@@ -736,50 +736,50 @@\n connection object, to be used by plugins. This is a low level interface that\n may not be stable across libtorrent versions

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

    bt_peer_connection_handle

    \n

    Declared in "libtorrent/peer_connection_handle.hpp"

    \n@@ -794,28 +794,14 @@\n bool support_extensions () const;\n bool supports_encryption () const;\n void switch_recv_crypto (std::shared_ptr<crypto_plugin> crypto);\n void switch_send_crypto (std::shared_ptr<crypto_plugin> crypto);\n std::shared_ptr<bt_peer_connection> native_handle () const;\n };\n \n-[report issue]
    \n-
    \n-

    create_ut_pex_plugin()

    \n-

    Declared in "libtorrent/extensions/ut_pex.hpp"

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

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

    \n-

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

    \n [report issue]
    \n
    \n

    create_ut_metadata_plugin()

    \n

    Declared in "libtorrent/extensions/ut_metadata.hpp"

    \n
    \n std::shared_ptr<torrent_plugin> create_ut_metadata_plugin (torrent_handle const&, client_data_t);\n 
    \n@@ -823,14 +809,28 @@\n extension allows peers to request the .torrent file (or more\n specifically the info-dictionary of the .torrent file) from each\n other. This is the main building block in making magnet links work.\n This extension is enabled by default unless explicitly disabled in\n the session constructor.

    \n

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

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

    create_ut_pex_plugin()

    \n+

    Declared in "libtorrent/extensions/ut_pex.hpp"

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

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

    \n+

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

    \n [report issue]
    \n
    \n

    create_smart_ban_plugin()

    \n

    Declared in "libtorrent/extensions/smart_ban.hpp"

    \n
    \n std::shared_ptr<torrent_plugin> create_smart_ban_plugin (torrent_handle const&, client_data_t);\n 
    \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -15,46 +15,46 @@\n o _\bo_\bn_\b__\ba_\bl_\be_\br_\bt_\b(_\b)\n o _\bo_\bn_\b__\bu_\bn_\bk_\bn_\bo_\bw_\bn_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b)\n o _\bo_\bn_\b__\bt_\bi_\bc_\bk_\b(_\b)\n o _\bg_\be_\bt_\b__\bu_\bn_\bc_\bh_\bo_\bk_\be_\b__\bp_\br_\bi_\bo_\br_\bi_\bt_\by_\b(_\b)\n o _\bl_\bo_\ba_\bd_\b__\bs_\bt_\ba_\bt_\be_\b(_\b)\n * _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\bl_\bu_\bg_\bi_\bn\n o _\bn_\be_\bw_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b(_\b)\n- o _\bo_\bn_\b__\bp_\bi_\be_\bc_\be_\b__\bf_\ba_\bi_\bl_\be_\bd_\b(_\b)_\b _\bo_\bn_\b__\bp_\bi_\be_\bc_\be_\b__\bp_\ba_\bs_\bs_\b(_\b)\n+ o _\bo_\bn_\b__\bp_\bi_\be_\bc_\be_\b__\bp_\ba_\bs_\bs_\b(_\b)_\b _\bo_\bn_\b__\bp_\bi_\be_\bc_\be_\b__\bf_\ba_\bi_\bl_\be_\bd_\b(_\b)\n o _\bt_\bi_\bc_\bk_\b(_\b)\n o _\bo_\bn_\b__\br_\be_\bs_\bu_\bm_\be_\b(_\b)_\b _\bo_\bn_\b__\bp_\ba_\bu_\bs_\be_\b(_\b)\n o _\bo_\bn_\b__\bf_\bi_\bl_\be_\bs_\b__\bc_\bh_\be_\bc_\bk_\be_\bd_\b(_\b)\n o _\bo_\bn_\b__\bs_\bt_\ba_\bt_\be_\b(_\b)\n o _\bo_\bn_\b__\ba_\bd_\bd_\b__\bp_\be_\be_\br_\b(_\b)\n * _\bp_\be_\be_\br_\b__\bp_\bl_\bu_\bg_\bi_\bn\n o _\bt_\by_\bp_\be_\b(_\b)\n o _\ba_\bd_\bd_\b__\bh_\ba_\bn_\bd_\bs_\bh_\ba_\bk_\be_\b(_\b)\n o _\bo_\bn_\b__\bd_\bi_\bs_\bc_\bo_\bn_\bn_\be_\bc_\bt_\b(_\b)\n o _\bo_\bn_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\be_\bd_\b(_\b)\n o _\bo_\bn_\b__\bh_\ba_\bn_\bd_\bs_\bh_\ba_\bk_\be_\b(_\b)\n o _\bo_\bn_\b__\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\b__\bh_\ba_\bn_\bd_\bs_\bh_\ba_\bk_\be_\b(_\b)\n- o _\bo_\bn_\b__\bd_\bo_\bn_\bt_\b__\bh_\ba_\bv_\be_\b(_\b)_\b _\bo_\bn_\b__\bh_\ba_\bv_\be_\b__\bn_\bo_\bn_\be_\b(_\b)_\b _\bo_\bn_\b__\br_\be_\bq_\bu_\be_\bs_\bt_\b(_\b)_\b _\bo_\bn_\b__\bh_\ba_\bv_\be_\b__\ba_\bl_\bl_\b(_\b)\n- _\bo_\bn_\b__\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd_\b(_\b)_\b _\bo_\bn_\b__\bh_\ba_\bv_\be_\b(_\b)_\b _\bo_\bn_\b__\bc_\bh_\bo_\bk_\be_\b(_\b)_\b _\bo_\bn_\b__\bn_\bo_\bt_\b__\bi_\bn_\bt_\be_\br_\be_\bs_\bt_\be_\bd_\b(_\b)\n- _\bo_\bn_\b__\bi_\bn_\bt_\be_\br_\be_\bs_\bt_\be_\bd_\b(_\b)_\b _\bo_\bn_\b__\bu_\bn_\bc_\bh_\bo_\bk_\be_\b(_\b)_\b _\bo_\bn_\b__\ba_\bl_\bl_\bo_\bw_\be_\bd_\b__\bf_\ba_\bs_\bt_\b(_\b)\n+ o _\bo_\bn_\b__\bn_\bo_\bt_\b__\bi_\bn_\bt_\be_\br_\be_\bs_\bt_\be_\bd_\b(_\b)_\b _\bo_\bn_\b__\bh_\ba_\bv_\be_\b__\ba_\bl_\bl_\b(_\b)_\b _\bo_\bn_\b__\ba_\bl_\bl_\bo_\bw_\be_\bd_\b__\bf_\ba_\bs_\bt_\b(_\b)_\b _\bo_\bn_\b__\bc_\bh_\bo_\bk_\be_\b(_\b)\n+ _\bo_\bn_\b__\bu_\bn_\bc_\bh_\bo_\bk_\be_\b(_\b)_\b _\bo_\bn_\b__\br_\be_\bq_\bu_\be_\bs_\bt_\b(_\b)_\b _\bo_\bn_\b__\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd_\b(_\b)_\b _\bo_\bn_\b__\bi_\bn_\bt_\be_\br_\be_\bs_\bt_\be_\bd_\b(_\b)_\b _\bo_\bn_\b__\bh_\ba_\bv_\be_\b(_\b)\n+ _\bo_\bn_\b__\bh_\ba_\bv_\be_\b__\bn_\bo_\bn_\be_\b(_\b)_\b _\bo_\bn_\b__\bd_\bo_\bn_\bt_\b__\bh_\ba_\bv_\be_\b(_\b)\n o _\bo_\bn_\b__\bp_\bi_\be_\bc_\be_\b(_\b)\n- o _\bs_\be_\bn_\bt_\b__\bi_\bn_\bt_\be_\br_\be_\bs_\bt_\be_\bd_\b(_\b)_\b _\bs_\be_\bn_\bt_\b__\bp_\bi_\be_\bc_\be_\b(_\b)_\b _\bs_\be_\bn_\bt_\b__\bu_\bn_\bc_\bh_\bo_\bk_\be_\b(_\b)_\b _\bs_\be_\bn_\bt_\b__\bh_\ba_\bv_\be_\b(_\b)\n- _\bs_\be_\bn_\bt_\b__\bn_\bo_\bt_\b__\bi_\bn_\bt_\be_\br_\be_\bs_\bt_\be_\bd_\b(_\b)\n+ o _\bs_\be_\bn_\bt_\b__\bu_\bn_\bc_\bh_\bo_\bk_\be_\b(_\b)_\b _\bs_\be_\bn_\bt_\b__\bn_\bo_\bt_\b__\bi_\bn_\bt_\be_\br_\be_\bs_\bt_\be_\bd_\b(_\b)_\b _\bs_\be_\bn_\bt_\b__\bh_\ba_\bv_\be_\b(_\b)_\b _\bs_\be_\bn_\bt_\b__\bp_\bi_\be_\bc_\be_\b(_\b)\n+ _\bs_\be_\bn_\bt_\b__\bi_\bn_\bt_\be_\br_\be_\bs_\bt_\be_\bd_\b(_\b)\n o _\bs_\be_\bn_\bt_\b__\bp_\ba_\by_\bl_\bo_\ba_\bd_\b(_\b)\n o _\bc_\ba_\bn_\b__\bd_\bi_\bs_\bc_\bo_\bn_\bn_\be_\bc_\bt_\b(_\b)\n o _\bo_\bn_\b__\be_\bx_\bt_\be_\bn_\bd_\be_\bd_\b(_\b)\n o _\bo_\bn_\b__\bu_\bn_\bk_\bn_\bo_\bw_\bn_\b__\bm_\be_\bs_\bs_\ba_\bg_\be_\b(_\b)\n- o _\bo_\bn_\b__\bp_\bi_\be_\bc_\be_\b__\bf_\ba_\bi_\bl_\be_\bd_\b(_\b)_\b _\bo_\bn_\b__\bp_\bi_\be_\bc_\be_\b__\bp_\ba_\bs_\bs_\b(_\b)\n+ o _\bo_\bn_\b__\bp_\bi_\be_\bc_\be_\b__\bp_\ba_\bs_\bs_\b(_\b)_\b _\bo_\bn_\b__\bp_\bi_\be_\bc_\be_\b__\bf_\ba_\bi_\bl_\be_\bd_\b(_\b)\n o _\bt_\bi_\bc_\bk_\b(_\b)\n o _\bw_\br_\bi_\bt_\be_\b__\br_\be_\bq_\bu_\be_\bs_\bt_\b(_\b)\n * _\bc_\br_\by_\bp_\bt_\bo_\b__\bp_\bl_\bu_\bg_\bi_\bn\n o _\bd_\be_\bc_\br_\by_\bp_\bt_\b(_\b)\n * _\bp_\be_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b__\bh_\ba_\bn_\bd_\bl_\be\n * _\bb_\bt_\b__\bp_\be_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b__\bh_\ba_\bn_\bd_\bl_\be\n- * _\bc_\br_\be_\ba_\bt_\be_\b__\bu_\bt_\b__\bp_\be_\bx_\b__\bp_\bl_\bu_\bg_\bi_\bn_\b(_\b)\n * _\bc_\br_\be_\ba_\bt_\be_\b__\bu_\bt_\b__\bm_\be_\bt_\ba_\bd_\ba_\bt_\ba_\b__\bp_\bl_\bu_\bg_\bi_\bn_\b(_\b)\n+ * _\bc_\br_\be_\ba_\bt_\be_\b__\bu_\bt_\b__\bp_\be_\bx_\b__\bp_\bl_\bu_\bg_\bi_\bn_\b(_\b)\n * _\bc_\br_\be_\ba_\bt_\be_\b__\bs_\bm_\ba_\br_\bt_\b__\bb_\ba_\bn_\b__\bp_\bl_\bu_\bg_\bi_\bn_\b(_\b)\n libtorrent has a _\bp_\bl_\bu_\bg_\bi_\bn interface for implementing extensions to the protocol.\n These can be general extensions for transferring metadata or peer exchange\n extensions, or it could be used to provide a way to customize the protocol to\n fit a particular (closed) network.\n In short, the _\bp_\bl_\bu_\bg_\bi_\bn interface makes it possible to:\n * register extension messages (sent in the extension handshake), see\n@@ -285,15 +285,15 @@\n have its hook functions called on event specific to that peer.\n The peer_connection_handle will be valid as long as the shared_ptr is being\n held by the torrent object. So, it is generally a good idea to not keep a\n shared_ptr to your own _\bp_\be_\be_\br_\b__\bp_\bl_\bu_\bg_\bi_\bn. If you want to keep references to it, use\n weak_ptr.\n If this function throws an exception, the connection will be closed.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_f\bfa\bai\bil\ble\bed\bd(\b()\b) o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_p\bpa\bas\bss\bs(\b()\b) *\b**\b**\b**\b**\b*\n+*\b**\b**\b**\b**\b* o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_p\bpa\bas\bss\bs(\b()\b) o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_f\bfa\bai\bil\ble\bed\bd(\b()\b) *\b**\b**\b**\b**\b*\n virtual void o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_f\bfa\bai\bil\ble\bed\bd (piece_index_t);\n virtual void o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_p\bpa\bas\bss\bs (piece_index_t);\n These hooks are called when a piece passes the hash check or fails the hash\n check, respectively. The index is the piece index that was downloaded. It is\n possible to access the list of peers that participated in sending the piece\n through the torrent and the piece_picker.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n@@ -354,42 +354,42 @@\n {\n virtual string_view t\bty\byp\bpe\be () const;\n virtual void a\bad\bdd\bd_\b_h\bha\ban\bnd\bds\bsh\bha\bak\bke\be (entry&);\n virtual void o\bon\bn_\b_d\bdi\bis\bsc\bco\bon\bnn\bne\bec\bct\bt (error_code const&);\n virtual void o\bon\bn_\b_c\bco\bon\bnn\bne\bec\bct\bte\bed\bd ();\n virtual bool o\bon\bn_\b_h\bha\ban\bnd\bds\bsh\bha\bak\bke\be (span);\n virtual bool o\bon\bn_\b_e\bex\bxt\bte\ben\bns\bsi\bio\bon\bn_\b_h\bha\ban\bnd\bds\bsh\bha\bak\bke\be (bdecode_node const&);\n+ virtual bool o\bon\bn_\b_h\bha\bav\bve\be_\b_a\bal\bll\bl ();\n virtual bool o\bon\bn_\b_h\bha\bav\bve\be_\b_n\bno\bon\bne\be ();\n- virtual bool o\bon\bn_\b_a\bal\bll\blo\bow\bwe\bed\bd_\b_f\bfa\bas\bst\bt (piece_index_t);\n- virtual bool o\bon\bn_\b_n\bno\bot\bt_\b_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd ();\n- virtual bool o\bon\bn_\b_h\bha\bav\bve\be (piece_index_t);\n- virtual bool o\bon\bn_\b_d\bdo\bon\bnt\bt_\b_h\bha\bav\bve\be (piece_index_t);\n- virtual bool o\bon\bn_\b_c\bch\bho\bok\bke\be ();\n virtual bool o\bon\bn_\b_r\bre\beq\bqu\bue\bes\bst\bt (peer_request const&);\n- virtual bool o\bon\bn_\b_b\bbi\bit\btf\bfi\bie\bel\bld\bd (bitfield const& /\b/*\b*b\bbi\bit\btf\bfi\bie\bel\bld\bd*\b*/\b/);\n+ virtual bool o\bon\bn_\b_h\bha\bav\bve\be (piece_index_t);\n+ virtual bool o\bon\bn_\b_a\bal\bll\blo\bow\bwe\bed\bd_\b_f\bfa\bas\bst\bt (piece_index_t);\n virtual bool o\bon\bn_\b_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd ();\n- virtual bool o\bon\bn_\b_h\bha\bav\bve\be_\b_a\bal\bll\bl ();\n+ virtual bool o\bon\bn_\b_c\bch\bho\bok\bke\be ();\n+ virtual bool o\bon\bn_\b_n\bno\bot\bt_\b_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd ();\n virtual bool o\bon\bn_\b_u\bun\bnc\bch\bho\bok\bke\be ();\n+ virtual bool o\bon\bn_\b_b\bbi\bit\btf\bfi\bie\bel\bld\bd (bitfield const& /\b/*\b*b\bbi\bit\btf\bfi\bie\bel\bld\bd*\b*/\b/);\n+ virtual bool o\bon\bn_\b_d\bdo\bon\bnt\bt_\b_h\bha\bav\bve\be (piece_index_t);\n virtual bool o\bon\bn_\b_p\bpi\bie\bec\bce\be (peer_request const& /\b/*\b*p\bpi\bie\bec\bce\be*\b*/\b/\n , span /\b/*\b*b\bbu\buf\bf*\b*/\b/);\n- virtual bool o\bon\bn_\b_r\bre\bej\bje\bec\bct\bt (peer_request const&);\n virtual bool o\bon\bn_\b_c\bca\ban\bnc\bce\bel\bl (peer_request const&);\n virtual bool o\bon\bn_\b_s\bsu\bug\bgg\bge\bes\bst\bt (piece_index_t);\n+ virtual bool o\bon\bn_\b_r\bre\bej\bje\bec\bct\bt (peer_request const&);\n+ virtual void s\bse\ben\bnt\bt_\b_a\bal\bll\blo\bow\bw_\b_f\bfa\bas\bst\bt (piece_index_t);\n virtual void s\bse\ben\bnt\bt_\b_h\bha\bav\bve\be_\b_n\bno\bon\bne\be ();\n- virtual void s\bse\ben\bnt\bt_\b_c\bca\ban\bnc\bce\bel\bl (peer_request const&);\n- virtual void s\bse\ben\bnt\bt_\b_h\bha\bav\bve\be_\b_a\bal\bll\bl ();\n+ virtual void s\bse\ben\bnt\bt_\b_s\bsu\bug\bgg\bge\bes\bst\bt (piece_index_t);\n+ virtual void s\bse\ben\bnt\bt_\b_r\bre\beq\bqu\bue\bes\bst\bt (peer_request const&);\n virtual void s\bse\ben\bnt\bt_\b_c\bch\bho\bok\bke\be ();\n virtual void s\bse\ben\bnt\bt_\b_r\bre\bej\bje\bec\bct\bt_\b_r\bre\beq\bqu\bue\bes\bst\bt (peer_request const&);\n- virtual void s\bse\ben\bnt\bt_\b_r\bre\beq\bqu\bue\bes\bst\bt (peer_request const&);\n- virtual void s\bse\ben\bnt\bt_\b_a\bal\bll\blo\bow\bw_\b_f\bfa\bas\bst\bt (piece_index_t);\n- virtual void s\bse\ben\bnt\bt_\b_s\bsu\bug\bgg\bge\bes\bst\bt (piece_index_t);\n+ virtual void s\bse\ben\bnt\bt_\b_c\bca\ban\bnc\bce\bel\bl (peer_request const&);\n+ virtual void s\bse\ben\bnt\bt_\b_h\bha\bav\bve\be_\b_a\bal\bll\bl ();\n virtual void s\bse\ben\bnt\bt_\b_n\bno\bot\bt_\b_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd ();\n+ virtual void s\bse\ben\bnt\bt_\b_u\bun\bnc\bch\bho\bok\bke\be ();\n virtual void s\bse\ben\bnt\bt_\b_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd ();\n virtual void s\bse\ben\bnt\bt_\b_h\bha\bav\bve\be (piece_index_t);\n- virtual void s\bse\ben\bnt\bt_\b_u\bun\bnc\bch\bho\bok\bke\be ();\n virtual void s\bse\ben\bnt\bt_\b_p\bpi\bie\bec\bce\be (peer_request const&);\n virtual void s\bse\ben\bnt\bt_\b_p\bpa\bay\byl\blo\boa\bad\bd (int /\b/*\b* b\bby\byt\bte\bes\bs *\b*/\b/);\n virtual bool c\bca\ban\bn_\b_d\bdi\bis\bsc\bco\bon\bnn\bne\bec\bct\bt (error_code const& /\b/*\b*e\bec\bc*\b*/\b/);\n virtual bool o\bon\bn_\b_e\bex\bxt\bte\ben\bnd\bde\bed\bd (int /\b/*\b*l\ble\ben\bng\bgt\bth\bh*\b*/\b/, int /\b/*\b*m\bms\bsg\bg*\b*/\b/,\n span /\b/*\b*b\bbo\bod\bdy\by*\b*/\b/);\n virtual bool o\bon\bn_\b_u\bun\bnk\bkn\bno\bow\bwn\bn_\b_m\bme\bes\bss\bsa\bag\bge\be (int /\b/*\b*l\ble\ben\bng\bgt\bth\bh*\b*/\b/, int /\b/*\b*m\bms\bsg\bg*\b*/\b/,\n span /\b/*\b*b\bbo\bod\bdy\by*\b*/\b/);\n@@ -426,47 +426,47 @@\n *\b**\b**\b**\b**\b* o\bon\bn_\b_e\bex\bxt\bte\ben\bns\bsi\bio\bon\bn_\b_h\bha\ban\bnd\bds\bsh\bha\bak\bke\be(\b()\b) *\b**\b**\b**\b**\b*\n virtual bool o\bon\bn_\b_e\bex\bxt\bte\ben\bns\bsi\bio\bon\bn_\b_h\bha\ban\bnd\bds\bsh\bha\bak\bke\be (bdecode_node const&);\n called when the extension handshake from the other end is received if this\n returns false, it means that this extension isn't supported by this peer. It\n will result in this _\bp_\be_\be_\br_\b__\bp_\bl_\bu_\bg_\bi_\bn being removed from the peer_connection and\n destructed. this is not called for web seeds\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* o\bon\bn_\b_d\bdo\bon\bnt\bt_\b_h\bha\bav\bve\be(\b()\b) o\bon\bn_\b_h\bha\bav\bve\be_\b_n\bno\bon\bne\be(\b()\b) o\bon\bn_\b_r\bre\beq\bqu\bue\bes\bst\bt(\b()\b) o\bon\bn_\b_h\bha\bav\bve\be_\b_a\bal\bll\bl(\b()\b) o\bon\bn_\b_b\bbi\bit\btf\bfi\bie\bel\bld\bd(\b()\b)\n-o\bon\bn_\b_h\bha\bav\bve\be(\b()\b) o\bon\bn_\b_c\bch\bho\bok\bke\be(\b()\b) o\bon\bn_\b_n\bno\bot\bt_\b_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd(\b()\b) o\bon\bn_\b_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd(\b()\b) o\bon\bn_\b_u\bun\bnc\bch\bho\bok\bke\be(\b()\b)\n-o\bon\bn_\b_a\bal\bll\blo\bow\bwe\bed\bd_\b_f\bfa\bas\bst\bt(\b()\b) *\b**\b**\b**\b**\b*\n+*\b**\b**\b**\b**\b* o\bon\bn_\b_n\bno\bot\bt_\b_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd(\b()\b) o\bon\bn_\b_h\bha\bav\bve\be_\b_a\bal\bll\bl(\b()\b) o\bon\bn_\b_a\bal\bll\blo\bow\bwe\bed\bd_\b_f\bfa\bas\bst\bt(\b()\b) o\bon\bn_\b_c\bch\bho\bok\bke\be(\b()\b) o\bon\bn_\b_u\bun\bnc\bch\bho\bok\bke\be\n+(\b()\b) o\bon\bn_\b_r\bre\beq\bqu\bue\bes\bst\bt(\b()\b) o\bon\bn_\b_b\bbi\bit\btf\bfi\bie\bel\bld\bd(\b()\b) o\bon\bn_\b_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd(\b()\b) o\bon\bn_\b_h\bha\bav\bve\be(\b()\b) o\bon\bn_\b_h\bha\bav\bve\be_\b_n\bno\bon\bne\be(\b()\b)\n+o\bon\bn_\b_d\bdo\bon\bnt\bt_\b_h\bha\bav\bve\be(\b()\b) *\b**\b**\b**\b**\b*\n+virtual bool o\bon\bn_\b_h\bha\bav\bve\be_\b_a\bal\bll\bl ();\n virtual bool o\bon\bn_\b_h\bha\bav\bve\be_\b_n\bno\bon\bne\be ();\n-virtual bool o\bon\bn_\b_a\bal\bll\blo\bow\bwe\bed\bd_\b_f\bfa\bas\bst\bt (piece_index_t);\n-virtual bool o\bon\bn_\b_n\bno\bot\bt_\b_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd ();\n-virtual bool o\bon\bn_\b_h\bha\bav\bve\be (piece_index_t);\n-virtual bool o\bon\bn_\b_d\bdo\bon\bnt\bt_\b_h\bha\bav\bve\be (piece_index_t);\n-virtual bool o\bon\bn_\b_c\bch\bho\bok\bke\be ();\n virtual bool o\bon\bn_\b_r\bre\beq\bqu\bue\bes\bst\bt (peer_request const&);\n-virtual bool o\bon\bn_\b_b\bbi\bit\btf\bfi\bie\bel\bld\bd (bitfield const& /\b/*\b*b\bbi\bit\btf\bfi\bie\bel\bld\bd*\b*/\b/);\n+virtual bool o\bon\bn_\b_h\bha\bav\bve\be (piece_index_t);\n+virtual bool o\bon\bn_\b_a\bal\bll\blo\bow\bwe\bed\bd_\b_f\bfa\bas\bst\bt (piece_index_t);\n virtual bool o\bon\bn_\b_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd ();\n-virtual bool o\bon\bn_\b_h\bha\bav\bve\be_\b_a\bal\bll\bl ();\n+virtual bool o\bon\bn_\b_c\bch\bho\bok\bke\be ();\n+virtual bool o\bon\bn_\b_n\bno\bot\bt_\b_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd ();\n virtual bool o\bon\bn_\b_u\bun\bnc\bch\bho\bok\bke\be ();\n+virtual bool o\bon\bn_\b_b\bbi\bit\btf\bfi\bie\bel\bld\bd (bitfield const& /\b/*\b*b\bbi\bit\btf\bfi\bie\bel\bld\bd*\b*/\b/);\n+virtual bool o\bon\bn_\b_d\bdo\bon\bnt\bt_\b_h\bha\bav\bve\be (piece_index_t);\n returning true from any of the message handlers indicates that the _\bp_\bl_\bu_\bg_\bi_\bn has\n handled the message. it will break the _\bp_\bl_\bu_\bg_\bi_\bn chain traversing and not let\n anyone else handle the message, including the default handler.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* o\bon\bn_\b_p\bpi\bie\bec\bce\be(\b()\b) *\b**\b**\b**\b**\b*\n virtual bool o\bon\bn_\b_p\bpi\bie\bec\bce\be (peer_request const& /\b/*\b*p\bpi\bie\bec\bce\be*\b*/\b/\n , span /\b/*\b*b\bbu\buf\bf*\b*/\b/);\n This function is called when the peer connection is receiving a piece. buf\n points (non-owning pointer) to the data in an internal immutable disk buffer.\n The length of the data is specified in the length member of the piece\n parameter. returns true to indicate that the piece is handled and the rest of\n the logic should be ignored.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* s\bse\ben\bnt\bt_\b_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd(\b()\b) s\bse\ben\bnt\bt_\b_p\bpi\bie\bec\bce\be(\b()\b) s\bse\ben\bnt\bt_\b_u\bun\bnc\bch\bho\bok\bke\be(\b()\b) s\bse\ben\bnt\bt_\b_h\bha\bav\bve\be(\b()\b)\n-s\bse\ben\bnt\bt_\b_n\bno\bot\bt_\b_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd(\b()\b) *\b**\b**\b**\b**\b*\n+*\b**\b**\b**\b**\b* s\bse\ben\bnt\bt_\b_u\bun\bnc\bch\bho\bok\bke\be(\b()\b) s\bse\ben\bnt\bt_\b_n\bno\bot\bt_\b_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd(\b()\b) s\bse\ben\bnt\bt_\b_h\bha\bav\bve\be(\b()\b) s\bse\ben\bnt\bt_\b_p\bpi\bie\bec\bce\be(\b()\b)\n+s\bse\ben\bnt\bt_\b_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd(\b()\b) *\b**\b**\b**\b**\b*\n virtual void s\bse\ben\bnt\bt_\b_n\bno\bot\bt_\b_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd ();\n+virtual void s\bse\ben\bnt\bt_\b_u\bun\bnc\bch\bho\bok\bke\be ();\n virtual void s\bse\ben\bnt\bt_\b_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd ();\n virtual void s\bse\ben\bnt\bt_\b_h\bha\bav\bve\be (piece_index_t);\n-virtual void s\bse\ben\bnt\bt_\b_u\bun\bnc\bch\bho\bok\bke\be ();\n virtual void s\bse\ben\bnt\bt_\b_p\bpi\bie\bec\bce\be (peer_request const&);\n called after a choke message has been sent to the peer\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* s\bse\ben\bnt\bt_\b_p\bpa\bay\byl\blo\boa\bad\bd(\b()\b) *\b**\b**\b**\b**\b*\n virtual void s\bse\ben\bnt\bt_\b_p\bpa\bay\byl\blo\boa\bad\bd (int /\b/*\b* b\bby\byt\bte\bes\bs *\b*/\b/);\n called after piece data has been sent to the peer this can be used for stats\n book keeping\n@@ -490,15 +490,15 @@\n receiving large messages.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* o\bon\bn_\b_u\bun\bnk\bkn\bno\bow\bwn\bn_\b_m\bme\bes\bss\bsa\bag\bge\be(\b()\b) *\b**\b**\b**\b**\b*\n virtual bool o\bon\bn_\b_u\bun\bnk\bkn\bno\bow\bwn\bn_\b_m\bme\bes\bss\bsa\bag\bge\be (int /\b/*\b*l\ble\ben\bng\bgt\bth\bh*\b*/\b/, int /\b/*\b*m\bms\bsg\bg*\b*/\b/,\n span /\b/*\b*b\bbo\bod\bdy\by*\b*/\b/);\n this is not called for web seeds\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_f\bfa\bai\bil\ble\bed\bd(\b()\b) o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_p\bpa\bas\bss\bs(\b()\b) *\b**\b**\b**\b**\b*\n+*\b**\b**\b**\b**\b* o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_p\bpa\bas\bss\bs(\b()\b) o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_f\bfa\bai\bil\ble\bed\bd(\b()\b) *\b**\b**\b**\b**\b*\n virtual void o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_f\bfa\bai\bil\ble\bed\bd (piece_index_t);\n virtual void o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_p\bpa\bas\bss\bs (piece_index_t);\n called when a piece that this peer participated in either fails or passes the\n hash_check\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* t\bti\bic\bck\bk(\b()\b) *\b**\b**\b**\b**\b*\n virtual void t\bti\bic\bck\bk ();\n@@ -538,51 +538,51 @@\n the _\bp_\be_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b__\bh_\ba_\bn_\bd_\bl_\be class provides a handle to the internal peer\n connection object, to be used by plugins. This is a low level interface that\n may not be stable across libtorrent versions\n struct peer_connection_handle\n {\n explicit p\bpe\bee\ber\br_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn_\b_h\bha\ban\bnd\bdl\ble\be (std::weak_ptr impl);\n connection_type t\bty\byp\bpe\be () const;\n- void a\bad\bdd\bd_\b_e\bex\bxt\bte\ben\bns\bsi\bio\bon\bn (std::shared_ptr);\n peer_plugin const* f\bfi\bin\bnd\bd_\b_p\bpl\blu\bug\bgi\bin\bn (string_view type) const;\n+ void a\bad\bdd\bd_\b_e\bex\bxt\bte\ben\bns\bsi\bio\bon\bn (std::shared_ptr);\n bool i\bis\bs_\b_s\bse\bee\bed\bd () const;\n bool u\bup\bpl\blo\boa\bad\bd_\b_o\bon\bnl\bly\by () const;\n bool h\bha\bas\bs_\b_p\bpi\bie\bec\bce\be (piece_index_t i) const;\n peer_id const& p\bpi\bid\bd () const;\n- bool i\bis\bs_\b_i\bin\bnt\bte\ber\bre\bes\bst\bti\bin\bng\bg () const;\n bool i\bis\bs_\b_c\bch\bho\bok\bke\bed\bd () const;\n- bool h\bha\bas\bs_\b_p\bpe\bee\ber\br_\b_c\bch\bho\bok\bke\bed\bd () const;\n+ bool i\bis\bs_\b_i\bin\bnt\bte\ber\bre\bes\bst\bti\bin\bng\bg () const;\n bool i\bis\bs_\b_p\bpe\bee\ber\br_\b_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd () const;\n- void m\bma\bay\byb\bbe\be_\b_u\bun\bnc\bch\bho\bok\bke\be_\b_t\bth\bhi\bis\bs_\b_p\bpe\bee\ber\br ();\n+ bool h\bha\bas\bs_\b_p\bpe\bee\ber\br_\b_c\bch\bho\bok\bke\bed\bd () const;\n void c\bch\bho\bok\bke\be_\b_t\bth\bhi\bis\bs_\b_p\bpe\bee\ber\br ();\n+ void m\bma\bay\byb\bbe\be_\b_u\bun\bnc\bch\bho\bok\bke\be_\b_t\bth\bhi\bis\bs_\b_p\bpe\bee\ber\br ();\n void g\bge\bet\bt_\b_p\bpe\bee\ber\br_\b_i\bin\bnf\bfo\bo (peer_info& p) const;\n torrent_handle a\bas\bss\bso\boc\bci\bia\bat\bte\bed\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt () const;\n- _\bt_\bc_\bp_\b:_\b:_\be_\bn_\bd_\bp_\bo_\bi_\bn_\bt l\blo\boc\bca\bal\bl_\b_e\ben\bnd\bdp\bpo\boi\bin\bnt\bt () const;\n _\bt_\bc_\bp_\b:_\b:_\be_\bn_\bd_\bp_\bo_\bi_\bn_\bt const& r\bre\bem\bmo\bot\bte\be () const;\n+ _\bt_\bc_\bp_\b:_\b:_\be_\bn_\bd_\bp_\bo_\bi_\bn_\bt l\blo\boc\bca\bal\bl_\b_e\ben\bnd\bdp\bpo\boi\bin\bnt\bt () const;\n+ bool i\bis\bs_\b_d\bdi\bis\bsc\bco\bon\bnn\bne\bec\bct\bti\bin\bng\bg () const;\n bool i\bis\bs_\b_c\bco\bon\bnn\bne\bec\bct\bti\bin\bng\bg () const;\n+ bool i\bis\bs_\b_o\bou\but\btg\bgo\boi\bin\bng\bg () const;\n void d\bdi\bis\bsc\bco\bon\bnn\bne\bec\bct\bt (error_code const& ec, operation_t op\n , disconnect_severity_t = peer_connection_interface::normal);\n- bool i\bis\bs_\b_d\bdi\bis\bsc\bco\bon\bnn\bne\bec\bct\bti\bin\bng\bg () const;\n- bool i\bis\bs_\b_o\bou\but\btg\bgo\boi\bin\bng\bg () const;\n bool i\big\bgn\bno\bor\bre\be_\b_u\bun\bnc\bch\bho\bok\bke\be_\b_s\bsl\blo\bot\bts\bs () const;\n bool o\bon\bn_\b_l\blo\boc\bca\bal\bl_\b_n\bne\bet\btw\bwo\bor\brk\bk () const;\n bool f\bfa\bai\bil\ble\bed\bd () const;\n bool s\bsh\bho\bou\bul\bld\bd_\b_l\blo\bog\bg (peer_log_alert::direction_t direction) const;\n void p\bpe\bee\ber\br_\b_l\blo\bog\bg (peer_log_alert::direction_t direction\n , char const* event, char const* fmt = \"\", ...) const TORRENT_FORMAT\n (4,5);\n bool c\bca\ban\bn_\b_d\bdi\bis\bsc\bco\bon\bnn\bne\bec\bct\bt (error_code const& ec) const;\n bool h\bha\bas\bs_\b_m\bme\bet\bta\bad\bda\bat\bta\ba () const;\n bool i\bin\bn_\b_h\bha\ban\bnd\bds\bsh\bha\bak\bke\be () const;\n void s\bse\ben\bnd\bd_\b_b\bbu\buf\bff\bfe\ber\br (char const* begin, int size);\n std::time_t l\bla\bas\bst\bt_\b_s\bse\bee\ben\bn_\b_c\bco\bom\bmp\bpl\ble\bet\bte\be () const;\n time_point t\bti\bim\bme\be_\b_o\bof\bf_\b_l\bla\bas\bst\bt_\b_u\bun\bnc\bch\bho\bok\bke\be () const;\n bool o\bop\bpe\ber\bra\bat\bto\bor\br!\b!=\b= (peer_connection_handle const& o) const;\n- bool o\bop\bpe\ber\bra\bat\bto\bor\br=\b==\b= (peer_connection_handle const& o) const;\n bool o\bop\bpe\ber\bra\bat\bto\bor\br<\b< (peer_connection_handle const& o) const;\n+ bool o\bop\bpe\ber\bra\bat\bto\bor\br=\b==\b= (peer_connection_handle const& o) const;\n std::shared_ptr n\bna\bat\bti\biv\bve\be_\b_h\bha\ban\bnd\bdl\ble\be () const;\n };\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* b\bbt\bt_\b_p\bpe\bee\ber\br_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn_\b_h\bha\ban\bnd\bdl\ble\be *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bp_\be_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b__\bh_\ba_\bn_\bd_\bl_\be_\b._\bh_\bp_\bp\"\n The _\bb_\bt_\b__\bp_\be_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b__\bh_\ba_\bn_\bd_\bl_\be provides a handle to the internal bittorrent peer\n connection object to plugins. It's low level and may not be a stable API across\n@@ -594,37 +594,37 @@\n bool s\bsu\bup\bpp\bpo\bor\brt\bt_\b_e\bex\bxt\bte\ben\bns\bsi\bio\bon\bns\bs () const;\n bool s\bsu\bup\bpp\bpo\bor\brt\bts\bs_\b_e\ben\bnc\bcr\bry\byp\bpt\bti\bio\bon\bn () const;\n void s\bsw\bwi\bit\btc\bch\bh_\b_r\bre\bec\bcv\bv_\b_c\bcr\bry\byp\bpt\bto\bo (std::shared_ptr crypto);\n void s\bsw\bwi\bit\btc\bch\bh_\b_s\bse\ben\bnd\bd_\b_c\bcr\bry\byp\bpt\bto\bo (std::shared_ptr crypto);\n std::shared_ptr n\bna\bat\bti\biv\bve\be_\b_h\bha\ban\bnd\bdl\ble\be () const;\n };\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* c\bcr\bre\bea\bat\bte\be_\b_u\but\bt_\b_p\bpe\bex\bx_\b_p\bpl\blu\bug\bgi\bin\bn(\b()\b) *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\bs_\b/_\bu_\bt_\b__\bp_\be_\bx_\b._\bh_\bp_\bp\"\n-std::shared_ptr c\bcr\bre\bea\bat\bte\be_\b_u\but\bt_\b_p\bpe\bex\bx_\b_p\bpl\blu\bug\bgi\bin\bn (torrent_handle const&,\n-client_data_t);\n-constructor function for the ut_pex extension. The ut_pex extension allows\n-peers to gossip about their connections, allowing the swarm stay well connected\n-and peers aware of more peers in the swarm. This extension is enabled by\n-default unless explicitly disabled in the _\bs_\be_\bs_\bs_\bi_\bo_\bn constructor.\n-This can either be passed in the add_torrent_params::extensions field, or via\n-_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be_\b:_\b:_\ba_\bd_\bd_\b__\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\b(_\b).\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* c\bcr\bre\bea\bat\bte\be_\b_u\but\bt_\b_m\bme\bet\bta\bad\bda\bat\bta\ba_\b_p\bpl\blu\bug\bgi\bin\bn(\b()\b) *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\bs_\b/_\bu_\bt_\b__\bm_\be_\bt_\ba_\bd_\ba_\bt_\ba_\b._\bh_\bp_\bp\"\n std::shared_ptr c\bcr\bre\bea\bat\bte\be_\b_u\but\bt_\b_m\bme\bet\bta\bad\bda\bat\bta\ba_\b_p\bpl\blu\bug\bgi\bin\bn (torrent_handle\n const&, client_data_t);\n constructor function for the ut_metadata extension. The ut_metadata extension\n allows peers to request the .torrent file (or more specifically the info-\n dictionary of the .torrent file) from each other. This is the main building\n block in making magnet links work. This extension is enabled by default unless\n explicitly disabled in the _\bs_\be_\bs_\bs_\bi_\bo_\bn constructor.\n This can either be passed in the add_torrent_params::extensions field, or via\n _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be_\b:_\b:_\ba_\bd_\bd_\b__\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\b(_\b).\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* c\bcr\bre\bea\bat\bte\be_\b_u\but\bt_\b_p\bpe\bex\bx_\b_p\bpl\blu\bug\bgi\bin\bn(\b()\b) *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\bs_\b/_\bu_\bt_\b__\bp_\be_\bx_\b._\bh_\bp_\bp\"\n+std::shared_ptr c\bcr\bre\bea\bat\bte\be_\b_u\but\bt_\b_p\bpe\bex\bx_\b_p\bpl\blu\bug\bgi\bin\bn (torrent_handle const&,\n+client_data_t);\n+constructor function for the ut_pex extension. The ut_pex extension allows\n+peers to gossip about their connections, allowing the swarm stay well connected\n+and peers aware of more peers in the swarm. This extension is enabled by\n+default unless explicitly disabled in the _\bs_\be_\bs_\bs_\bi_\bo_\bn constructor.\n+This can either be passed in the add_torrent_params::extensions field, or via\n+_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be_\b:_\b:_\ba_\bd_\bd_\b__\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\b(_\b).\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* c\bcr\bre\bea\bat\bte\be_\b_s\bsm\bma\bar\brt\bt_\b_b\bba\ban\bn_\b_p\bpl\blu\bug\bgi\bin\bn(\b()\b) *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\bs_\b/_\bs_\bm_\ba_\br_\bt_\b__\bb_\ba_\bn_\b._\bh_\bp_\bp\"\n std::shared_ptr c\bcr\bre\bea\bat\bte\be_\b_s\bsm\bma\bar\brt\bt_\b_b\bba\ban\bn_\b_p\bpl\blu\bug\bgi\bin\bn (torrent_handle const&,\n client_data_t);\n constructor function for the smart ban extension. The extension keeps track of\n the data peers have sent us for failing pieces and once the piece completes and\n passes the hash check bans the peers that turned out to have sent corrupt data.\n"}]}, {"source1": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Resume_Data.html", "source2": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Resume_Data.html", "unified_diff": "@@ -28,22 +28,50 @@\n 2.0.11\n \n \n

    home

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

    read_resume_data()

    \n+

    Declared in "libtorrent/read_resume_data.hpp"

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

    these functions are used to parse resume data and populate the appropriate\n+fields in an add_torrent_params object. This object can then be used to add\n+the actual torrent_info object to and pass to session::add_torrent() or\n+session::async_add_torrent().

    \n+

    If the client wants to override any field that was loaded from the resume\n+data, e.g. save_path, those fields must be changed after loading resume\n+data but before adding the torrent.

    \n+

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

    \n+

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

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

    write_resume_data() write_resume_data_buf()

    \n

    Declared in "libtorrent/write_resume_data.hpp"

    \n
    \n std::vector<char> write_resume_data_buf (add_torrent_params const& atp);\n entry write_resume_data (add_torrent_params const& atp);\n 
    \n

    this function turns the resume data in an add_torrent_params object\n@@ -51,56 +79,28 @@\n \n [report issue]

    \n
    \n

    write_torrent_file_buf() write_torrent_file()

    \n

    Declared in "libtorrent/write_resume_data.hpp"

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

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

    \n
      \n
    • The add_torrent_params object passed to this function does not contain the\n info dictionary (the ti field)
    • \n
    • The piece layers are not complete for all files that need them
    • \n
    \n

    The write_torrent_file_buf() overload returns the torrent file in\n bencoded buffer form. This overload may be faster at the expense of lost\n flexibility to add custom fields.

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

    read_resume_data()

    \n-

    Declared in "libtorrent/read_resume_data.hpp"

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

    these functions are used to parse resume data and populate the appropriate\n-fields in an add_torrent_params object. This object can then be used to add\n-the actual torrent_info object to and pass to session::add_torrent() or\n-session::async_add_torrent().

    \n-

    If the client wants to override any field that was loaded from the resume\n-data, e.g. save_path, those fields must be changed after loading resume\n-data but before adding the torrent.

    \n-

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

    \n-

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

    \n [report issue]
    \n
    \n

    write_torrent_flags_t

    \n

    Declared in "libtorrent/write_resume_data.hpp"

    \n
    \n
    allow_missing_piece_layer
    \n
    this makes write_torrent_file() not fail when attempting to write a\n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,50 +1,27 @@\n >\n _\b[_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b _\bl_\bo_\bg_\bo_\b]\n V\bVe\ber\brs\bsi\bio\bon\bn:\b: 2.0.11\n _\bh_\bo_\bm_\be\n Table of contents\n+ * _\br_\be_\ba_\bd_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b)\n * _\bw_\br_\bi_\bt_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b)_\b _\bw_\br_\bi_\bt_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b__\bb_\bu_\bf_\b(_\b)\n * _\bw_\br_\bi_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bi_\bl_\be_\b__\bb_\bu_\bf_\b(_\b)_\b _\bw_\br_\bi_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bi_\bl_\be_\b(_\b)\n- * _\br_\be_\ba_\bd_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b)\n * _\bw_\br_\bi_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bl_\ba_\bg_\bs_\b__\bt\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* w\bwr\bri\bit\bte\be_\b_r\bre\bes\bsu\bum\bme\be_\b_d\bda\bat\bta\ba(\b()\b) w\bwr\bri\bit\bte\be_\b_r\bre\bes\bsu\bum\bme\be_\b_d\bda\bat\bta\ba_\b_b\bbu\buf\bf(\b()\b) *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bw_\br_\bi_\bt_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b._\bh_\bp_\bp\"\n-std::vector w\bwr\bri\bit\bte\be_\b_r\bre\bes\bsu\bum\bme\be_\b_d\bda\bat\bta\ba_\b_b\bbu\buf\bf (add_torrent_params const& atp);\n-entry w\bwr\bri\bit\bte\be_\b_r\bre\bes\bsu\bum\bme\be_\b_d\bda\bat\bta\ba (add_torrent_params const& atp);\n-this function turns the resume data in an add_torrent_params object into a\n-bencoded structure\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* w\bwr\bri\bit\bte\be_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be_\b_b\bbu\buf\bf(\b()\b) w\bwr\bri\bit\bte\be_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be(\b()\b) *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bw_\br_\bi_\bt_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b._\bh_\bp_\bp\"\n-entry w\bwr\bri\bit\bte\be_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be (add_torrent_params const& atp);\n-entry w\bwr\bri\bit\bte\be_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be (add_torrent_params const& atp, write_torrent_flags_t\n-flags);\n-std::vector w\bwr\bri\bit\bte\be_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be_\b_b\bbu\buf\bf (add_torrent_params const& atp\n- , write_torrent_flags_t flags);\n-writes only the fields to create a .torrent file. This function may fail with a\n-std::system_error exception if:\n- * The _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs object passed to this function does not contain\n- the info dictionary (the ti field)\n- * The piece layers are not complete for all files that need them\n-The write_torrent_file_buf() overload returns the torrent file in bencoded\n-buffer form. This overload may be faster at the expense of lost flexibility to\n-add custom fields.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* r\bre\bea\bad\bd_\b_r\bre\bes\bsu\bum\bme\be_\b_d\bda\bat\bta\ba(\b()\b) *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\br_\be_\ba_\bd_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b._\bh_\bp_\bp\"\n add_torrent_params r\bre\bea\bad\bd_\b_r\bre\bes\bsu\bum\bme\be_\b_d\bda\bat\bta\ba (span buffer\n , load_torrent_limits const& cfg = {});\n add_torrent_params r\bre\bea\bad\bd_\b_r\bre\bes\bsu\bum\bme\be_\b_d\bda\bat\bta\ba (bdecode_node const& rd\n , error_code& ec, int piece_limit = 0x200000);\n-add_torrent_params r\bre\bea\bad\bd_\b_r\bre\bes\bsu\bum\bme\be_\b_d\bda\bat\bta\ba (bdecode_node const& rd\n- , int piece_limit = 0x200000);\n add_torrent_params r\bre\bea\bad\bd_\b_r\bre\bes\bsu\bum\bme\be_\b_d\bda\bat\bta\ba (span buffer\n , error_code& ec, load_torrent_limits const& cfg = {});\n+add_torrent_params r\bre\bea\bad\bd_\b_r\bre\bes\bsu\bum\bme\be_\b_d\bda\bat\bta\ba (bdecode_node const& rd\n+ , int piece_limit = 0x200000);\n these functions are used to parse resume data and populate the appropriate\n fields in an _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs object. This object can then be used to add the\n actual _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo object to and pass to session::add_torrent() or session::\n async_add_torrent().\n If the client wants to override any field that was loaded from the resume data,\n e.g. save_path, those fields must be changed after loading resume data but\n before adding the torrent.\n@@ -52,14 +29,37 @@\n the torrent that may be loaded as part of the resume data, if it contains an\n info field. The overloads that take a flat buffer are instead configured with\n limits on torrent sizes via load_torrent limits.\n In order to support large torrents, it may also be necessary to raise the\n _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk_\b:_\b:_\bm_\ba_\bx_\b__\bp_\bi_\be_\bc_\be_\b__\bc_\bo_\bu_\bn_\bt setting and pass a higher limit to calls to\n _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b:_\b:_\bp_\ba_\br_\bs_\be_\b__\bi_\bn_\bf_\bo_\b__\bs_\be_\bc_\bt_\bi_\bo_\bn_\b(_\b).\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* w\bwr\bri\bit\bte\be_\b_r\bre\bes\bsu\bum\bme\be_\b_d\bda\bat\bta\ba(\b()\b) w\bwr\bri\bit\bte\be_\b_r\bre\bes\bsu\bum\bme\be_\b_d\bda\bat\bta\ba_\b_b\bbu\buf\bf(\b()\b) *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bw_\br_\bi_\bt_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b._\bh_\bp_\bp\"\n+std::vector w\bwr\bri\bit\bte\be_\b_r\bre\bes\bsu\bum\bme\be_\b_d\bda\bat\bta\ba_\b_b\bbu\buf\bf (add_torrent_params const& atp);\n+entry w\bwr\bri\bit\bte\be_\b_r\bre\bes\bsu\bum\bme\be_\b_d\bda\bat\bta\ba (add_torrent_params const& atp);\n+this function turns the resume data in an add_torrent_params object into a\n+bencoded structure\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* w\bwr\bri\bit\bte\be_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be_\b_b\bbu\buf\bf(\b()\b) w\bwr\bri\bit\bte\be_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be(\b()\b) *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bw_\br_\bi_\bt_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b._\bh_\bp_\bp\"\n+entry w\bwr\bri\bit\bte\be_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be (add_torrent_params const& atp);\n+std::vector w\bwr\bri\bit\bte\be_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be_\b_b\bbu\buf\bf (add_torrent_params const& atp\n+ , write_torrent_flags_t flags);\n+entry w\bwr\bri\bit\bte\be_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be (add_torrent_params const& atp, write_torrent_flags_t\n+flags);\n+writes only the fields to create a .torrent file. This function may fail with a\n+std::system_error exception if:\n+ * The _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs object passed to this function does not contain\n+ the info dictionary (the ti field)\n+ * The piece layers are not complete for all files that need them\n+The write_torrent_file_buf() overload returns the torrent file in bencoded\n+buffer form. This overload may be faster at the expense of lost flexibility to\n+add custom fields.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* w\bwr\bri\bit\bte\be_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfl\bla\bag\bgs\bs_\b_t\bt *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bw_\br_\bi_\bt_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b._\bh_\bp_\bp\"\n allow_missing_piece_layer\n this makes _\bw_\br_\bi_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bi_\bl_\be_\b(_\b) not fail when attempting to write a v2\n torrent file that does not have all the piece layers\n no_http_seeds\n don't include http seeds in the torrent file, even if some are present in\n"}]}, {"source1": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Session.html", "source2": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Session.html", "unified_diff": "@@ -28,78 +28,158 @@\n 2.0.11\n \n \n

    home

    \n
    \n

    Table of contents

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

    session_params

    \n+

    Declared in "libtorrent/session_params.hpp"

    \n+

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

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

    session_params()

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

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

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

    session_params()

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

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

    \n+[report issue]
    \n+
    settings
    \n+
    The settings to configure the session with
    \n+
    \n+[report issue]
    \n+
    extensions
    \n+
    the plugins to add to the session as it is constructed
    \n+
    \n+[report issue]
    \n+
    dht_state
    \n+
    DHT node ID and node addresses to bootstrap the DHT with.
    \n+
    \n+[report issue]
    \n+
    dht_storage_constructor
    \n+
    function object to construct the storage object for DHT items.
    \n+
    \n+[report issue]
    \n+
    disk_io_constructor
    \n+
    function object to create the disk I/O subsystem. Defaults to\n+default_disk_io_constructor.
    \n+
    \n+[report issue]
    \n+
    ext_state
    \n+
    this container can be used by extensions/plugins to store settings. It's\n+primarily here to make it convenient to save and restore state across\n+sessions, using read_session_params() and write_session_params().
    \n+
    \n+[report issue]
    \n+
    ip_filter
    \n+
    the IP filter to use for the session. This restricts which peers are allowed\n+to connect. As if passed to set_ip_filter().
    \n+
    \n+[report issue]
    \n+
    \n+
    \n

    session_handle

    \n

    Declared in "libtorrent/session_handle.hpp"

    \n

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

    \n
    \n struct session_handle\n {\n    bool is_valid () const;\n    session_params session_state (save_state_flags_t flags = save_state_flags_t::all()) const;\n@@ -111,23 +191,23 @@\n    void post_torrent_updates (status_flags_t flags = status_flags_t::all());\n    void post_session_stats ();\n    void post_dht_stats ();\n    void set_dht_state (dht::dht_state const& st);\n    void set_dht_state (dht::dht_state&& st);\n    torrent_handle find_torrent (sha1_hash const& info_hash) const;\n    std::vector<torrent_handle> get_torrents () const;\n+   torrent_handle add_torrent (add_torrent_params const& params, error_code& ec);\n    torrent_handle add_torrent (add_torrent_params const& params);\n-   torrent_handle add_torrent (add_torrent_params&& params, error_code& ec);\n    void async_add_torrent (add_torrent_params const& params);\n+   torrent_handle add_torrent (add_torrent_params&& params, error_code& ec);\n    void async_add_torrent (add_torrent_params&& params);\n-   torrent_handle add_torrent (add_torrent_params const& params, error_code& ec);\n    torrent_handle add_torrent (add_torrent_params&& params);\n    void pause ();\n-   bool is_paused () const;\n    void resume ();\n+   bool is_paused () const;\n    bool is_dht_running () const;\n    void set_dht_storage (dht::dht_storage_constructor_type sc);\n    void add_dht_node (std::pair<std::string, int> const& node);\n    void dht_get_item (sha1_hash const& target);\n    void dht_get_item (std::array<char, 32> key\n       , std::string salt = std::string());\n    sha1_hash dht_put_item (entry data);\n@@ -139,37 +219,37 @@\n    void dht_get_peers (sha1_hash const& info_hash);\n    void dht_live_nodes (sha1_hash const& nid);\n    void dht_sample_infohashes (udp::endpoint const& ep, sha1_hash const& target);\n    void dht_direct_request (udp::endpoint const& ep, entry const& e, client_data_t userdata = {});\n    void add_extension (std::function<std::shared_ptr<torrent_plugin>(\n       torrent_handle const&, client_data_t)> ext);\n    void add_extension (std::shared_ptr<plugin> ext);\n-   void set_ip_filter (ip_filter f);\n    ip_filter get_ip_filter () const;\n+   void set_ip_filter (ip_filter f);\n    void set_port_filter (port_filter const& f);\n-   unsigned short ssl_listen_port () const;\n    unsigned short listen_port () const;\n+   unsigned short ssl_listen_port () const;\n    bool is_listening () const;\n    void set_peer_class_filter (ip_filter const& f);\n    ip_filter get_peer_class_filter () const;\n    void set_peer_class_type_filter (peer_class_type_filter const& f);\n    peer_class_type_filter get_peer_class_type_filter () const;\n    peer_class_t create_peer_class (char const* name);\n    void delete_peer_class (peer_class_t cid);\n-   peer_class_info get_peer_class (peer_class_t cid) const;\n    void set_peer_class (peer_class_t cid, peer_class_info const& pci);\n+   peer_class_info get_peer_class (peer_class_t cid) const;\n    void remove_torrent (const torrent_handle&, remove_flags_t = {});\n    void apply_settings (settings_pack&&);\n-   void apply_settings (settings_pack const&);\n    settings_pack get_settings () const;\n-   void set_alert_notify (std::function<void()> const& fun);\n-   void pop_alerts (std::vector<alert*>* alerts);\n+   void apply_settings (settings_pack const&);\n    alert* wait_for_alert (time_duration max_wait);\n-   void delete_port_mapping (port_mapping_t handle);\n+   void pop_alerts (std::vector<alert*>* alerts);\n+   void set_alert_notify (std::function<void()> const& fun);\n    std::vector<port_mapping_t> add_port_mapping (portmap_protocol t, int external_port, int local_port);\n+   void delete_port_mapping (port_mapping_t handle);\n    void reopen_network_sockets (reopen_network_flags_t options = reopen_map_ports);\n    std::shared_ptr<aux::session_impl> native_handle () const;\n \n    static constexpr save_state_flags_t save_settings  = 0_bit;\n    static constexpr save_state_flags_t save_dht_state  = 2_bit;\n    static constexpr save_state_flags_t save_extension_state  = 11_bit;\n    static constexpr save_state_flags_t save_ip_filter  = 12_bit;\n@@ -304,24 +384,24 @@\n case there is such a torrent in the session, a torrent_handle to that\n torrent is returned. In case the torrent cannot be found, an invalid\n torrent_handle is returned.

    \n

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

    \n

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

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

    async_add_torrent() add_torrent()

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

    add_torrent() async_add_torrent()

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

    You add torrents through the add_torrent() function where you give an\n object with all the parameters. The add_torrent() overloads will block\n until the torrent has been added (or failed to be added) and returns\n an error code and a torrent_handle. In order to add torrents more\n efficiently, consider using async_add_torrent() which returns\n@@ -354,16 +434,16 @@\n \n \n [report issue]

    \n
    \n

    pause() resume() is_paused()

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

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

    \n@@ -573,16 +653,16 @@\n ses.add_extension(&lt::create_smart_ban_plugin);\n \n \n [report issue]
    \n
    \n

    set_ip_filter() get_ip_filter()

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

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

    \n

    Each time a peer is blocked because of the IP filter, a\n peer_blocked_alert is generated. get_ip_filter() Returns the\n@@ -594,21 +674,21 @@\n void set_port_filter (port_filter const& f);\n \n

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

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

    listen_port() is_listening() ssl_listen_port()

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

    listen_port() ssl_listen_port() is_listening()

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

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

    \n@@ -696,21 +776,21 @@\n remove the peer class if it's still assigned to torrents or peers. It\n will however remove it once the last peer and torrent drops their\n references to it.

    \n

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

    \n

    For more information on peer classes, see peer classes.

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

    set_peer_class() get_peer_class()

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

    get_peer_class() set_peer_class()

    \n
    \n-peer_class_info get_peer_class (peer_class_t cid) const;\n void set_peer_class (peer_class_t cid, peer_class_info const& pci);\n+peer_class_info get_peer_class (peer_class_t cid) const;\n 
    \n

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

    \n

    cid must refer to an existing peer class. If it does not, the\n return value of get_peer_class() is undefined.

    \n

    set_peer_class() sets all the information in the\n peer_class_info object in the specified peer class. There is no\n@@ -756,29 +836,29 @@\n shifting.

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

    apply_settings() get_settings()

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

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

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

    pop_alerts() set_alert_notify() wait_for_alert()

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

    wait_for_alert() set_alert_notify() pop_alerts()

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

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

    \n

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

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

    add_port_mapping() delete_port_mapping()

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

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

    \n [report issue]
    \n@@ -918,33 +998,33 @@\n synchronize the completion of the shutdown. The lifetime of this object\n may outlive session, causing the session destructor to not block. The\n session_proxy destructor will block however, until the underlying session\n is done shutting down.

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

    session_proxy() operator=() ~session_proxy()

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

    session_proxy() ~session_proxy() operator=()

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

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

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

    session

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

    \n

    see apply_settings().

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

    session()

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

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

    \n

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

    \n [report issue]
    \n
    \n

    session()

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

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

    \n
    \n@@ -1043,110 +1123,30 @@\n session destructor call until the session_proxy destructor\n call. The session_proxy does not have any operations on it (since\n the session is being closed down, no operations are allowed on it).\n The only valid operation is calling the destructor:

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

    session_params

    \n-

    Declared in "libtorrent/session_params.hpp"

    \n-

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

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

    session_params()

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

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

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

    session_params()

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

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

    \n-[report issue]
    \n-
    settings
    \n-
    The settings to configure the session with
    \n-
    \n-[report issue]
    \n-
    extensions
    \n-
    the plugins to add to the session as it is constructed
    \n-
    \n-[report issue]
    \n-
    dht_state
    \n-
    DHT node ID and node addresses to bootstrap the DHT with.
    \n-
    \n-[report issue]
    \n-
    dht_storage_constructor
    \n-
    function object to construct the storage object for DHT items.
    \n-
    \n-[report issue]
    \n-
    disk_io_constructor
    \n-
    function object to create the disk I/O subsystem. Defaults to\n-default_disk_io_constructor.
    \n-
    \n-[report issue]
    \n-
    ext_state
    \n-
    this container can be used by extensions/plugins to store settings. It's\n-primarily here to make it convenient to save and restore state across\n-sessions, using read_session_params() and write_session_params().
    \n-
    \n-[report issue]
    \n-
    ip_filter
    \n-
    the IP filter to use for the session. This restricts which peers are allowed\n-to connect. As if passed to set_ip_filter().
    \n-
    \n \n-\n-[report issue]
    \n+\n+[report issue]
    \n
    \n-
    \n-

    write_session_params() write_session_params_buf() read_session_params()

    \n+
    \n+

    write_session_params() read_session_params() write_session_params_buf()

    \n

    Declared in "libtorrent/session_params.hpp"

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

    These functions serialize and de-serialize a session_params object to and\n from bencoded form. The session_params object is used to initialize a new\n session using the state from a previous one (or by programmatically configure\n the session up-front).\n The flags parameter can be used to only save and load certain aspects of the\n session's state.\n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,22 +1,25 @@\n >\n _\b[_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b _\bl_\bo_\bg_\bo_\b]\n V\bVe\ber\brs\bsi\bio\bon\bn:\b: 2.0.11\n _\bh_\bo_\bm_\be\n Table of contents\n+ * _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs\n+ o _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs_\b(_\b)\n+ o _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs_\b(_\b)\n * _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bh_\ba_\bn_\bd_\bl_\be\n o _\bi_\bs_\b__\bv_\ba_\bl_\bi_\bd_\b(_\b)\n o _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bs_\bt_\ba_\bt_\be_\b(_\b)\n o _\bg_\be_\bt_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bs_\bt_\ba_\bt_\bu_\bs_\b(_\b)_\b _\br_\be_\bf_\br_\be_\bs_\bh_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bs_\bt_\ba_\bt_\bu_\bs_\b(_\b)\n o _\bp_\bo_\bs_\bt_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bu_\bp_\bd_\ba_\bt_\be_\bs_\b(_\b)\n o _\bp_\bo_\bs_\bt_\b__\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bs_\bt_\ba_\bt_\bs_\b(_\b)\n o _\bp_\bo_\bs_\bt_\b__\bd_\bh_\bt_\b__\bs_\bt_\ba_\bt_\bs_\b(_\b)\n o _\bs_\be_\bt_\b__\bd_\bh_\bt_\b__\bs_\bt_\ba_\bt_\be_\b(_\b)\n o _\bf_\bi_\bn_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b)_\b _\bg_\be_\bt_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\bs_\b(_\b)\n- o _\ba_\bs_\by_\bn_\bc_\b__\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b)_\b _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b)\n+ o _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b)_\b _\ba_\bs_\by_\bn_\bc_\b__\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b)\n o _\bp_\ba_\bu_\bs_\be_\b(_\b)_\b _\br_\be_\bs_\bu_\bm_\be_\b(_\b)_\b _\bi_\bs_\b__\bp_\ba_\bu_\bs_\be_\bd_\b(_\b)\n o _\bi_\bs_\b__\bd_\bh_\bt_\b__\br_\bu_\bn_\bn_\bi_\bn_\bg_\b(_\b)\n o _\bs_\be_\bt_\b__\bd_\bh_\bt_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b(_\b)\n o _\ba_\bd_\bd_\b__\bd_\bh_\bt_\b__\bn_\bo_\bd_\be_\b(_\b)\n o _\bd_\bh_\bt_\b__\bg_\be_\bt_\b__\bi_\bt_\be_\bm_\b(_\b)\n o _\bd_\bh_\bt_\b__\bg_\be_\bt_\b__\bi_\bt_\be_\bm_\b(_\b)\n o _\bd_\bh_\bt_\b__\bp_\bu_\bt_\b__\bi_\bt_\be_\bm_\b(_\b)\n@@ -24,37 +27,98 @@\n o _\bd_\bh_\bt_\b__\bg_\be_\bt_\b__\bp_\be_\be_\br_\bs_\b(_\b)_\b _\bd_\bh_\bt_\b__\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b(_\b)\n o _\bd_\bh_\bt_\b__\bl_\bi_\bv_\be_\b__\bn_\bo_\bd_\be_\bs_\b(_\b)\n o _\bd_\bh_\bt_\b__\bs_\ba_\bm_\bp_\bl_\be_\b__\bi_\bn_\bf_\bo_\bh_\ba_\bs_\bh_\be_\bs_\b(_\b)\n o _\bd_\bh_\bt_\b__\bd_\bi_\br_\be_\bc_\bt_\b__\br_\be_\bq_\bu_\be_\bs_\bt_\b(_\b)\n o _\ba_\bd_\bd_\b__\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\b(_\b)\n o _\bs_\be_\bt_\b__\bi_\bp_\b__\bf_\bi_\bl_\bt_\be_\br_\b(_\b)_\b _\bg_\be_\bt_\b__\bi_\bp_\b__\bf_\bi_\bl_\bt_\be_\br_\b(_\b)\n o _\bs_\be_\bt_\b__\bp_\bo_\br_\bt_\b__\bf_\bi_\bl_\bt_\be_\br_\b(_\b)\n- o _\bl_\bi_\bs_\bt_\be_\bn_\b__\bp_\bo_\br_\bt_\b(_\b)_\b _\bi_\bs_\b__\bl_\bi_\bs_\bt_\be_\bn_\bi_\bn_\bg_\b(_\b)_\b _\bs_\bs_\bl_\b__\bl_\bi_\bs_\bt_\be_\bn_\b__\bp_\bo_\br_\bt_\b(_\b)\n+ o _\bl_\bi_\bs_\bt_\be_\bn_\b__\bp_\bo_\br_\bt_\b(_\b)_\b _\bs_\bs_\bl_\b__\bl_\bi_\bs_\bt_\be_\bn_\b__\bp_\bo_\br_\bt_\b(_\b)_\b _\bi_\bs_\b__\bl_\bi_\bs_\bt_\be_\bn_\bi_\bn_\bg_\b(_\b)\n o _\bs_\be_\bt_\b__\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b__\bf_\bi_\bl_\bt_\be_\br_\b(_\b)_\b _\bg_\be_\bt_\b__\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b__\bf_\bi_\bl_\bt_\be_\br_\b(_\b)\n o _\bg_\be_\bt_\b__\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b__\bt_\by_\bp_\be_\b__\bf_\bi_\bl_\bt_\be_\br_\b(_\b)_\b _\bs_\be_\bt_\b__\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b__\bt_\by_\bp_\be_\b__\bf_\bi_\bl_\bt_\be_\br_\b(_\b)\n o _\bc_\br_\be_\ba_\bt_\be_\b__\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b(_\b)\n o _\bd_\be_\bl_\be_\bt_\be_\b__\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b(_\b)\n- o _\bs_\be_\bt_\b__\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b(_\b)_\b _\bg_\be_\bt_\b__\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b(_\b)\n+ o _\bg_\be_\bt_\b__\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b(_\b)_\b _\bs_\be_\bt_\b__\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b(_\b)\n o _\br_\be_\bm_\bo_\bv_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b)\n o _\ba_\bp_\bp_\bl_\by_\b__\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b(_\b)_\b _\bg_\be_\bt_\b__\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b(_\b)\n- o _\bp_\bo_\bp_\b__\ba_\bl_\be_\br_\bt_\bs_\b(_\b)_\b _\bs_\be_\bt_\b__\ba_\bl_\be_\br_\bt_\b__\bn_\bo_\bt_\bi_\bf_\by_\b(_\b)_\b _\bw_\ba_\bi_\bt_\b__\bf_\bo_\br_\b__\ba_\bl_\be_\br_\bt_\b(_\b)\n+ o _\bw_\ba_\bi_\bt_\b__\bf_\bo_\br_\b__\ba_\bl_\be_\br_\bt_\b(_\b)_\b _\bs_\be_\bt_\b__\ba_\bl_\be_\br_\bt_\b__\bn_\bo_\bt_\bi_\bf_\by_\b(_\b)_\b _\bp_\bo_\bp_\b__\ba_\bl_\be_\br_\bt_\bs_\b(_\b)\n o _\ba_\bd_\bd_\b__\bp_\bo_\br_\bt_\b__\bm_\ba_\bp_\bp_\bi_\bn_\bg_\b(_\b)_\b _\bd_\be_\bl_\be_\bt_\be_\b__\bp_\bo_\br_\bt_\b__\bm_\ba_\bp_\bp_\bi_\bn_\bg_\b(_\b)\n o _\br_\be_\bo_\bp_\be_\bn_\b__\bn_\be_\bt_\bw_\bo_\br_\bk_\b__\bs_\bo_\bc_\bk_\be_\bt_\bs_\b(_\b)\n o _\bn_\ba_\bt_\bi_\bv_\be_\b__\bh_\ba_\bn_\bd_\bl_\be_\b(_\b)\n * _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\br_\bo_\bx_\by\n- o _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\br_\bo_\bx_\by_\b(_\b)_\b _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b=_\b(_\b)_\b _\b~_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\br_\bo_\bx_\by_\b(_\b)\n+ o _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\br_\bo_\bx_\by_\b(_\b)_\b _\b~_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\br_\bo_\bx_\by_\b(_\b)_\b _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b=_\b(_\b)\n * _\bs_\be_\bs_\bs_\bi_\bo_\bn\n o _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b(_\b)\n o _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b(_\b)\n o _\b~_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b(_\b)\n o _\ba_\bb_\bo_\br_\bt_\b(_\b)\n- * _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs\n- o _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs_\b(_\b)\n- o _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs_\b(_\b)\n- * _\bw_\br_\bi_\bt_\be_\b__\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs_\b(_\b)_\b _\bw_\br_\bi_\bt_\be_\b__\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs_\b__\bb_\bu_\bf_\b(_\b)_\b _\br_\be_\ba_\bd_\b__\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs_\b(_\b)\n+ * _\bw_\br_\bi_\bt_\be_\b__\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs_\b(_\b)_\b _\br_\be_\ba_\bd_\b__\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs_\b(_\b)_\b _\bw_\br_\bi_\bt_\be_\b__\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs_\b__\bb_\bu_\bf_\b(_\b)\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs_\b._\bh_\bp_\bp\"\n+The _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs is a parameters pack for configuring the _\bs_\be_\bs_\bs_\bi_\bo_\bn before it's\n+started.\n+struct session_params\n+{\n+ s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs (settings_pack&& sp);\n+ s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs (settings_pack const& sp);\n+ s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs ();\n+ s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs (settings_pack const& sp\n+ , std::vector> exts);\n+ s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs (settings_pack&& sp\n+ , std::vector> exts);\n+\n+ settings_pack settings;\n+ std::vector> extensions;\n+ dht::dht_state dht_state;\n+ dht::dht_storage_constructor_type dht_storage_constructor;\n+ disk_io_constructor_type disk_io_constructor;\n+ std::map ext_state;\n+ libtorrent::ip_filter ip_filter;\n+};\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs(\b()\b) *\b**\b**\b**\b**\b*\n+s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs (settings_pack&& sp);\n+s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs (settings_pack const& sp);\n+s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs ();\n+This constructor can be used to start with the default plugins (ut_metadata,\n+ut_pex and smart_ban). Pass a _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk to set the initial settings when\n+the _\bs_\be_\bs_\bs_\bi_\bo_\bn starts.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs(\b()\b) *\b**\b**\b**\b**\b*\n+s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs (settings_pack const& sp\n+ , std::vector> exts);\n+s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs (settings_pack&& sp\n+ , std::vector> exts);\n+This constructor helps to configure the set of initial plugins to be added to\n+the _\bs_\be_\bs_\bs_\bi_\bo_\bn before it's started.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ settings\n+ The settings to configure the _\bs_\be_\bs_\bs_\bi_\bo_\bn with\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ extensions\n+ the plugins to add to the _\bs_\be_\bs_\bs_\bi_\bo_\bn as it is constructed\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ dht_state\n+ DHT node ID and node addresses to bootstrap the DHT with.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ dht_storage_constructor\n+ function object to construct the storage object for DHT items.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ disk_io_constructor\n+ function object to create the disk I/O subsystem. Defaults to\n+ default_disk_io_constructor.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ ext_state\n+ this container can be used by extensions/plugins to store settings. It's\n+ primarily here to make it convenient to save and restore state across\n+ sessions, using _\br_\be_\ba_\bd_\b__\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs_\b(_\b) and _\bw_\br_\bi_\bt_\be_\b__\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs_\b(_\b).\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ ip_filter\n+ the IP filter to use for the _\bs_\be_\bs_\bs_\bi_\bo_\bn. This restricts which peers are\n+ allowed to connect. As if passed to _\bs_\be_\bt_\b__\bi_\bp_\b__\bf_\bi_\bl_\bt_\be_\br_\b(_\b).\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* s\bse\bes\bss\bsi\bio\bon\bn_\b_h\bha\ban\bnd\bdl\ble\be *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bh_\ba_\bn_\bd_\bl_\be_\b._\bh_\bp_\bp\"\n this class provides a non-owning handle to a _\bs_\be_\bs_\bs_\bi_\bo_\bn and a subset of the\n interface of the _\bs_\be_\bs_\bs_\bi_\bo_\bn class. If the underlying _\bs_\be_\bs_\bs_\bi_\bo_\bn is destructed any\n handle to it will no longer be valid. _\bi_\bs_\b__\bv_\ba_\bl_\bi_\bd_\b(_\b) will return false and any\n operation on it will throw a system_error exception, with error code\n@@ -72,24 +136,24 @@\n void p\bpo\bos\bst\bt_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_u\bup\bpd\bda\bat\bte\bes\bs (status_flags_t flags = status_flags_t::all());\n void p\bpo\bos\bst\bt_\b_s\bse\bes\bss\bsi\bio\bon\bn_\b_s\bst\bta\bat\bts\bs ();\n void p\bpo\bos\bst\bt_\b_d\bdh\bht\bt_\b_s\bst\bta\bat\bts\bs ();\n void s\bse\bet\bt_\b_d\bdh\bht\bt_\b_s\bst\bta\bat\bte\be (dht::dht_state const& st);\n void s\bse\bet\bt_\b_d\bdh\bht\bt_\b_s\bst\bta\bat\bte\be (dht::dht_state&& st);\n torrent_handle f\bfi\bin\bnd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt (sha1_hash const& info_hash) const;\n std::vector g\bge\bet\bt_\b_t\bto\bor\brr\bre\ben\bnt\bts\bs () const;\n+ torrent_handle a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt (add_torrent_params const& params, error_code&\n+ec);\n torrent_handle a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt (add_torrent_params const& params);\n- torrent_handle a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt (add_torrent_params&& params, error_code& ec);\n void a\bas\bsy\byn\bnc\bc_\b_a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt (add_torrent_params const& params);\n+ torrent_handle a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt (add_torrent_params&& params, error_code& ec);\n void a\bas\bsy\byn\bnc\bc_\b_a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt (add_torrent_params&& params);\n- torrent_handle a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt (add_torrent_params const& params, error_code&\n-ec);\n torrent_handle a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt (add_torrent_params&& params);\n void p\bpa\bau\bus\bse\be ();\n- bool i\bis\bs_\b_p\bpa\bau\bus\bse\bed\bd () const;\n void r\bre\bes\bsu\bum\bme\be ();\n+ bool i\bis\bs_\b_p\bpa\bau\bus\bse\bed\bd () const;\n bool i\bis\bs_\b_d\bdh\bht\bt_\b_r\bru\bun\bnn\bni\bin\bng\bg () const;\n void s\bse\bet\bt_\b_d\bdh\bht\bt_\b_s\bst\bto\bor\bra\bag\bge\be (dht::dht_storage_constructor_type sc);\n void a\bad\bdd\bd_\b_d\bdh\bht\bt_\b_n\bno\bod\bde\be (std::pair const& node);\n void d\bdh\bht\bt_\b_g\bge\bet\bt_\b_i\bit\bte\bem\bm (sha1_hash const& target);\n void d\bdh\bht\bt_\b_g\bge\bet\bt_\b_i\bit\bte\bem\bm (std::array key\n , std::string salt = std::string());\n sha1_hash d\bdh\bht\bt_\b_p\bpu\but\bt_\b_i\bit\bte\bem\bm (entry data);\n@@ -104,38 +168,38 @@\n void d\bdh\bht\bt_\b_s\bsa\bam\bmp\bpl\ble\be_\b_i\bin\bnf\bfo\boh\bha\bas\bsh\bhe\bes\bs (udp::endpoint const& ep, sha1_hash const&\n target);\n void d\bdh\bht\bt_\b_d\bdi\bir\bre\bec\bct\bt_\b_r\bre\beq\bqu\bue\bes\bst\bt (udp::endpoint const& ep, entry const& e,\n client_data_t userdata = {});\n void a\bad\bdd\bd_\b_e\bex\bxt\bte\ben\bns\bsi\bio\bon\bn (std::function(\n torrent_handle const&, client_data_t)> ext);\n void a\bad\bdd\bd_\b_e\bex\bxt\bte\ben\bns\bsi\bio\bon\bn (std::shared_ptr ext);\n- void s\bse\bet\bt_\b_i\bip\bp_\b_f\bfi\bil\blt\bte\ber\br (ip_filter f);\n ip_filter g\bge\bet\bt_\b_i\bip\bp_\b_f\bfi\bil\blt\bte\ber\br () const;\n+ void s\bse\bet\bt_\b_i\bip\bp_\b_f\bfi\bil\blt\bte\ber\br (ip_filter f);\n void s\bse\bet\bt_\b_p\bpo\bor\brt\bt_\b_f\bfi\bil\blt\bte\ber\br (port_filter const& f);\n- unsigned short s\bss\bsl\bl_\b_l\bli\bis\bst\bte\ben\bn_\b_p\bpo\bor\brt\bt () const;\n unsigned short l\bli\bis\bst\bte\ben\bn_\b_p\bpo\bor\brt\bt () const;\n+ unsigned short s\bss\bsl\bl_\b_l\bli\bis\bst\bte\ben\bn_\b_p\bpo\bor\brt\bt () const;\n bool i\bis\bs_\b_l\bli\bis\bst\bte\ben\bni\bin\bng\bg () const;\n void s\bse\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_f\bfi\bil\blt\bte\ber\br (ip_filter const& f);\n ip_filter g\bge\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_f\bfi\bil\blt\bte\ber\br () const;\n void s\bse\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_t\bty\byp\bpe\be_\b_f\bfi\bil\blt\bte\ber\br (peer_class_type_filter const& f);\n peer_class_type_filter g\bge\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_t\bty\byp\bpe\be_\b_f\bfi\bil\blt\bte\ber\br () const;\n peer_class_t c\bcr\bre\bea\bat\bte\be_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs (char const* name);\n void d\bde\bel\ble\bet\bte\be_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs (peer_class_t cid);\n- peer_class_info g\bge\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs (peer_class_t cid) const;\n void s\bse\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs (peer_class_t cid, peer_class_info const& pci);\n+ peer_class_info g\bge\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs (peer_class_t cid) const;\n void r\bre\bem\bmo\bov\bve\be_\b_t\bto\bor\brr\bre\ben\bnt\bt (const torrent_handle&, remove_flags_t = {});\n void a\bap\bpp\bpl\bly\by_\b_s\bse\bet\btt\bti\bin\bng\bgs\bs (settings_pack&&);\n- void a\bap\bpp\bpl\bly\by_\b_s\bse\bet\btt\bti\bin\bng\bgs\bs (settings_pack const&);\n settings_pack g\bge\bet\bt_\b_s\bse\bet\btt\bti\bin\bng\bgs\bs () const;\n- void s\bse\bet\bt_\b_a\bal\ble\ber\brt\bt_\b_n\bno\bot\bti\bif\bfy\by (std::function const& fun);\n- void p\bpo\bop\bp_\b_a\bal\ble\ber\brt\bts\bs (std::vector* alerts);\n+ void a\bap\bpp\bpl\bly\by_\b_s\bse\bet\btt\bti\bin\bng\bgs\bs (settings_pack const&);\n alert* w\bwa\bai\bit\bt_\b_f\bfo\bor\br_\b_a\bal\ble\ber\brt\bt (time_duration max_wait);\n- void d\bde\bel\ble\bet\bte\be_\b_p\bpo\bor\brt\bt_\b_m\bma\bap\bpp\bpi\bin\bng\bg (port_mapping_t handle);\n+ void p\bpo\bop\bp_\b_a\bal\ble\ber\brt\bts\bs (std::vector* alerts);\n+ void s\bse\bet\bt_\b_a\bal\ble\ber\brt\bt_\b_n\bno\bot\bti\bif\bfy\by (std::function const& fun);\n std::vector a\bad\bdd\bd_\b_p\bpo\bor\brt\bt_\b_m\bma\bap\bpp\bpi\bin\bng\bg (portmap_protocol t, int\n external_port, int local_port);\n+ void d\bde\bel\ble\bet\bte\be_\b_p\bpo\bor\brt\bt_\b_m\bma\bap\bpp\bpi\bin\bng\bg (port_mapping_t handle);\n void r\bre\beo\bop\bpe\ben\bn_\b_n\bne\bet\btw\bwo\bor\brk\bk_\b_s\bso\boc\bck\bke\bet\bts\bs (reopen_network_flags_t options =\n reopen_map_ports);\n std::shared_ptr n\bna\bat\bti\biv\bve\be_\b_h\bha\ban\bnd\bdl\ble\be () const;\n \n static constexpr save_state_flags_t s\bsa\bav\bve\be_\b_s\bse\bet\btt\bti\bin\bng\bgs\bs = 0_bit;\n static constexpr save_state_flags_t s\bsa\bav\bve\be_\b_d\bdh\bht\bt_\b_s\bst\bta\bat\bte\be = 2_bit;\n static constexpr save_state_flags_t s\bsa\bav\bve\be_\b_e\bex\bxt\bte\ben\bns\bsi\bio\bon\bn_\b_s\bst\bta\bat\bte\be = 11_bit;\n@@ -235,20 +299,20 @@\n find_torrent() looks for a torrent with the given info-hash. In case there is\n such a torrent in the _\bs_\be_\bs_\bs_\bi_\bo_\bn, a _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be to that torrent is returned. In\n case the torrent cannot be found, an invalid _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be is returned.\n See torrent_handle::is_valid() to know if the torrent was found or not.\n get_torrents() returns a vector of torrent_handles to all the torrents\n currently in the _\bs_\be_\bs_\bs_\bi_\bo_\bn.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* a\bas\bsy\byn\bnc\bc_\b_a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt(\b()\b) a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt(\b()\b) *\b**\b**\b**\b**\b*\n+*\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt(\b()\b) a\bas\bsy\byn\bnc\bc_\b_a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt(\b()\b) *\b**\b**\b**\b**\b*\n+torrent_handle a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt (add_torrent_params const& params, error_code& ec);\n torrent_handle a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt (add_torrent_params const& params);\n-torrent_handle a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt (add_torrent_params&& params, error_code& ec);\n void a\bas\bsy\byn\bnc\bc_\b_a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt (add_torrent_params const& params);\n+torrent_handle a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt (add_torrent_params&& params, error_code& ec);\n void a\bas\bsy\byn\bnc\bc_\b_a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt (add_torrent_params&& params);\n-torrent_handle a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt (add_torrent_params const& params, error_code& ec);\n torrent_handle a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt (add_torrent_params&& params);\n You add torrents through the _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b) function where you give an object\n with all the parameters. The _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b) overloads will block until the\n torrent has been added (or failed to be added) and returns an error code and a\n _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be. In order to add torrents more efficiently, consider using\n _\ba_\bs_\by_\bn_\bc_\b__\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b) which returns immediately, without waiting for the torrent\n to add. Notification of the torrent being added is sent as _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\ba_\bl_\be_\br_\bt.\n@@ -272,16 +336,16 @@\n torrent_flags::upload_mode flag.\n Special consideration has to be taken when adding hybrid torrents (i.e.\n torrents that are BitTorrent v2 torrents that are backwards compatible with\n v1). For more details, see _\bB_\bi_\bt_\bT_\bo_\br_\br_\be_\bn_\bt_\b _\bv_\b2_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\bs.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* p\bpa\bau\bus\bse\be(\b()\b) r\bre\bes\bsu\bum\bme\be(\b()\b) i\bis\bs_\b_p\bpa\bau\bus\bse\bed\bd(\b()\b) *\b**\b**\b**\b**\b*\n void p\bpa\bau\bus\bse\be ();\n-bool i\bis\bs_\b_p\bpa\bau\bus\bse\bed\bd () const;\n void r\bre\bes\bsu\bum\bme\be ();\n+bool i\bis\bs_\b_p\bpa\bau\bus\bse\bed\bd () const;\n Pausing the _\bs_\be_\bs_\bs_\bi_\bo_\bn has the same effect as pausing every torrent in it, except\n that torrents will not be resumed by the auto-manage mechanism. Resuming will\n restore the torrents to their previous paused state. i.e. the _\bs_\be_\bs_\bs_\bi_\bo_\bn pause\n state is separate from the torrent pause state. A torrent is inactive if it is\n paused or if the _\bs_\be_\bs_\bs_\bi_\bo_\bn is paused.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* i\bis\bs_\b_d\bdh\bht\bt_\b_r\bru\bun\bnn\bni\bin\bng\bg(\b()\b) *\b**\b**\b**\b**\b*\n@@ -426,16 +490,16 @@\n A _\bp_\bl_\bu_\bg_\bi_\bn that, with a small overhead, can ban peers that sends bad data\n with very high accuracy. Should eliminate most problems on poisoned\n torrents.\n #include \n ses.add_extension(<::create_smart_ban_plugin);\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* s\bse\bet\bt_\b_i\bip\bp_\b_f\bfi\bil\blt\bte\ber\br(\b()\b) g\bge\bet\bt_\b_i\bip\bp_\b_f\bfi\bil\blt\bte\ber\br(\b()\b) *\b**\b**\b**\b**\b*\n-void s\bse\bet\bt_\b_i\bip\bp_\b_f\bfi\bil\blt\bte\ber\br (ip_filter f);\n ip_filter g\bge\bet\bt_\b_i\bip\bp_\b_f\bfi\bil\blt\bte\ber\br () const;\n+void s\bse\bet\bt_\b_i\bip\bp_\b_f\bfi\bil\blt\bte\ber\br (ip_filter f);\n Sets a filter that will be used to reject and accept incoming as well as\n outgoing connections based on their originating ip address. The default filter\n will allow connections to any ip address. To build a set of rules for which\n addresses are accepted and not, see _\bi_\bp_\b__\bf_\bi_\bl_\bt_\be_\br.\n Each time a peer is blocked because of the IP filter, a _\bp_\be_\be_\br_\b__\bb_\bl_\bo_\bc_\bk_\be_\bd_\b__\ba_\bl_\be_\br_\bt is\n generated. get_ip_filter() Returns the _\bi_\bp_\b__\bf_\bi_\bl_\bt_\be_\br currently in the _\bs_\be_\bs_\bs_\bi_\bo_\bn. See\n _\bi_\bp_\b__\bf_\bi_\bl_\bt_\be_\br.\n@@ -443,17 +507,17 @@\n *\b**\b**\b**\b**\b* s\bse\bet\bt_\b_p\bpo\bor\brt\bt_\b_f\bfi\bil\blt\bte\ber\br(\b()\b) *\b**\b**\b**\b**\b*\n void s\bse\bet\bt_\b_p\bpo\bor\brt\bt_\b_f\bfi\bil\blt\bte\ber\br (port_filter const& f);\n apply _\bp_\bo_\br_\bt_\b__\bf_\bi_\bl_\bt_\be_\br f to incoming and outgoing peers. a port filter will reject\n making outgoing peer connections to certain remote ports. The main intention is\n to be able to avoid triggering certain anti-virus software by connecting to\n SMTP, FTP ports.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* l\bli\bis\bst\bte\ben\bn_\b_p\bpo\bor\brt\bt(\b()\b) i\bis\bs_\b_l\bli\bis\bst\bte\ben\bni\bin\bng\bg(\b()\b) s\bss\bsl\bl_\b_l\bli\bis\bst\bte\ben\bn_\b_p\bpo\bor\brt\bt(\b()\b) *\b**\b**\b**\b**\b*\n-unsigned short s\bss\bsl\bl_\b_l\bli\bis\bst\bte\ben\bn_\b_p\bpo\bor\brt\bt () const;\n+*\b**\b**\b**\b**\b* l\bli\bis\bst\bte\ben\bn_\b_p\bpo\bor\brt\bt(\b()\b) s\bss\bsl\bl_\b_l\bli\bis\bst\bte\ben\bn_\b_p\bpo\bor\brt\bt(\b()\b) i\bis\bs_\b_l\bli\bis\bst\bte\ben\bni\bin\bng\bg(\b()\b) *\b**\b**\b**\b**\b*\n unsigned short l\bli\bis\bst\bte\ben\bn_\b_p\bpo\bor\brt\bt () const;\n+unsigned short s\bss\bsl\bl_\b_l\bli\bis\bst\bte\ben\bn_\b_p\bpo\bor\brt\bt () const;\n bool i\bis\bs_\b_l\bli\bis\bst\bte\ben\bni\bin\bng\bg () const;\n is_listening() will tell you whether or not the _\bs_\be_\bs_\bs_\bi_\bo_\bn has successfully opened\n a listening port. If it hasn't, this function will return false, and then you\n can set a new _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk_\b:_\b:_\bl_\bi_\bs_\bt_\be_\bn_\b__\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be_\bs to try another interface and\n port to bind to.\n listen_port() returns the port we ended up listening on.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n@@ -518,17 +582,17 @@\n Since peer classes are reference counted, this function will not remove the\n peer class if it's still assigned to torrents or peers. It will however remove\n it once the last peer and torrent drops their references to it.\n There is no need to call this function for custom peer classes. All peer\n classes will be properly destructed when the _\bs_\be_\bs_\bs_\bi_\bo_\bn object destructs.\n For more information on peer classes, see _\bp_\be_\be_\br_\b _\bc_\bl_\ba_\bs_\bs_\be_\bs.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* s\bse\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs(\b()\b) g\bge\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs(\b()\b) *\b**\b**\b**\b**\b*\n-peer_class_info g\bge\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs (peer_class_t cid) const;\n+*\b**\b**\b**\b**\b* g\bge\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs(\b()\b) s\bse\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs(\b()\b) *\b**\b**\b**\b**\b*\n void s\bse\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs (peer_class_t cid, peer_class_info const& pci);\n+peer_class_info g\bge\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs (peer_class_t cid) const;\n These functions queries information from a peer class and updates the\n configuration of a peer class, respectively.\n cid must refer to an existing peer class. If it does not, the return value of\n get_peer_class() is undefined.\n set_peer_class() sets all the information in the _\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b__\bi_\bn_\bf_\bo object in the\n specified peer class. There is no option to only update a single property.\n A peer or torrent belonging to more than one class, the highest priority among\n@@ -560,24 +624,24 @@\n download queue is vacated and every subsequent torrent in the queue has their\n queue positions updated. This can potentially cause a large state_update to be\n posted. When removing all torrents, it is advised to remove them from the back\n of the queue, to minimize the shifting.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* a\bap\bpp\bpl\bly\by_\b_s\bse\bet\btt\bti\bin\bng\bgs\bs(\b()\b) g\bge\bet\bt_\b_s\bse\bet\btt\bti\bin\bng\bgs\bs(\b()\b) *\b**\b**\b**\b**\b*\n void a\bap\bpp\bpl\bly\by_\b_s\bse\bet\btt\bti\bin\bng\bgs\bs (settings_pack&&);\n-void a\bap\bpp\bpl\bly\by_\b_s\bse\bet\btt\bti\bin\bng\bgs\bs (settings_pack const&);\n settings_pack g\bge\bet\bt_\b_s\bse\bet\btt\bti\bin\bng\bgs\bs () const;\n+void a\bap\bpp\bpl\bly\by_\b_s\bse\bet\btt\bti\bin\bng\bgs\bs (settings_pack const&);\n Applies the settings specified by the _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk s. This is an asynchronous\n operation that will return immediately and actually apply the settings to the\n main thread of libtorrent some time later.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* p\bpo\bop\bp_\b_a\bal\ble\ber\brt\bts\bs(\b()\b) s\bse\bet\bt_\b_a\bal\ble\ber\brt\bt_\b_n\bno\bot\bti\bif\bfy\by(\b()\b) w\bwa\bai\bit\bt_\b_f\bfo\bor\br_\b_a\bal\ble\ber\brt\bt(\b()\b) *\b**\b**\b**\b**\b*\n-void s\bse\bet\bt_\b_a\bal\ble\ber\brt\bt_\b_n\bno\bot\bti\bif\bfy\by (std::function const& fun);\n-void p\bpo\bop\bp_\b_a\bal\ble\ber\brt\bts\bs (std::vector* alerts);\n+*\b**\b**\b**\b**\b* w\bwa\bai\bit\bt_\b_f\bfo\bor\br_\b_a\bal\ble\ber\brt\bt(\b()\b) s\bse\bet\bt_\b_a\bal\ble\ber\brt\bt_\b_n\bno\bot\bti\bif\bfy\by(\b()\b) p\bpo\bop\bp_\b_a\bal\ble\ber\brt\bts\bs(\b()\b) *\b**\b**\b**\b**\b*\n alert* w\bwa\bai\bit\bt_\b_f\bfo\bor\br_\b_a\bal\ble\ber\brt\bt (time_duration max_wait);\n+void p\bpo\bop\bp_\b_a\bal\ble\ber\brt\bts\bs (std::vector* alerts);\n+void s\bse\bet\bt_\b_a\bal\ble\ber\brt\bt_\b_n\bno\bot\bti\bif\bfy\by (std::function const& fun);\n Alerts is the main mechanism for libtorrent to report errors and events.\n pop_alerts fills in the vector passed to it with pointers to new alerts. The\n _\bs_\be_\bs_\bs_\bi_\bo_\bn still owns these alerts and they will stay valid until the next time\n pop_alerts is called. You may not delete the _\ba_\bl_\be_\br_\bt objects.\n It is safe to call pop_alerts from multiple different threads, as long as the\n alerts themselves are not accessed once another thread calls pop_alerts. Doing\n this requires manual synchronization between the popping threads.\n@@ -617,17 +681,17 @@\n block. It should not perform any expensive work. It really should just notify\n the main application thread.\n The type of an _\ba_\bl_\be_\br_\bt is returned by the polymorphic function alert::type() but\n can also be queries from a concrete type via T::alert_type, as a static\n constant.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_p\bpo\bor\brt\bt_\b_m\bma\bap\bpp\bpi\bin\bng\bg(\b()\b) d\bde\bel\ble\bet\bte\be_\b_p\bpo\bor\brt\bt_\b_m\bma\bap\bpp\bpi\bin\bng\bg(\b()\b) *\b**\b**\b**\b**\b*\n-void d\bde\bel\ble\bet\bte\be_\b_p\bpo\bor\brt\bt_\b_m\bma\bap\bpp\bpi\bin\bng\bg (port_mapping_t handle);\n std::vector a\bad\bdd\bd_\b_p\bpo\bor\brt\bt_\b_m\bma\bap\bpp\bpi\bin\bng\bg (portmap_protocol t, int\n external_port, int local_port);\n+void d\bde\bel\ble\bet\bte\be_\b_p\bpo\bor\brt\bt_\b_m\bma\bap\bpp\bpi\bin\bng\bg (port_mapping_t handle);\n add_port_mapping adds one or more port forwards on UPnP and/or NAT-PMP,\n whichever is enabled. A mapping is created for each listen socket in the\n _\bs_\be_\bs_\bs_\bi_\bo_\bn. The return values are all handles referring to the port mappings that\n were just created. Pass them to _\bd_\be_\bl_\be_\bt_\be_\b__\bp_\bo_\br_\bt_\b__\bm_\ba_\bp_\bp_\bi_\bn_\bg_\b(_\b) to remove them.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* r\bre\beo\bop\bpe\ben\bn_\b_n\bne\bet\btw\bwo\bor\brk\bk_\b_s\bso\boc\bck\bke\bet\bts\bs(\b()\b) *\b**\b**\b**\b**\b*\n void r\bre\beo\bop\bpe\ben\bn_\b_n\bne\bet\btw\bwo\bor\brk\bk_\b_s\bso\boc\bck\bke\bet\bts\bs (reopen_network_flags_t options =\n@@ -683,29 +747,29 @@\n _\bs_\be_\bs_\bs_\bi_\bo_\bn destruction is explicitly initiated, this holder is used to synchronize\n the completion of the shutdown. The lifetime of this object may outlive\n _\bs_\be_\bs_\bs_\bi_\bo_\bn, causing the _\bs_\be_\bs_\bs_\bi_\bo_\bn destructor to not block. The _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\br_\bo_\bx_\by\n destructor will block however, until the underlying _\bs_\be_\bs_\bs_\bi_\bo_\bn is done shutting\n down.\n struct session_proxy\n {\n- s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by ();\n- s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by (session_proxy&&) noexcept;\n session_proxy& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (session_proxy const&) &;\n- session_proxy& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (session_proxy&&) & noexcept;\n- ~\b~s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by ();\n s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by (session_proxy const&);\n+ s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by (session_proxy&&) noexcept;\n+ ~\b~s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by ();\n+ session_proxy& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (session_proxy&&) & noexcept;\n+ s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by ();\n };\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by(\b()\b) o\bop\bpe\ber\bra\bat\bto\bor\br=\b=(\b()\b) ~\b~s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by(\b()\b) *\b**\b**\b**\b**\b*\n-s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by ();\n-s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by (session_proxy&&) noexcept;\n+*\b**\b**\b**\b**\b* s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by(\b()\b) ~\b~s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by(\b()\b) o\bop\bpe\ber\bra\bat\bto\bor\br=\b=(\b()\b) *\b**\b**\b**\b**\b*\n session_proxy& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (session_proxy const&) &;\n-session_proxy& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (session_proxy&&) & noexcept;\n-~\b~s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by ();\n s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by (session_proxy const&);\n+s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by (session_proxy&&) noexcept;\n+~\b~s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by ();\n+session_proxy& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (session_proxy&&) & noexcept;\n+s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by ();\n default constructor, does not refer to any _\bs_\be_\bs_\bs_\bi_\bo_\bn implementation object.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* s\bse\bes\bss\bsi\bio\bon\bn *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b._\bh_\bp_\bp\"\n The _\bs_\be_\bs_\bs_\bi_\bo_\bn holds all state that spans multiple torrents. Among other things it\n runs the network loop and manages all torrents. Once it's created, the _\bs_\be_\bs_\bs_\bi_\bo_\bn\n object will spawn the main thread that will do all the work. The main thread\n@@ -713,47 +777,47 @@\n You have some control over _\bs_\be_\bs_\bs_\bi_\bo_\bn configuration through the session_handle::\n apply_settings() member function. To change one or more configuration options,\n create a _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk. object and fill it with the settings to be set and pass\n it in to session::apply_settings().\n see _\ba_\bp_\bp_\bl_\by_\b__\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b(_\b).\n struct session : session_handle\n {\n- explicit s\bse\bes\bss\bsi\bio\bon\bn (session_params const& params);\n- s\bse\bes\bss\bsi\bio\bon\bn (session_params const& params, session_flags_t flags);\n- s\bse\bes\bss\bsi\bio\bon\bn ();\n s\bse\bes\bss\bsi\bio\bon\bn (session_params&& params, session_flags_t flags);\n explicit s\bse\bes\bss\bsi\bio\bon\bn (session_params&& params);\n+ s\bse\bes\bss\bsi\bio\bon\bn ();\n+ s\bse\bes\bss\bsi\bio\bon\bn (session_params const& params, session_flags_t flags);\n+ explicit s\bse\bes\bss\bsi\bio\bon\bn (session_params const& params);\n+ s\bse\bes\bss\bsi\bio\bon\bn (session_params const& params, io_context& ios);\n+ s\bse\bes\bss\bsi\bio\bon\bn (session_params&& params, io_context& ios, session_flags_t);\n s\bse\bes\bss\bsi\bio\bon\bn (session_params&& params, io_context& ios);\n s\bse\bes\bss\bsi\bio\bon\bn (session_params const& params, io_context& ios, session_flags_t);\n- s\bse\bes\bss\bsi\bio\bon\bn (session_params&& params, io_context& ios, session_flags_t);\n- s\bse\bes\bss\bsi\bio\bon\bn (session_params const& params, io_context& ios);\n ~\b~s\bse\bes\bss\bsi\bio\bon\bn ();\n session_proxy a\bab\bbo\bor\brt\bt ();\n };\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* s\bse\bes\bss\bsi\bio\bon\bn(\b()\b) *\b**\b**\b**\b**\b*\n-explicit s\bse\bes\bss\bsi\bio\bon\bn (session_params const& params);\n-s\bse\bes\bss\bsi\bio\bon\bn (session_params const& params, session_flags_t flags);\n-s\bse\bes\bss\bsi\bio\bon\bn ();\n s\bse\bes\bss\bsi\bio\bon\bn (session_params&& params, session_flags_t flags);\n explicit s\bse\bes\bss\bsi\bio\bon\bn (session_params&& params);\n+s\bse\bes\bss\bsi\bio\bon\bn ();\n+s\bse\bes\bss\bsi\bio\bon\bn (session_params const& params, session_flags_t flags);\n+explicit s\bse\bes\bss\bsi\bio\bon\bn (session_params const& params);\n Constructs the _\bs_\be_\bs_\bs_\bi_\bo_\bn objects which acts as the container of torrents. In\n order to avoid a race condition between starting the _\bs_\be_\bs_\bs_\bi_\bo_\bn and configuring\n it, you can pass in a _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs object. Its settings will take effect\n before the _\bs_\be_\bs_\bs_\bi_\bo_\bn starts up.\n The overloads taking flags can be used to start a _\bs_\be_\bs_\bs_\bi_\bo_\bn in paused mode (by\n passing in session::paused). Note that add_default_plugins do not have an\n affect on constructors that take a _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs object. It already contains\n the plugins to use.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* s\bse\bes\bss\bsi\bio\bon\bn(\b()\b) *\b**\b**\b**\b**\b*\n+s\bse\bes\bss\bsi\bio\bon\bn (session_params const& params, io_context& ios);\n+s\bse\bes\bss\bsi\bio\bon\bn (session_params&& params, io_context& ios, session_flags_t);\n s\bse\bes\bss\bsi\bio\bon\bn (session_params&& params, io_context& ios);\n s\bse\bes\bss\bsi\bio\bon\bn (session_params const& params, io_context& ios, session_flags_t);\n-s\bse\bes\bss\bsi\bio\bon\bn (session_params&& params, io_context& ios, session_flags_t);\n-s\bse\bes\bss\bsi\bio\bon\bn (session_params const& params, io_context& ios);\n Overload of the constructor that takes an external io_context to run the\n _\bs_\be_\bs_\bs_\bi_\bo_\bn object on. This is primarily useful for tests that may want to run\n multiple sessions on a single io_context, or low resource systems where\n additional threads are expensive and sharing an io_context with other events is\n fine.\n Warning\n The _\bs_\be_\bs_\bs_\bi_\bo_\bn object does not cleanly terminate with an external io_context. The\n@@ -781,89 +845,25 @@\n then synchronize the threads. So, the destruction of the _\bs_\be_\bs_\bs_\bi_\bo_\bn is performed\n from the session destructor call until the session_proxy destructor call. The\n session_proxy does not have any operations on it (since the _\bs_\be_\bs_\bs_\bi_\bo_\bn is being\n closed down, no operations are allowed on it). The only valid operation is\n calling the destructor:\n struct session_proxy {};\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs_\b._\bh_\bp_\bp\"\n-The _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs is a parameters pack for configuring the _\bs_\be_\bs_\bs_\bi_\bo_\bn before it's\n-started.\n-struct session_params\n-{\n- s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs ();\n- s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs (settings_pack&& sp);\n- s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs (settings_pack const& sp);\n- s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs (settings_pack&& sp\n- , std::vector> exts);\n- s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs (settings_pack const& sp\n- , std::vector> exts);\n-\n- settings_pack settings;\n- std::vector> extensions;\n- dht::dht_state dht_state;\n- dht::dht_storage_constructor_type dht_storage_constructor;\n- disk_io_constructor_type disk_io_constructor;\n- std::map ext_state;\n- libtorrent::ip_filter ip_filter;\n-};\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs(\b()\b) *\b**\b**\b**\b**\b*\n-s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs ();\n-s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs (settings_pack&& sp);\n-s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs (settings_pack const& sp);\n-This constructor can be used to start with the default plugins (ut_metadata,\n-ut_pex and smart_ban). Pass a _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk to set the initial settings when\n-the _\bs_\be_\bs_\bs_\bi_\bo_\bn starts.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs(\b()\b) *\b**\b**\b**\b**\b*\n-s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs (settings_pack&& sp\n- , std::vector> exts);\n-s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs (settings_pack const& sp\n- , std::vector> exts);\n-This constructor helps to configure the set of initial plugins to be added to\n-the _\bs_\be_\bs_\bs_\bi_\bo_\bn before it's started.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- settings\n- The settings to configure the _\bs_\be_\bs_\bs_\bi_\bo_\bn with\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- extensions\n- the plugins to add to the _\bs_\be_\bs_\bs_\bi_\bo_\bn as it is constructed\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- dht_state\n- DHT node ID and node addresses to bootstrap the DHT with.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- dht_storage_constructor\n- function object to construct the storage object for DHT items.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- disk_io_constructor\n- function object to create the disk I/O subsystem. Defaults to\n- default_disk_io_constructor.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- ext_state\n- this container can be used by extensions/plugins to store settings. It's\n- primarily here to make it convenient to save and restore state across\n- sessions, using _\br_\be_\ba_\bd_\b__\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs_\b(_\b) and _\bw_\br_\bi_\bt_\be_\b__\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs_\b(_\b).\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- ip_filter\n- the IP filter to use for the _\bs_\be_\bs_\bs_\bi_\bo_\bn. This restricts which peers are\n- allowed to connect. As if passed to _\bs_\be_\bt_\b__\bi_\bp_\b__\bf_\bi_\bl_\bt_\be_\br_\b(_\b).\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* w\bwr\bri\bit\bte\be_\b_s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs(\b()\b) w\bwr\bri\bit\bte\be_\b_s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs_\b_b\bbu\buf\bf(\b()\b) r\bre\bea\bad\bd_\b_s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs(\b()\b)\n+*\b**\b**\b**\b**\b**\b* w\bwr\bri\bit\bte\be_\b_s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs(\b()\b) r\bre\bea\bad\bd_\b_s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs(\b()\b) w\bwr\bri\bit\bte\be_\b_s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs_\b_b\bbu\buf\bf(\b()\b)\n *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs_\b._\bh_\bp_\bp\"\n std::vector w\bwr\bri\bit\bte\be_\b_s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs_\b_b\bbu\buf\bf (session_params const& sp\n , save_state_flags_t flags = save_state_flags_t::all());\n entry w\bwr\bri\bit\bte\be_\b_s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs (session_params const& sp\n , save_state_flags_t flags = save_state_flags_t::all());\n-session_params r\bre\bea\bad\bd_\b_s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs (span buf\n- , save_state_flags_t flags = save_state_flags_t::all());\n session_params r\bre\bea\bad\bd_\b_s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs (bdecode_node const& e\n , save_state_flags_t flags = save_state_flags_t::all());\n+session_params r\bre\bea\bad\bd_\b_s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs (span buf\n+ , save_state_flags_t flags = save_state_flags_t::all());\n These functions serialize and de-serialize a session_params object to and from\n bencoded form. The _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs object is used to initialize a new _\bs_\be_\bs_\bs_\bi_\bo_\bn\n using the state from a previous one (or by programmatically configure the\n _\bs_\be_\bs_\bs_\bi_\bo_\bn up-front). The flags parameter can be used to only save and load\n certain aspects of the session's state. The _buf suffix indicates the function\n operates on buffer rather than the bencoded structure. The torrents in a\n _\bs_\be_\bs_\bs_\bi_\bo_\bn are not part of the _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs state, they have to be restored\n"}]}, {"source1": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Settings.html", "source2": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Settings.html", "unified_diff": "@@ -29,15 +29,15 @@\n \n \n

    home

    \n \n

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

    \n

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

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

    set_bool() set_str() set_int()

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

    set_str() set_bool() set_int()

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

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

    \n [report issue]
    \n
    \n

    has_val()

    \n@@ -4727,17 +4727,17 @@\n

    clear a specific setting from the pack

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

    get_str() get_bool() get_int()

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

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

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

    min_memory_usage() high_performance_seed()

    \n-

    Declared in "libtorrent/session.hpp"

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

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

    \n-

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

    \n-

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

    \n-

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

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

    name_for_setting() setting_by_name()

    \n-

    Declared in "libtorrent/settings_pack.hpp"

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

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

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

    default_settings()

    \n-

    Declared in "libtorrent/settings_pack.hpp"

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

    returns a settings_pack with every setting set to its default value

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

    generate_fingerprint()

    \n

    Declared in "libtorrent/fingerprint.hpp"

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

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

    \n

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

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

    high_performance_seed() min_memory_usage()

    \n+

    Declared in "libtorrent/session.hpp"

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

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

    \n+

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

    \n+

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

    \n+

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

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

    name_for_setting() setting_by_name()

    \n+

    Declared in "libtorrent/settings_pack.hpp"

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

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

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

    default_settings()

    \n+

    Declared in "libtorrent/settings_pack.hpp"

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

    returns a settings_pack with every setting set to its default value

    \n
    \n \n
    \n
    \n
    \n
    \n
    \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,32 +1,32 @@\n >\n _\b[_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b _\bl_\bo_\bg_\bo_\b]\n V\bVe\ber\brs\bsi\bio\bon\bn:\b: 2.0.11\n _\bh_\bo_\bm_\be\n Table of contents\n * _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk\n- o _\bs_\be_\bt_\b__\bb_\bo_\bo_\bl_\b(_\b)_\b _\bs_\be_\bt_\b__\bs_\bt_\br_\b(_\b)_\b _\bs_\be_\bt_\b__\bi_\bn_\bt_\b(_\b)\n+ o _\bs_\be_\bt_\b__\bs_\bt_\br_\b(_\b)_\b _\bs_\be_\bt_\b__\bb_\bo_\bo_\bl_\b(_\b)_\b _\bs_\be_\bt_\b__\bi_\bn_\bt_\b(_\b)\n o _\bh_\ba_\bs_\b__\bv_\ba_\bl_\b(_\b)\n o _\bc_\bl_\be_\ba_\br_\b(_\b)\n o _\bc_\bl_\be_\ba_\br_\b(_\b)\n o _\bg_\be_\bt_\b__\bs_\bt_\br_\b(_\b)_\b _\bg_\be_\bt_\b__\bb_\bo_\bo_\bl_\b(_\b)_\b _\bg_\be_\bt_\b__\bi_\bn_\bt_\b(_\b)\n o _\be_\bn_\bu_\bm_\b _\bt_\by_\bp_\be_\b__\bb_\ba_\bs_\be_\bs\n o _\be_\bn_\bu_\bm_\b _\bm_\bm_\ba_\bp_\b__\bw_\br_\bi_\bt_\be_\b__\bm_\bo_\bd_\be_\b__\bt\n o _\be_\bn_\bu_\bm_\b _\bs_\bu_\bg_\bg_\be_\bs_\bt_\b__\bm_\bo_\bd_\be_\b__\bt\n o _\be_\bn_\bu_\bm_\b _\bc_\bh_\bo_\bk_\bi_\bn_\bg_\b__\ba_\bl_\bg_\bo_\br_\bi_\bt_\bh_\bm_\b__\bt\n o _\be_\bn_\bu_\bm_\b _\bs_\be_\be_\bd_\b__\bc_\bh_\bo_\bk_\bi_\bn_\bg_\b__\ba_\bl_\bg_\bo_\br_\bi_\bt_\bh_\bm_\b__\bt\n o _\be_\bn_\bu_\bm_\b _\bi_\bo_\b__\bb_\bu_\bf_\bf_\be_\br_\b__\bm_\bo_\bd_\be_\b__\bt\n o _\be_\bn_\bu_\bm_\b _\bb_\ba_\bn_\bd_\bw_\bi_\bd_\bt_\bh_\b__\bm_\bi_\bx_\be_\bd_\b__\ba_\bl_\bg_\bo_\b__\bt\n o _\be_\bn_\bu_\bm_\b _\be_\bn_\bc_\b__\bp_\bo_\bl_\bi_\bc_\by\n o _\be_\bn_\bu_\bm_\b _\be_\bn_\bc_\b__\bl_\be_\bv_\be_\bl\n o _\be_\bn_\bu_\bm_\b _\bp_\br_\bo_\bx_\by_\b__\bt_\by_\bp_\be_\b__\bt\n- * _\bm_\bi_\bn_\b__\bm_\be_\bm_\bo_\br_\by_\b__\bu_\bs_\ba_\bg_\be_\b(_\b)_\b _\bh_\bi_\bg_\bh_\b__\bp_\be_\br_\bf_\bo_\br_\bm_\ba_\bn_\bc_\be_\b__\bs_\be_\be_\bd_\b(_\b)\n+ * _\bg_\be_\bn_\be_\br_\ba_\bt_\be_\b__\bf_\bi_\bn_\bg_\be_\br_\bp_\br_\bi_\bn_\bt_\b(_\b)\n+ * _\bh_\bi_\bg_\bh_\b__\bp_\be_\br_\bf_\bo_\br_\bm_\ba_\bn_\bc_\be_\b__\bs_\be_\be_\bd_\b(_\b)_\b _\bm_\bi_\bn_\b__\bm_\be_\bm_\bo_\br_\by_\b__\bu_\bs_\ba_\bg_\be_\b(_\b)\n * _\bn_\ba_\bm_\be_\b__\bf_\bo_\br_\b__\bs_\be_\bt_\bt_\bi_\bn_\bg_\b(_\b)_\b _\bs_\be_\bt_\bt_\bi_\bn_\bg_\b__\bb_\by_\b__\bn_\ba_\bm_\be_\b(_\b)\n * _\bd_\be_\bf_\ba_\bu_\bl_\bt_\b__\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b(_\b)\n- * _\bg_\be_\bn_\be_\br_\ba_\bt_\be_\b__\bf_\bi_\bn_\bg_\be_\br_\bp_\br_\bi_\bn_\bt_\b(_\b)\n You have some control over _\bs_\be_\bs_\bs_\bi_\bo_\bn configuration through the session::\n apply_settings() member function. To change one or more configuration options,\n create a _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk object and fill it with the settings to be set and pass\n it in to session::apply_settings().\n The _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk object is a collection of settings updates that are applied\n to the _\bs_\be_\bs_\bs_\bi_\bo_\bn when passed to session::apply_settings(). It's empty when\n constructed.\n@@ -1436,23 +1436,23 @@\n of the actual local listening port.\n struct settings_pack final : settings_interface\n {\n friend void a\bap\bpp\bpl\bly\by_\b_p\bpa\bac\bck\bk_\b_i\bim\bmp\bpl\bl (settings_pack const*\n , aux::session_settings_single_thread&\n , std::vector*);\n void s\bse\bet\bt_\b_b\bbo\boo\bol\bl (int name, bool val) override;\n- void s\bse\bet\bt_\b_i\bin\bnt\bt (int name, flags::bitfield_flag const val);\n- void s\bse\bet\bt_\b_i\bin\bnt\bt (int name, int val) override;\n void s\bse\bet\bt_\b_s\bst\btr\br (int name, std::string val) override;\n+ void s\bse\bet\bt_\b_i\bin\bnt\bt (int name, int val) override;\n+ void s\bse\bet\bt_\b_i\bin\bnt\bt (int name, flags::bitfield_flag const val);\n bool h\bha\bas\bs_\b_v\bva\bal\bl (int name) const override;\n void c\bcl\ble\bea\bar\br ();\n void c\bcl\ble\bea\bar\br (int name);\n- int g\bge\bet\bt_\b_i\bin\bnt\bt (int name) const override;\n std::string const& g\bge\bet\bt_\b_s\bst\btr\br (int name) const override;\n bool g\bge\bet\bt_\b_b\bbo\boo\bol\bl (int name) const override;\n+ int g\bge\bet\bt_\b_i\bin\bnt\bt (int name) const override;\n void f\bfo\bor\br_\b_e\bea\bac\bch\bh (Fun&& f) const;\n \n enum type_bases\n {\n string_type_base,\n int_type_base,\n bool_type_base,\n@@ -1522,19 +1522,19 @@\n socks5,\n socks5_pw,\n http,\n http_pw,\n };\n };\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* s\bse\bet\bt_\b_b\bbo\boo\bol\bl(\b()\b) s\bse\bet\bt_\b_s\bst\btr\br(\b()\b) s\bse\bet\bt_\b_i\bin\bnt\bt(\b()\b) *\b**\b**\b**\b**\b*\n+*\b**\b**\b**\b**\b* s\bse\bet\bt_\b_s\bst\btr\br(\b()\b) s\bse\bet\bt_\b_b\bbo\boo\bol\bl(\b()\b) s\bse\bet\bt_\b_i\bin\bnt\bt(\b()\b) *\b**\b**\b**\b**\b*\n void s\bse\bet\bt_\b_b\bbo\boo\bol\bl (int name, bool val) override;\n-void s\bse\bet\bt_\b_i\bin\bnt\bt (int name, flags::bitfield_flag const val);\n-void s\bse\bet\bt_\b_i\bin\bnt\bt (int name, int val) override;\n void s\bse\bet\bt_\b_s\bst\btr\br (int name, std::string val) override;\n+void s\bse\bet\bt_\b_i\bin\bnt\bt (int name, int val) override;\n+void s\bse\bet\bt_\b_i\bin\bnt\bt (int name, flags::bitfield_flag const val);\n set a configuration option in the _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk. name is one of the enum values\n from string_types, int_types or bool_types. They must match the respective type\n of the set_* function.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* h\bha\bas\bs_\b_v\bva\bal\bl(\b()\b) *\b**\b**\b**\b**\b*\n bool h\bha\bas\bs_\b_v\bva\bal\bl (int name) const override;\n queries whether the specified configuration option has a value set in this\n@@ -1546,17 +1546,17 @@\n clear the settings pack from all settings\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* c\bcl\ble\bea\bar\br(\b()\b) *\b**\b**\b**\b**\b*\n void c\bcl\ble\bea\bar\br (int name);\n clear a specific setting from the pack\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* g\bge\bet\bt_\b_s\bst\btr\br(\b()\b) g\bge\bet\bt_\b_b\bbo\boo\bol\bl(\b()\b) g\bge\bet\bt_\b_i\bin\bnt\bt(\b()\b) *\b**\b**\b**\b**\b*\n-int g\bge\bet\bt_\b_i\bin\bnt\bt (int name) const override;\n std::string const& g\bge\bet\bt_\b_s\bst\btr\br (int name) const override;\n bool g\bge\bet\bt_\b_b\bbo\boo\bol\bl (int name) const override;\n+int g\bge\bet\bt_\b_i\bin\bnt\bt (int name) const override;\n queries the current configuration option from the _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk. name is one of\n the enumeration values from string_types, int_types or bool_types. The enum\n value must match the type of the get_* function. If the specified setting field\n has not been set, the default value is returned.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* e\ben\bnu\bum\bm t\bty\byp\bpe\be_\b_b\bba\bas\bse\bes\bs *\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk_\b._\bh_\bp_\bp\"\n@@ -1683,18 +1683,43 @@\n | | |trackers, a plain proxy will suffice. The proxy is assumed to|\n | | |not require authorization. The username and password will not|\n |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bb_\be_\b _\bu_\bs_\be_\bd_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n | | |The server is assumed to be an HTTP proxy that requires user |\n |http_pw |5 |authorization. The username and password will be sent to the |\n |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bp_\br_\bo_\bx_\by_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* m\bmi\bin\bn_\b_m\bme\bem\bmo\bor\bry\by_\b_u\bus\bsa\bag\bge\be(\b()\b) h\bhi\big\bgh\bh_\b_p\bpe\ber\brf\bfo\bor\brm\bma\ban\bnc\bce\be_\b_s\bse\bee\bed\bd(\b()\b) *\b**\b**\b**\b**\b**\b*\n+*\b**\b**\b**\b**\b**\b* g\bge\ben\bne\ber\bra\bat\bte\be_\b_f\bfi\bin\bng\bge\ber\brp\bpr\bri\bin\bnt\bt(\b()\b) *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bf_\bi_\bn_\bg_\be_\br_\bp_\br_\bi_\bn_\bt_\b._\bh_\bp_\bp\"\n+std::string g\bge\ben\bne\ber\bra\bat\bte\be_\b_f\bfi\bin\bng\bge\ber\brp\bpr\bri\bin\bnt\bt (std::string name\n+ , int major, int minor = 0, int revision = 0, int tag = 0);\n+This is a utility function to produce a client ID fingerprint formatted to the\n+most common convention. The fingerprint can be set via the peer_fingerprint\n+setting, in _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk.\n+The name string should contain exactly two characters. These are the characters\n+unique to your client, used to identify it. Make sure not to clash with anybody\n+else. Here are some taken id's:\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n+|_\bi\bi_\bd\bd_\b _\bc\bc_\bh\bh_\ba\ba_\br\br_\bs\bs_\b|_\bc\bc_\bl\bl_\bi\bi_\be\be_\bn\bn_\bt\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bL_\bT_\b _\b _\b _\b _\b _\b _\b|_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b _\b(_\bd_\be_\bf_\ba_\bu_\bl_\bt_\b)|\n+|_\bU_\bT_\b _\b _\b _\b _\b _\b _\b|_\bu_\bT_\bo_\br_\br_\be_\bn_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bU_\bM_\b _\b _\b _\b _\b _\b _\b|_\bu_\bT_\bo_\br_\br_\be_\bn_\bt_\b _\bM_\ba_\bc_\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bq_\bB_\b _\b _\b _\b _\b _\b _\b|_\bq_\bB_\bi_\bt_\bt_\bo_\br_\br_\be_\bn_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bB_\bP_\b _\b _\b _\b _\b _\b _\b|_\bB_\bi_\bt_\bT_\bo_\br_\br_\be_\bn_\bt_\b _\bP_\br_\bo_\b _\b _\b _\b _\b _\b |\n+|_\bB_\bT_\b _\b _\b _\b _\b _\b _\b|_\bB_\bi_\bt_\bT_\bo_\br_\br_\be_\bn_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bD_\bE_\b _\b _\b _\b _\b _\b _\b|_\bD_\be_\bl_\bu_\bg_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bA_\bZ_\b _\b _\b _\b _\b _\b _\b|_\bA_\bz_\bu_\br_\be_\bu_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bT_\bL_\b _\b _\b _\b _\b _\b _\b|_\bT_\br_\bi_\bb_\bl_\be_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+There's an informal directory of client id's _\bh_\be_\br_\be.\n+The major, minor, revision and tag parameters are used to identify the version\n+of your client.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* h\bhi\big\bgh\bh_\b_p\bpe\ber\brf\bfo\bor\brm\bma\ban\bnc\bce\be_\b_s\bse\bee\bed\bd(\b()\b) m\bmi\bin\bn_\b_m\bme\bem\bmo\bor\bry\by_\b_u\bus\bsa\bag\bge\be(\b()\b) *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b._\bh_\bp_\bp\"\n-settings_pack h\bhi\big\bgh\bh_\b_p\bpe\ber\brf\bfo\bor\brm\bma\ban\bnc\bce\be_\b_s\bse\bee\bed\bd ();\n settings_pack m\bmi\bin\bn_\b_m\bme\bem\bmo\bor\bry\by_\b_u\bus\bsa\bag\bge\be ();\n+settings_pack h\bhi\big\bgh\bh_\b_p\bpe\ber\brf\bfo\bor\brm\bma\ban\bnc\bce\be_\b_s\bse\bee\bed\bd ();\n The default values of the _\bs_\be_\bs_\bs_\bi_\bo_\bn settings are set for a regular bittorrent\n client running on a desktop system. There are functions that can set the\n _\bs_\be_\bs_\bs_\bi_\bo_\bn settings to pre set settings for other environments. These can be used\n for the basis, and should be tweaked to fit your needs better.\n min_memory_usage returns settings that will use the minimal amount of RAM, at\n the potential expense of upload and download performance. It adjusts the socket\n buffer sizes, disables the disk cache, lowers the send buffer watermarks so\n@@ -1709,48 +1734,23 @@\n high_performance_seed returns settings optimized for a seed box, serving many\n peers and that doesn't do any downloading. It has a 128 MB disk cache and has a\n limit of 400 files in its file pool. It support fast upload rates by allowing\n large send buffers.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* n\bna\bam\bme\be_\b_f\bfo\bor\br_\b_s\bse\bet\btt\bti\bin\bng\bg(\b()\b) s\bse\bet\btt\bti\bin\bng\bg_\b_b\bby\by_\b_n\bna\bam\bme\be(\b()\b) *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk_\b._\bh_\bp_\bp\"\n-char const* n\bna\bam\bme\be_\b_f\bfo\bor\br_\b_s\bse\bet\btt\bti\bin\bng\bg (int s);\n int s\bse\bet\btt\bti\bin\bng\bg_\b_b\bby\by_\b_n\bna\bam\bme\be (string_view name);\n+char const* n\bna\bam\bme\be_\b_f\bfo\bor\br_\b_s\bse\bet\btt\bti\bin\bng\bg (int s);\n converts a setting integer (from the enums string_types, int_types or\n bool_types) to a string, and vice versa.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* d\bde\bef\bfa\bau\bul\blt\bt_\b_s\bse\bet\btt\bti\bin\bng\bgs\bs(\b()\b) *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk_\b._\bh_\bp_\bp\"\n settings_pack d\bde\bef\bfa\bau\bul\blt\bt_\b_s\bse\bet\btt\bti\bin\bng\bgs\bs ();\n returns a _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk with every setting set to its default value\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* g\bge\ben\bne\ber\bra\bat\bte\be_\b_f\bfi\bin\bng\bge\ber\brp\bpr\bri\bin\bnt\bt(\b()\b) *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bf_\bi_\bn_\bg_\be_\br_\bp_\br_\bi_\bn_\bt_\b._\bh_\bp_\bp\"\n-std::string g\bge\ben\bne\ber\bra\bat\bte\be_\b_f\bfi\bin\bng\bge\ber\brp\bpr\bri\bin\bnt\bt (std::string name\n- , int major, int minor = 0, int revision = 0, int tag = 0);\n-This is a utility function to produce a client ID fingerprint formatted to the\n-most common convention. The fingerprint can be set via the peer_fingerprint\n-setting, in _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk.\n-The name string should contain exactly two characters. These are the characters\n-unique to your client, used to identify it. Make sure not to clash with anybody\n-else. Here are some taken id's:\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n-|_\bi\bi_\bd\bd_\b _\bc\bc_\bh\bh_\ba\ba_\br\br_\bs\bs_\b|_\bc\bc_\bl\bl_\bi\bi_\be\be_\bn\bn_\bt\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bL_\bT_\b _\b _\b _\b _\b _\b _\b|_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b _\b(_\bd_\be_\bf_\ba_\bu_\bl_\bt_\b)|\n-|_\bU_\bT_\b _\b _\b _\b _\b _\b _\b|_\bu_\bT_\bo_\br_\br_\be_\bn_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bU_\bM_\b _\b _\b _\b _\b _\b _\b|_\bu_\bT_\bo_\br_\br_\be_\bn_\bt_\b _\bM_\ba_\bc_\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bq_\bB_\b _\b _\b _\b _\b _\b _\b|_\bq_\bB_\bi_\bt_\bt_\bo_\br_\br_\be_\bn_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bB_\bP_\b _\b _\b _\b _\b _\b _\b|_\bB_\bi_\bt_\bT_\bo_\br_\br_\be_\bn_\bt_\b _\bP_\br_\bo_\b _\b _\b _\b _\b _\b |\n-|_\bB_\bT_\b _\b _\b _\b _\b _\b _\b|_\bB_\bi_\bt_\bT_\bo_\br_\br_\be_\bn_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bD_\bE_\b _\b _\b _\b _\b _\b _\b|_\bD_\be_\bl_\bu_\bg_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bA_\bZ_\b _\b _\b _\b _\b _\b _\b|_\bA_\bz_\bu_\br_\be_\bu_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bT_\bL_\b _\b _\b _\b _\b _\b _\b|_\bT_\br_\bi_\bb_\bl_\be_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-There's an informal directory of client id's _\bh_\be_\br_\be.\n-The major, minor, revision and tag parameters are used to identify the version\n-of your client.\n _\bh_\bo_\bm_\be\n _\bb_\bl_\bo_\bg\n _\bu_\bT_\bP\n _\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd\n _\bd_\bo_\bc_\bu_\bm_\be_\bn_\bt_\ba_\bt_\bi_\bo_\bn\n _\bD_\bH_\bT_\b _\bp_\bu_\bt_\b _\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn\n _\bp_\by_\bt_\bh_\bo_\bn_\b _\bb_\bi_\bn_\bd_\bi_\bn_\bg_\bs\n"}]}, {"source1": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Stats.html", "source2": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Stats.html", "unified_diff": "@@ -28,50 +28,25 @@\n 2.0.11\n \n \n

    home

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

    counters

    \n-

    Declared in "libtorrent/performance_counters.hpp"

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

    inc_stats_counter() operator[]()

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

    returns the new value

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

    stats_metric

    \n

    Declared in "libtorrent/session_stats.hpp"

    \n

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

    \n
    \n struct stats_metric\n {\n@@ -87,15 +62,40 @@\n \n [report issue]
    \n
    value_index type
    \n
    the index into the session stats array, where the underlying value of\n this counter or gauge is found. The session stats array is part of the\n session_stats_alert object.
    \n
    \n+[report issue]
    \n+
    \n+

    counters

    \n+

    Declared in "libtorrent/performance_counters.hpp"

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

    operator[]() inc_stats_counter()

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

    returns the new value

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

    session_stats_metrics()

    \n

    Declared in "libtorrent/session_stats.hpp"

    \n
    \n std::vector<stats_metric> session_stats_metrics ();\n 
    \n

    This free function returns the list of available metrics exposed by\n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,37 +1,19 @@\n >\n _\b[_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b _\bl_\bo_\bg_\bo_\b]\n V\bVe\ber\brs\bsi\bio\bon\bn:\b: 2.0.11\n _\bh_\bo_\bm_\be\n Table of contents\n- * _\bc_\bo_\bu_\bn_\bt_\be_\br_\bs\n- o _\bi_\bn_\bc_\b__\bs_\bt_\ba_\bt_\bs_\b__\bc_\bo_\bu_\bn_\bt_\be_\br_\b(_\b)_\b _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b[_\b]_\b(_\b)\n * _\bs_\bt_\ba_\bt_\bs_\b__\bm_\be_\bt_\br_\bi_\bc\n+ * _\bc_\bo_\bu_\bn_\bt_\be_\br_\bs\n+ o _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b[_\b]_\b(_\b)_\b _\bi_\bn_\bc_\b__\bs_\bt_\ba_\bt_\bs_\b__\bc_\bo_\bu_\bn_\bt_\be_\br_\b(_\b)\n * _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bs_\bt_\ba_\bt_\bs_\b__\bm_\be_\bt_\br_\bi_\bc_\bs_\b(_\b)\n * _\bf_\bi_\bn_\bd_\b__\bm_\be_\bt_\br_\bi_\bc_\b__\bi_\bd_\bx_\b(_\b)\n * _\be_\bn_\bu_\bm_\b _\bm_\be_\bt_\br_\bi_\bc_\b__\bt_\by_\bp_\be_\b__\bt\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* c\bco\bou\bun\bnt\bte\ber\brs\bs *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bp_\be_\br_\bf_\bo_\br_\bm_\ba_\bn_\bc_\be_\b__\bc_\bo_\bu_\bn_\bt_\be_\br_\bs_\b._\bh_\bp_\bp\"\n-struct counters\n-{\n- c\bco\bou\bun\bnt\bte\ber\brs\bs () ;\n- counters& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (counters const&) & ;\n- c\bco\bou\bun\bnt\bte\ber\brs\bs (counters const&) ;\n- std::int64_t i\bin\bnc\bc_\b_s\bst\bta\bat\bts\bs_\b_c\bco\bou\bun\bnt\bte\ber\br (int c, std::int64_t value = 1) ;\n- std::int64_t o\bop\bpe\ber\bra\bat\bto\bor\br[\b[]\b] (int i) const ;\n- void b\bbl\ble\ben\bnd\bd_\b_s\bst\bta\bat\bts\bs_\b_c\bco\bou\bun\bnt\bte\ber\br (int c, std::int64_t value, int ratio) ;\n- void s\bse\bet\bt_\b_v\bva\bal\blu\bue\be (int c, std::int64_t value) ;\n-};\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* i\bin\bnc\bc_\b_s\bst\bta\bat\bts\bs_\b_c\bco\bou\bun\bnt\bte\ber\br(\b()\b) o\bop\bpe\ber\bra\bat\bto\bor\br[\b[]\b](\b()\b) *\b**\b**\b**\b**\b*\n-std::int64_t i\bin\bnc\bc_\b_s\bst\bta\bat\bts\bs_\b_c\bco\bou\bun\bnt\bte\ber\br (int c, std::int64_t value = 1) ;\n-std::int64_t o\bop\bpe\ber\bra\bat\bto\bor\br[\b[]\b] (int i) const ;\n-returns the new value\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* s\bst\bta\bat\bts\bs_\b_m\bme\bet\btr\bri\bic\bc *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bs_\bt_\ba_\bt_\bs_\b._\bh_\bp_\bp\"\n describes one statistics metric from the _\bs_\be_\bs_\bs_\bi_\bo_\bn. For more information, see the\n _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b _\bs_\bt_\ba_\bt_\bi_\bs_\bt_\bi_\bc_\bs section.\n struct stats_metric\n {\n char const* name;\n@@ -43,14 +25,32 @@\n the name of the counter or gauge\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n value_index type\n the index into the _\bs_\be_\bs_\bs_\bi_\bo_\bn stats array, where the underlying value of\n this counter or gauge is found. The _\bs_\be_\bs_\bs_\bi_\bo_\bn stats array is part of the\n _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bs_\bt_\ba_\bt_\bs_\b__\ba_\bl_\be_\br_\bt object.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* c\bco\bou\bun\bnt\bte\ber\brs\bs *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bp_\be_\br_\bf_\bo_\br_\bm_\ba_\bn_\bc_\be_\b__\bc_\bo_\bu_\bn_\bt_\be_\br_\bs_\b._\bh_\bp_\bp\"\n+struct counters\n+{\n+ c\bco\bou\bun\bnt\bte\ber\brs\bs () ;\n+ c\bco\bou\bun\bnt\bte\ber\brs\bs (counters const&) ;\n+ counters& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (counters const&) & ;\n+ std::int64_t o\bop\bpe\ber\bra\bat\bto\bor\br[\b[]\b] (int i) const ;\n+ std::int64_t i\bin\bnc\bc_\b_s\bst\bta\bat\bts\bs_\b_c\bco\bou\bun\bnt\bte\ber\br (int c, std::int64_t value = 1) ;\n+ void s\bse\bet\bt_\b_v\bva\bal\blu\bue\be (int c, std::int64_t value) ;\n+ void b\bbl\ble\ben\bnd\bd_\b_s\bst\bta\bat\bts\bs_\b_c\bco\bou\bun\bnt\bte\ber\br (int c, std::int64_t value, int ratio) ;\n+};\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* o\bop\bpe\ber\bra\bat\bto\bor\br[\b[]\b](\b()\b) i\bin\bnc\bc_\b_s\bst\bta\bat\bts\bs_\b_c\bco\bou\bun\bnt\bte\ber\br(\b()\b) *\b**\b**\b**\b**\b*\n+std::int64_t o\bop\bpe\ber\bra\bat\bto\bor\br[\b[]\b] (int i) const ;\n+std::int64_t i\bin\bnc\bc_\b_s\bst\bta\bat\bts\bs_\b_c\bco\bou\bun\bnt\bte\ber\br (int c, std::int64_t value = 1) ;\n+returns the new value\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* s\bse\bes\bss\bsi\bio\bon\bn_\b_s\bst\bta\bat\bts\bs_\b_m\bme\bet\btr\bri\bic\bcs\bs(\b()\b) *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bs_\bt_\ba_\bt_\bs_\b._\bh_\bp_\bp\"\n std::vector s\bse\bes\bss\bsi\bio\bon\bn_\b_s\bst\bta\bat\bts\bs_\b_m\bme\bet\btr\bri\bic\bcs\bs ();\n This free function returns the list of available metrics exposed by\n libtorrent's statistics API. Each metric has a name and a v\bva\bal\blu\bue\be i\bin\bnd\bde\bex\bx. The\n value index is the index into the array in _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bs_\bt_\ba_\bt_\bs_\b__\ba_\bl_\be_\br_\bt where this\n metric's value can be found when the _\bs_\be_\bs_\bs_\bi_\bo_\bn stats is sampled (by calling\n"}]}, {"source1": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Storage.html", "source2": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Storage.html", "unified_diff": "@@ -40,45 +40,45 @@\n

  • rename_file()
  • \n
  • map_block()
  • \n
  • map_file()
  • \n
  • num_files()
  • \n
  • end_file()
  • \n
  • file_range()
  • \n
  • total_size()
  • \n-
  • set_num_pieces() num_pieces()
  • \n+
  • num_pieces() set_num_pieces()
  • \n
  • end_piece()
  • \n
  • last_piece()
  • \n
  • piece_range()
  • \n
  • set_piece_length() piece_length()
  • \n
  • piece_size()
  • \n
  • piece_size2()
  • \n
  • blocks_in_piece2()
  • \n
  • blocks_per_piece()
  • \n
  • set_name() name()
  • \n
  • swap()
  • \n
  • canonicalize()
  • \n-
  • file_offset() pad_file_at() mtime() root_ptr() file_size() root() file_name() hash() symlink() file_path()
  • \n-
  • file_num_blocks() file_num_pieces() file_piece_range()
  • \n+
  • mtime() file_name() file_offset() hash() root_ptr() file_path() pad_file_at() symlink() root() file_size()
  • \n+
  • file_num_blocks() file_piece_range() file_num_pieces()
  • \n
  • file_first_piece_node() file_first_block_node()
  • \n
  • file_path_hash()
  • \n
  • all_path_hashes()
  • \n
  • file_flags()
  • \n
  • file_absolute_path()
  • \n-
  • file_index_at_offset() file_index_at_piece()
  • \n+
  • file_index_at_piece() file_index_at_offset()
  • \n
  • file_index_for_root()
  • \n
  • piece_index_at_file()
  • \n
  • sanitize_symlinks()
  • \n
  • v2()
  • \n \n \n
  • storage_params
  • \n-
  • mmap_disk_io_constructor()
  • \n+
  • default_disk_io_constructor()
  • \n
  • disabled_disk_io_constructor()
  • \n-
  • default_disk_io_constructor()
  • \n-
  • posix_disk_io_constructor()
  • \n+
  • posix_disk_io_constructor()
  • \n+
  • mmap_disk_io_constructor()
  • \n
  • enum storage_mode_t
  • \n
  • enum status_t
  • \n
  • enum move_flags_t
  • \n \n
    \n [report issue]
    \n

    file_slice

    \n@@ -117,68 +117,68 @@\n size. Everything necessary to interpret a regular bittorrent storage\n file structure.

    \n
    \n class file_storage\n {\n    bool is_valid () const;\n    void reserve (int num_files);\n-   void add_file (error_code& ec, std::string const& path, std::int64_t file_size\n-      , file_flags_t file_flags = {}\n-      , std::time_t mtime = 0, string_view symlink_path = string_view()\n+   void add_file_borrow (error_code& ec, string_view filename\n+      , std::string const& path, std::int64_t file_size\n+      , file_flags_t file_flags = {}, char const* filehash = nullptr\n+      , std::int64_t mtime = 0, string_view symlink_path = string_view()\n       , char const* root_hash = nullptr);\n    void add_file_borrow (string_view filename\n       , std::string const& path, std::int64_t file_size\n       , file_flags_t file_flags = {}, char const* filehash = nullptr\n       , std::int64_t mtime = 0, string_view symlink_path = string_view()\n       , char const* root_hash = nullptr);\n    void add_file (std::string const& path, std::int64_t file_size\n       , file_flags_t file_flags = {}\n       , std::time_t mtime = 0, string_view symlink_path = string_view()\n       , char const* root_hash = nullptr);\n-   void add_file_borrow (error_code& ec, string_view filename\n-      , std::string const& path, std::int64_t file_size\n-      , file_flags_t file_flags = {}, char const* filehash = nullptr\n-      , std::int64_t mtime = 0, string_view symlink_path = string_view()\n+   void add_file (error_code& ec, std::string const& path, std::int64_t file_size\n+      , file_flags_t file_flags = {}\n+      , std::time_t mtime = 0, string_view symlink_path = string_view()\n       , char const* root_hash = nullptr);\n    void rename_file (file_index_t index, std::string const& new_filename);\n    std::vector<file_slice> map_block (piece_index_t piece, std::int64_t offset\n       , std::int64_t size) const;\n    peer_request map_file (file_index_t file, std::int64_t offset, int size) const;\n    int num_files () const noexcept;\n    file_index_t end_file () const noexcept;\n    index_range<file_index_t> file_range () const noexcept;\n    std::int64_t total_size () const;\n-   int num_pieces () const;\n    void set_num_pieces (int n);\n+   int num_pieces () const;\n    piece_index_t end_piece () const;\n    piece_index_t last_piece () const;\n    index_range<piece_index_t> piece_range () const noexcept;\n    void set_piece_length (int l);\n    int piece_length () const;\n    int piece_size (piece_index_t index) const;\n    int piece_size2 (piece_index_t index) const;\n    int blocks_in_piece2 (piece_index_t index) const;\n    int blocks_per_piece () const;\n-   void set_name (std::string const& n);\n    std::string const& name () const;\n+   void set_name (std::string const& n);\n    void swap (file_storage& ti) noexcept;\n    void canonicalize ();\n-   std::int64_t file_offset (file_index_t index) const;\n-   std::time_t mtime (file_index_t index) const;\n    bool pad_file_at (file_index_t index) const;\n-   std::string file_path (file_index_t index, std::string const& save_path = "") const;\n-   sha1_hash hash (file_index_t index) const;\n-   std::string symlink (file_index_t index) const;\n    sha256_hash root (file_index_t index) const;\n+   sha1_hash hash (file_index_t index) const;\n+   std::int64_t file_size (file_index_t index) const;\n+   std::time_t mtime (file_index_t index) const;\n    char const* root_ptr (file_index_t const index) const;\n+   std::int64_t file_offset (file_index_t index) const;\n    string_view file_name (file_index_t index) const;\n-   std::int64_t file_size (file_index_t index) const;\n+   std::string file_path (file_index_t index, std::string const& save_path = "") const;\n+   std::string symlink (file_index_t index) const;\n    int file_num_pieces (file_index_t index) const;\n-   int file_num_blocks (file_index_t index) const;\n    index_range<piece_index_t::diff_type> file_piece_range (file_index_t) const;\n+   int file_num_blocks (file_index_t index) const;\n    int file_first_block_node (file_index_t index) const;\n    int file_first_piece_node (file_index_t index) const;\n    std::uint32_t file_path_hash (file_index_t index, std::string const& save_path) const;\n    void all_path_hashes (std::unordered_set<std::uint32_t>& table) const;\n    file_flags_t file_flags (file_index_t index) const;\n    bool file_absolute_path (file_index_t index) const;\n    file_index_t file_index_at_piece (piece_index_t piece) const;\n@@ -213,31 +213,31 @@\n be used to avoid reallocating the internal file list when the number\n of files to be added is known up-front.

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

    add_file_borrow() add_file()

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

    Adds a file to the file storage. The add_file_borrow version\n expects that filename is the file name (without a path) of\n the file that's being added.\n This memory is borrowed, i.e. it is the caller's\n responsibility to make sure it stays valid throughout the lifetime\n@@ -336,21 +336,21 @@\n [report issue]

    \n
    \n

    total_size()

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

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

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

    set_num_pieces() num_pieces()

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

    num_pieces() set_num_pieces()

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

    set and get the number of pieces in the torrent

    \n [report issue]
    \n
    \n

    end_piece()

    \n
    \n piece_index_t end_piece () const;\n@@ -418,16 +418,16 @@\n 

    returns the number of blocks there are in the typical piece. There\n may be fewer in the last piece)

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

    set_name() name()

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

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

    \n [report issue]
    \n
    \n

    swap()

    \n
    \n@@ -438,37 +438,37 @@\n 
    \n

    canonicalize()

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

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

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

    file_num_blocks() file_num_pieces() file_piece_range()

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

    file_num_blocks() file_piece_range() file_num_pieces()

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

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

    \n@@ -547,18 +547,18 @@\n

    file_absolute_path()

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

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

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

    file_index_at_offset() file_index_at_piece()

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

    file_index_at_piece() file_index_at_offset()

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

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

    \n [report issue]
    \n
    \n@@ -630,56 +630,56 @@\n file_storage const* mapped_files = nullptr;\n std::string const& path;\n storage_mode_t mode {storage_mode_sparse};\n aux::vector<download_priority_t, file_index_t> const& priorities;\n sha1_hash info_hash;\n };\n
    \n-[report issue]
    \n-
    \n-

    mmap_disk_io_constructor()

    \n-

    Declared in "libtorrent/mmap_disk_io.hpp"

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

    default_disk_io_constructor()

    \n+

    Declared in "libtorrent/session.hpp"

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

    constructs a memory mapped file disk I/O object.

    \n+

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

    \n [report issue]
    \n
    \n

    disabled_disk_io_constructor()

    \n

    Declared in "libtorrent/disabled_disk_io.hpp"

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

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

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

    default_disk_io_constructor()

    \n-

    Declared in "libtorrent/session.hpp"

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

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

    \n [report issue]
    \n
    \n

    posix_disk_io_constructor()

    \n

    Declared in "libtorrent/posix_disk_io.hpp"

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

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

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

    mmap_disk_io_constructor()

    \n+

    Declared in "libtorrent/mmap_disk_io.hpp"

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

    constructs a memory mapped file disk I/O object.

    \n [report issue]
    \n
    \n

    enum storage_mode_t

    \n

    Declared in "libtorrent/storage_defs.hpp"

    \n \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -11,44 +11,44 @@\n o _\br_\be_\bn_\ba_\bm_\be_\b__\bf_\bi_\bl_\be_\b(_\b)\n o _\bm_\ba_\bp_\b__\bb_\bl_\bo_\bc_\bk_\b(_\b)\n o _\bm_\ba_\bp_\b__\bf_\bi_\bl_\be_\b(_\b)\n o _\bn_\bu_\bm_\b__\bf_\bi_\bl_\be_\bs_\b(_\b)\n o _\be_\bn_\bd_\b__\bf_\bi_\bl_\be_\b(_\b)\n o _\bf_\bi_\bl_\be_\b__\br_\ba_\bn_\bg_\be_\b(_\b)\n o _\bt_\bo_\bt_\ba_\bl_\b__\bs_\bi_\bz_\be_\b(_\b)\n- o _\bs_\be_\bt_\b__\bn_\bu_\bm_\b__\bp_\bi_\be_\bc_\be_\bs_\b(_\b)_\b _\bn_\bu_\bm_\b__\bp_\bi_\be_\bc_\be_\bs_\b(_\b)\n+ o _\bn_\bu_\bm_\b__\bp_\bi_\be_\bc_\be_\bs_\b(_\b)_\b _\bs_\be_\bt_\b__\bn_\bu_\bm_\b__\bp_\bi_\be_\bc_\be_\bs_\b(_\b)\n o _\be_\bn_\bd_\b__\bp_\bi_\be_\bc_\be_\b(_\b)\n o _\bl_\ba_\bs_\bt_\b__\bp_\bi_\be_\bc_\be_\b(_\b)\n o _\bp_\bi_\be_\bc_\be_\b__\br_\ba_\bn_\bg_\be_\b(_\b)\n o _\bs_\be_\bt_\b__\bp_\bi_\be_\bc_\be_\b__\bl_\be_\bn_\bg_\bt_\bh_\b(_\b)_\b _\bp_\bi_\be_\bc_\be_\b__\bl_\be_\bn_\bg_\bt_\bh_\b(_\b)\n o _\bp_\bi_\be_\bc_\be_\b__\bs_\bi_\bz_\be_\b(_\b)\n o _\bp_\bi_\be_\bc_\be_\b__\bs_\bi_\bz_\be_\b2_\b(_\b)\n o _\bb_\bl_\bo_\bc_\bk_\bs_\b__\bi_\bn_\b__\bp_\bi_\be_\bc_\be_\b2_\b(_\b)\n o _\bb_\bl_\bo_\bc_\bk_\bs_\b__\bp_\be_\br_\b__\bp_\bi_\be_\bc_\be_\b(_\b)\n o _\bs_\be_\bt_\b__\bn_\ba_\bm_\be_\b(_\b)_\b _\bn_\ba_\bm_\be_\b(_\b)\n o _\bs_\bw_\ba_\bp_\b(_\b)\n o _\bc_\ba_\bn_\bo_\bn_\bi_\bc_\ba_\bl_\bi_\bz_\be_\b(_\b)\n- o _\bf_\bi_\bl_\be_\b__\bo_\bf_\bf_\bs_\be_\bt_\b(_\b)_\b _\bp_\ba_\bd_\b__\bf_\bi_\bl_\be_\b__\ba_\bt_\b(_\b)_\b _\bm_\bt_\bi_\bm_\be_\b(_\b)_\b _\br_\bo_\bo_\bt_\b__\bp_\bt_\br_\b(_\b)_\b _\bf_\bi_\bl_\be_\b__\bs_\bi_\bz_\be_\b(_\b)_\b _\br_\bo_\bo_\bt_\b(_\b)\n- _\bf_\bi_\bl_\be_\b__\bn_\ba_\bm_\be_\b(_\b)_\b _\bh_\ba_\bs_\bh_\b(_\b)_\b _\bs_\by_\bm_\bl_\bi_\bn_\bk_\b(_\b)_\b _\bf_\bi_\bl_\be_\b__\bp_\ba_\bt_\bh_\b(_\b)\n- o _\bf_\bi_\bl_\be_\b__\bn_\bu_\bm_\b__\bb_\bl_\bo_\bc_\bk_\bs_\b(_\b)_\b _\bf_\bi_\bl_\be_\b__\bn_\bu_\bm_\b__\bp_\bi_\be_\bc_\be_\bs_\b(_\b)_\b _\bf_\bi_\bl_\be_\b__\bp_\bi_\be_\bc_\be_\b__\br_\ba_\bn_\bg_\be_\b(_\b)\n+ o _\bm_\bt_\bi_\bm_\be_\b(_\b)_\b _\bf_\bi_\bl_\be_\b__\bn_\ba_\bm_\be_\b(_\b)_\b _\bf_\bi_\bl_\be_\b__\bo_\bf_\bf_\bs_\be_\bt_\b(_\b)_\b _\bh_\ba_\bs_\bh_\b(_\b)_\b _\br_\bo_\bo_\bt_\b__\bp_\bt_\br_\b(_\b)_\b _\bf_\bi_\bl_\be_\b__\bp_\ba_\bt_\bh_\b(_\b)\n+ _\bp_\ba_\bd_\b__\bf_\bi_\bl_\be_\b__\ba_\bt_\b(_\b)_\b _\bs_\by_\bm_\bl_\bi_\bn_\bk_\b(_\b)_\b _\br_\bo_\bo_\bt_\b(_\b)_\b _\bf_\bi_\bl_\be_\b__\bs_\bi_\bz_\be_\b(_\b)\n+ o _\bf_\bi_\bl_\be_\b__\bn_\bu_\bm_\b__\bb_\bl_\bo_\bc_\bk_\bs_\b(_\b)_\b _\bf_\bi_\bl_\be_\b__\bp_\bi_\be_\bc_\be_\b__\br_\ba_\bn_\bg_\be_\b(_\b)_\b _\bf_\bi_\bl_\be_\b__\bn_\bu_\bm_\b__\bp_\bi_\be_\bc_\be_\bs_\b(_\b)\n o _\bf_\bi_\bl_\be_\b__\bf_\bi_\br_\bs_\bt_\b__\bp_\bi_\be_\bc_\be_\b__\bn_\bo_\bd_\be_\b(_\b)_\b _\bf_\bi_\bl_\be_\b__\bf_\bi_\br_\bs_\bt_\b__\bb_\bl_\bo_\bc_\bk_\b__\bn_\bo_\bd_\be_\b(_\b)\n o _\bf_\bi_\bl_\be_\b__\bp_\ba_\bt_\bh_\b__\bh_\ba_\bs_\bh_\b(_\b)\n o _\ba_\bl_\bl_\b__\bp_\ba_\bt_\bh_\b__\bh_\ba_\bs_\bh_\be_\bs_\b(_\b)\n o _\bf_\bi_\bl_\be_\b__\bf_\bl_\ba_\bg_\bs_\b(_\b)\n o _\bf_\bi_\bl_\be_\b__\ba_\bb_\bs_\bo_\bl_\bu_\bt_\be_\b__\bp_\ba_\bt_\bh_\b(_\b)\n- o _\bf_\bi_\bl_\be_\b__\bi_\bn_\bd_\be_\bx_\b__\ba_\bt_\b__\bo_\bf_\bf_\bs_\be_\bt_\b(_\b)_\b _\bf_\bi_\bl_\be_\b__\bi_\bn_\bd_\be_\bx_\b__\ba_\bt_\b__\bp_\bi_\be_\bc_\be_\b(_\b)\n+ o _\bf_\bi_\bl_\be_\b__\bi_\bn_\bd_\be_\bx_\b__\ba_\bt_\b__\bp_\bi_\be_\bc_\be_\b(_\b)_\b _\bf_\bi_\bl_\be_\b__\bi_\bn_\bd_\be_\bx_\b__\ba_\bt_\b__\bo_\bf_\bf_\bs_\be_\bt_\b(_\b)\n o _\bf_\bi_\bl_\be_\b__\bi_\bn_\bd_\be_\bx_\b__\bf_\bo_\br_\b__\br_\bo_\bo_\bt_\b(_\b)\n o _\bp_\bi_\be_\bc_\be_\b__\bi_\bn_\bd_\be_\bx_\b__\ba_\bt_\b__\bf_\bi_\bl_\be_\b(_\b)\n o _\bs_\ba_\bn_\bi_\bt_\bi_\bz_\be_\b__\bs_\by_\bm_\bl_\bi_\bn_\bk_\bs_\b(_\b)\n o _\bv_\b2_\b(_\b)\n * _\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bp_\ba_\br_\ba_\bm_\bs\n- * _\bm_\bm_\ba_\bp_\b__\bd_\bi_\bs_\bk_\b__\bi_\bo_\b__\bc_\bo_\bn_\bs_\bt_\br_\bu_\bc_\bt_\bo_\br_\b(_\b)\n- * _\bd_\bi_\bs_\ba_\bb_\bl_\be_\bd_\b__\bd_\bi_\bs_\bk_\b__\bi_\bo_\b__\bc_\bo_\bn_\bs_\bt_\br_\bu_\bc_\bt_\bo_\br_\b(_\b)\n * _\bd_\be_\bf_\ba_\bu_\bl_\bt_\b__\bd_\bi_\bs_\bk_\b__\bi_\bo_\b__\bc_\bo_\bn_\bs_\bt_\br_\bu_\bc_\bt_\bo_\br_\b(_\b)\n+ * _\bd_\bi_\bs_\ba_\bb_\bl_\be_\bd_\b__\bd_\bi_\bs_\bk_\b__\bi_\bo_\b__\bc_\bo_\bn_\bs_\bt_\br_\bu_\bc_\bt_\bo_\br_\b(_\b)\n * _\bp_\bo_\bs_\bi_\bx_\b__\bd_\bi_\bs_\bk_\b__\bi_\bo_\b__\bc_\bo_\bn_\bs_\bt_\br_\bu_\bc_\bt_\bo_\br_\b(_\b)\n+ * _\bm_\bm_\ba_\bp_\b__\bd_\bi_\bs_\bk_\b__\bi_\bo_\b__\bc_\bo_\bn_\bs_\bt_\br_\bu_\bc_\bt_\bo_\br_\b(_\b)\n * _\be_\bn_\bu_\bm_\b _\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bm_\bo_\bd_\be_\b__\bt\n * _\be_\bn_\bu_\bm_\b _\bs_\bt_\ba_\bt_\bu_\bs_\b__\bt\n * _\be_\bn_\bu_\bm_\b _\bm_\bo_\bv_\be_\b__\bf_\bl_\ba_\bg_\bs_\b__\bt\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* f\bfi\bil\ble\be_\b_s\bsl\bli\bic\bce\be *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b._\bh_\bp_\bp\"\n represents a window of a file in a torrent.\n@@ -77,71 +77,71 @@\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b._\bh_\bp_\bp\"\n The file_storage class represents a file list and the piece size. Everything\n necessary to interpret a regular bittorrent storage file structure.\n class file_storage\n {\n bool i\bis\bs_\b_v\bva\bal\bli\bid\bd () const;\n void r\bre\bes\bse\ber\brv\bve\be (int num_files);\n- void a\bad\bdd\bd_\b_f\bfi\bil\ble\be (error_code& ec, std::string const& path, std::int64_t\n-file_size\n- , file_flags_t file_flags = {}\n- , std::time_t mtime = 0, string_view symlink_path = string_view()\n+ void a\bad\bdd\bd_\b_f\bfi\bil\ble\be_\b_b\bbo\bor\brr\bro\bow\bw (error_code& ec, string_view filename\n+ , std::string const& path, std::int64_t file_size\n+ , file_flags_t file_flags = {}, char const* filehash = nullptr\n+ , std::int64_t mtime = 0, string_view symlink_path = string_view()\n , char const* root_hash = nullptr);\n void a\bad\bdd\bd_\b_f\bfi\bil\ble\be_\b_b\bbo\bor\brr\bro\bow\bw (string_view filename\n , std::string const& path, std::int64_t file_size\n , file_flags_t file_flags = {}, char const* filehash = nullptr\n , std::int64_t mtime = 0, string_view symlink_path = string_view()\n , char const* root_hash = nullptr);\n void a\bad\bdd\bd_\b_f\bfi\bil\ble\be (std::string const& path, std::int64_t file_size\n , file_flags_t file_flags = {}\n , std::time_t mtime = 0, string_view symlink_path = string_view()\n , char const* root_hash = nullptr);\n- void a\bad\bdd\bd_\b_f\bfi\bil\ble\be_\b_b\bbo\bor\brr\bro\bow\bw (error_code& ec, string_view filename\n- , std::string const& path, std::int64_t file_size\n- , file_flags_t file_flags = {}, char const* filehash = nullptr\n- , std::int64_t mtime = 0, string_view symlink_path = string_view()\n+ void a\bad\bdd\bd_\b_f\bfi\bil\ble\be (error_code& ec, std::string const& path, std::int64_t\n+file_size\n+ , file_flags_t file_flags = {}\n+ , std::time_t mtime = 0, string_view symlink_path = string_view()\n , char const* root_hash = nullptr);\n void r\bre\ben\bna\bam\bme\be_\b_f\bfi\bil\ble\be (file_index_t index, std::string const& new_filename);\n std::vector m\bma\bap\bp_\b_b\bbl\blo\boc\bck\bk (piece_index_t piece, std::int64_t offset\n , std::int64_t size) const;\n peer_request m\bma\bap\bp_\b_f\bfi\bil\ble\be (file_index_t file, std::int64_t offset, int size)\n const;\n int n\bnu\bum\bm_\b_f\bfi\bil\ble\bes\bs () const noexcept;\n file_index_t e\ben\bnd\bd_\b_f\bfi\bil\ble\be () const noexcept;\n index_range f\bfi\bil\ble\be_\b_r\bra\ban\bng\bge\be () const noexcept;\n std::int64_t t\bto\bot\bta\bal\bl_\b_s\bsi\biz\bze\be () const;\n- int n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs () const;\n void s\bse\bet\bt_\b_n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs (int n);\n+ int n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs () const;\n piece_index_t e\ben\bnd\bd_\b_p\bpi\bie\bec\bce\be () const;\n piece_index_t l\bla\bas\bst\bt_\b_p\bpi\bie\bec\bce\be () const;\n index_range p\bpi\bie\bec\bce\be_\b_r\bra\ban\bng\bge\be () const noexcept;\n void s\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_l\ble\ben\bng\bgt\bth\bh (int l);\n int p\bpi\bie\bec\bce\be_\b_l\ble\ben\bng\bgt\bth\bh () const;\n int p\bpi\bie\bec\bce\be_\b_s\bsi\biz\bze\be (piece_index_t index) const;\n int p\bpi\bie\bec\bce\be_\b_s\bsi\biz\bze\be2\b2 (piece_index_t index) const;\n int b\bbl\blo\boc\bck\bks\bs_\b_i\bin\bn_\b_p\bpi\bie\bec\bce\be2\b2 (piece_index_t index) const;\n int b\bbl\blo\boc\bck\bks\bs_\b_p\bpe\ber\br_\b_p\bpi\bie\bec\bce\be () const;\n- void s\bse\bet\bt_\b_n\bna\bam\bme\be (std::string const& n);\n std::string const& n\bna\bam\bme\be () const;\n+ void s\bse\bet\bt_\b_n\bna\bam\bme\be (std::string const& n);\n void s\bsw\bwa\bap\bp (file_storage& ti) noexcept;\n void c\bca\ban\bno\bon\bni\bic\bca\bal\bli\biz\bze\be ();\n- std::int64_t f\bfi\bil\ble\be_\b_o\bof\bff\bfs\bse\bet\bt (file_index_t index) const;\n- std::time_t m\bmt\bti\bim\bme\be (file_index_t index) const;\n bool p\bpa\bad\bd_\b_f\bfi\bil\ble\be_\b_a\bat\bt (file_index_t index) const;\n- std::string f\bfi\bil\ble\be_\b_p\bpa\bat\bth\bh (file_index_t index, std::string const& save_path =\n-\"\") const;\n- sha1_hash h\bha\bas\bsh\bh (file_index_t index) const;\n- std::string s\bsy\bym\bml\bli\bin\bnk\bk (file_index_t index) const;\n sha256_hash r\bro\boo\bot\bt (file_index_t index) const;\n+ sha1_hash h\bha\bas\bsh\bh (file_index_t index) const;\n+ std::int64_t f\bfi\bil\ble\be_\b_s\bsi\biz\bze\be (file_index_t index) const;\n+ std::time_t m\bmt\bti\bim\bme\be (file_index_t index) const;\n char const* r\bro\boo\bot\bt_\b_p\bpt\btr\br (file_index_t const index) const;\n+ std::int64_t f\bfi\bil\ble\be_\b_o\bof\bff\bfs\bse\bet\bt (file_index_t index) const;\n string_view f\bfi\bil\ble\be_\b_n\bna\bam\bme\be (file_index_t index) const;\n- std::int64_t f\bfi\bil\ble\be_\b_s\bsi\biz\bze\be (file_index_t index) const;\n+ std::string f\bfi\bil\ble\be_\b_p\bpa\bat\bth\bh (file_index_t index, std::string const& save_path =\n+\"\") const;\n+ std::string s\bsy\bym\bml\bli\bin\bnk\bk (file_index_t index) const;\n int f\bfi\bil\ble\be_\b_n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs (file_index_t index) const;\n- int f\bfi\bil\ble\be_\b_n\bnu\bum\bm_\b_b\bbl\blo\boc\bck\bks\bs (file_index_t index) const;\n index_range f\bfi\bil\ble\be_\b_p\bpi\bie\bec\bce\be_\b_r\bra\ban\bng\bge\be (file_index_t) const;\n+ int f\bfi\bil\ble\be_\b_n\bnu\bum\bm_\b_b\bbl\blo\boc\bck\bks\bs (file_index_t index) const;\n int f\bfi\bil\ble\be_\b_f\bfi\bir\brs\bst\bt_\b_b\bbl\blo\boc\bck\bk_\b_n\bno\bod\bde\be (file_index_t index) const;\n int f\bfi\bil\ble\be_\b_f\bfi\bir\brs\bst\bt_\b_p\bpi\bie\bec\bce\be_\b_n\bno\bod\bde\be (file_index_t index) const;\n std::uint32_t f\bfi\bil\ble\be_\b_p\bpa\bat\bth\bh_\b_h\bha\bas\bsh\bh (file_index_t index, std::string const&\n save_path) const;\n void a\bal\bll\bl_\b_p\bpa\bat\bth\bh_\b_h\bha\bas\bsh\bhe\bes\bs (std::unordered_set& table) const;\n file_flags_t f\bfi\bil\ble\be_\b_f\bfl\bla\bag\bgs\bs (file_index_t index) const;\n bool f\bfi\bil\ble\be_\b_a\bab\bbs\bso\bol\blu\but\bte\be_\b_p\bpa\bat\bth\bh (file_index_t index) const;\n@@ -167,31 +167,31 @@\n *\b**\b**\b**\b**\b* r\bre\bes\bse\ber\brv\bve\be(\b()\b) *\b**\b**\b**\b**\b*\n void r\bre\bes\bse\ber\brv\bve\be (int num_files);\n allocates space for num_files in the internal file list. This can be used to\n avoid reallocating the internal file list when the number of files to be added\n is known up-front.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_f\bfi\bil\ble\be_\b_b\bbo\bor\brr\bro\bow\bw(\b()\b) a\bad\bdd\bd_\b_f\bfi\bil\ble\be(\b()\b) *\b**\b**\b**\b**\b*\n-void a\bad\bdd\bd_\b_f\bfi\bil\ble\be (error_code& ec, std::string const& path, std::int64_t file_size\n- , file_flags_t file_flags = {}\n- , std::time_t mtime = 0, string_view symlink_path = string_view()\n+void a\bad\bdd\bd_\b_f\bfi\bil\ble\be_\b_b\bbo\bor\brr\bro\bow\bw (error_code& ec, string_view filename\n+ , std::string const& path, std::int64_t file_size\n+ , file_flags_t file_flags = {}, char const* filehash = nullptr\n+ , std::int64_t mtime = 0, string_view symlink_path = string_view()\n , char const* root_hash = nullptr);\n void a\bad\bdd\bd_\b_f\bfi\bil\ble\be_\b_b\bbo\bor\brr\bro\bow\bw (string_view filename\n , std::string const& path, std::int64_t file_size\n , file_flags_t file_flags = {}, char const* filehash = nullptr\n , std::int64_t mtime = 0, string_view symlink_path = string_view()\n , char const* root_hash = nullptr);\n void a\bad\bdd\bd_\b_f\bfi\bil\ble\be (std::string const& path, std::int64_t file_size\n , file_flags_t file_flags = {}\n , std::time_t mtime = 0, string_view symlink_path = string_view()\n , char const* root_hash = nullptr);\n-void a\bad\bdd\bd_\b_f\bfi\bil\ble\be_\b_b\bbo\bor\brr\bro\bow\bw (error_code& ec, string_view filename\n- , std::string const& path, std::int64_t file_size\n- , file_flags_t file_flags = {}, char const* filehash = nullptr\n- , std::int64_t mtime = 0, string_view symlink_path = string_view()\n+void a\bad\bdd\bd_\b_f\bfi\bil\ble\be (error_code& ec, std::string const& path, std::int64_t file_size\n+ , file_flags_t file_flags = {}\n+ , std::time_t mtime = 0, string_view symlink_path = string_view()\n , char const* root_hash = nullptr);\n Adds a file to the file storage. The add_file_borrow version expects that\n filename is the file name (without a path) of the file that's being added. This\n memory is b\bbo\bor\brr\bro\bow\bwe\bed\bd, i.e. it is the caller's responsibility to make sure it\n stays valid throughout the lifetime of this _\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be object or any copy of\n it. The same thing applies to filehash, which is an optional pointer to a 20\n byte binary SHA-1 hash of the file.\n@@ -261,17 +261,17 @@\n range-for loop. Where the values are the indices of all files in the\n _\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* t\bto\bot\bta\bal\bl_\b_s\bsi\biz\bze\be(\b()\b) *\b**\b**\b**\b**\b*\n std::int64_t t\bto\bot\bta\bal\bl_\b_s\bsi\biz\bze\be () const;\n returns the total number of bytes all the files in this torrent spans\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* s\bse\bet\bt_\b_n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs(\b()\b) n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n-int n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs () const;\n+*\b**\b**\b**\b**\b* n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs(\b()\b) s\bse\bet\bt_\b_n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n void s\bse\bet\bt_\b_n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs (int n);\n+int n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs () const;\n set and get the number of pieces in the torrent\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* e\ben\bnd\bd_\b_p\bpi\bie\bec\bce\be(\b()\b) *\b**\b**\b**\b**\b*\n piece_index_t e\ben\bnd\bd_\b_p\bpi\bie\bec\bce\be () const;\n returns the index of the one-past-end piece in the file storage\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* l\bla\bas\bst\bt_\b_p\bpi\bie\bec\bce\be(\b()\b) *\b**\b**\b**\b**\b*\n@@ -310,40 +310,40 @@\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* b\bbl\blo\boc\bck\bks\bs_\b_p\bpe\ber\br_\b_p\bpi\bie\bec\bce\be(\b()\b) *\b**\b**\b**\b**\b*\n int b\bbl\blo\boc\bck\bks\bs_\b_p\bpe\ber\br_\b_p\bpi\bie\bec\bce\be () const;\n returns the number of blocks there are in the typical piece. There may be fewer\n in the last piece)\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* s\bse\bet\bt_\b_n\bna\bam\bme\be(\b()\b) n\bna\bam\bme\be(\b()\b) *\b**\b**\b**\b**\b*\n-void s\bse\bet\bt_\b_n\bna\bam\bme\be (std::string const& n);\n std::string const& n\bna\bam\bme\be () const;\n+void s\bse\bet\bt_\b_n\bna\bam\bme\be (std::string const& n);\n set and get the name of this torrent. For multi-file torrents, this is also the\n name of the root directory all the files are stored in.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* s\bsw\bwa\bap\bp(\b()\b) *\b**\b**\b**\b**\b*\n void s\bsw\bwa\bap\bp (file_storage& ti) noexcept;\n swap all content of t\bth\bhi\bis\bs with t\bti\bi.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* c\bca\ban\bno\bon\bni\bic\bca\bal\bli\biz\bze\be(\b()\b) *\b**\b**\b**\b**\b*\n void c\bca\ban\bno\bon\bni\bic\bca\bal\bli\biz\bze\be ();\n arrange files and padding to match the canonical form required by BEP 52\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* f\bfi\bil\ble\be_\b_o\bof\bff\bfs\bse\bet\bt(\b()\b) p\bpa\bad\bd_\b_f\bfi\bil\ble\be_\b_a\bat\bt(\b()\b) m\bmt\bti\bim\bme\be(\b()\b) r\bro\boo\bot\bt_\b_p\bpt\btr\br(\b()\b) f\bfi\bil\ble\be_\b_s\bsi\biz\bze\be(\b()\b) r\bro\boo\bot\bt(\b()\b)\n-f\bfi\bil\ble\be_\b_n\bna\bam\bme\be(\b()\b) h\bha\bas\bsh\bh(\b()\b) s\bsy\bym\bml\bli\bin\bnk\bk(\b()\b) f\bfi\bil\ble\be_\b_p\bpa\bat\bth\bh(\b()\b) *\b**\b**\b**\b**\b*\n-std::int64_t f\bfi\bil\ble\be_\b_o\bof\bff\bfs\bse\bet\bt (file_index_t index) const;\n-std::time_t m\bmt\bti\bim\bme\be (file_index_t index) const;\n+*\b**\b**\b**\b**\b* m\bmt\bti\bim\bme\be(\b()\b) f\bfi\bil\ble\be_\b_n\bna\bam\bme\be(\b()\b) f\bfi\bil\ble\be_\b_o\bof\bff\bfs\bse\bet\bt(\b()\b) h\bha\bas\bsh\bh(\b()\b) r\bro\boo\bot\bt_\b_p\bpt\btr\br(\b()\b) f\bfi\bil\ble\be_\b_p\bpa\bat\bth\bh(\b()\b)\n+p\bpa\bad\bd_\b_f\bfi\bil\ble\be_\b_a\bat\bt(\b()\b) s\bsy\bym\bml\bli\bin\bnk\bk(\b()\b) r\bro\boo\bot\bt(\b()\b) f\bfi\bil\ble\be_\b_s\bsi\biz\bze\be(\b()\b) *\b**\b**\b**\b**\b*\n bool p\bpa\bad\bd_\b_f\bfi\bil\ble\be_\b_a\bat\bt (file_index_t index) const;\n-std::string f\bfi\bil\ble\be_\b_p\bpa\bat\bth\bh (file_index_t index, std::string const& save_path = \"\")\n-const;\n-sha1_hash h\bha\bas\bsh\bh (file_index_t index) const;\n-std::string s\bsy\bym\bml\bli\bin\bnk\bk (file_index_t index) const;\n sha256_hash r\bro\boo\bot\bt (file_index_t index) const;\n+sha1_hash h\bha\bas\bsh\bh (file_index_t index) const;\n+std::int64_t f\bfi\bil\ble\be_\b_s\bsi\biz\bze\be (file_index_t index) const;\n+std::time_t m\bmt\bti\bim\bme\be (file_index_t index) const;\n char const* r\bro\boo\bot\bt_\b_p\bpt\btr\br (file_index_t const index) const;\n+std::int64_t f\bfi\bil\ble\be_\b_o\bof\bff\bfs\bse\bet\bt (file_index_t index) const;\n string_view f\bfi\bil\ble\be_\b_n\bna\bam\bme\be (file_index_t index) const;\n-std::int64_t f\bfi\bil\ble\be_\b_s\bsi\biz\bze\be (file_index_t index) const;\n+std::string f\bfi\bil\ble\be_\b_p\bpa\bat\bth\bh (file_index_t index, std::string const& save_path = \"\")\n+const;\n+std::string s\bsy\bym\bml\bli\bin\bnk\bk (file_index_t index) const;\n These functions are used to query attributes of files at a given index.\n The hash() is a SHA-1 hash of the file, or 0 if none was provided in the\n torrent file. This can potentially be used to join a bittorrent network with\n other file sharing networks.\n root() returns the SHA-256 merkle tree root of the specified file, in case this\n is a v2 torrent. Otherwise returns zeros. root_ptr() returns a pointer to the\n SHA-256 merkle tree root hash for the specified file. The pointer points into\n@@ -356,18 +356,18 @@\n file_size() returns the size of a file.\n pad_file_at() returns true if the file at the given index is a pad-file.\n file_name() returns j\bju\bus\bst\bt the name of the file, whereas file_path() returns the\n path (inside the torrent file) with the filename appended.\n file_offset() returns the byte offset within the torrent file where this file\n starts. It can be used to map the file to a piece index (given the piece size).\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* f\bfi\bil\ble\be_\b_n\bnu\bum\bm_\b_b\bbl\blo\boc\bck\bks\bs(\b()\b) f\bfi\bil\ble\be_\b_n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs(\b()\b) f\bfi\bil\ble\be_\b_p\bpi\bie\bec\bce\be_\b_r\bra\ban\bng\bge\be(\b()\b) *\b**\b**\b**\b**\b*\n+*\b**\b**\b**\b**\b* f\bfi\bil\ble\be_\b_n\bnu\bum\bm_\b_b\bbl\blo\boc\bck\bks\bs(\b()\b) f\bfi\bil\ble\be_\b_p\bpi\bie\bec\bce\be_\b_r\bra\ban\bng\bge\be(\b()\b) f\bfi\bil\ble\be_\b_n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n int f\bfi\bil\ble\be_\b_n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs (file_index_t index) const;\n-int f\bfi\bil\ble\be_\b_n\bnu\bum\bm_\b_b\bbl\blo\boc\bck\bks\bs (file_index_t index) const;\n index_range f\bfi\bil\ble\be_\b_p\bpi\bie\bec\bce\be_\b_r\bra\ban\bng\bge\be (file_index_t) const;\n+int f\bfi\bil\ble\be_\b_n\bnu\bum\bm_\b_b\bbl\blo\boc\bck\bks\bs (file_index_t index) const;\n Returns the number of pieces or blocks the file atindexspans, under the\n assumption that the file is aligned to the start of a piece. This is only\n meaningful for v2 torrents, where files are guaranteed such alignment. These\n numbers are used to size and navigate the merkle hash tree for each file.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* f\bfi\bil\ble\be_\b_f\bfi\bir\brs\bst\bt_\b_p\bpi\bie\bec\bce\be_\b_n\bno\bod\bde\be(\b()\b) f\bfi\bil\ble\be_\b_f\bfi\bir\brs\bst\bt_\b_b\bbl\blo\boc\bck\bk_\b_n\bno\bod\bde\be(\b()\b) *\b**\b**\b**\b**\b*\n int f\bfi\bil\ble\be_\b_f\bfi\bir\brs\bst\bt_\b_b\bbl\blo\boc\bck\bk_\b_n\bno\bod\bde\be (file_index_t index) const;\n@@ -392,15 +392,15 @@\n returns a bitmask of flags from file_flags_t that apply to file at index.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* f\bfi\bil\ble\be_\b_a\bab\bbs\bso\bol\blu\but\bte\be_\b_p\bpa\bat\bth\bh(\b()\b) *\b**\b**\b**\b**\b*\n bool f\bfi\bil\ble\be_\b_a\bab\bbs\bso\bol\blu\but\bte\be_\b_p\bpa\bat\bth\bh (file_index_t index) const;\n returns true if the file at the specified index has been renamed to have an\n absolute path, i.e. is not anchored in the save path of the torrent.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* f\bfi\bil\ble\be_\b_i\bin\bnd\bde\bex\bx_\b_a\bat\bt_\b_o\bof\bff\bfs\bse\bet\bt(\b()\b) f\bfi\bil\ble\be_\b_i\bin\bnd\bde\bex\bx_\b_a\bat\bt_\b_p\bpi\bie\bec\bce\be(\b()\b) *\b**\b**\b**\b**\b*\n+*\b**\b**\b**\b**\b* f\bfi\bil\ble\be_\b_i\bin\bnd\bde\bex\bx_\b_a\bat\bt_\b_p\bpi\bie\bec\bce\be(\b()\b) f\bfi\bil\ble\be_\b_i\bin\bnd\bde\bex\bx_\b_a\bat\bt_\b_o\bof\bff\bfs\bse\bet\bt(\b()\b) *\b**\b**\b**\b**\b*\n file_index_t f\bfi\bil\ble\be_\b_i\bin\bnd\bde\bex\bx_\b_a\bat\bt_\b_p\bpi\bie\bec\bce\be (piece_index_t piece) const;\n file_index_t f\bfi\bil\ble\be_\b_i\bin\bnd\bde\bex\bx_\b_a\bat\bt_\b_o\bof\bff\bfs\bse\bet\bt (std::int64_t offset) const;\n returns the index of the file at the given offset in the torrent\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* f\bfi\bil\ble\be_\b_i\bin\bnd\bde\bex\bx_\b_f\bfo\bor\br_\b_r\bro\boo\bot\bt(\b()\b) *\b**\b**\b**\b**\b*\n file_index_t f\bfi\bil\ble\be_\b_i\bin\bnd\bde\bex\bx_\b_f\bfo\bor\br_\b_r\bro\boo\bot\bt (sha256_hash const& root_hash) const;\n finds the file with the given root hash and returns its index if there is no\n@@ -450,43 +450,43 @@\n file_storage const* m\bma\bap\bpp\bpe\bed\bd_\b_f\bfi\bil\ble\bes\bs = nullptr;\n std::string const& path;\n storage_mode_t m\bmo\bod\bde\be {storage_mode_sparse};\n aux::vector const& priorities;\n sha1_hash info_hash;\n };\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* m\bmm\bma\bap\bp_\b_d\bdi\bis\bsk\bk_\b_i\bio\bo_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br(\b()\b) *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bm_\bm_\ba_\bp_\b__\bd_\bi_\bs_\bk_\b__\bi_\bo_\b._\bh_\bp_\bp\"\n-std::unique_ptr m\bmm\bma\bap\bp_\b_d\bdi\bis\bsk\bk_\b_i\bio\bo_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br (\n+*\b**\b**\b**\b**\b**\b* d\bde\bef\bfa\bau\bul\blt\bt_\b_d\bdi\bis\bsk\bk_\b_i\bio\bo_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br(\b()\b) *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b._\bh_\bp_\bp\"\n+std::unique_ptr d\bde\bef\bfa\bau\bul\blt\bt_\b_d\bdi\bis\bsk\bk_\b_i\bio\bo_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br (\n io_context& ios, settings_interface const&, counters& cnt);\n-constructs a memory mapped file disk I/O object.\n+the constructor function for the default storage. On systems that support\n+memory mapped files (and a 64 bit address space) the memory mapped storage will\n+be constructed, otherwise the portable posix storage.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* d\bdi\bis\bsa\bab\bbl\ble\bed\bd_\b_d\bdi\bis\bsk\bk_\b_i\bio\bo_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br(\b()\b) *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bd_\bi_\bs_\ba_\bb_\bl_\be_\bd_\b__\bd_\bi_\bs_\bk_\b__\bi_\bo_\b._\bh_\bp_\bp\"\n std::unique_ptr d\bdi\bis\bsa\bab\bbl\ble\bed\bd_\b_d\bdi\bis\bsk\bk_\b_i\bio\bo_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br (\n io_context& ios, settings_interface const&, counters& cnt);\n creates a disk io object that discards all data written to it, and only returns\n zero-buffers when read from. May be useful for testing and benchmarking.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* d\bde\bef\bfa\bau\bul\blt\bt_\b_d\bdi\bis\bsk\bk_\b_i\bio\bo_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br(\b()\b) *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b._\bh_\bp_\bp\"\n-std::unique_ptr d\bde\bef\bfa\bau\bul\blt\bt_\b_d\bdi\bis\bsk\bk_\b_i\bio\bo_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br (\n- io_context& ios, settings_interface const&, counters& cnt);\n-the constructor function for the default storage. On systems that support\n-memory mapped files (and a 64 bit address space) the memory mapped storage will\n-be constructed, otherwise the portable posix storage.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* p\bpo\bos\bsi\bix\bx_\b_d\bdi\bis\bsk\bk_\b_i\bio\bo_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br(\b()\b) *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bp_\bo_\bs_\bi_\bx_\b__\bd_\bi_\bs_\bk_\b__\bi_\bo_\b._\bh_\bp_\bp\"\n std::unique_ptr p\bpo\bos\bsi\bix\bx_\b_d\bdi\bis\bsk\bk_\b_i\bio\bo_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br (\n io_context& ios, settings_interface const&, counters& cnt);\n this is a simple posix disk I/O back-end, used for systems that don't have a 64\n bit virtual address space or don't support memory mapped files. It's\n implemented using portable C file functions and is single-threaded.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* m\bmm\bma\bap\bp_\b_d\bdi\bis\bsk\bk_\b_i\bio\bo_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br(\b()\b) *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bm_\bm_\ba_\bp_\b__\bd_\bi_\bs_\bk_\b__\bi_\bo_\b._\bh_\bp_\bp\"\n+std::unique_ptr m\bmm\bma\bap\bp_\b_d\bdi\bis\bsk\bk_\b_i\bio\bo_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br (\n+ io_context& ios, settings_interface const&, counters& cnt);\n+constructs a memory mapped file disk I/O object.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* e\ben\bnu\bum\bm s\bst\bto\bor\bra\bag\bge\be_\b_m\bmo\bod\bde\be_\b_t\bt *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bd_\be_\bf_\bs_\b._\bh_\bp_\bp\"\n _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n |_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n | | |All pieces will be written to their final |\n | | |position, all files will be allocated in full |\n |storage_mode_allocate|0 |when the torrent is first started. This mode |\n"}]}, {"source1": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Torrent_Handle.html", "source2": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Torrent_Handle.html", "unified_diff": "@@ -39,52 +39,52 @@\n \n
  • partial_piece_info
  • \n
  • torrent_handle\n
  • \n
  • hash_value()
  • \n@@ -94,16 +94,16 @@\n

    block_info

    \n

    Declared in "libtorrent/torrent_handle.hpp"

    \n

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

    \n
    \n struct block_info\n {\n-   void set_peer (tcp::endpoint const& ep);\n    tcp::endpoint peer () const;\n+   void set_peer (tcp::endpoint const& ep);\n \n    enum block_state_t\n    {\n       none,\n       requested,\n       writing,\n       finished,\n@@ -115,16 +115,16 @@\n    unsigned num_peers:14;\n };\n 
    \n \n [report issue]
    \n

    set_peer() peer()

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

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

    \n [report issue]
    \n
    \n

    enum block_state_t

    \n

    Declared in "libtorrent/torrent_handle.hpp"

    \n
    \n@@ -254,119 +254,119 @@\n Which means you cannot perform any operation on it, unless you first\n assign it a valid handle. If you try to perform any operation on an\n uninitialized handle, it will throw invalid_handle.

    \n
    \n

    Warning

    \n

    All operations on a torrent_handle may throw system_error\n exception, in case the handle is no longer referring to a torrent.\n-There is one exception is_valid() will never throw. Since the torrents\n+There is one exception is_valid() will never throw. Since the torrents\n are processed by a background thread, there is no guarantee that a\n handle will remain valid between two calls.

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

    torrent_handle()

    \n
    \n torrent_handle () noexcept = default;\n 
    \n

    constructs a torrent handle that does not refer to a torrent.\n-i.e. is_valid() will return false.

    \n+i.e. is_valid() will return false.

    \n [report issue]
    \n
    \n

    add_piece()

    \n
    \n void add_piece (piece_index_t piece, std::vector<char> data, add_piece_flags_t flags = {}) const;\n void add_piece (piece_index_t piece, char const* data, add_piece_flags_t flags = {}) const;\n 
    \n@@ -444,21 +444,21 @@\n
    \n

    have_piece()

    \n
    \n bool have_piece (piece_index_t piece) const;\n 
    \n

    Returns true if this piece has been completely downloaded and written\n to disk, and false otherwise.

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

    get_peer_info() post_peer_info()

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

    post_peer_info() get_peer_info()

    \n
    \n-void post_peer_info () const;\n void get_peer_info (std::vector<peer_info>& v) const;\n+void post_peer_info () const;\n 
    \n

    Query information about connected peers for this torrent. If the\n torrent_handle is invalid, it will throw a system_error exception.

    \n

    post_peer_info() is asynchronous and will trigger the posting of\n a peer_info_alert. The alert contain a list of peer_info objects, one\n for each connected peer.

    \n

    get_peer_info() is synchronous and takes a reference to a vector\n@@ -467,16 +467,16 @@\n the vector contains information about that particular peer. See\n peer_info.

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

    post_status() status()

    \n
    \n-void post_status (status_flags_t flags = status_flags_t::all()) const;\n torrent_status status (status_flags_t flags = status_flags_t::all()) const;\n+void post_status (status_flags_t flags = status_flags_t::all()) const;\n 
    \n

    status() will return a structure with information about the status\n of this torrent. If the torrent_handle is invalid, it will throw\n system_error exception. See torrent_status. The flags\n argument filters what information is returned in the torrent_status.\n Some information in there is relatively expensive to calculate, and if\n you're not interested in it (and see performance issues), you can\n@@ -486,38 +486,38 @@\n instead call post_status(). It will trigger posting of a\n state_update_alert with a single torrent_status object for this\n torrent.

    \n

    In order to get regular updates for torrents whose status changes,\n consider calling session::post_torrent_updates()`` instead.

    \n

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

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

    post_download_queue() get_download_queue()

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

    get_download_queue() post_download_queue()

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

    post_download_queue() triggers a download_queue_alert to be\n posted.\n get_download_queue() is a synchronous call and returns a vector\n with information about pieces that are partially downloaded or not\n downloaded but partially requested. See partial_piece_info for the\n fields in the returned vector.

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

    reset_piece_deadline() clear_piece_deadlines() set_piece_deadline()

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

    clear_piece_deadlines() set_piece_deadline() reset_piece_deadline()

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

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

    clear_piece_deadlines() removes deadlines on all pieces in\n the torrent. As if reset_piece_deadline() was called on all pieces.

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

    post_file_progress() file_progress()

    \n
    \n-void file_progress (std::vector<std::int64_t>& progress, file_progress_flags_t flags = {}) const;\n-void post_file_progress (file_progress_flags_t flags) const;\n std::vector<std::int64_t> file_progress (file_progress_flags_t flags = {}) const;\n+void post_file_progress (file_progress_flags_t flags) const;\n+void file_progress (std::vector<std::int64_t>& progress, file_progress_flags_t flags = {}) const;\n 
    \n

    This function fills in the supplied vector, or returns a vector, with\n the number of bytes downloaded of each file in this torrent. The\n progress values are ordered the same as the files in the\n torrent_info.

    \n

    This operation is not very cheap. Its complexity is O(n + mj).\n Where n is the number of files, m is the number of currently\n@@ -573,28 +573,28 @@\n

    clear_error()

    \n
    \n void clear_error () const;\n 
    \n

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

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

    add_tracker() post_trackers() replace_trackers() trackers()

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

    add_tracker() replace_trackers() post_trackers() trackers()

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

    trackers() returns the list of trackers for this torrent. The\n announce entry contains both a string url which specify the\n-announce url for the tracker as well as an int tier, which is\n+announce url for the tracker as well as an int tier, which is\n specifies the order in which this tracker is tried. If you want\n libtorrent to use another list of trackers for this torrent, you can\n use replace_trackers() which takes a list of the same form as the\n one returned from trackers() and will replace it. If you want an\n immediate effect, you have to call force_reannounce(). See\n announce_entry.

    \n

    post_trackers() is the asynchronous version of trackers(). It\n@@ -608,35 +608,35 @@\n data will replace the original ones.

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

    add_url_seed() remove_url_seed() url_seeds()

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

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

    \n

    See http seeding for more information.

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

    add_http_seed() http_seeds() remove_http_seed()

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

    add_http_seed() remove_http_seed() http_seeds()

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

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

    \n

    See http seeding for more information.

    \n [report issue]
    \n
    \n@@ -673,27 +673,27 @@\n

    Returns true if this handle refers to a valid torrent and false if it\n hasn't been initialized or if the torrent it refers to has been\n removed from the session AND destructed.

    \n

    To tell if the torrent_handle is in the session, use\n torrent_handle::in_session(). This will return true before\n session_handle::remove_torrent() is called, and false\n afterward.

    \n-

    Clients should only use is_valid() to determine if the result of\n+

    Clients should only use is_valid() to determine if the result of\n session::find_torrent() was successful.

    \n-

    Unlike other member functions which return a value, is_valid()\n+

    Unlike other member functions which return a value, is_valid()\n completes immediately, without blocking on a result from the\n network thread. Also unlike other functions, it never throws\n the system_error exception.

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

    pause() resume()

    \n
    \n-void resume () const;\n void pause (pause_flags_t flags = {}) const;\n+void resume () const;\n 
    \n

    pause(), and resume() will disconnect all peers and reconnect\n all peers respectively. When a torrent is paused, it will however\n remember all share ratios to all peers and remember all potential (not\n connected) peers. Torrents may be paused automatically if there is a\n file error (e.g. disk full) or something similar. See\n file_error_alert.

    \n@@ -704,19 +704,19 @@\n
    \n

    Note

    \n

    Torrents that are auto-managed may be automatically resumed again. It\n does not make sense to pause an auto-managed torrent without making it\n not auto-managed first. Torrents are auto-managed by default when added\n to the session. For more information, see queuing.

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

    flags() set_flags() unset_flags()

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

    set_flags() flags() unset_flags()

    \n
    \n void set_flags (torrent_flags_t flags) const;\n torrent_flags_t flags () const;\n void unset_flags (torrent_flags_t flags) const;\n void set_flags (torrent_flags_t flags, torrent_flags_t mask) const;\n 
    \n

    sets and gets the torrent state flags. See torrent_flags_t.\n@@ -858,16 +858,16 @@\n report that they don't need to save resume data again, and skipped by\n the initial loop, and thwart the counter otherwise.

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

    need_save_resume_data()

    \n
    \n-bool need_save_resume_data () const;\n bool need_save_resume_data (resume_data_flags_t flags) const;\n+bool need_save_resume_data () const;\n 
    \n

    This function returns true if anything that is stored in the resume\n data has changed since the last time resume data was saved.\n The overload that takes flags let you ask if specific categories\n of properties have changed. These flags have the same behavior as in\n the save_resume_data() call.

    \n

    This is a blocking call. It will wait for a response from\n@@ -879,24 +879,24 @@\n

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

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

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

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

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

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

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

    \n

    When a torrent is removed or turns into a seed, all torrents with\n@@ -916,18 +916,18 @@\n

    queue_position_set()

    \n
    \n void queue_position_set (queue_position_t p) const;\n 
    \n

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

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

    set_ssl_certificate_buffer() set_ssl_certificate()

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

    set_ssl_certificate() set_ssl_certificate_buffer()

    \n
    \n void set_ssl_certificate_buffer (std::string const& certificate\n       , std::string const& private_key\n       , std::string const& dh_params);\n void set_ssl_certificate (std::string const& certificate\n       , std::string const& private_key\n       , std::string const& dh_params\n@@ -956,16 +956,16 @@\n provide a valid cert. If you don't have a cert you won't be allowed to\n connect to any peers.

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

    torrent_file_with_hashes() torrent_file()

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

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

    \n@@ -997,42 +997,42 @@\n
    \n std::vector<std::vector<sha256_hash>> piece_layers () const;\n 
    \n

    returns the piece layers for all files in the torrent. If this is a\n v1 torrent (and doesn't have any piece layers) it returns an empty\n vector. This is a blocking call that will synchronize with the\n libtorrent network thread.

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

    piece_availability() post_piece_availability()

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

    post_piece_availability() piece_availability()

    \n
    \n void piece_availability (std::vector<int>& avail) const;\n void post_piece_availability () const;\n 
    \n

    The piece availability is the number of peers that we are connected\n that has advertised having a particular piece. This is the information\n that libtorrent uses in order to prefer picking rare pieces.

    \n

    post_piece_availability() will trigger a piece_availability_alert\n to be posted.

    \n

    piece_availability() fills the specified std::vector<int>\n with the availability for each piece in this torrent. libtorrent does\n not keep track of availability for seeds, so if the torrent is\n seeding the availability for all pieces is reported as 0.

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

    get_piece_priorities() piece_priority() prioritize_pieces()

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

    piece_priority() prioritize_pieces() get_piece_priorities()

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

    These functions are used to set and get the priority of individual\n pieces. By default all pieces have priority 4. That means that the\n random rarest first algorithm is effectively active for all pieces.\n You may however change the priority of individual pieces. There are 8\n priority levels. 0 means not to download the piece at all. Otherwise,\n lower priority values means less likely to be picked. Piece priority\n@@ -1054,23 +1054,23 @@\n Invalid entries, where the piece index or priority is out of range, are\n not allowed.

    \n

    get_piece_priorities returns a vector with one element for each piece\n in the torrent. Each element is the current priority of that piece.

    \n

    It's possible to cancel the effect of file priorities by setting the\n priorities for the affected pieces. Care has to be taken when mixing\n usage of file- and piece priorities.

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

    file_priority() get_file_priorities() prioritize_files()

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

    prioritize_files() file_priority() get_file_priorities()

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

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

    \n

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

    \n

    prioritize_files() takes a vector that has at as many elements as\n there are files in the torrent. Each entry is the priority of that\n file. The function sets the priorities of all the pieces in the\n@@ -1094,23 +1094,23 @@\n file_prio_alert.

    \n

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

    \n

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

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

    force_reannounce() force_dht_announce() force_lsd_announce()

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

    force_dht_announce() force_lsd_announce() force_reannounce()

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

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

    \n

    If the tracker's min_interval has not passed since the last\n announce, the forced announce will be scheduled to happen immediately\n as the min_interval expires. This is to honor trackers minimum\n@@ -1134,25 +1134,25 @@\n idx is >= 0, the tracker with the specified index will scraped.

    \n

    A scrape request queries the tracker for statistics such as total\n number of incomplete peers, complete peers, number of downloads etc.

    \n

    This request will specifically update the num_complete and\n num_incomplete fields in the torrent_status struct once it\n completes. When it completes, it will generate a scrape_reply_alert.\n If it fails, it will generate a scrape_failed_alert.

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

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

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

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

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

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

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

    \n

    max_uploads() returns the current settings.

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

    max_connections() set_max_connections()

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

    set_max_connections() max_connections()

    \n
    \n-int max_connections () const;\n void set_max_connections (int max_connections) const;\n+int max_connections () const;\n 
    \n

    set_max_connections() sets the maximum number of connection this\n torrent will open. If all connections are used up, incoming\n connections may be refused or poor connections may be closed. This\n must be at least 2. The default is unlimited number of connections. If\n -1 is given to the function, it means unlimited. There is also a\n global limit of the number of connections, set by\n@@ -1275,37 +1275,37 @@\n

    rename_file()

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

    Renames the file with the given index asynchronously. The rename\n operation is complete when either a file_renamed_alert or\n file_rename_failed_alert is posted.

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

    info_hash() info_hashes()

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

    info_hashes() info_hash()

    \n
    \n info_hash_t info_hashes () const;\n sha1_hash info_hash () const;\n 
    \n

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

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

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

    \n+

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

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

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

    \n [report issue]
    \n
    \n

    id()

    \n
    \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -8,68 +8,68 @@\n           o _\be_\bn_\bu_\bm_\b _\bb_\bl_\bo_\bc_\bk_\b__\bs_\bt_\ba_\bt_\be_\b__\bt\n     * _\bp_\ba_\br_\bt_\bi_\ba_\bl_\b__\bp_\bi_\be_\bc_\be_\b__\bi_\bn_\bf_\bo\n     * _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be\n           o _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be_\b(_\b)\n           o _\ba_\bd_\bd_\b__\bp_\bi_\be_\bc_\be_\b(_\b)\n           o _\br_\be_\ba_\bd_\b__\bp_\bi_\be_\bc_\be_\b(_\b)\n           o _\bh_\ba_\bv_\be_\b__\bp_\bi_\be_\bc_\be_\b(_\b)\n-          o _\bg_\be_\bt_\b__\bp_\be_\be_\br_\b__\bi_\bn_\bf_\bo_\b(_\b)_\b _\bp_\bo_\bs_\bt_\b__\bp_\be_\be_\br_\b__\bi_\bn_\bf_\bo_\b(_\b)\n+          o _\bp_\bo_\bs_\bt_\b__\bp_\be_\be_\br_\b__\bi_\bn_\bf_\bo_\b(_\b)_\b _\bg_\be_\bt_\b__\bp_\be_\be_\br_\b__\bi_\bn_\bf_\bo_\b(_\b)\n           o _\bp_\bo_\bs_\bt_\b__\bs_\bt_\ba_\bt_\bu_\bs_\b(_\b)_\b _\bs_\bt_\ba_\bt_\bu_\bs_\b(_\b)\n-          o _\bp_\bo_\bs_\bt_\b__\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\b__\bq_\bu_\be_\bu_\be_\b(_\b)_\b _\bg_\be_\bt_\b__\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\b__\bq_\bu_\be_\bu_\be_\b(_\b)\n-          o _\br_\be_\bs_\be_\bt_\b__\bp_\bi_\be_\bc_\be_\b__\bd_\be_\ba_\bd_\bl_\bi_\bn_\be_\b(_\b)_\b _\bc_\bl_\be_\ba_\br_\b__\bp_\bi_\be_\bc_\be_\b__\bd_\be_\ba_\bd_\bl_\bi_\bn_\be_\bs_\b(_\b)_\b _\bs_\be_\bt_\b__\bp_\bi_\be_\bc_\be_\b__\bd_\be_\ba_\bd_\bl_\bi_\bn_\be_\b(_\b)\n+          o _\bg_\be_\bt_\b__\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\b__\bq_\bu_\be_\bu_\be_\b(_\b)_\b _\bp_\bo_\bs_\bt_\b__\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\b__\bq_\bu_\be_\bu_\be_\b(_\b)\n+          o _\bc_\bl_\be_\ba_\br_\b__\bp_\bi_\be_\bc_\be_\b__\bd_\be_\ba_\bd_\bl_\bi_\bn_\be_\bs_\b(_\b)_\b _\bs_\be_\bt_\b__\bp_\bi_\be_\bc_\be_\b__\bd_\be_\ba_\bd_\bl_\bi_\bn_\be_\b(_\b)_\b _\br_\be_\bs_\be_\bt_\b__\bp_\bi_\be_\bc_\be_\b__\bd_\be_\ba_\bd_\bl_\bi_\bn_\be_\b(_\b)\n           o _\bp_\bo_\bs_\bt_\b__\bf_\bi_\bl_\be_\b__\bp_\br_\bo_\bg_\br_\be_\bs_\bs_\b(_\b)_\b _\bf_\bi_\bl_\be_\b__\bp_\br_\bo_\bg_\br_\be_\bs_\bs_\b(_\b)\n           o _\bf_\bi_\bl_\be_\b__\bs_\bt_\ba_\bt_\bu_\bs_\b(_\b)\n           o _\bc_\bl_\be_\ba_\br_\b__\be_\br_\br_\bo_\br_\b(_\b)\n-          o _\ba_\bd_\bd_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\b(_\b)_\b _\bp_\bo_\bs_\bt_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\bs_\b(_\b)_\b _\br_\be_\bp_\bl_\ba_\bc_\be_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\bs_\b(_\b)_\b _\bt_\br_\ba_\bc_\bk_\be_\br_\bs_\b(_\b)\n+          o _\ba_\bd_\bd_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\b(_\b)_\b _\br_\be_\bp_\bl_\ba_\bc_\be_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\bs_\b(_\b)_\b _\bp_\bo_\bs_\bt_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\bs_\b(_\b)_\b _\bt_\br_\ba_\bc_\bk_\be_\br_\bs_\b(_\b)\n           o _\ba_\bd_\bd_\b__\bu_\br_\bl_\b__\bs_\be_\be_\bd_\b(_\b)_\b _\br_\be_\bm_\bo_\bv_\be_\b__\bu_\br_\bl_\b__\bs_\be_\be_\bd_\b(_\b)_\b _\bu_\br_\bl_\b__\bs_\be_\be_\bd_\bs_\b(_\b)\n-          o _\ba_\bd_\bd_\b__\bh_\bt_\bt_\bp_\b__\bs_\be_\be_\bd_\b(_\b)_\b _\bh_\bt_\bt_\bp_\b__\bs_\be_\be_\bd_\bs_\b(_\b)_\b _\br_\be_\bm_\bo_\bv_\be_\b__\bh_\bt_\bt_\bp_\b__\bs_\be_\be_\bd_\b(_\b)\n+          o _\ba_\bd_\bd_\b__\bh_\bt_\bt_\bp_\b__\bs_\be_\be_\bd_\b(_\b)_\b _\br_\be_\bm_\bo_\bv_\be_\b__\bh_\bt_\bt_\bp_\b__\bs_\be_\be_\bd_\b(_\b)_\b _\bh_\bt_\bt_\bp_\b__\bs_\be_\be_\bd_\bs_\b(_\b)\n           o _\ba_\bd_\bd_\b__\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\b(_\b)\n           o _\bs_\be_\bt_\b__\bm_\be_\bt_\ba_\bd_\ba_\bt_\ba_\b(_\b)\n           o _\bi_\bs_\b__\bv_\ba_\bl_\bi_\bd_\b(_\b)\n           o _\bp_\ba_\bu_\bs_\be_\b(_\b)_\b _\br_\be_\bs_\bu_\bm_\be_\b(_\b)\n-          o _\bf_\bl_\ba_\bg_\bs_\b(_\b)_\b _\bs_\be_\bt_\b__\bf_\bl_\ba_\bg_\bs_\b(_\b)_\b _\bu_\bn_\bs_\be_\bt_\b__\bf_\bl_\ba_\bg_\bs_\b(_\b)\n+          o _\bs_\be_\bt_\b__\bf_\bl_\ba_\bg_\bs_\b(_\b)_\b _\bf_\bl_\ba_\bg_\bs_\b(_\b)_\b _\bu_\bn_\bs_\be_\bt_\b__\bf_\bl_\ba_\bg_\bs_\b(_\b)\n           o _\bf_\bl_\bu_\bs_\bh_\b__\bc_\ba_\bc_\bh_\be_\b(_\b)\n           o _\bf_\bo_\br_\bc_\be_\b__\br_\be_\bc_\bh_\be_\bc_\bk_\b(_\b)\n           o _\bs_\ba_\bv_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b)\n           o _\bn_\be_\be_\bd_\b__\bs_\ba_\bv_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b)\n-          o _\bq_\bu_\be_\bu_\be_\b__\bp_\bo_\bs_\bi_\bt_\bi_\bo_\bn_\b__\bu_\bp_\b(_\b)_\b _\bq_\bu_\be_\bu_\be_\b__\bp_\bo_\bs_\bi_\bt_\bi_\bo_\bn_\b__\bt_\bo_\bp_\b(_\b)_\b _\bq_\bu_\be_\bu_\be_\b__\bp_\bo_\bs_\bi_\bt_\bi_\bo_\bn_\b(_\b)\n-            _\bq_\bu_\be_\bu_\be_\b__\bp_\bo_\bs_\bi_\bt_\bi_\bo_\bn_\b__\bb_\bo_\bt_\bt_\bo_\bm_\b(_\b)_\b _\bq_\bu_\be_\bu_\be_\b__\bp_\bo_\bs_\bi_\bt_\bi_\bo_\bn_\b__\bd_\bo_\bw_\bn_\b(_\b)\n+          o _\bq_\bu_\be_\bu_\be_\b__\bp_\bo_\bs_\bi_\bt_\bi_\bo_\bn_\b__\bu_\bp_\b(_\b)_\b _\bq_\bu_\be_\bu_\be_\b__\bp_\bo_\bs_\bi_\bt_\bi_\bo_\bn_\b__\bt_\bo_\bp_\b(_\b)_\b _\bq_\bu_\be_\bu_\be_\b__\bp_\bo_\bs_\bi_\bt_\bi_\bo_\bn_\b__\bd_\bo_\bw_\bn_\b(_\b)\n+            _\bq_\bu_\be_\bu_\be_\b__\bp_\bo_\bs_\bi_\bt_\bi_\bo_\bn_\b(_\b)_\b _\bq_\bu_\be_\bu_\be_\b__\bp_\bo_\bs_\bi_\bt_\bi_\bo_\bn_\b__\bb_\bo_\bt_\bt_\bo_\bm_\b(_\b)\n           o _\bq_\bu_\be_\bu_\be_\b__\bp_\bo_\bs_\bi_\bt_\bi_\bo_\bn_\b__\bs_\be_\bt_\b(_\b)\n-          o _\bs_\be_\bt_\b__\bs_\bs_\bl_\b__\bc_\be_\br_\bt_\bi_\bf_\bi_\bc_\ba_\bt_\be_\b__\bb_\bu_\bf_\bf_\be_\br_\b(_\b)_\b _\bs_\be_\bt_\b__\bs_\bs_\bl_\b__\bc_\be_\br_\bt_\bi_\bf_\bi_\bc_\ba_\bt_\be_\b(_\b)\n+          o _\bs_\be_\bt_\b__\bs_\bs_\bl_\b__\bc_\be_\br_\bt_\bi_\bf_\bi_\bc_\ba_\bt_\be_\b(_\b)_\b _\bs_\be_\bt_\b__\bs_\bs_\bl_\b__\bc_\be_\br_\bt_\bi_\bf_\bi_\bc_\ba_\bt_\be_\b__\bb_\bu_\bf_\bf_\be_\br_\b(_\b)\n           o _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bi_\bl_\be_\b__\bw_\bi_\bt_\bh_\b__\bh_\ba_\bs_\bh_\be_\bs_\b(_\b)_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bi_\bl_\be_\b(_\b)\n           o _\bp_\bi_\be_\bc_\be_\b__\bl_\ba_\by_\be_\br_\bs_\b(_\b)\n-          o _\bp_\bi_\be_\bc_\be_\b__\ba_\bv_\ba_\bi_\bl_\ba_\bb_\bi_\bl_\bi_\bt_\by_\b(_\b)_\b _\bp_\bo_\bs_\bt_\b__\bp_\bi_\be_\bc_\be_\b__\ba_\bv_\ba_\bi_\bl_\ba_\bb_\bi_\bl_\bi_\bt_\by_\b(_\b)\n-          o _\bg_\be_\bt_\b__\bp_\bi_\be_\bc_\be_\b__\bp_\br_\bi_\bo_\br_\bi_\bt_\bi_\be_\bs_\b(_\b)_\b _\bp_\bi_\be_\bc_\be_\b__\bp_\br_\bi_\bo_\br_\bi_\bt_\by_\b(_\b)_\b _\bp_\br_\bi_\bo_\br_\bi_\bt_\bi_\bz_\be_\b__\bp_\bi_\be_\bc_\be_\bs_\b(_\b)\n-          o _\bf_\bi_\bl_\be_\b__\bp_\br_\bi_\bo_\br_\bi_\bt_\by_\b(_\b)_\b _\bg_\be_\bt_\b__\bf_\bi_\bl_\be_\b__\bp_\br_\bi_\bo_\br_\bi_\bt_\bi_\be_\bs_\b(_\b)_\b _\bp_\br_\bi_\bo_\br_\bi_\bt_\bi_\bz_\be_\b__\bf_\bi_\bl_\be_\bs_\b(_\b)\n-          o _\bf_\bo_\br_\bc_\be_\b__\br_\be_\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b(_\b)_\b _\bf_\bo_\br_\bc_\be_\b__\bd_\bh_\bt_\b__\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b(_\b)_\b _\bf_\bo_\br_\bc_\be_\b__\bl_\bs_\bd_\b__\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b(_\b)\n+          o _\bp_\bo_\bs_\bt_\b__\bp_\bi_\be_\bc_\be_\b__\ba_\bv_\ba_\bi_\bl_\ba_\bb_\bi_\bl_\bi_\bt_\by_\b(_\b)_\b _\bp_\bi_\be_\bc_\be_\b__\ba_\bv_\ba_\bi_\bl_\ba_\bb_\bi_\bl_\bi_\bt_\by_\b(_\b)\n+          o _\bp_\bi_\be_\bc_\be_\b__\bp_\br_\bi_\bo_\br_\bi_\bt_\by_\b(_\b)_\b _\bp_\br_\bi_\bo_\br_\bi_\bt_\bi_\bz_\be_\b__\bp_\bi_\be_\bc_\be_\bs_\b(_\b)_\b _\bg_\be_\bt_\b__\bp_\bi_\be_\bc_\be_\b__\bp_\br_\bi_\bo_\br_\bi_\bt_\bi_\be_\bs_\b(_\b)\n+          o _\bp_\br_\bi_\bo_\br_\bi_\bt_\bi_\bz_\be_\b__\bf_\bi_\bl_\be_\bs_\b(_\b)_\b _\bf_\bi_\bl_\be_\b__\bp_\br_\bi_\bo_\br_\bi_\bt_\by_\b(_\b)_\b _\bg_\be_\bt_\b__\bf_\bi_\bl_\be_\b__\bp_\br_\bi_\bo_\br_\bi_\bt_\bi_\be_\bs_\b(_\b)\n+          o _\bf_\bo_\br_\bc_\be_\b__\bd_\bh_\bt_\b__\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b(_\b)_\b _\bf_\bo_\br_\bc_\be_\b__\bl_\bs_\bd_\b__\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b(_\b)_\b _\bf_\bo_\br_\bc_\be_\b__\br_\be_\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b(_\b)\n           o _\bs_\bc_\br_\ba_\bp_\be_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\b(_\b)\n-          o _\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\b__\bl_\bi_\bm_\bi_\bt_\b(_\b)_\b _\bs_\be_\bt_\b__\bu_\bp_\bl_\bo_\ba_\bd_\b__\bl_\bi_\bm_\bi_\bt_\b(_\b)_\b _\bu_\bp_\bl_\bo_\ba_\bd_\b__\bl_\bi_\bm_\bi_\bt_\b(_\b)\n+          o _\bs_\be_\bt_\b__\bu_\bp_\bl_\bo_\ba_\bd_\b__\bl_\bi_\bm_\bi_\bt_\b(_\b)_\b _\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\b__\bl_\bi_\bm_\bi_\bt_\b(_\b)_\b _\bu_\bp_\bl_\bo_\ba_\bd_\b__\bl_\bi_\bm_\bi_\bt_\b(_\b)\n             _\bs_\be_\bt_\b__\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\b__\bl_\bi_\bm_\bi_\bt_\b(_\b)\n           o _\bc_\bo_\bn_\bn_\be_\bc_\bt_\b__\bp_\be_\be_\br_\b(_\b)\n           o _\bc_\bl_\be_\ba_\br_\b__\bp_\be_\be_\br_\bs_\b(_\b)\n           o _\bs_\be_\bt_\b__\bm_\ba_\bx_\b__\bu_\bp_\bl_\bo_\ba_\bd_\bs_\b(_\b)_\b _\bm_\ba_\bx_\b__\bu_\bp_\bl_\bo_\ba_\bd_\bs_\b(_\b)\n-          o _\bm_\ba_\bx_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\bs_\b(_\b)_\b _\bs_\be_\bt_\b__\bm_\ba_\bx_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\bs_\b(_\b)\n+          o _\bs_\be_\bt_\b__\bm_\ba_\bx_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\bs_\b(_\b)_\b _\bm_\ba_\bx_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\bs_\b(_\b)\n           o _\bm_\bo_\bv_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b(_\b)\n           o _\br_\be_\bn_\ba_\bm_\be_\b__\bf_\bi_\bl_\be_\b(_\b)\n-          o _\bi_\bn_\bf_\bo_\b__\bh_\ba_\bs_\bh_\b(_\b)_\b _\bi_\bn_\bf_\bo_\b__\bh_\ba_\bs_\bh_\be_\bs_\b(_\b)\n-          o _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b=_\b=_\b(_\b)_\b _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b!_\b=_\b(_\b)_\b _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b<_\b(_\b)\n+          o _\bi_\bn_\bf_\bo_\b__\bh_\ba_\bs_\bh_\be_\bs_\b(_\b)_\b _\bi_\bn_\bf_\bo_\b__\bh_\ba_\bs_\bh_\b(_\b)\n+          o _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b<_\b(_\b)_\b _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b!_\b=_\b(_\b)_\b _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b=_\b=_\b(_\b)\n           o _\bi_\bd_\b(_\b)\n           o _\bn_\ba_\bt_\bi_\bv_\be_\b__\bh_\ba_\bn_\bd_\bl_\be_\b(_\b)\n           o _\bu_\bs_\be_\br_\bd_\ba_\bt_\ba_\b(_\b)\n           o _\bi_\bn_\b__\bs_\be_\bs_\bs_\bi_\bo_\bn_\b(_\b)\n     * _\bh_\ba_\bs_\bh_\b__\bv_\ba_\bl_\bu_\be_\b(_\b)\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* b\bbl\blo\boc\bck\bk_\b_i\bin\bnf\bfo\bo *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be_\b._\bh_\bp_\bp\"\n holds the state of a block in a piece. Who we requested it from and how far\n along we are at downloading it.\n struct block_info\n {\n-   void s\bse\bet\bt_\b_p\bpe\bee\ber\br (tcp::endpoint const& ep);\n    _\bt_\bc_\bp_\b:_\b:_\be_\bn_\bd_\bp_\bo_\bi_\bn_\bt p\bpe\bee\ber\br () const;\n+   void s\bse\bet\bt_\b_p\bpe\bee\ber\br (tcp::endpoint const& ep);\n \n    enum block_state_t\n    {\n       none,\n       requested,\n       writing,\n       finished,\n@@ -78,16 +78,16 @@\n    unsigned bytes_progress:15;\n    unsigned block_size:15;\n    unsigned state:2;\n    unsigned num_peers:14;\n };\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* s\bse\bet\bt_\b_p\bpe\bee\ber\br(\b()\b) p\bpe\bee\ber\br(\b()\b) *\b**\b**\b**\b**\b*\n-void s\bse\bet\bt_\b_p\bpe\bee\ber\br (tcp::endpoint const& ep);\n _\bt_\bc_\bp_\b:_\b:_\be_\bn_\bd_\bp_\bo_\bi_\bn_\bt p\bpe\bee\ber\br () const;\n+void s\bse\bet\bt_\b_p\bpe\bee\ber\br (tcp::endpoint const& ep);\n The peer is the ip address of the peer this block was downloaded from.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* e\ben\bnu\bum\bm b\bbl\blo\boc\bck\bk_\b_s\bst\bta\bat\bte\be_\b_t\bt *\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be_\b._\bh_\bp_\bp\"\n  _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n |_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |none     |0    |This block has not been downloaded or requested form any   |\n@@ -181,114 +181,114 @@\n    t\bto\bor\brr\bre\ben\bnt\bt_\b_h\bha\ban\bnd\bdl\ble\be () noexcept = default;\n    void a\bad\bdd\bd_\b_p\bpi\bie\bec\bce\be (piece_index_t piece, std::vector data,\n add_piece_flags_t flags = {}) const;\n    void a\bad\bdd\bd_\b_p\bpi\bie\bec\bce\be (piece_index_t piece, char const* data, add_piece_flags_t\n flags = {}) const;\n    void r\bre\bea\bad\bd_\b_p\bpi\bie\bec\bce\be (piece_index_t piece) const;\n    bool h\bha\bav\bve\be_\b_p\bpi\bie\bec\bce\be (piece_index_t piece) const;\n-   void p\bpo\bos\bst\bt_\b_p\bpe\bee\ber\br_\b_i\bin\bnf\bfo\bo () const;\n    void g\bge\bet\bt_\b_p\bpe\bee\ber\br_\b_i\bin\bnf\bfo\bo (std::vector& v) const;\n-   void p\bpo\bos\bst\bt_\b_s\bst\bta\bat\btu\bus\bs (status_flags_t flags = status_flags_t::all()) const;\n+   void p\bpo\bos\bst\bt_\b_p\bpe\bee\ber\br_\b_i\bin\bnf\bfo\bo () const;\n    torrent_status s\bst\bta\bat\btu\bus\bs (status_flags_t flags = status_flags_t::all()) const;\n-   std::vector g\bge\bet\bt_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_q\bqu\bue\beu\bue\be () const;\n-   void p\bpo\bos\bst\bt_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_q\bqu\bue\beu\bue\be () const;\n+   void p\bpo\bos\bst\bt_\b_s\bst\bta\bat\btu\bus\bs (status_flags_t flags = status_flags_t::all()) const;\n    void g\bge\bet\bt_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_q\bqu\bue\beu\bue\be (std::vector& queue) const;\n-   void r\bre\bes\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_d\bde\bea\bad\bdl\bli\bin\bne\be (piece_index_t index) const;\n+   void p\bpo\bos\bst\bt_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_q\bqu\bue\beu\bue\be () const;\n+   std::vector g\bge\bet\bt_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_q\bqu\bue\beu\bue\be () const;\n    void s\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_d\bde\bea\bad\bdl\bli\bin\bne\be (piece_index_t index, int deadline, deadline_flags_t\n flags = {}) const;\n    void c\bcl\ble\bea\bar\br_\b_p\bpi\bie\bec\bce\be_\b_d\bde\bea\bad\bdl\bli\bin\bne\bes\bs () const;\n-   void f\bfi\bil\ble\be_\b_p\bpr\bro\bog\bgr\bre\bes\bss\bs (std::vector& progress,\n-file_progress_flags_t flags = {}) const;\n-   void p\bpo\bos\bst\bt_\b_f\bfi\bil\ble\be_\b_p\bpr\bro\bog\bgr\bre\bes\bss\bs (file_progress_flags_t flags) const;\n+   void r\bre\bes\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_d\bde\bea\bad\bdl\bli\bin\bne\be (piece_index_t index) const;\n    std::vector f\bfi\bil\ble\be_\b_p\bpr\bro\bog\bgr\bre\bes\bss\bs (file_progress_flags_t flags = {})\n const;\n+   void p\bpo\bos\bst\bt_\b_f\bfi\bil\ble\be_\b_p\bpr\bro\bog\bgr\bre\bes\bss\bs (file_progress_flags_t flags) const;\n+   void f\bfi\bil\ble\be_\b_p\bpr\bro\bog\bgr\bre\bes\bss\bs (std::vector& progress,\n+file_progress_flags_t flags = {}) const;\n    std::vector f\bfi\bil\ble\be_\b_s\bst\bta\bat\btu\bus\bs () const;\n    void c\bcl\ble\bea\bar\br_\b_e\ber\brr\bro\bor\br () const;\n+   std::vector t\btr\bra\bac\bck\bke\ber\brs\bs () const;\n    void p\bpo\bos\bst\bt_\b_t\btr\bra\bac\bck\bke\ber\brs\bs () const;\n    void a\bad\bdd\bd_\b_t\btr\bra\bac\bck\bke\ber\br (announce_entry const&) const;\n    void r\bre\bep\bpl\bla\bac\bce\be_\b_t\btr\bra\bac\bck\bke\ber\brs\bs (std::vector const&) const;\n-   std::vector t\btr\bra\bac\bck\bke\ber\brs\bs () const;\n-   std::set u\bur\brl\bl_\b_s\bse\bee\bed\bds\bs () const;\n    void r\bre\bem\bmo\bov\bve\be_\b_u\bur\brl\bl_\b_s\bse\bee\bed\bd (std::string const& url) const;\n+   std::set u\bur\brl\bl_\b_s\bse\bee\bed\bds\bs () const;\n    void a\bad\bdd\bd_\b_u\bur\brl\bl_\b_s\bse\bee\bed\bd (std::string const& url) const;\n-   void r\bre\bem\bmo\bov\bve\be_\b_h\bht\btt\btp\bp_\b_s\bse\bee\bed\bd (std::string const& url) const;\n    void a\bad\bdd\bd_\b_h\bht\btt\btp\bp_\b_s\bse\bee\bed\bd (std::string const& url) const;\n+   void r\bre\bem\bmo\bov\bve\be_\b_h\bht\btt\btp\bp_\b_s\bse\bee\bed\bd (std::string const& url) const;\n    std::set h\bht\btt\btp\bp_\b_s\bse\bee\bed\bds\bs () const;\n    void a\bad\bdd\bd_\b_e\bex\bxt\bte\ben\bns\bsi\bio\bon\bn (\n       std::function(torrent_handle const&,\n client_data_t)> const& ext\n       , client_data_t userdata = client_data_t{});\n    bool s\bse\bet\bt_\b_m\bme\bet\bta\bad\bda\bat\bta\ba (span metadata) const;\n    bool i\bis\bs_\b_v\bva\bal\bli\bid\bd () const;\n-   void r\bre\bes\bsu\bum\bme\be () const;\n    void p\bpa\bau\bus\bse\be (pause_flags_t flags = {}) const;\n+   void r\bre\bes\bsu\bum\bme\be () const;\n    void s\bse\bet\bt_\b_f\bfl\bla\bag\bgs\bs (torrent_flags_t flags) const;\n    torrent_flags_t f\bfl\bla\bag\bgs\bs () const;\n    void u\bun\bns\bse\bet\bt_\b_f\bfl\bla\bag\bgs\bs (torrent_flags_t flags) const;\n    void s\bse\bet\bt_\b_f\bfl\bla\bag\bgs\bs (torrent_flags_t flags, torrent_flags_t mask) const;\n    void f\bfl\blu\bus\bsh\bh_\b_c\bca\bac\bch\bhe\be () const;\n    void f\bfo\bor\brc\bce\be_\b_r\bre\bec\bch\bhe\bec\bck\bk () const;\n    void s\bsa\bav\bve\be_\b_r\bre\bes\bsu\bum\bme\be_\b_d\bda\bat\bta\ba (resume_data_flags_t flags = {}) const;\n-   bool n\bne\bee\bed\bd_\b_s\bsa\bav\bve\be_\b_r\bre\bes\bsu\bum\bme\be_\b_d\bda\bat\bta\ba () const;\n    bool n\bne\bee\bed\bd_\b_s\bsa\bav\bve\be_\b_r\bre\bes\bsu\bum\bme\be_\b_d\bda\bat\bta\ba (resume_data_flags_t flags) const;\n+   bool n\bne\bee\bed\bd_\b_s\bsa\bav\bve\be_\b_r\bre\bes\bsu\bum\bme\be_\b_d\bda\bat\bta\ba () const;\n    void q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn_\b_b\bbo\bot\btt\bto\bom\bm () const;\n    void q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn_\b_t\bto\bop\bp () const;\n-   void q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn_\b_u\bup\bp () const;\n    void q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn_\b_d\bdo\bow\bwn\bn () const;\n+   void q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn_\b_u\bup\bp () const;\n    queue_position_t q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn () const;\n    void q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn_\b_s\bse\bet\bt (queue_position_t p) const;\n    void s\bse\bet\bt_\b_s\bss\bsl\bl_\b_c\bce\ber\brt\bti\bif\bfi\bic\bca\bat\bte\be_\b_b\bbu\buf\bff\bfe\ber\br (std::string const& certificate\n       , std::string const& private_key\n       , std::string const& dh_params);\n    void s\bse\bet\bt_\b_s\bss\bsl\bl_\b_c\bce\ber\brt\bti\bif\bfi\bic\bca\bat\bte\be (std::string const& certificate\n       , std::string const& private_key\n       , std::string const& dh_params\n       , std::string const& passphrase = \"\");\n-   std::shared_ptr t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be_\b_w\bwi\bit\bth\bh_\b_h\bha\bas\bsh\bhe\bes\bs () const;\n    std::shared_ptr t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be () const;\n+   std::shared_ptr t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be_\b_w\bwi\bit\bth\bh_\b_h\bha\bas\bsh\bhe\bes\bs () const;\n    std::vector> p\bpi\bie\bec\bce\be_\b_l\bla\bay\bye\ber\brs\bs () const;\n    void p\bpi\bie\bec\bce\be_\b_a\bav\bva\bai\bil\bla\bab\bbi\bil\bli\bit\bty\by (std::vector& avail) const;\n    void p\bpo\bos\bst\bt_\b_p\bpi\bie\bec\bce\be_\b_a\bav\bva\bai\bil\bla\bab\bbi\bil\bli\bit\bty\by () const;\n    void p\bpr\bri\bio\bor\bri\bit\bti\biz\bze\be_\b_p\bpi\bie\bec\bce\bes\bs (std::vector const& pieces)\n const;\n    download_priority_t p\bpi\bie\bec\bce\be_\b_p\bpr\bri\bio\bor\bri\bit\bty\by (piece_index_t index) const;\n    std::vector g\bge\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_p\bpr\bri\bio\bor\bri\bit\bti\bie\bes\bs () const;\n-   void p\bpi\bie\bec\bce\be_\b_p\bpr\bri\bio\bor\bri\bit\bty\by (piece_index_t index, download_priority_t priority)\n-const;\n    void p\bpr\bri\bio\bor\bri\bit\bti\biz\bze\be_\b_p\bpi\bie\bec\bce\bes\bs (std::vector> const& pieces) const;\n+   void p\bpi\bie\bec\bce\be_\b_p\bpr\bri\bio\bor\bri\bit\bty\by (piece_index_t index, download_priority_t priority)\n+const;\n    std::vector g\bge\bet\bt_\b_f\bfi\bil\ble\be_\b_p\bpr\bri\bio\bor\bri\bit\bti\bie\bes\bs () const;\n-   void f\bfi\bil\ble\be_\b_p\bpr\bri\bio\bor\bri\bit\bty\by (file_index_t index, download_priority_t priority) const;\n    download_priority_t f\bfi\bil\ble\be_\b_p\bpr\bri\bio\bor\bri\bit\bty\by (file_index_t index) const;\n+   void f\bfi\bil\ble\be_\b_p\bpr\bri\bio\bor\bri\bit\bty\by (file_index_t index, download_priority_t priority) const;\n    void p\bpr\bri\bio\bor\bri\bit\bti\biz\bze\be_\b_f\bfi\bil\ble\bes\bs (std::vector const& files) const;\n-   void f\bfo\bor\brc\bce\be_\b_l\bls\bsd\bd_\b_a\ban\bnn\bno\bou\bun\bnc\bce\be () const;\n    void f\bfo\bor\brc\bce\be_\b_d\bdh\bht\bt_\b_a\ban\bnn\bno\bou\bun\bnc\bce\be () const;\n    void f\bfo\bor\brc\bce\be_\b_r\bre\bea\ban\bnn\bno\bou\bun\bnc\bce\be (int seconds = 0, int idx = -1, reannounce_flags_t =\n {}) const;\n+   void f\bfo\bor\brc\bce\be_\b_l\bls\bsd\bd_\b_a\ban\bnn\bno\bou\bun\bnc\bce\be () const;\n    void s\bsc\bcr\bra\bap\bpe\be_\b_t\btr\bra\bac\bck\bke\ber\br (int idx = -1) const;\n+   int u\bup\bpl\blo\boa\bad\bd_\b_l\bli\bim\bmi\bit\bt () const;\n    void s\bse\bet\bt_\b_u\bup\bpl\blo\boa\bad\bd_\b_l\bli\bim\bmi\bit\bt (int limit) const;\n    int d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_l\bli\bim\bmi\bit\bt () const;\n    void s\bse\bet\bt_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_l\bli\bim\bmi\bit\bt (int limit) const;\n-   int u\bup\bpl\blo\boa\bad\bd_\b_l\bli\bim\bmi\bit\bt () const;\n    void c\bco\bon\bnn\bne\bec\bct\bt_\b_p\bpe\bee\ber\br (tcp::endpoint const& adr, peer_source_flags_t source = {}\n       , pex_flags_t flags = pex_encryption | pex_utp | pex_holepunch) const;\n    void c\bcl\ble\bea\bar\br_\b_p\bpe\bee\ber\brs\bs ();\n    void s\bse\bet\bt_\b_m\bma\bax\bx_\b_u\bup\bpl\blo\boa\bad\bds\bs (int max_uploads) const;\n    int m\bma\bax\bx_\b_u\bup\bpl\blo\boa\bad\bds\bs () const;\n-   int m\bma\bax\bx_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bns\bs () const;\n    void s\bse\bet\bt_\b_m\bma\bax\bx_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bns\bs (int max_connections) const;\n+   int m\bma\bax\bx_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bns\bs () const;\n    void m\bmo\bov\bve\be_\b_s\bst\bto\bor\bra\bag\bge\be (std::string const& save_path\n       , move_flags_t flags = move_flags_t::always_replace_files\n       ) const;\n    void r\bre\ben\bna\bam\bme\be_\b_f\bfi\bil\ble\be (file_index_t index, std::string const& new_name) const;\n    info_hash_t i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bhe\bes\bs () const;\n    sha1_hash i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh () const;\n+   bool o\bop\bpe\ber\bra\bat\bto\bor\br!\b!=\b= (const torrent_handle& h) const;\n    bool o\bop\bpe\ber\bra\bat\bto\bor\br=\b==\b= (const torrent_handle& h) const;\n    bool o\bop\bpe\ber\bra\bat\bto\bor\br<\b< (const torrent_handle& h) const;\n-   bool o\bop\bpe\ber\bra\bat\bto\bor\br!\b!=\b= (const torrent_handle& h) const;\n    std::uint32_t i\bid\bd () const;\n    std::shared_ptr n\bna\bat\bti\biv\bve\be_\b_h\bha\ban\bnd\bdl\ble\be () const;\n    client_data_t u\bus\bse\ber\brd\bda\bat\bta\ba () const;\n    bool i\bin\bn_\b_s\bse\bes\bss\bsi\bio\bon\bn () const;\n \n    static constexpr add_piece_flags_t o\bov\bve\ber\brw\bwr\bri\bit\bte\be_\b_e\bex\bxi\bis\bst\bti\bin\bng\bg  = 0_bit;\n    static constexpr status_flags_t q\bqu\bue\ber\bry\by_\b_d\bdi\bis\bst\btr\bri\bib\bbu\but\bte\bed\bd_\b_c\bco\bop\bpi\bie\bes\bs  = 0_bit;\n@@ -354,30 +354,30 @@\n to finish in the same order as you initiated them.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* h\bha\bav\bve\be_\b_p\bpi\bie\bec\bce\be(\b()\b) *\b**\b**\b**\b**\b*\n bool h\bha\bav\bve\be_\b_p\bpi\bie\bec\bce\be (piece_index_t piece) const;\n Returns true if this piece has been completely downloaded and written to disk,\n and false otherwise.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* g\bge\bet\bt_\b_p\bpe\bee\ber\br_\b_i\bin\bnf\bfo\bo(\b()\b) p\bpo\bos\bst\bt_\b_p\bpe\bee\ber\br_\b_i\bin\bnf\bfo\bo(\b()\b) *\b**\b**\b**\b**\b*\n-void p\bpo\bos\bst\bt_\b_p\bpe\bee\ber\br_\b_i\bin\bnf\bfo\bo () const;\n+*\b**\b**\b**\b**\b* p\bpo\bos\bst\bt_\b_p\bpe\bee\ber\br_\b_i\bin\bnf\bfo\bo(\b()\b) g\bge\bet\bt_\b_p\bpe\bee\ber\br_\b_i\bin\bnf\bfo\bo(\b()\b) *\b**\b**\b**\b**\b*\n void g\bge\bet\bt_\b_p\bpe\bee\ber\br_\b_i\bin\bnf\bfo\bo (std::vector& v) const;\n+void p\bpo\bos\bst\bt_\b_p\bpe\bee\ber\br_\b_i\bin\bnf\bfo\bo () const;\n Query information about connected peers for this torrent. If the _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be\n is invalid, it will throw a system_error exception.\n post_peer_info() is asynchronous and will trigger the posting of a\n _\bp_\be_\be_\br_\b__\bi_\bn_\bf_\bo_\b__\ba_\bl_\be_\br_\bt. The _\ba_\bl_\be_\br_\bt contain a list of _\bp_\be_\be_\br_\b__\bi_\bn_\bf_\bo objects, one for each\n connected peer.\n get_peer_info() is synchronous and takes a reference to a vector that will be\n cleared and filled with one _\be_\bn_\bt_\br_\by for each peer connected to this torrent,\n given the handle is valid. Each _\be_\bn_\bt_\br_\by in the vector contains information about\n that particular peer. See _\bp_\be_\be_\br_\b__\bi_\bn_\bf_\bo.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* p\bpo\bos\bst\bt_\b_s\bst\bta\bat\btu\bus\bs(\b()\b) s\bst\bta\bat\btu\bus\bs(\b()\b) *\b**\b**\b**\b**\b*\n-void p\bpo\bos\bst\bt_\b_s\bst\bta\bat\btu\bus\bs (status_flags_t flags = status_flags_t::all()) const;\n torrent_status s\bst\bta\bat\btu\bus\bs (status_flags_t flags = status_flags_t::all()) const;\n+void p\bpo\bos\bst\bt_\b_s\bst\bta\bat\btu\bus\bs (status_flags_t flags = status_flags_t::all()) const;\n status() will return a structure with information about the status of this\n torrent. If the _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be is invalid, it will throw system_error\n exception. See _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bs_\bt_\ba_\bt_\bu_\bs. The flags argument filters what information is\n returned in the _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bs_\bt_\ba_\bt_\bu_\bs. Some information in there is relatively\n expensive to calculate, and if you're not interested in it (and see performance\n issues), you can filter them out.\n The status() function will block until the internal libtorrent thread responds\n@@ -385,29 +385,29 @@\n It will trigger posting of a _\bs_\bt_\ba_\bt_\be_\b__\bu_\bp_\bd_\ba_\bt_\be_\b__\ba_\bl_\be_\br_\bt with a single _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bs_\bt_\ba_\bt_\bu_\bs\n object for this torrent.\n In order to get regular updates for torrents whose status changes, consider\n calling session::post_torrent_updates()`` instead.\n By default everything is included. The flags you can use to decide what to\n i\bin\bnc\bcl\blu\bud\bde\be are defined in this class.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* p\bpo\bos\bst\bt_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_q\bqu\bue\beu\bue\be(\b()\b) g\bge\bet\bt_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_q\bqu\bue\beu\bue\be(\b()\b) *\b**\b**\b**\b**\b*\n-std::vector g\bge\bet\bt_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_q\bqu\bue\beu\bue\be () const;\n-void p\bpo\bos\bst\bt_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_q\bqu\bue\beu\bue\be () const;\n+*\b**\b**\b**\b**\b* g\bge\bet\bt_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_q\bqu\bue\beu\bue\be(\b()\b) p\bpo\bos\bst\bt_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_q\bqu\bue\beu\bue\be(\b()\b) *\b**\b**\b**\b**\b*\n void g\bge\bet\bt_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_q\bqu\bue\beu\bue\be (std::vector& queue) const;\n+void p\bpo\bos\bst\bt_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_q\bqu\bue\beu\bue\be () const;\n+std::vector g\bge\bet\bt_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_q\bqu\bue\beu\bue\be () const;\n post_download_queue() triggers a download_queue_alert to be posted.\n get_download_queue() is a synchronous call and returns a vector with\n information about pieces that are partially downloaded or not downloaded but\n partially requested. See _\bp_\ba_\br_\bt_\bi_\ba_\bl_\b__\bp_\bi_\be_\bc_\be_\b__\bi_\bn_\bf_\bo for the fields in the returned\n vector.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* r\bre\bes\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_d\bde\bea\bad\bdl\bli\bin\bne\be(\b()\b) c\bcl\ble\bea\bar\br_\b_p\bpi\bie\bec\bce\be_\b_d\bde\bea\bad\bdl\bli\bin\bne\bes\bs(\b()\b) s\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_d\bde\bea\bad\bdl\bli\bin\bne\be(\b()\b) *\b**\b**\b**\b**\b*\n-void r\bre\bes\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_d\bde\bea\bad\bdl\bli\bin\bne\be (piece_index_t index) const;\n+*\b**\b**\b**\b**\b* c\bcl\ble\bea\bar\br_\b_p\bpi\bie\bec\bce\be_\b_d\bde\bea\bad\bdl\bli\bin\bne\bes\bs(\b()\b) s\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_d\bde\bea\bad\bdl\bli\bin\bne\be(\b()\b) r\bre\bes\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_d\bde\bea\bad\bdl\bli\bin\bne\be(\b()\b) *\b**\b**\b**\b**\b*\n void s\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_d\bde\bea\bad\bdl\bli\bin\bne\be (piece_index_t index, int deadline, deadline_flags_t\n flags = {}) const;\n void c\bcl\ble\bea\bar\br_\b_p\bpi\bie\bec\bce\be_\b_d\bde\bea\bad\bdl\bli\bin\bne\bes\bs () const;\n+void r\bre\bes\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_d\bde\bea\bad\bdl\bli\bin\bne\be (piece_index_t index) const;\n This function sets or resets the deadline associated with a specific piece\n index (index). libtorrent will attempt to download this entire piece before the\n deadline expires. This is not necessarily possible, but pieces with a more\n recent deadline will always be prioritized over pieces with a deadline further\n ahead in time. The deadline (and flags) of a piece can be changed by calling\n this function again.\n If the piece is already downloaded when this call is made, nothing happens,\n@@ -416,19 +416,19 @@\n deadline is the number of milliseconds until this piece should be completed.\n reset_piece_deadline removes the deadline from the piece. If it hasn't already\n been downloaded, it will no longer be considered a priority.\n clear_piece_deadlines() removes deadlines on all pieces in the torrent. As if\n _\br_\be_\bs_\be_\bt_\b__\bp_\bi_\be_\bc_\be_\b__\bd_\be_\ba_\bd_\bl_\bi_\bn_\be_\b(_\b) was called on all pieces.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* p\bpo\bos\bst\bt_\b_f\bfi\bil\ble\be_\b_p\bpr\bro\bog\bgr\bre\bes\bss\bs(\b()\b) f\bfi\bil\ble\be_\b_p\bpr\bro\bog\bgr\bre\bes\bss\bs(\b()\b) *\b**\b**\b**\b**\b*\n-void f\bfi\bil\ble\be_\b_p\bpr\bro\bog\bgr\bre\bes\bss\bs (std::vector& progress, file_progress_flags_t\n-flags = {}) const;\n-void p\bpo\bos\bst\bt_\b_f\bfi\bil\ble\be_\b_p\bpr\bro\bog\bgr\bre\bes\bss\bs (file_progress_flags_t flags) const;\n std::vector f\bfi\bil\ble\be_\b_p\bpr\bro\bog\bgr\bre\bes\bss\bs (file_progress_flags_t flags = {})\n const;\n+void p\bpo\bos\bst\bt_\b_f\bfi\bil\ble\be_\b_p\bpr\bro\bog\bgr\bre\bes\bss\bs (file_progress_flags_t flags) const;\n+void f\bfi\bil\ble\be_\b_p\bpr\bro\bog\bgr\bre\bes\bss\bs (std::vector& progress, file_progress_flags_t\n+flags = {}) const;\n This function fills in the supplied vector, or returns a vector, with the\n number of bytes downloaded of each file in this torrent. The progress values\n are ordered the same as the files in the _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo.\n This operation is not very cheap. Its complexity is O\bO(\b(n\bn +\b+ m\bmj\bj)\b). Where n\bn is the\n number of files, m\bm is the number of currently downloading pieces and j\bj is the\n number of blocks in a piece.\n The flags parameter can be used to specify the granularity of the file\n@@ -449,19 +449,19 @@\n See _\bo_\bp_\be_\bn_\b__\bf_\bi_\bl_\be_\b__\bs_\bt_\ba_\bt_\be\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* c\bcl\ble\bea\bar\br_\b_e\ber\brr\bro\bor\br(\b()\b) *\b**\b**\b**\b**\b*\n void c\bcl\ble\bea\bar\br_\b_e\ber\brr\bro\bor\br () const;\n If the torrent is in an error state (i.e. torrent_status::error is non-empty),\n this will clear the error and start the torrent again.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_t\btr\bra\bac\bck\bke\ber\br(\b()\b) p\bpo\bos\bst\bt_\b_t\btr\bra\bac\bck\bke\ber\brs\bs(\b()\b) r\bre\bep\bpl\bla\bac\bce\be_\b_t\btr\bra\bac\bck\bke\ber\brs\bs(\b()\b) t\btr\bra\bac\bck\bke\ber\brs\bs(\b()\b) *\b**\b**\b**\b**\b*\n+*\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_t\btr\bra\bac\bck\bke\ber\br(\b()\b) r\bre\bep\bpl\bla\bac\bce\be_\b_t\btr\bra\bac\bck\bke\ber\brs\bs(\b()\b) p\bpo\bos\bst\bt_\b_t\btr\bra\bac\bck\bke\ber\brs\bs(\b()\b) t\btr\bra\bac\bck\bke\ber\brs\bs(\b()\b) *\b**\b**\b**\b**\b*\n+std::vector t\btr\bra\bac\bck\bke\ber\brs\bs () const;\n void p\bpo\bos\bst\bt_\b_t\btr\bra\bac\bck\bke\ber\brs\bs () const;\n void a\bad\bdd\bd_\b_t\btr\bra\bac\bck\bke\ber\br (announce_entry const&) const;\n void r\bre\bep\bpl\bla\bac\bce\be_\b_t\btr\bra\bac\bck\bke\ber\brs\bs (std::vector const&) const;\n-std::vector t\btr\bra\bac\bck\bke\ber\brs\bs () const;\n trackers() returns the list of trackers for this torrent. The announce _\be_\bn_\bt_\br_\by\n contains both a string url which specify the announce url for the tracker as\n well as an _\bi_\bn_\bt tier, which is specifies the order in which this tracker is\n tried. If you want libtorrent to use another list of trackers for this torrent,\n you can use replace_trackers() which takes a list of the same form as the one\n returned from trackers() and will replace it. If you want an immediate effect,\n you have to call _\bf_\bo_\br_\bc_\be_\b__\br_\be_\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b(_\b). See _\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\be_\bn_\bt_\br_\by.\n@@ -471,28 +471,28 @@\n is, it doesn't do anything. If it's not in the current set of trackers, it will\n insert it in the tier specified in the _\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\be_\bn_\bt_\br_\by.\n The updated set of trackers will be saved in the resume data, and when a\n torrent is started with resume data, the trackers from the resume data will\n replace the original ones.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_u\bur\brl\bl_\b_s\bse\bee\bed\bd(\b()\b) r\bre\bem\bmo\bov\bve\be_\b_u\bur\brl\bl_\b_s\bse\bee\bed\bd(\b()\b) u\bur\brl\bl_\b_s\bse\bee\bed\bds\bs(\b()\b) *\b**\b**\b**\b**\b*\n-std::set u\bur\brl\bl_\b_s\bse\bee\bed\bds\bs () const;\n void r\bre\bem\bmo\bov\bve\be_\b_u\bur\brl\bl_\b_s\bse\bee\bed\bd (std::string const& url) const;\n+std::set u\bur\brl\bl_\b_s\bse\bee\bed\bds\bs () const;\n void a\bad\bdd\bd_\b_u\bur\brl\bl_\b_s\bse\bee\bed\bd (std::string const& url) const;\n add_url_seed() adds another url to the torrent's list of url seeds. If the\n given url already exists in that list, the call has no effect. The torrent will\n connect to the server and try to download pieces from it, unless it's paused,\n queued, checking or seeding. remove_url_seed() removes the given url if it\n exists already. url_seeds() return a set of the url seeds currently in this\n torrent. Note that URLs that fails may be removed automatically from the list.\n See _\bh_\bt_\bt_\bp_\b _\bs_\be_\be_\bd_\bi_\bn_\bg for more information.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_h\bht\btt\btp\bp_\b_s\bse\bee\bed\bd(\b()\b) h\bht\btt\btp\bp_\b_s\bse\bee\bed\bds\bs(\b()\b) r\bre\bem\bmo\bov\bve\be_\b_h\bht\btt\btp\bp_\b_s\bse\bee\bed\bd(\b()\b) *\b**\b**\b**\b**\b*\n-void r\bre\bem\bmo\bov\bve\be_\b_h\bht\btt\btp\bp_\b_s\bse\bee\bed\bd (std::string const& url) const;\n+*\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_h\bht\btt\btp\bp_\b_s\bse\bee\bed\bd(\b()\b) r\bre\bem\bmo\bov\bve\be_\b_h\bht\btt\btp\bp_\b_s\bse\bee\bed\bd(\b()\b) h\bht\btt\btp\bp_\b_s\bse\bee\bed\bds\bs(\b()\b) *\b**\b**\b**\b**\b*\n void a\bad\bdd\bd_\b_h\bht\btt\btp\bp_\b_s\bse\bee\bed\bd (std::string const& url) const;\n+void r\bre\bem\bmo\bov\bve\be_\b_h\bht\btt\btp\bp_\b_s\bse\bee\bed\bd (std::string const& url) const;\n std::set h\bht\btt\btp\bp_\b_s\bse\bee\bed\bds\bs () const;\n These functions are identical as the *_url_seed() variants, but they operate on\n _\bB_\bE_\bP_\b _\b1_\b7 web seeds instead of _\bB_\bE_\bP_\b _\b1_\b9.\n See _\bh_\bt_\bt_\bp_\b _\bs_\be_\be_\bd_\bi_\bn_\bg for more information.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_e\bex\bxt\bte\ben\bns\bsi\bio\bon\bn(\b()\b) *\b**\b**\b**\b**\b*\n void a\bad\bdd\bd_\b_e\bex\bxt\bte\ben\bns\bsi\bio\bon\bn (\n@@ -525,31 +525,31 @@\n Clients should only use _\bi_\bs_\b__\bv_\ba_\bl_\bi_\bd_\b(_\b) to determine if the result of session::\n find_torrent() was successful.\n Unlike other member functions which return a value, _\bi_\bs_\b__\bv_\ba_\bl_\bi_\bd_\b(_\b) completes\n immediately, without blocking on a result from the network thread. Also unlike\n other functions, it never throws the system_error exception.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* p\bpa\bau\bus\bse\be(\b()\b) r\bre\bes\bsu\bum\bme\be(\b()\b) *\b**\b**\b**\b**\b*\n-void r\bre\bes\bsu\bum\bme\be () const;\n void p\bpa\bau\bus\bse\be (pause_flags_t flags = {}) const;\n+void r\bre\bes\bsu\bum\bme\be () const;\n pause(), and resume() will disconnect all peers and reconnect all peers\n respectively. When a torrent is paused, it will however remember all share\n ratios to all peers and remember all potential (not connected) peers. Torrents\n may be paused automatically if there is a file error (e.g. disk full) or\n something similar. See _\bf_\bi_\bl_\be_\b__\be_\br_\br_\bo_\br_\b__\ba_\bl_\be_\br_\bt.\n For possible values of the flags parameter, see pause_flags_t.\n To know if a torrent is paused or not, call torrent_handle::flags() and check\n for the torrent_status::paused flag.\n Note\n Torrents that are auto-managed may be automatically resumed again. It does not\n make sense to pause an auto-managed torrent without making it not auto-managed\n first. Torrents are auto-managed by default when added to the _\bs_\be_\bs_\bs_\bi_\bo_\bn. For more\n information, see _\bq_\bu_\be_\bu_\bi_\bn_\bg.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* f\bfl\bla\bag\bgs\bs(\b()\b) s\bse\bet\bt_\b_f\bfl\bla\bag\bgs\bs(\b()\b) u\bun\bns\bse\bet\bt_\b_f\bfl\bla\bag\bgs\bs(\b()\b) *\b**\b**\b**\b**\b*\n+*\b**\b**\b**\b**\b* s\bse\bet\bt_\b_f\bfl\bla\bag\bgs\bs(\b()\b) f\bfl\bla\bag\bgs\bs(\b()\b) u\bun\bns\bse\bet\bt_\b_f\bfl\bla\bag\bgs\bs(\b()\b) *\b**\b**\b**\b**\b*\n void s\bse\bet\bt_\b_f\bfl\bla\bag\bgs\bs (torrent_flags_t flags) const;\n torrent_flags_t f\bfl\bla\bag\bgs\bs () const;\n void u\bun\bns\bse\bet\bt_\b_f\bfl\bla\bag\bgs\bs (torrent_flags_t flags) const;\n void s\bse\bet\bt_\b_f\bfl\bla\bag\bgs\bs (torrent_flags_t flags, torrent_flags_t mask) const;\n sets and gets the torrent state flags. See _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bl_\ba_\bg_\bs_\b__\bt. The set_flags\n overload that take a mask will affect all flags part of the mask, and set their\n values to what the flags argument is set to. This allows clearing and setting\n@@ -663,34 +663,34 @@\n Note how outstanding_resume_data is a global counter in this example. This is\n deliberate, otherwise there is a race condition for torrents that was just\n asked to save their resume data, they posted the _\ba_\bl_\be_\br_\bt, but it has not been\n received yet. Those torrents would report that they don't need to save resume\n data again, and skipped by the initial loop, and thwart the counter otherwise.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* n\bne\bee\bed\bd_\b_s\bsa\bav\bve\be_\b_r\bre\bes\bsu\bum\bme\be_\b_d\bda\bat\bta\ba(\b()\b) *\b**\b**\b**\b**\b*\n-bool n\bne\bee\bed\bd_\b_s\bsa\bav\bve\be_\b_r\bre\bes\bsu\bum\bme\be_\b_d\bda\bat\bta\ba () const;\n bool n\bne\bee\bed\bd_\b_s\bsa\bav\bve\be_\b_r\bre\bes\bsu\bum\bme\be_\b_d\bda\bat\bta\ba (resume_data_flags_t flags) const;\n+bool n\bne\bee\bed\bd_\b_s\bsa\bav\bve\be_\b_r\bre\bes\bsu\bum\bme\be_\b_d\bda\bat\bta\ba () const;\n This function returns true if anything that is stored in the resume data has\n changed since the last time resume data was saved. The overload that takes\n flags let you ask if specific categories of properties have changed. These\n flags have the same behavior as in the _\bs_\ba_\bv_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b) call.\n This is a b\bbl\blo\boc\bck\bki\bin\bng\bg call. It will wait for a response from libtorrent's main\n thread. A way to avoid blocking is to instead call _\bs_\ba_\bv_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b) directly,\n specifying the conditions under which resume data should be saved.\n Note\n A torrent's resume data is considered saved as soon as the\n _\bs_\ba_\bv_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b__\ba_\bl_\be_\br_\bt is posted. It is important to make sure this _\ba_\bl_\be_\br_\bt is\n received and handled in order for this function to be meaningful.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn_\b_u\bup\bp(\b()\b) q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn_\b_t\bto\bop\bp(\b()\b) q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn(\b()\b)\n-q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn_\b_b\bbo\bot\btt\bto\bom\bm(\b()\b) q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn_\b_d\bdo\bow\bwn\bn(\b()\b) *\b**\b**\b**\b**\b*\n+*\b**\b**\b**\b**\b* q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn_\b_u\bup\bp(\b()\b) q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn_\b_t\bto\bop\bp(\b()\b) q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn_\b_d\bdo\bow\bwn\bn(\b()\b)\n+q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn(\b()\b) q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn_\b_b\bbo\bot\btt\bto\bom\bm(\b()\b) *\b**\b**\b**\b**\b*\n void q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn_\b_b\bbo\bot\btt\bto\bom\bm () const;\n void q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn_\b_t\bto\bop\bp () const;\n-void q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn_\b_u\bup\bp () const;\n void q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn_\b_d\bdo\bow\bwn\bn () const;\n+void q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn_\b_u\bup\bp () const;\n queue_position_t q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn () const;\n Every torrent that is added is assigned a queue position exactly one greater\n than the greatest queue position of all existing torrents. Torrents that are\n being seeded have -1 as their queue position, since they're no longer in line\n to be downloaded.\n When a torrent is removed or turns into a seed, all torrents with greater queue\n positions have their positions decreased to fill in the space in the sequence.\n@@ -705,15 +705,15 @@\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn_\b_s\bse\bet\bt(\b()\b) *\b**\b**\b**\b**\b*\n void q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn_\b_s\bse\bet\bt (queue_position_t p) const;\n updates the position in the queue for this torrent. The relative order of all\n other torrents remain intact but their numerical queue position shifts to make\n space for this torrent's new position\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* s\bse\bet\bt_\b_s\bss\bsl\bl_\b_c\bce\ber\brt\bti\bif\bfi\bic\bca\bat\bte\be_\b_b\bbu\buf\bff\bfe\ber\br(\b()\b) s\bse\bet\bt_\b_s\bss\bsl\bl_\b_c\bce\ber\brt\bti\bif\bfi\bic\bca\bat\bte\be(\b()\b) *\b**\b**\b**\b**\b*\n+*\b**\b**\b**\b**\b* s\bse\bet\bt_\b_s\bss\bsl\bl_\b_c\bce\ber\brt\bti\bif\bfi\bic\bca\bat\bte\be(\b()\b) s\bse\bet\bt_\b_s\bss\bsl\bl_\b_c\bce\ber\brt\bti\bif\bfi\bic\bca\bat\bte\be_\b_b\bbu\buf\bff\bfe\ber\br(\b()\b) *\b**\b**\b**\b**\b*\n void s\bse\bet\bt_\b_s\bss\bsl\bl_\b_c\bce\ber\brt\bti\bif\bfi\bic\bca\bat\bte\be_\b_b\bbu\buf\bff\bfe\ber\br (std::string const& certificate\n       , std::string const& private_key\n       , std::string const& dh_params);\n void s\bse\bet\bt_\b_s\bss\bsl\bl_\b_c\bce\ber\brt\bti\bif\bfi\bic\bca\bat\bte\be (std::string const& certificate\n       , std::string const& private_key\n       , std::string const& dh_params\n       , std::string const& passphrase = \"\");\n@@ -735,16 +735,16 @@\n suspend connecting to any peers until it has one. It's typically desirable to\n resume the torrent after setting the SSL certificate.\n If you receive a _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bn_\be_\be_\bd_\b__\bc_\be_\br_\bt_\b__\ba_\bl_\be_\br_\bt, you need to call this to provide a\n valid cert. If you don't have a cert you won't be allowed to connect to any\n peers.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be_\b_w\bwi\bit\bth\bh_\b_h\bha\bas\bsh\bhe\bes\bs(\b()\b) t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be(\b()\b) *\b**\b**\b**\b**\b*\n-std::shared_ptr t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be_\b_w\bwi\bit\bth\bh_\b_h\bha\bas\bsh\bhe\bes\bs () const;\n std::shared_ptr t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be () const;\n+std::shared_ptr t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be_\b_w\bwi\bit\bth\bh_\b_h\bha\bas\bsh\bhe\bes\bs () const;\n _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bi_\bl_\be_\b(_\b) returns a pointer to the _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo object associated with\n this torrent. The _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo object may be a copy of the internal object. If\n the torrent doesn't have metadata, the pointer will not be initialized (i.e. a\n nullptr). The torrent may be in a state without metadata only if it was started\n without a .torrent file, e.g. by being added by magnet link.\n Note that the _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo object returned here may be a different instance\n than the one added to the _\bs_\be_\bs_\bs_\bi_\bo_\bn, with different attributes like piece layers,\n@@ -770,33 +770,33 @@\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* p\bpi\bie\bec\bce\be_\b_l\bla\bay\bye\ber\brs\bs(\b()\b) *\b**\b**\b**\b**\b*\n std::vector> p\bpi\bie\bec\bce\be_\b_l\bla\bay\bye\ber\brs\bs () const;\n returns the piece layers for all files in the torrent. If this is a v1 torrent\n (and doesn't have any piece layers) it returns an empty vector. This is a\n blocking call that will synchronize with the libtorrent network thread.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* p\bpi\bie\bec\bce\be_\b_a\bav\bva\bai\bil\bla\bab\bbi\bil\bli\bit\bty\by(\b()\b) p\bpo\bos\bst\bt_\b_p\bpi\bie\bec\bce\be_\b_a\bav\bva\bai\bil\bla\bab\bbi\bil\bli\bit\bty\by(\b()\b) *\b**\b**\b**\b**\b*\n+*\b**\b**\b**\b**\b* p\bpo\bos\bst\bt_\b_p\bpi\bie\bec\bce\be_\b_a\bav\bva\bai\bil\bla\bab\bbi\bil\bli\bit\bty\by(\b()\b) p\bpi\bie\bec\bce\be_\b_a\bav\bva\bai\bil\bla\bab\bbi\bil\bli\bit\bty\by(\b()\b) *\b**\b**\b**\b**\b*\n void p\bpi\bie\bec\bce\be_\b_a\bav\bva\bai\bil\bla\bab\bbi\bil\bli\bit\bty\by (std::vector& avail) const;\n void p\bpo\bos\bst\bt_\b_p\bpi\bie\bec\bce\be_\b_a\bav\bva\bai\bil\bla\bab\bbi\bil\bli\bit\bty\by () const;\n The piece availability is the number of peers that we are connected that has\n advertised having a particular piece. This is the information that libtorrent\n uses in order to prefer picking rare pieces.\n post_piece_availability() will trigger a _\bp_\bi_\be_\bc_\be_\b__\ba_\bv_\ba_\bi_\bl_\ba_\bb_\bi_\bl_\bi_\bt_\by_\b__\ba_\bl_\be_\br_\bt to be posted.\n piece_availability() fills the specified std::vector with the availability\n for each piece in this torrent. libtorrent does not keep track of availability\n for seeds, so if the torrent is seeding the availability for all pieces is\n reported as 0.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* g\bge\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_p\bpr\bri\bio\bor\bri\bit\bti\bie\bes\bs(\b()\b) p\bpi\bie\bec\bce\be_\b_p\bpr\bri\bio\bor\bri\bit\bty\by(\b()\b) p\bpr\bri\bio\bor\bri\bit\bti\biz\bze\be_\b_p\bpi\bie\bec\bce\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n+*\b**\b**\b**\b**\b* p\bpi\bie\bec\bce\be_\b_p\bpr\bri\bio\bor\bri\bit\bty\by(\b()\b) p\bpr\bri\bio\bor\bri\bit\bti\biz\bze\be_\b_p\bpi\bie\bec\bce\bes\bs(\b()\b) g\bge\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_p\bpr\bri\bio\bor\bri\bit\bti\bie\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n void p\bpr\bri\bio\bor\bri\bit\bti\biz\bze\be_\b_p\bpi\bie\bec\bce\bes\bs (std::vector const& pieces) const;\n download_priority_t p\bpi\bie\bec\bce\be_\b_p\bpr\bri\bio\bor\bri\bit\bty\by (piece_index_t index) const;\n std::vector g\bge\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_p\bpr\bri\bio\bor\bri\bit\bti\bie\bes\bs () const;\n-void p\bpi\bie\bec\bce\be_\b_p\bpr\bri\bio\bor\bri\bit\bty\by (piece_index_t index, download_priority_t priority) const;\n void p\bpr\bri\bio\bor\bri\bit\bti\biz\bze\be_\b_p\bpi\bie\bec\bce\bes\bs (std::vector> const& pieces) const;\n+void p\bpi\bie\bec\bce\be_\b_p\bpr\bri\bio\bor\bri\bit\bty\by (piece_index_t index, download_priority_t priority) const;\n These functions are used to set and get the priority of individual pieces. By\n default all pieces have priority 4. That means that the random rarest first\n algorithm is effectively active for all pieces. You may however change the\n priority of individual pieces. There are 8 priority levels. 0 means not to\n download the piece at all. Otherwise, lower priority values means less likely\n to be picked. Piece priority takes precedence over piece availability. Every\n piece with priority 7 will be attempted to be picked before a priority 6 piece\n@@ -816,18 +816,18 @@\n where the piece index or priority is out of range, are not allowed.\n get_piece_priorities returns a vector with one element for each piece in the\n torrent. Each element is the current priority of that piece.\n It's possible to cancel the effect of f\bfi\bil\ble\be priorities by setting the priorities\n for the affected pieces. Care has to be taken when mixing usage of file- and\n piece priorities.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* f\bfi\bil\ble\be_\b_p\bpr\bri\bio\bor\bri\bit\bty\by(\b()\b) g\bge\bet\bt_\b_f\bfi\bil\ble\be_\b_p\bpr\bri\bio\bor\bri\bit\bti\bie\bes\bs(\b()\b) p\bpr\bri\bio\bor\bri\bit\bti\biz\bze\be_\b_f\bfi\bil\ble\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n+*\b**\b**\b**\b**\b* p\bpr\bri\bio\bor\bri\bit\bti\biz\bze\be_\b_f\bfi\bil\ble\bes\bs(\b()\b) f\bfi\bil\ble\be_\b_p\bpr\bri\bio\bor\bri\bit\bty\by(\b()\b) g\bge\bet\bt_\b_f\bfi\bil\ble\be_\b_p\bpr\bri\bio\bor\bri\bit\bti\bie\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n std::vector g\bge\bet\bt_\b_f\bfi\bil\ble\be_\b_p\bpr\bri\bio\bor\bri\bit\bti\bie\bes\bs () const;\n-void f\bfi\bil\ble\be_\b_p\bpr\bri\bio\bor\bri\bit\bty\by (file_index_t index, download_priority_t priority) const;\n download_priority_t f\bfi\bil\ble\be_\b_p\bpr\bri\bio\bor\bri\bit\bty\by (file_index_t index) const;\n+void f\bfi\bil\ble\be_\b_p\bpr\bri\bio\bor\bri\bit\bty\by (file_index_t index, download_priority_t priority) const;\n void p\bpr\bri\bio\bor\bri\bit\bti\biz\bze\be_\b_f\bfi\bil\ble\bes\bs (std::vector const& files) const;\n index must be in the range [0, number_of_files).\n file_priority() queries or sets the priority of file index.\n prioritize_files() takes a vector that has at as many elements as there are\n files in the torrent. Each _\be_\bn_\bt_\br_\by is the priority of that file. The function\n sets the priorities of all the pieces in the torrent based on the vector.\n get_file_priorities() returns a vector with the priorities of all files.\n@@ -847,19 +847,19 @@\n When combining file- and piece priorities, the resume file will record both.\n When loading the resume data, the file priorities will be applied first, then\n the piece priorities.\n Moving data from a file into the part file is currently not supported. If a\n file has its priority set to 0 a\baf\bft\bte\ber\br it has already been created, it will not\n be moved into the partfile.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* f\bfo\bor\brc\bce\be_\b_r\bre\bea\ban\bnn\bno\bou\bun\bnc\bce\be(\b()\b) f\bfo\bor\brc\bce\be_\b_d\bdh\bht\bt_\b_a\ban\bnn\bno\bou\bun\bnc\bce\be(\b()\b) f\bfo\bor\brc\bce\be_\b_l\bls\bsd\bd_\b_a\ban\bnn\bno\bou\bun\bnc\bce\be(\b()\b) *\b**\b**\b**\b**\b*\n-void f\bfo\bor\brc\bce\be_\b_l\bls\bsd\bd_\b_a\ban\bnn\bno\bou\bun\bnc\bce\be () const;\n+*\b**\b**\b**\b**\b* f\bfo\bor\brc\bce\be_\b_d\bdh\bht\bt_\b_a\ban\bnn\bno\bou\bun\bnc\bce\be(\b()\b) f\bfo\bor\brc\bce\be_\b_l\bls\bsd\bd_\b_a\ban\bnn\bno\bou\bun\bnc\bce\be(\b()\b) f\bfo\bor\brc\bce\be_\b_r\bre\bea\ban\bnn\bno\bou\bun\bnc\bce\be(\b()\b) *\b**\b**\b**\b**\b*\n void f\bfo\bor\brc\bce\be_\b_d\bdh\bht\bt_\b_a\ban\bnn\bno\bou\bun\bnc\bce\be () const;\n void f\bfo\bor\brc\bce\be_\b_r\bre\bea\ban\bnn\bno\bou\bun\bnc\bce\be (int seconds = 0, int idx = -1, reannounce_flags_t = {})\n const;\n+void f\bfo\bor\brc\bce\be_\b_l\bls\bsd\bd_\b_a\ban\bnn\bno\bou\bun\bnc\bce\be () const;\n force_reannounce() will force this torrent to do another tracker request, to\n receive new peers. The seconds argument specifies how many seconds from now to\n issue the tracker announces.\n If the tracker's min_interval has not passed since the last announce, the\n forced announce will be scheduled to happen immediately as the min_interval\n expires. This is to honor trackers minimum re-announce interval settings.\n The tracker_index argument specifies which tracker to re-announce. If set to -\n@@ -877,20 +877,20 @@\n A scrape request queries the tracker for statistics such as total number of\n incomplete peers, complete peers, number of downloads etc.\n This request will specifically update the num_complete and num_incomplete\n fields in the _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bs_\bt_\ba_\bt_\bu_\bs struct once it completes. When it completes, it\n will generate a _\bs_\bc_\br_\ba_\bp_\be_\b__\br_\be_\bp_\bl_\by_\b__\ba_\bl_\be_\br_\bt. If it fails, it will generate a\n _\bs_\bc_\br_\ba_\bp_\be_\b__\bf_\ba_\bi_\bl_\be_\bd_\b__\ba_\bl_\be_\br_\bt.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_l\bli\bim\bmi\bit\bt(\b()\b) s\bse\bet\bt_\b_u\bup\bpl\blo\boa\bad\bd_\b_l\bli\bim\bmi\bit\bt(\b()\b) u\bup\bpl\blo\boa\bad\bd_\b_l\bli\bim\bmi\bit\bt(\b()\b) s\bse\bet\bt_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_l\bli\bim\bmi\bit\bt(\b()\b)\n+*\b**\b**\b**\b**\b* s\bse\bet\bt_\b_u\bup\bpl\blo\boa\bad\bd_\b_l\bli\bim\bmi\bit\bt(\b()\b) d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_l\bli\bim\bmi\bit\bt(\b()\b) u\bup\bpl\blo\boa\bad\bd_\b_l\bli\bim\bmi\bit\bt(\b()\b) s\bse\bet\bt_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_l\bli\bim\bmi\bit\bt(\b()\b)\n *\b**\b**\b**\b**\b*\n+int u\bup\bpl\blo\boa\bad\bd_\b_l\bli\bim\bmi\bit\bt () const;\n void s\bse\bet\bt_\b_u\bup\bpl\blo\boa\bad\bd_\b_l\bli\bim\bmi\bit\bt (int limit) const;\n int d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_l\bli\bim\bmi\bit\bt () const;\n void s\bse\bet\bt_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_l\bli\bim\bmi\bit\bt (int limit) const;\n-int u\bup\bpl\blo\boa\bad\bd_\b_l\bli\bim\bmi\bit\bt () const;\n set_upload_limit will limit the upload bandwidth used by this particular\n torrent to the limit you set. It is given as the number of bytes per second the\n torrent is allowed to upload. set_download_limit works the same way but for\n download bandwidth instead of upload bandwidth. Note that setting a higher\n limit on a torrent then the global limit (settings_pack::upload_rate_limit)\n will not override the global rate limit. The torrent can never upload more than\n the global rate limit.\n@@ -922,17 +922,17 @@\n int m\bma\bax\bx_\b_u\bup\bpl\blo\boa\bad\bds\bs () const;\n set_max_uploads() sets the maximum number of peers that's unchoked at the same\n time on this torrent. If you set this to -1, there will be no limit. This\n defaults to infinite. The primary setting controlling this is the global\n unchoke slots limit, set by unchoke_slots_limit in _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk.\n max_uploads() returns the current settings.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* m\bma\bax\bx_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bns\bs(\b()\b) s\bse\bet\bt_\b_m\bma\bax\bx_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bns\bs(\b()\b) *\b**\b**\b**\b**\b*\n-int m\bma\bax\bx_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bns\bs () const;\n+*\b**\b**\b**\b**\b* s\bse\bet\bt_\b_m\bma\bax\bx_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bns\bs(\b()\b) m\bma\bax\bx_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bns\bs(\b()\b) *\b**\b**\b**\b**\b*\n void s\bse\bet\bt_\b_m\bma\bax\bx_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bns\bs (int max_connections) const;\n+int m\bma\bax\bx_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bns\bs () const;\n set_max_connections() sets the maximum number of connection this torrent will\n open. If all connections are used up, incoming connections may be refused or\n poor connections may be closed. This must be at least 2. The default is\n unlimited number of connections. If -1 is given to the function, it means\n unlimited. There is also a global limit of the number of connections, set by\n connections_limit in _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk.\n max_connections() returns the current settings.\n@@ -982,27 +982,27 @@\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* r\bre\ben\bna\bam\bme\be_\b_f\bfi\bil\ble\be(\b()\b) *\b**\b**\b**\b**\b*\n void r\bre\ben\bna\bam\bme\be_\b_f\bfi\bil\ble\be (file_index_t index, std::string const& new_name) const;\n Renames the file with the given index asynchronously. The rename operation is\n complete when either a _\bf_\bi_\bl_\be_\b__\br_\be_\bn_\ba_\bm_\be_\bd_\b__\ba_\bl_\be_\br_\bt or _\bf_\bi_\bl_\be_\b__\br_\be_\bn_\ba_\bm_\be_\b__\bf_\ba_\bi_\bl_\be_\bd_\b__\ba_\bl_\be_\br_\bt is\n posted.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh(\b()\b) i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bhe\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n+*\b**\b**\b**\b**\b* i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bhe\bes\bs(\b()\b) i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh(\b()\b) *\b**\b**\b**\b**\b*\n info_hash_t i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bhe\bes\bs () const;\n sha1_hash i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh () const;\n returns the info-hash(es) of the torrent. If this handle is to a torrent that\n hasn't loaded yet (for instance by being added) by a URL, the returned value is\n undefined. The info_hash() returns the SHA-1 info-hash for v1 torrents and a\n truncated hash for v2 torrents. For the full v2 info-hash, use info_hashes()\n instead.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* o\bop\bpe\ber\bra\bat\bto\bor\br=\b==\b=(\b()\b) o\bop\bpe\ber\bra\bat\bto\bor\br!\b!=\b=(\b()\b) o\bop\bpe\ber\bra\bat\bto\bor\br<\b<(\b()\b) *\b**\b**\b**\b**\b*\n+*\b**\b**\b**\b**\b* o\bop\bpe\ber\bra\bat\bto\bor\br<\b<(\b()\b) o\bop\bpe\ber\bra\bat\bto\bor\br!\b!=\b=(\b()\b) o\bop\bpe\ber\bra\bat\bto\bor\br=\b==\b=(\b()\b) *\b**\b**\b**\b**\b*\n+bool o\bop\bpe\ber\bra\bat\bto\bor\br!\b!=\b= (const torrent_handle& h) const;\n bool o\bop\bpe\ber\bra\bat\bto\bor\br=\b==\b= (const torrent_handle& h) const;\n bool o\bop\bpe\ber\bra\bat\bto\bor\br<\b< (const torrent_handle& h) const;\n-bool o\bop\bpe\ber\bra\bat\bto\bor\br!\b!=\b= (const torrent_handle& h) const;\n comparison operators. The order of the torrents is unspecified but stable.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* i\bid\bd(\b()\b) *\b**\b**\b**\b**\b*\n std::uint32_t i\bid\bd () const;\n returns a unique identifier for this torrent. It's not a dense index. It's not\n preserved across sessions.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n"}]}, {"source1": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Torrent_Info.html", "source2": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Torrent_Info.html", "unified_diff": "@@ -38,35 +38,35 @@\n 
  • enum type_t
  • \n \n \n
  • load_torrent_limits
  • \n
  • torrent_info
      \n
    • torrent_info()
    • \n
    • ~torrent_info()
    • \n-
    • orig_files() files()
    • \n+
    • files() orig_files()
    • \n
    • rename_file()
    • \n
    • remap_files()
    • \n-
    • add_tracker() clear_trackers() trackers()
    • \n+
    • add_tracker() trackers() clear_trackers()
    • \n
    • collections() similar_torrents()
    • \n-
    • add_url_seed() add_http_seed() set_web_seeds() web_seeds()
    • \n+
    • add_url_seed() add_http_seed() web_seeds() set_web_seeds()
    • \n
    • total_size()
    • \n
    • num_pieces() piece_length()
    • \n
    • blocks_per_piece()
    • \n-
    • piece_range() last_piece() end_piece()
    • \n-
    • info_hash() info_hashes()
    • \n+
    • last_piece() piece_range() end_piece()
    • \n+
    • info_hashes() info_hash()
    • \n
    • v2() v1()
    • \n
    • num_files()
    • \n
    • map_block()
    • \n
    • map_file()
    • \n
    • ssl_cert()
    • \n
    • is_valid()
    • \n
    • priv()
    • \n
    • is_i2p()
    • \n
    • piece_size()
    • \n-
    • hash_for_piece_ptr() hash_for_piece()
    • \n+
    • hash_for_piece() hash_for_piece_ptr()
    • \n
    • name()
    • \n
    • creation_date()
    • \n
    • creator()
    • \n
    • comment()
    • \n
    • nodes()
    • \n
    • add_node()
    • \n
    • parse_info_section()
    • \n@@ -197,56 +197,56 @@\n
      \n

      torrent_info

      \n

      Declared in "libtorrent/torrent_info.hpp"

      \n

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

      \n
      \n class torrent_info\n {\n-   torrent_info (std::string const& filename, load_torrent_limits const& cfg);\n-   torrent_info (span<char const> buffer, load_torrent_limits const& cfg, from_span_t);\n    explicit torrent_info (span<char const> buffer, from_span_t);\n-   torrent_info (std::string const& filename, error_code& ec);\n-   explicit torrent_info (bdecode_node const& torrent_file);\n+   torrent_info (std::string const& filename, load_torrent_limits const& cfg);\n+   torrent_info (torrent_info const& t);\n+   torrent_info (char const* buffer, int size);\n    torrent_info (char const* buffer, int size, error_code& ec);\n+   torrent_info (std::string const& filename, error_code& ec);\n    explicit torrent_info (std::string const& filename);\n-   torrent_info (char const* buffer, int size);\n-   explicit torrent_info (info_hash_t const& info_hash);\n-   torrent_info (bdecode_node const& torrent_file, error_code& ec);\n+   torrent_info (span<char const> buffer, load_torrent_limits const& cfg, from_span_t);\n    torrent_info (bdecode_node const& torrent_file, load_torrent_limits const& cfg);\n+   torrent_info (bdecode_node const& torrent_file, error_code& ec);\n    torrent_info (span<char const> buffer, error_code& ec, from_span_t);\n-   torrent_info (torrent_info const& t);\n+   explicit torrent_info (info_hash_t const& info_hash);\n+   explicit torrent_info (bdecode_node const& torrent_file);\n    ~torrent_info ();\n    file_storage const& files () const;\n    file_storage const& orig_files () const;\n    void rename_file (file_index_t index, std::string const& new_filename);\n    void remap_files (file_storage const& f);\n    std::vector<announce_entry> const& trackers () const;\n-   void add_tracker (std::string const& url, int tier = 0);\n    void clear_trackers ();\n+   void add_tracker (std::string const& url, int tier = 0);\n    void add_tracker (std::string const& url, int tier\n       , announce_entry::tracker_source source);\n    std::vector<sha1_hash> similar_torrents () const;\n    std::vector<std::string> collections () const;\n+   void add_http_seed (std::string const& url\n+      , std::string const& extern_auth = std::string()\n+      , web_seed_entry::headers_t const& extra_headers = web_seed_entry::headers_t());\n    void add_url_seed (std::string const& url\n       , std::string const& ext_auth = std::string()\n       , web_seed_entry::headers_t const& ext_headers = web_seed_entry::headers_t());\n-   std::vector<web_seed_entry> const& web_seeds () const;\n    void set_web_seeds (std::vector<web_seed_entry> seeds);\n-   void add_http_seed (std::string const& url\n-      , std::string const& extern_auth = std::string()\n-      , web_seed_entry::headers_t const& extra_headers = web_seed_entry::headers_t());\n+   std::vector<web_seed_entry> const& web_seeds () const;\n    std::int64_t total_size () const;\n-   int num_pieces () const;\n    int piece_length () const;\n+   int num_pieces () const;\n    int blocks_per_piece () const;\n    piece_index_t end_piece () const;\n    piece_index_t last_piece () const;\n    index_range<piece_index_t> piece_range () const;\n-   sha1_hash info_hash () const noexcept;\n    info_hash_t const& info_hashes () const;\n+   sha1_hash info_hash () const noexcept;\n    bool v1 () const;\n    bool v2 () const;\n    int num_files () const;\n    std::vector<file_slice> map_block (piece_index_t const piece\n       , std::int64_t offset, int size) const;\n    peer_request map_file (file_index_t const file, std::int64_t offset, int size) const;\n    string_view ssl_cert () const;\n@@ -269,27 +269,27 @@\n    span<char const> piece_layer (file_index_t) const;\n    void free_piece_layers ();\n };\n 
      \n [report issue]
      \n

      torrent_info()

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

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

      \n

      The constructor that takes a bdecode_node will create a torrent_info\n@@ -318,18 +318,18 @@\n [report issue]

      \n
      \n

      ~torrent_info()

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

      frees all storage associated with this torrent_info object

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

      orig_files() files()

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

      files() orig_files()

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

      The file_storage object contains the information on how to map the\n pieces to files. It is separated from the torrent_info object because\n when creating torrents a storage object needs to be created without\n@@ -377,22 +377,22 @@\n

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

      \n

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

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

      add_tracker() clear_trackers() trackers()

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

      add_tracker() trackers() clear_trackers()

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

      add_tracker() adds a tracker to the announce-list. The tier\n determines the order in which the trackers are to be tried.\n The trackers() function will return a sorted vector of\n announce_entry. Each announce entry contains a string, which is\n@@ -413,27 +413,27 @@\n

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

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

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

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

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

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

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

      \n

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

      \n

      set_web_seeds() replaces all web seeds with the ones specified in\n@@ -458,16 +458,16 @@\n the total size will be larger than the sum of all (regular) file\n sizes.

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

      num_pieces() piece_length()

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

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

      \n

      blocks_per_piece()

      \n
      \n int blocks_per_piece () const;\n 
      \n

      returns the number of blocks there are in the typical piece. There\n may be fewer in the last piece)

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

      piece_range() last_piece() end_piece()

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

      last_piece() piece_range() end_piece()

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

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

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

      info_hash() info_hashes()

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

      info_hashes() info_hash()

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

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

      \n \n [report issue]
      \n
      \n@@ -590,18 +590,18 @@\n
      \n

      piece_size()

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

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

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

      hash_for_piece_ptr() hash_for_piece()

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

      hash_for_piece() hash_for_piece_ptr()

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

      hash_for_piece() takes a piece-index and returns the 20-bytes\n sha1-hash for that piece and info_hash() returns the 20-bytes\n sha1-hash for the info-section of the torrent file.\n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -7,35 +7,35 @@\n o _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b=_\b=_\b(_\b)\n o _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b<_\b(_\b)\n o _\be_\bn_\bu_\bm_\b _\bt_\by_\bp_\be_\b__\bt\n * _\bl_\bo_\ba_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bl_\bi_\bm_\bi_\bt_\bs\n * _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo\n o _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b(_\b)\n o _\b~_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b(_\b)\n- o _\bo_\br_\bi_\bg_\b__\bf_\bi_\bl_\be_\bs_\b(_\b)_\b _\bf_\bi_\bl_\be_\bs_\b(_\b)\n+ o _\bf_\bi_\bl_\be_\bs_\b(_\b)_\b _\bo_\br_\bi_\bg_\b__\bf_\bi_\bl_\be_\bs_\b(_\b)\n o _\br_\be_\bn_\ba_\bm_\be_\b__\bf_\bi_\bl_\be_\b(_\b)\n o _\br_\be_\bm_\ba_\bp_\b__\bf_\bi_\bl_\be_\bs_\b(_\b)\n- o _\ba_\bd_\bd_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\b(_\b)_\b _\bc_\bl_\be_\ba_\br_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\bs_\b(_\b)_\b _\bt_\br_\ba_\bc_\bk_\be_\br_\bs_\b(_\b)\n+ o _\ba_\bd_\bd_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\b(_\b)_\b _\bt_\br_\ba_\bc_\bk_\be_\br_\bs_\b(_\b)_\b _\bc_\bl_\be_\ba_\br_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\bs_\b(_\b)\n o _\bc_\bo_\bl_\bl_\be_\bc_\bt_\bi_\bo_\bn_\bs_\b(_\b)_\b _\bs_\bi_\bm_\bi_\bl_\ba_\br_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\bs_\b(_\b)\n- o _\ba_\bd_\bd_\b__\bu_\br_\bl_\b__\bs_\be_\be_\bd_\b(_\b)_\b _\ba_\bd_\bd_\b__\bh_\bt_\bt_\bp_\b__\bs_\be_\be_\bd_\b(_\b)_\b _\bs_\be_\bt_\b__\bw_\be_\bb_\b__\bs_\be_\be_\bd_\bs_\b(_\b)_\b _\bw_\be_\bb_\b__\bs_\be_\be_\bd_\bs_\b(_\b)\n+ o _\ba_\bd_\bd_\b__\bu_\br_\bl_\b__\bs_\be_\be_\bd_\b(_\b)_\b _\ba_\bd_\bd_\b__\bh_\bt_\bt_\bp_\b__\bs_\be_\be_\bd_\b(_\b)_\b _\bw_\be_\bb_\b__\bs_\be_\be_\bd_\bs_\b(_\b)_\b _\bs_\be_\bt_\b__\bw_\be_\bb_\b__\bs_\be_\be_\bd_\bs_\b(_\b)\n o _\bt_\bo_\bt_\ba_\bl_\b__\bs_\bi_\bz_\be_\b(_\b)\n o _\bn_\bu_\bm_\b__\bp_\bi_\be_\bc_\be_\bs_\b(_\b)_\b _\bp_\bi_\be_\bc_\be_\b__\bl_\be_\bn_\bg_\bt_\bh_\b(_\b)\n o _\bb_\bl_\bo_\bc_\bk_\bs_\b__\bp_\be_\br_\b__\bp_\bi_\be_\bc_\be_\b(_\b)\n- o _\bp_\bi_\be_\bc_\be_\b__\br_\ba_\bn_\bg_\be_\b(_\b)_\b _\bl_\ba_\bs_\bt_\b__\bp_\bi_\be_\bc_\be_\b(_\b)_\b _\be_\bn_\bd_\b__\bp_\bi_\be_\bc_\be_\b(_\b)\n- o _\bi_\bn_\bf_\bo_\b__\bh_\ba_\bs_\bh_\b(_\b)_\b _\bi_\bn_\bf_\bo_\b__\bh_\ba_\bs_\bh_\be_\bs_\b(_\b)\n+ o _\bl_\ba_\bs_\bt_\b__\bp_\bi_\be_\bc_\be_\b(_\b)_\b _\bp_\bi_\be_\bc_\be_\b__\br_\ba_\bn_\bg_\be_\b(_\b)_\b _\be_\bn_\bd_\b__\bp_\bi_\be_\bc_\be_\b(_\b)\n+ o _\bi_\bn_\bf_\bo_\b__\bh_\ba_\bs_\bh_\be_\bs_\b(_\b)_\b _\bi_\bn_\bf_\bo_\b__\bh_\ba_\bs_\bh_\b(_\b)\n o _\bv_\b2_\b(_\b)_\b _\bv_\b1_\b(_\b)\n o _\bn_\bu_\bm_\b__\bf_\bi_\bl_\be_\bs_\b(_\b)\n o _\bm_\ba_\bp_\b__\bb_\bl_\bo_\bc_\bk_\b(_\b)\n o _\bm_\ba_\bp_\b__\bf_\bi_\bl_\be_\b(_\b)\n o _\bs_\bs_\bl_\b__\bc_\be_\br_\bt_\b(_\b)\n o _\bi_\bs_\b__\bv_\ba_\bl_\bi_\bd_\b(_\b)\n o _\bp_\br_\bi_\bv_\b(_\b)\n o _\bi_\bs_\b__\bi_\b2_\bp_\b(_\b)\n o _\bp_\bi_\be_\bc_\be_\b__\bs_\bi_\bz_\be_\b(_\b)\n- o _\bh_\ba_\bs_\bh_\b__\bf_\bo_\br_\b__\bp_\bi_\be_\bc_\be_\b__\bp_\bt_\br_\b(_\b)_\b _\bh_\ba_\bs_\bh_\b__\bf_\bo_\br_\b__\bp_\bi_\be_\bc_\be_\b(_\b)\n+ o _\bh_\ba_\bs_\bh_\b__\bf_\bo_\br_\b__\bp_\bi_\be_\bc_\be_\b(_\b)_\b _\bh_\ba_\bs_\bh_\b__\bf_\bo_\br_\b__\bp_\bi_\be_\bc_\be_\b__\bp_\bt_\br_\b(_\b)\n o _\bn_\ba_\bm_\be_\b(_\b)\n o _\bc_\br_\be_\ba_\bt_\bi_\bo_\bn_\b__\bd_\ba_\bt_\be_\b(_\b)\n o _\bc_\br_\be_\ba_\bt_\bo_\br_\b(_\b)\n o _\bc_\bo_\bm_\bm_\be_\bn_\bt_\b(_\b)\n o _\bn_\bo_\bd_\be_\bs_\b(_\b)\n o _\ba_\bd_\bd_\b__\bn_\bo_\bd_\be_\b(_\b)\n o _\bp_\ba_\br_\bs_\be_\b__\bi_\bn_\bf_\bo_\b__\bs_\be_\bc_\bt_\bi_\bo_\bn_\b(_\b)\n@@ -120,60 +120,60 @@\n the max number of bdecode tokens\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b._\bh_\bp_\bp\"\n the _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo class holds the information found in a .torrent file.\n class torrent_info\n {\n- t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (std::string const& filename, load_torrent_limits const& cfg);\n- t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (span buffer, load_torrent_limits const& cfg,\n-from_span_t);\n explicit t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (span buffer, from_span_t);\n- t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (std::string const& filename, error_code& ec);\n- explicit t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (bdecode_node const& torrent_file);\n+ t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (std::string const& filename, load_torrent_limits const& cfg);\n+ t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (torrent_info const& t);\n+ t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (char const* buffer, int size);\n t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (char const* buffer, int size, error_code& ec);\n+ t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (std::string const& filename, error_code& ec);\n explicit t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (std::string const& filename);\n- t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (char const* buffer, int size);\n- explicit t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (info_hash_t const& info_hash);\n- t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (bdecode_node const& torrent_file, error_code& ec);\n+ t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (span buffer, load_torrent_limits const& cfg,\n+from_span_t);\n t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (bdecode_node const& torrent_file, load_torrent_limits const&\n cfg);\n+ t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (bdecode_node const& torrent_file, error_code& ec);\n t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (span buffer, error_code& ec, from_span_t);\n- t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (torrent_info const& t);\n+ explicit t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (info_hash_t const& info_hash);\n+ explicit t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (bdecode_node const& torrent_file);\n ~\b~t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo ();\n file_storage const& f\bfi\bil\ble\bes\bs () const;\n file_storage const& o\bor\bri\big\bg_\b_f\bfi\bil\ble\bes\bs () const;\n void r\bre\ben\bna\bam\bme\be_\b_f\bfi\bil\ble\be (file_index_t index, std::string const& new_filename);\n void r\bre\bem\bma\bap\bp_\b_f\bfi\bil\ble\bes\bs (file_storage const& f);\n std::vector const& t\btr\bra\bac\bck\bke\ber\brs\bs () const;\n- void a\bad\bdd\bd_\b_t\btr\bra\bac\bck\bke\ber\br (std::string const& url, int tier = 0);\n void c\bcl\ble\bea\bar\br_\b_t\btr\bra\bac\bck\bke\ber\brs\bs ();\n+ void a\bad\bdd\bd_\b_t\btr\bra\bac\bck\bke\ber\br (std::string const& url, int tier = 0);\n void a\bad\bdd\bd_\b_t\btr\bra\bac\bck\bke\ber\br (std::string const& url, int tier\n , announce_entry::tracker_source source);\n std::vector s\bsi\bim\bmi\bil\bla\bar\br_\b_t\bto\bor\brr\bre\ben\bnt\bts\bs () const;\n std::vector c\bco\bol\bll\ble\bec\bct\bti\bio\bon\bns\bs () const;\n+ void a\bad\bdd\bd_\b_h\bht\btt\btp\bp_\b_s\bse\bee\bed\bd (std::string const& url\n+ , std::string const& extern_auth = std::string()\n+ , web_seed_entry::headers_t const& extra_headers = web_seed_entry::\n+headers_t());\n void a\bad\bdd\bd_\b_u\bur\brl\bl_\b_s\bse\bee\bed\bd (std::string const& url\n , std::string const& ext_auth = std::string()\n , web_seed_entry::headers_t const& ext_headers = web_seed_entry::\n headers_t());\n- std::vector const& w\bwe\beb\bb_\b_s\bse\bee\bed\bds\bs () const;\n void s\bse\bet\bt_\b_w\bwe\beb\bb_\b_s\bse\bee\bed\bds\bs (std::vector seeds);\n- void a\bad\bdd\bd_\b_h\bht\btt\btp\bp_\b_s\bse\bee\bed\bd (std::string const& url\n- , std::string const& extern_auth = std::string()\n- , web_seed_entry::headers_t const& extra_headers = web_seed_entry::\n-headers_t());\n+ std::vector const& w\bwe\beb\bb_\b_s\bse\bee\bed\bds\bs () const;\n std::int64_t t\bto\bot\bta\bal\bl_\b_s\bsi\biz\bze\be () const;\n- int n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs () const;\n int p\bpi\bie\bec\bce\be_\b_l\ble\ben\bng\bgt\bth\bh () const;\n+ int n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs () const;\n int b\bbl\blo\boc\bck\bks\bs_\b_p\bpe\ber\br_\b_p\bpi\bie\bec\bce\be () const;\n piece_index_t e\ben\bnd\bd_\b_p\bpi\bie\bec\bce\be () const;\n piece_index_t l\bla\bas\bst\bt_\b_p\bpi\bie\bec\bce\be () const;\n index_range p\bpi\bie\bec\bce\be_\b_r\bra\ban\bng\bge\be () const;\n- sha1_hash i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh () const noexcept;\n info_hash_t const& i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bhe\bes\bs () const;\n+ sha1_hash i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh () const noexcept;\n bool v\bv1\b1 () const;\n bool v\bv2\b2 () const;\n int n\bnu\bum\bm_\b_f\bfi\bil\ble\bes\bs () const;\n std::vector m\bma\bap\bp_\b_b\bbl\blo\boc\bck\bk (piece_index_t const piece\n , std::int64_t offset, int size) const;\n peer_request m\bma\bap\bp_\b_f\bfi\bil\ble\be (file_index_t const file, std::int64_t offset, int\n size) const;\n@@ -196,29 +196,29 @@\n bdecode_node i\bin\bnf\bfo\bo (char const* key) const;\n span i\bin\bnf\bfo\bo_\b_s\bse\bec\bct\bti\bio\bon\bn () const;\n span p\bpi\bie\bec\bce\be_\b_l\bla\bay\bye\ber\br (file_index_t) const;\n void f\bfr\bre\bee\be_\b_p\bpi\bie\bec\bce\be_\b_l\bla\bay\bye\ber\brs\bs ();\n };\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo(\b()\b) *\b**\b**\b**\b**\b*\n-t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (std::string const& filename, load_torrent_limits const& cfg);\n-t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (span buffer, load_torrent_limits const& cfg,\n-from_span_t);\n explicit t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (span buffer, from_span_t);\n-t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (std::string const& filename, error_code& ec);\n-explicit t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (bdecode_node const& torrent_file);\n+t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (std::string const& filename, load_torrent_limits const& cfg);\n+t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (torrent_info const& t);\n+t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (char const* buffer, int size);\n t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (char const* buffer, int size, error_code& ec);\n+t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (std::string const& filename, error_code& ec);\n explicit t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (std::string const& filename);\n-t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (char const* buffer, int size);\n-explicit t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (info_hash_t const& info_hash);\n-t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (bdecode_node const& torrent_file, error_code& ec);\n+t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (span buffer, load_torrent_limits const& cfg,\n+from_span_t);\n t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (bdecode_node const& torrent_file, load_torrent_limits const&\n cfg);\n+t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (bdecode_node const& torrent_file, error_code& ec);\n t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (span buffer, error_code& ec, from_span_t);\n-t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (torrent_info const& t);\n+explicit t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (info_hash_t const& info_hash);\n+explicit t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (bdecode_node const& torrent_file);\n The constructor that takes an info-hash will initialize the info-hash to the\n given value, but leave all other fields empty. This is used internally when\n downloading torrents without the metadata. The metadata will be created by\n libtorrent as soon as it has been downloaded from the swarm.\n The constructor that takes a _\bb_\bd_\be_\bc_\bo_\bd_\be_\b__\bn_\bo_\bd_\be will create a _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo object\n from the information found in the given torrent_file. The _\bb_\bd_\be_\bc_\bo_\bd_\be_\b__\bn_\bo_\bd_\be\n represents a tree node in an bencoded file. To load an ordinary .torrent file\n@@ -241,15 +241,15 @@\n from_span_t to disambiguate the std::string overload for string literals. There\n is an object in the libtorrent namespace of this type called from_span.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* ~\b~t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo(\b()\b) *\b**\b**\b**\b**\b*\n ~\b~t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo ();\n frees all storage associated with this _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo object\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* o\bor\bri\big\bg_\b_f\bfi\bil\ble\bes\bs(\b()\b) f\bfi\bil\ble\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n+*\b**\b**\b**\b**\b* f\bfi\bil\ble\bes\bs(\b()\b) o\bor\bri\big\bg_\b_f\bfi\bil\ble\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n file_storage const& f\bfi\bil\ble\bes\bs () const;\n file_storage const& o\bor\bri\big\bg_\b_f\bfi\bil\ble\bes\bs () const;\n The _\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be object contains the information on how to map the pieces to\n files. It is separated from the _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo object because when creating\n torrents a storage object needs to be created without having a torrent file.\n When renaming files in a storage, the storage needs to make its own copy of the\n _\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be in order to make its mapping differ from the one in the torrent\n@@ -284,18 +284,18 @@\n Remaps the file storage to a new file layout. This can be used to, for\n instance, download all data in a torrent to a single file, or to a number of\n fixed size sector aligned files, regardless of the number and sizes of the\n files in the torrent.\n The new specified file_storage must have the exact same size as the current\n one.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_t\btr\bra\bac\bck\bke\ber\br(\b()\b) c\bcl\ble\bea\bar\br_\b_t\btr\bra\bac\bck\bke\ber\brs\bs(\b()\b) t\btr\bra\bac\bck\bke\ber\brs\bs(\b()\b) *\b**\b**\b**\b**\b*\n+*\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_t\btr\bra\bac\bck\bke\ber\br(\b()\b) t\btr\bra\bac\bck\bke\ber\brs\bs(\b()\b) c\bcl\ble\bea\bar\br_\b_t\btr\bra\bac\bck\bke\ber\brs\bs(\b()\b) *\b**\b**\b**\b**\b*\n std::vector const& t\btr\bra\bac\bck\bke\ber\brs\bs () const;\n-void a\bad\bdd\bd_\b_t\btr\bra\bac\bck\bke\ber\br (std::string const& url, int tier = 0);\n void c\bcl\ble\bea\bar\br_\b_t\btr\bra\bac\bck\bke\ber\brs\bs ();\n+void a\bad\bdd\bd_\b_t\btr\bra\bac\bck\bke\ber\br (std::string const& url, int tier = 0);\n void a\bad\bdd\bd_\b_t\btr\bra\bac\bck\bke\ber\br (std::string const& url, int tier\n , announce_entry::tracker_source source);\n add_tracker() adds a tracker to the announce-list. The tier determines the\n order in which the trackers are to be tried. The trackers() function will\n return a sorted vector of _\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\be_\bn_\bt_\br_\by. Each announce _\be_\bn_\bt_\br_\by contains a\n string, which is the tracker url, and a tier index. The tier index is the high-\n level priority. No matter which trackers that works or not, the ones with lower\n@@ -308,25 +308,25 @@\n std::vector s\bsi\bim\bmi\bil\bla\bar\br_\b_t\bto\bor\brr\bre\ben\bnt\bts\bs () const;\n std::vector c\bco\bol\bll\ble\bec\bct\bti\bio\bon\bns\bs () const;\n These two functions are related to _\bB_\bE_\bP_\b _\b3_\b8 (mutable torrents). The vectors\n returned from these correspond to the \"similar\" and \"collections\" keys in the\n .torrent file. Both info-hashes and collections from within the info-dict and\n from outside of it are included.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_u\bur\brl\bl_\b_s\bse\bee\bed\bd(\b()\b) a\bad\bdd\bd_\b_h\bht\btt\btp\bp_\b_s\bse\bee\bed\bd(\b()\b) s\bse\bet\bt_\b_w\bwe\beb\bb_\b_s\bse\bee\bed\bds\bs(\b()\b) w\bwe\beb\bb_\b_s\bse\bee\bed\bds\bs(\b()\b) *\b**\b**\b**\b**\b*\n+*\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_u\bur\brl\bl_\b_s\bse\bee\bed\bd(\b()\b) a\bad\bdd\bd_\b_h\bht\btt\btp\bp_\b_s\bse\bee\bed\bd(\b()\b) w\bwe\beb\bb_\b_s\bse\bee\bed\bds\bs(\b()\b) s\bse\bet\bt_\b_w\bwe\beb\bb_\b_s\bse\bee\bed\bds\bs(\b()\b) *\b**\b**\b**\b**\b*\n+void a\bad\bdd\bd_\b_h\bht\btt\btp\bp_\b_s\bse\bee\bed\bd (std::string const& url\n+ , std::string const& extern_auth = std::string()\n+ , web_seed_entry::headers_t const& extra_headers = web_seed_entry::\n+headers_t());\n void a\bad\bdd\bd_\b_u\bur\brl\bl_\b_s\bse\bee\bed\bd (std::string const& url\n , std::string const& ext_auth = std::string()\n , web_seed_entry::headers_t const& ext_headers = web_seed_entry::\n headers_t());\n-std::vector const& w\bwe\beb\bb_\b_s\bse\bee\bed\bds\bs () const;\n void s\bse\bet\bt_\b_w\bwe\beb\bb_\b_s\bse\bee\bed\bds\bs (std::vector seeds);\n-void a\bad\bdd\bd_\b_h\bht\btt\btp\bp_\b_s\bse\bee\bed\bd (std::string const& url\n- , std::string const& extern_auth = std::string()\n- , web_seed_entry::headers_t const& extra_headers = web_seed_entry::\n-headers_t());\n+std::vector const& w\bwe\beb\bb_\b_s\bse\bee\bed\bds\bs () const;\n web_seeds() returns all url seeds and http seeds in the torrent. Each _\be_\bn_\bt_\br_\by is\n a web_seed_entry and may refer to either a url seed or http seed.\n add_url_seed() and add_http_seed() adds one url to the list of url/http seeds.\n set_web_seeds() replaces all web seeds with the ones specified in the seeds\n vector.\n The extern_auth argument can be used for other authorization schemes than basic\n HTTP authorization. If set, it will override any username and password found in\n@@ -340,40 +340,40 @@\n std::int64_t t\bto\bot\bta\bal\bl_\b_s\bsi\biz\bze\be () const;\n total_size() returns the total number of bytes the torrent-file represents.\n Note that this is the number of pieces times the piece size (modulo the last\n piece possibly being smaller). With pad files, the total size will be larger\n than the sum of all (regular) file sizes.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs(\b()\b) p\bpi\bie\bec\bce\be_\b_l\ble\ben\bng\bgt\bth\bh(\b()\b) *\b**\b**\b**\b**\b*\n-int n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs () const;\n int p\bpi\bie\bec\bce\be_\b_l\ble\ben\bng\bgt\bth\bh () const;\n+int n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs () const;\n piece_length() and num_pieces() returns the number of byte for each piece and\n the total number of pieces, respectively. The difference between piece_size()\n and piece_length() is that piece_size() takes the piece index as argument and\n gives you the exact size of that piece. It will always be the same as\n piece_length() except in the case of the last piece, which may be smaller.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* b\bbl\blo\boc\bck\bks\bs_\b_p\bpe\ber\br_\b_p\bpi\bie\bec\bce\be(\b()\b) *\b**\b**\b**\b**\b*\n int b\bbl\blo\boc\bck\bks\bs_\b_p\bpe\ber\br_\b_p\bpi\bie\bec\bce\be () const;\n returns the number of blocks there are in the typical piece. There may be fewer\n in the last piece)\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* p\bpi\bie\bec\bce\be_\b_r\bra\ban\bng\bge\be(\b()\b) l\bla\bas\bst\bt_\b_p\bpi\bie\bec\bce\be(\b()\b) e\ben\bnd\bd_\b_p\bpi\bie\bec\bce\be(\b()\b) *\b**\b**\b**\b**\b*\n+*\b**\b**\b**\b**\b* l\bla\bas\bst\bt_\b_p\bpi\bie\bec\bce\be(\b()\b) p\bpi\bie\bec\bce\be_\b_r\bra\ban\bng\bge\be(\b()\b) e\ben\bnd\bd_\b_p\bpi\bie\bec\bce\be(\b()\b) *\b**\b**\b**\b**\b*\n piece_index_t e\ben\bnd\bd_\b_p\bpi\bie\bec\bce\be () const;\n piece_index_t l\bla\bas\bst\bt_\b_p\bpi\bie\bec\bce\be () const;\n index_range p\bpi\bie\bec\bce\be_\b_r\bra\ban\bng\bge\be () const;\n last_piece() returns the index to the last piece in the torrent and end_piece()\n returns the index to the one-past-end piece in the torrent piece_range()\n returns an implementation-defined type that can be used as the container in a\n range-for loop. Where the values are the indices of all pieces in the\n _\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh(\b()\b) i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bhe\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n-sha1_hash i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh () const noexcept;\n+*\b**\b**\b**\b**\b* i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bhe\bes\bs(\b()\b) i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh(\b()\b) *\b**\b**\b**\b**\b*\n info_hash_t const& i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bhe\bes\bs () const;\n+sha1_hash i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh () const noexcept;\n returns the info-hash of the torrent. For BitTorrent v2 support, use\n info_hashes() to get an object that may hold both a v1 and v2 info-hash\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* v\bv2\b2(\b()\b) v\bv1\b1(\b()\b) *\b**\b**\b**\b**\b*\n bool v\bv1\b1 () const;\n bool v\bv2\b2 () const;\n returns whether this torrent has v1 and/or v2 metadata, respectively. Hybrid\n@@ -427,15 +427,15 @@\n than the i2p network.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* p\bpi\bie\bec\bce\be_\b_s\bsi\biz\bze\be(\b()\b) *\b**\b**\b**\b**\b*\n int p\bpi\bie\bec\bce\be_\b_s\bsi\biz\bze\be (piece_index_t index) const;\n returns the piece size of file with index. This will be the same as\n _\bp_\bi_\be_\bc_\be_\b__\bl_\be_\bn_\bg_\bt_\bh_\b(_\b), except for the last piece, which may be shorter.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* h\bha\bas\bsh\bh_\b_f\bfo\bor\br_\b_p\bpi\bie\bec\bce\be_\b_p\bpt\btr\br(\b()\b) h\bha\bas\bsh\bh_\b_f\bfo\bor\br_\b_p\bpi\bie\bec\bce\be(\b()\b) *\b**\b**\b**\b**\b*\n+*\b**\b**\b**\b**\b* h\bha\bas\bsh\bh_\b_f\bfo\bor\br_\b_p\bpi\bie\bec\bce\be(\b()\b) h\bha\bas\bsh\bh_\b_f\bfo\bor\br_\b_p\bpi\bie\bec\bce\be_\b_p\bpt\btr\br(\b()\b) *\b**\b**\b**\b**\b*\n char const* h\bha\bas\bsh\bh_\b_f\bfo\bor\br_\b_p\bpi\bie\bec\bce\be_\b_p\bpt\btr\br (piece_index_t const index) const;\n sha1_hash h\bha\bas\bsh\bh_\b_f\bfo\bor\br_\b_p\bpi\bie\bec\bce\be (piece_index_t index) const;\n hash_for_piece() takes a piece-index and returns the 20-bytes sha1-hash for\n that piece and info_hash() returns the 20-bytes sha1-hash for the info-section\n of the torrent file. hash_for_piece_ptr() returns a pointer to the 20 byte sha1\n digest for the piece. Note that the string is not 0-terminated.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n"}]}, {"source1": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Trackers.html", "source2": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Trackers.html", "unified_diff": "@@ -31,15 +31,15 @@\n

      home

      \n \n [report issue]
      \n

      announce_infohash

      \n@@ -131,19 +131,19 @@\n

      announce_entry

      \n

      Declared in "libtorrent/announce_entry.hpp"

      \n

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

      \n
      \n struct announce_entry\n {\n-   announce_entry& operator= (announce_entry const&) &;\n    announce_entry (announce_entry const&);\n-   announce_entry ();\n    ~announce_entry ();\n    explicit announce_entry (string_view u);\n+   announce_entry& operator= (announce_entry const&) &;\n+   announce_entry ();\n \n    enum tracker_source\n    {\n       source_torrent,\n       source_client,\n       source_magnet_link,\n       source_tex,\n@@ -154,24 +154,24 @@\n    std::vector<announce_endpoint> endpoints;\n    std::uint8_t tier  = 0;\n    std::uint8_t fail_limit  = 0;\n    std::uint8_t source:4;\n    bool verified:1;\n };\n 
      \n-\n+\n \n-[report issue]
      \n-

      operator=() ~announce_entry() announce_entry()

      \n+[report issue]
      \n+

      announce_entry() ~announce_entry() operator=()

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

      constructs a tracker announce entry with u as the URL.

      \n [report issue]
      \n
      \n

      enum tracker_source

      \n

      Declared in "libtorrent/announce_entry.hpp"

      \n
  • \n@@ -189,15 +189,15 @@\n \n \n \n \n \n \n \n-\n+\n \n \n \n \n \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,15 +2,15 @@\n _\b[_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b _\bl_\bo_\bg_\bo_\b]\n V\bVe\ber\brs\bsi\bio\bon\bn:\b: 2.0.11\n _\bh_\bo_\bm_\be\n Table of contents\n * _\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\bi_\bn_\bf_\bo_\bh_\ba_\bs_\bh\n * _\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\be_\bn_\bd_\bp_\bo_\bi_\bn_\bt\n * _\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\be_\bn_\bt_\br_\by\n- o _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b=_\b(_\b)_\b _\b~_\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\be_\bn_\bt_\br_\by_\b(_\b)_\b _\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\be_\bn_\bt_\br_\by_\b(_\b)\n+ o _\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\be_\bn_\bt_\br_\by_\b(_\b)_\b _\b~_\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\be_\bn_\bt_\br_\by_\b(_\b)_\b _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b=_\b(_\b)\n o _\be_\bn_\bu_\bm_\b _\bt_\br_\ba_\bc_\bk_\be_\br_\b__\bs_\bo_\bu_\br_\bc_\be\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_i\bin\bnf\bfo\boh\bha\bas\bsh\bh *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\be_\bn_\bt_\br_\by_\b._\bh_\bp_\bp\"\n struct announce_infohash\n {\n std::string message;\n@@ -78,19 +78,19 @@\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\be_\bn_\bt_\br_\by_\b._\bh_\bp_\bp\"\n this class holds information about one bittorrent tracker, as it relates to a\n specific torrent.\n struct announce_entry\n {\n- announce_entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (announce_entry const&) &;\n a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by (announce_entry const&);\n- a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by ();\n ~\b~a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by ();\n explicit a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by (string_view u);\n+ announce_entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (announce_entry const&) &;\n+ a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by ();\n \n enum tracker_source\n {\n source_torrent,\n source_client,\n source_magnet_link,\n source_tex,\n@@ -101,20 +101,20 @@\n std::vector endpoints;\n std::uint8_t t\bti\bie\ber\br = 0;\n std::uint8_t f\bfa\bai\bil\bl_\b_l\bli\bim\bmi\bit\bt = 0;\n std::uint8_t source:4;\n bool verified:1;\n };\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* o\bop\bpe\ber\bra\bat\bto\bor\br=\b=(\b()\b) ~\b~a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by(\b()\b) a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by(\b()\b) *\b**\b**\b**\b**\b*\n-announce_entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (announce_entry const&) &;\n+*\b**\b**\b**\b**\b* a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by(\b()\b) ~\b~a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by(\b()\b) o\bop\bpe\ber\bra\bat\bto\bor\br=\b=(\b()\b) *\b**\b**\b**\b**\b*\n a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by (announce_entry const&);\n-a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by ();\n ~\b~a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by ();\n explicit a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by (string_view u);\n+announce_entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (announce_entry const&) &;\n+a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by ();\n constructs a tracker announce _\be_\bn_\bt_\br_\by with u as the URL.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* e\ben\bnu\bum\bm t\btr\bra\bac\bck\bke\ber\br_\b_s\bso\bou\bur\brc\bce\be *\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\be_\bn_\bt_\br_\by_\b._\bh_\bp_\bp\"\n _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n |_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |_\bs_\bo_\bu_\br_\bc_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b _\b _\b _\b _\b|_\b1_\b _\b _\b _\b _\b|_\bt_\bh_\be_\b _\bt_\br_\ba_\bc_\bk_\be_\br_\b _\bw_\ba_\bs_\b _\bp_\ba_\br_\bt_\b _\bo_\bf_\b _\bt_\bh_\be_\b _\b._\bt_\bo_\br_\br_\be_\bn_\bt_\b _\bf_\bi_\bl_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n"}]}, {"source1": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Utility.html", "source2": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Utility.html", "unified_diff": "@@ -28,213 +28,91 @@\n \n \n
    source_torrent1the tracker was part of the .torrent file
    source_client2the tracker was added programmatically via the add_tracker() functionthe tracker was added programmatically via the add_tracker() function
    source_magnet_link4the tracker was part of a magnet link
    source_tex82.0.11
    \n

    home

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

    hasher

    \n-

    Declared in "libtorrent/hasher.hpp"

    \n-

    this is a SHA-1 hash class.

    \n-

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

    \n-

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

    \n-

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

    \n-

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

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

    hasher() operator=()

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

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

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

    update()

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

    append the following bytes to what is being hashed

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

    final()

    \n-
    \n-sha1_hash final ();\n-
    \n-

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

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

    reset()

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

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

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

    hasher256

    \n-

    Declared in "libtorrent/hasher.hpp"

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

    operator=() hasher256()

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

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

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

    update()

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

    append the following bytes to what is being hashed

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

    final()

    \n-
    \n-sha256_hash final ();\n-
    \n-

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

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

    reset()

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

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

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

    bitfield

    \n

    Declared in "libtorrent/bitfield.hpp"

    \n

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

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

    bitfield()

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

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

    \n

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

    \n

    assign()

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

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

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

    get_bit() operator[]()

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

    operator[]() get_bit()

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

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

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

    set_bit() clear_bit()

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

    clear_bit() set_bit()

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

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

    \n [report issue]
    \n
    \n

    all_set()

    \n
    \n bool all_set () const noexcept;\n@@ -309,16 +187,16 @@\n bool empty () const noexcept;\n 
    \n

    returns true if the bitfield has zero size.

    \n [report issue]
    \n
    \n

    data()

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

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

    \n [report issue]
    \n
    \n

    swap()

    \n
    \n@@ -342,14 +220,136 @@\n [report issue]
    \n
    \n

    find_last_clear()

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

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

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

    hasher

    \n+

    Declared in "libtorrent/hasher.hpp"

    \n+

    this is a SHA-1 hash class.

    \n+

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

    \n+

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

    \n+

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

    \n+

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

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

    hasher() operator=()

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

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

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

    update()

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

    append the following bytes to what is being hashed

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

    final()

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

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

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

    reset()

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

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

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

    hasher256

    \n+

    Declared in "libtorrent/hasher.hpp"

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

    hasher256() operator=()

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

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

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

    update()

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

    append the following bytes to what is being hashed

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

    final()

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

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

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

    reset()

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

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

    \n
    \n
    \n \n
    \n
    \n
    \n
    \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,187 +1,98 @@\n >\n _\b[_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b _\bl_\bo_\bg_\bo_\b]\n V\bVe\ber\brs\bsi\bio\bon\bn:\b: 2.0.11\n _\bh_\bo_\bm_\be\n Table of contents\n- * _\bh_\ba_\bs_\bh_\be_\br\n- o _\bh_\ba_\bs_\bh_\be_\br_\b(_\b)_\b _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b=_\b(_\b)\n- o _\bu_\bp_\bd_\ba_\bt_\be_\b(_\b)\n- o _\bf_\bi_\bn_\ba_\bl_\b(_\b)\n- o _\br_\be_\bs_\be_\bt_\b(_\b)\n- * _\bh_\ba_\bs_\bh_\be_\br_\b2_\b5_\b6\n- o _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b=_\b(_\b)_\b _\bh_\ba_\bs_\bh_\be_\br_\b2_\b5_\b6_\b(_\b)\n- o _\bu_\bp_\bd_\ba_\bt_\be_\b(_\b)\n- o _\bf_\bi_\bn_\ba_\bl_\b(_\b)\n- o _\br_\be_\bs_\be_\bt_\b(_\b)\n * _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd\n o _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd_\b(_\b)\n o _\ba_\bs_\bs_\bi_\bg_\bn_\b(_\b)\n- o _\bg_\be_\bt_\b__\bb_\bi_\bt_\b(_\b)_\b _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b[_\b]_\b(_\b)\n- o _\bs_\be_\bt_\b__\bb_\bi_\bt_\b(_\b)_\b _\bc_\bl_\be_\ba_\br_\b__\bb_\bi_\bt_\b(_\b)\n+ o _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b[_\b]_\b(_\b)_\b _\bg_\be_\bt_\b__\bb_\bi_\bt_\b(_\b)\n+ o _\bc_\bl_\be_\ba_\br_\b__\bb_\bi_\bt_\b(_\b)_\b _\bs_\be_\bt_\b__\bb_\bi_\bt_\b(_\b)\n o _\ba_\bl_\bl_\b__\bs_\be_\bt_\b(_\b)\n o _\bn_\bo_\bn_\be_\b__\bs_\be_\bt_\b(_\b)\n o _\bs_\bi_\bz_\be_\b(_\b)\n o _\bn_\bu_\bm_\b__\bw_\bo_\br_\bd_\bs_\b(_\b)\n o _\bn_\bu_\bm_\b__\bb_\by_\bt_\be_\bs_\b(_\b)\n o _\be_\bm_\bp_\bt_\by_\b(_\b)\n o _\bd_\ba_\bt_\ba_\b(_\b)\n o _\bs_\bw_\ba_\bp_\b(_\b)\n o _\bc_\bo_\bu_\bn_\bt_\b(_\b)\n o _\bf_\bi_\bn_\bd_\b__\bf_\bi_\br_\bs_\bt_\b__\bs_\be_\bt_\b(_\b)\n o _\bf_\bi_\bn_\bd_\b__\bl_\ba_\bs_\bt_\b__\bc_\bl_\be_\ba_\br_\b(_\b)\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* h\bha\bas\bsh\bhe\ber\br *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bh_\ba_\bs_\bh_\be_\br_\b._\bh_\bp_\bp\"\n-this is a SHA-1 hash class.\n-You use it by first instantiating it, then call update() to feed it with data.\n-i.e. you don't have to keep the entire buffer of which you want to create the\n-hash in memory. You can feed the _\bh_\ba_\bs_\bh_\be_\br parts of it at a time. When You have\n-fed the _\bh_\ba_\bs_\bh_\be_\br with all the data, you call final() and it will return the sha1-\n-hash of the data.\n-The constructor that takes a char const* and an integer will construct the sha1\n-context and feed it the data passed in.\n-If you want to reuse the _\bh_\ba_\bs_\bh_\be_\br object once you have created a hash, you have\n-to call reset() to reinitialize it.\n-The built-in software version of sha1-algorithm was implemented by Steve Reid\n-and released as public domain. For more info, see src/sha1.cpp.\n-class hasher\n-{\n- h\bha\bas\bsh\bhe\ber\br ();\n- explicit h\bha\bas\bsh\bhe\ber\br (span data);\n- h\bha\bas\bsh\bhe\ber\br (char const* data, int len);\n- hasher& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (hasher const&) &;\n- h\bha\bas\bsh\bhe\ber\br (hasher const&);\n- hasher& u\bup\bpd\bda\bat\bte\be (span data);\n- hasher& u\bup\bpd\bda\bat\bte\be (char const* data, int len);\n- sha1_hash f\bfi\bin\bna\bal\bl ();\n- void r\bre\bes\bse\bet\bt ();\n-};\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* h\bha\bas\bsh\bhe\ber\br(\b()\b) o\bop\bpe\ber\bra\bat\bto\bor\br=\b=(\b()\b) *\b**\b**\b**\b**\b*\n-explicit h\bha\bas\bsh\bhe\ber\br (span data);\n-h\bha\bas\bsh\bhe\ber\br (char const* data, int len);\n-hasher& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (hasher const&) &;\n-h\bha\bas\bsh\bhe\ber\br (hasher const&);\n-this is the same as default constructing followed by a call to update(data,\n-len).\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* u\bup\bpd\bda\bat\bte\be(\b()\b) *\b**\b**\b**\b**\b*\n-hasher& u\bup\bpd\bda\bat\bte\be (span data);\n-hasher& u\bup\bpd\bda\bat\bte\be (char const* data, int len);\n-append the following bytes to what is being hashed\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* f\bfi\bin\bna\bal\bl(\b()\b) *\b**\b**\b**\b**\b*\n-sha1_hash f\bfi\bin\bna\bal\bl ();\n-returns the SHA-1 digest of the buffers previously passed to _\bu_\bp_\bd_\ba_\bt_\be_\b(_\b) and the\n-_\bh_\ba_\bs_\bh_\be_\br constructor.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* r\bre\bes\bse\bet\bt(\b()\b) *\b**\b**\b**\b**\b*\n-void r\bre\bes\bse\bet\bt ();\n-restore the _\bh_\ba_\bs_\bh_\be_\br state to be as if the _\bh_\ba_\bs_\bh_\be_\br has just been default\n-constructed.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* h\bha\bas\bsh\bhe\ber\br2\b25\b56\b6 *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bh_\ba_\bs_\bh_\be_\br_\b._\bh_\bp_\bp\"\n-class hasher256\n-{\n- h\bha\bas\bsh\bhe\ber\br2\b25\b56\b6 ();\n- hasher256& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (hasher256 const&) &;\n- h\bha\bas\bsh\bhe\ber\br2\b25\b56\b6 (hasher256 const&);\n- h\bha\bas\bsh\bhe\ber\br2\b25\b56\b6 (char const* data, int len);\n- explicit h\bha\bas\bsh\bhe\ber\br2\b25\b56\b6 (span data);\n- hasher256& u\bup\bpd\bda\bat\bte\be (span data);\n- hasher256& u\bup\bpd\bda\bat\bte\be (char const* data, int len);\n- sha256_hash f\bfi\bin\bna\bal\bl ();\n- void r\bre\bes\bse\bet\bt ();\n- ~\b~h\bha\bas\bsh\bhe\ber\br2\b25\b56\b6 ();\n-};\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* o\bop\bpe\ber\bra\bat\bto\bor\br=\b=(\b()\b) h\bha\bas\bsh\bhe\ber\br2\b25\b56\b6(\b()\b) *\b**\b**\b**\b**\b*\n-hasher256& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (hasher256 const&) &;\n-h\bha\bas\bsh\bhe\ber\br2\b25\b56\b6 (hasher256 const&);\n-h\bha\bas\bsh\bhe\ber\br2\b25\b56\b6 (char const* data, int len);\n-explicit h\bha\bas\bsh\bhe\ber\br2\b25\b56\b6 (span data);\n-this is the same as default constructing followed by a call to update(data,\n-len).\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* u\bup\bpd\bda\bat\bte\be(\b()\b) *\b**\b**\b**\b**\b*\n-hasher256& u\bup\bpd\bda\bat\bte\be (span data);\n-hasher256& u\bup\bpd\bda\bat\bte\be (char const* data, int len);\n-append the following bytes to what is being hashed\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* f\bfi\bin\bna\bal\bl(\b()\b) *\b**\b**\b**\b**\b*\n-sha256_hash f\bfi\bin\bna\bal\bl ();\n-returns the SHA-1 digest of the buffers previously passed to _\bu_\bp_\bd_\ba_\bt_\be_\b(_\b) and the\n-_\bh_\ba_\bs_\bh_\be_\br constructor.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* r\bre\bes\bse\bet\bt(\b()\b) *\b**\b**\b**\b**\b*\n-void r\bre\bes\bse\bet\bt ();\n-restore the _\bh_\ba_\bs_\bh_\be_\br state to be as if the _\bh_\ba_\bs_\bh_\be_\br has just been default\n-constructed.\n+ * _\bh_\ba_\bs_\bh_\be_\br\n+ o _\bh_\ba_\bs_\bh_\be_\br_\b(_\b)_\b _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b=_\b(_\b)\n+ o _\bu_\bp_\bd_\ba_\bt_\be_\b(_\b)\n+ o _\bf_\bi_\bn_\ba_\bl_\b(_\b)\n+ o _\br_\be_\bs_\be_\bt_\b(_\b)\n+ * _\bh_\ba_\bs_\bh_\be_\br_\b2_\b5_\b6\n+ o _\bh_\ba_\bs_\bh_\be_\br_\b2_\b5_\b6_\b(_\b)_\b _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b=_\b(_\b)\n+ o _\bu_\bp_\bd_\ba_\bt_\be_\b(_\b)\n+ o _\bf_\bi_\bn_\ba_\bl_\b(_\b)\n+ o _\br_\be_\bs_\be_\bt_\b(_\b)\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* b\bbi\bit\btf\bfi\bie\bel\bld\bd *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd_\b._\bh_\bp_\bp\"\n The _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd type stores any number of bits as a _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd in a heap allocated\n array.\n struct bitfield\n {\n- b\bbi\bit\btf\bfi\bie\bel\bld\bd (bitfield&& rhs) noexcept = default;\n- b\bbi\bit\btf\bfi\bie\bel\bld\bd (char const* b, int bits);\n- b\bbi\bit\btf\bfi\bie\bel\bld\bd () noexcept = default;\n+ b\bbi\bit\btf\bfi\bie\bel\bld\bd (bitfield const& rhs);\n explicit b\bbi\bit\btf\bfi\bie\bel\bld\bd (int bits);\n+ b\bbi\bit\btf\bfi\bie\bel\bld\bd () noexcept = default;\n b\bbi\bit\btf\bfi\bie\bel\bld\bd (int bits, bool val);\n- b\bbi\bit\btf\bfi\bie\bel\bld\bd (bitfield const& rhs);\n+ b\bbi\bit\btf\bfi\bie\bel\bld\bd (char const* b, int bits);\n+ b\bbi\bit\btf\bfi\bie\bel\bld\bd (bitfield&& rhs) noexcept = default;\n void a\bas\bss\bsi\big\bgn\bn (char const* b, int const bits);\n- bool g\bge\bet\bt_\b_b\bbi\bit\bt (int index) const noexcept;\n bool o\bop\bpe\ber\bra\bat\bto\bor\br[\b[]\b] (int index) const noexcept;\n- void c\bcl\ble\bea\bar\br_\b_b\bbi\bit\bt (int index) noexcept;\n+ bool g\bge\bet\bt_\b_b\bbi\bit\bt (int index) const noexcept;\n void s\bse\bet\bt_\b_b\bbi\bit\bt (int index) noexcept;\n+ void c\bcl\ble\bea\bar\br_\b_b\bbi\bit\bt (int index) noexcept;\n bool a\bal\bll\bl_\b_s\bse\bet\bt () const noexcept;\n bool n\bno\bon\bne\be_\b_s\bse\bet\bt () const noexcept;\n int s\bsi\biz\bze\be () const noexcept;\n int n\bnu\bum\bm_\b_w\bwo\bor\brd\bds\bs () const noexcept;\n int n\bnu\bum\bm_\b_b\bby\byt\bte\bes\bs () const noexcept;\n bool e\bem\bmp\bpt\bty\by () const noexcept;\n- char const* d\bda\bat\bta\ba () const noexcept;\n char* d\bda\bat\bta\ba () noexcept;\n+ char const* d\bda\bat\bta\ba () const noexcept;\n void s\bsw\bwa\bap\bp (bitfield& rhs) noexcept;\n int c\bco\bou\bun\bnt\bt () const noexcept;\n int f\bfi\bin\bnd\bd_\b_f\bfi\bir\brs\bst\bt_\b_s\bse\bet\bt () const noexcept;\n int f\bfi\bin\bnd\bd_\b_l\bla\bas\bst\bt_\b_c\bcl\ble\bea\bar\br () const noexcept;\n bool o\bop\bpe\ber\bra\bat\bto\bor\br=\b==\b= (lt::bitfield const& rhs) const;\n };\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* b\bbi\bit\btf\bfi\bie\bel\bld\bd(\b()\b) *\b**\b**\b**\b**\b*\n-b\bbi\bit\btf\bfi\bie\bel\bld\bd (bitfield&& rhs) noexcept = default;\n-b\bbi\bit\btf\bfi\bie\bel\bld\bd (char const* b, int bits);\n-b\bbi\bit\btf\bfi\bie\bel\bld\bd () noexcept = default;\n+b\bbi\bit\btf\bfi\bie\bel\bld\bd (bitfield const& rhs);\n explicit b\bbi\bit\btf\bfi\bie\bel\bld\bd (int bits);\n+b\bbi\bit\btf\bfi\bie\bel\bld\bd () noexcept = default;\n b\bbi\bit\btf\bfi\bie\bel\bld\bd (int bits, bool val);\n-b\bbi\bit\btf\bfi\bie\bel\bld\bd (bitfield const& rhs);\n+b\bbi\bit\btf\bfi\bie\bel\bld\bd (char const* b, int bits);\n+b\bbi\bit\btf\bfi\bie\bel\bld\bd (bitfield&& rhs) noexcept = default;\n constructs a new _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd. The default constructor creates an empty _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd.\n bits is the size of the _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd (specified in bits). val is the value to\n initialize the bits to. If not specified all bits are initialized to 0.\n The constructor taking a pointer b and bits copies a _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd from the\n specified buffer, and bits number of bits (rounded up to the nearest byte\n boundary).\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* a\bas\bss\bsi\big\bgn\bn(\b()\b) *\b**\b**\b**\b**\b*\n void a\bas\bss\bsi\big\bgn\bn (char const* b, int const bits);\n copy _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd from buffer b of bits number of bits, rounded up to the nearest\n byte boundary.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* g\bge\bet\bt_\b_b\bbi\bit\bt(\b()\b) o\bop\bpe\ber\bra\bat\bto\bor\br[\b[]\b](\b()\b) *\b**\b**\b**\b**\b*\n-bool g\bge\bet\bt_\b_b\bbi\bit\bt (int index) const noexcept;\n+*\b**\b**\b**\b**\b* o\bop\bpe\ber\bra\bat\bto\bor\br[\b[]\b](\b()\b) g\bge\bet\bt_\b_b\bbi\bit\bt(\b()\b) *\b**\b**\b**\b**\b*\n bool o\bop\bpe\ber\bra\bat\bto\bor\br[\b[]\b] (int index) const noexcept;\n+bool g\bge\bet\bt_\b_b\bbi\bit\bt (int index) const noexcept;\n query bit at index. Returns true if bit is 1, otherwise false.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* s\bse\bet\bt_\b_b\bbi\bit\bt(\b()\b) c\bcl\ble\bea\bar\br_\b_b\bbi\bit\bt(\b()\b) *\b**\b**\b**\b**\b*\n-void c\bcl\ble\bea\bar\br_\b_b\bbi\bit\bt (int index) noexcept;\n+*\b**\b**\b**\b**\b* c\bcl\ble\bea\bar\br_\b_b\bbi\bit\bt(\b()\b) s\bse\bet\bt_\b_b\bbi\bit\bt(\b()\b) *\b**\b**\b**\b**\b*\n void s\bse\bet\bt_\b_b\bbi\bit\bt (int index) noexcept;\n+void c\bcl\ble\bea\bar\br_\b_b\bbi\bit\bt (int index) noexcept;\n set bit at index to 0 (clear_bit) or 1 (set_bit).\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* a\bal\bll\bl_\b_s\bse\bet\bt(\b()\b) *\b**\b**\b**\b**\b*\n bool a\bal\bll\bl_\b_s\bse\bet\bt () const noexcept;\n returns true if all bits in the _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd are set\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* n\bno\bon\bne\be_\b_s\bse\bet\bt(\b()\b) *\b**\b**\b**\b**\b*\n@@ -202,16 +113,16 @@\n returns the number of bytes needed to represent all bits in this _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* e\bem\bmp\bpt\bty\by(\b()\b) *\b**\b**\b**\b**\b*\n bool e\bem\bmp\bpt\bty\by () const noexcept;\n returns true if the _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd has zero size.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* d\bda\bat\bta\ba(\b()\b) *\b**\b**\b**\b**\b*\n-char const* d\bda\bat\bta\ba () const noexcept;\n char* d\bda\bat\bta\ba () noexcept;\n+char const* d\bda\bat\bta\ba () const noexcept;\n returns a pointer to the internal buffer of the _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd, or nullptr if it's\n empty.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* s\bsw\bwa\bap\bp(\b()\b) *\b**\b**\b**\b**\b*\n void s\bsw\bwa\bap\bp (bitfield& rhs) noexcept;\n swaps the bit-fields two variables refer to\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n@@ -222,14 +133,103 @@\n *\b**\b**\b**\b**\b* f\bfi\bin\bnd\bd_\b_f\bfi\bir\brs\bst\bt_\b_s\bse\bet\bt(\b()\b) *\b**\b**\b**\b**\b*\n int f\bfi\bin\bnd\bd_\b_f\bfi\bir\brs\bst\bt_\b_s\bse\bet\bt () const noexcept;\n returns the index of the first set bit in the _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd, i.e. 1 bit.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* f\bfi\bin\bnd\bd_\b_l\bla\bas\bst\bt_\b_c\bcl\ble\bea\bar\br(\b()\b) *\b**\b**\b**\b**\b*\n int f\bfi\bin\bnd\bd_\b_l\bla\bas\bst\bt_\b_c\bcl\ble\bea\bar\br () const noexcept;\n returns the index to the last cleared bit in the _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd, i.e. 0 bit.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* h\bha\bas\bsh\bhe\ber\br *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bh_\ba_\bs_\bh_\be_\br_\b._\bh_\bp_\bp\"\n+this is a SHA-1 hash class.\n+You use it by first instantiating it, then call update() to feed it with data.\n+i.e. you don't have to keep the entire buffer of which you want to create the\n+hash in memory. You can feed the _\bh_\ba_\bs_\bh_\be_\br parts of it at a time. When You have\n+fed the _\bh_\ba_\bs_\bh_\be_\br with all the data, you call final() and it will return the sha1-\n+hash of the data.\n+The constructor that takes a char const* and an integer will construct the sha1\n+context and feed it the data passed in.\n+If you want to reuse the _\bh_\ba_\bs_\bh_\be_\br object once you have created a hash, you have\n+to call reset() to reinitialize it.\n+The built-in software version of sha1-algorithm was implemented by Steve Reid\n+and released as public domain. For more info, see src/sha1.cpp.\n+class hasher\n+{\n+ h\bha\bas\bsh\bhe\ber\br ();\n+ explicit h\bha\bas\bsh\bhe\ber\br (span data);\n+ h\bha\bas\bsh\bhe\ber\br (char const* data, int len);\n+ hasher& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (hasher const&) &;\n+ h\bha\bas\bsh\bhe\ber\br (hasher const&);\n+ hasher& u\bup\bpd\bda\bat\bte\be (char const* data, int len);\n+ hasher& u\bup\bpd\bda\bat\bte\be (span data);\n+ sha1_hash f\bfi\bin\bna\bal\bl ();\n+ void r\bre\bes\bse\bet\bt ();\n+};\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* h\bha\bas\bsh\bhe\ber\br(\b()\b) o\bop\bpe\ber\bra\bat\bto\bor\br=\b=(\b()\b) *\b**\b**\b**\b**\b*\n+explicit h\bha\bas\bsh\bhe\ber\br (span data);\n+h\bha\bas\bsh\bhe\ber\br (char const* data, int len);\n+hasher& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (hasher const&) &;\n+h\bha\bas\bsh\bhe\ber\br (hasher const&);\n+this is the same as default constructing followed by a call to update(data,\n+len).\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* u\bup\bpd\bda\bat\bte\be(\b()\b) *\b**\b**\b**\b**\b*\n+hasher& u\bup\bpd\bda\bat\bte\be (char const* data, int len);\n+hasher& u\bup\bpd\bda\bat\bte\be (span data);\n+append the following bytes to what is being hashed\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* f\bfi\bin\bna\bal\bl(\b()\b) *\b**\b**\b**\b**\b*\n+sha1_hash f\bfi\bin\bna\bal\bl ();\n+returns the SHA-1 digest of the buffers previously passed to _\bu_\bp_\bd_\ba_\bt_\be_\b(_\b) and the\n+_\bh_\ba_\bs_\bh_\be_\br constructor.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* r\bre\bes\bse\bet\bt(\b()\b) *\b**\b**\b**\b**\b*\n+void r\bre\bes\bse\bet\bt ();\n+restore the _\bh_\ba_\bs_\bh_\be_\br state to be as if the _\bh_\ba_\bs_\bh_\be_\br has just been default\n+constructed.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* h\bha\bas\bsh\bhe\ber\br2\b25\b56\b6 *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bh_\ba_\bs_\bh_\be_\br_\b._\bh_\bp_\bp\"\n+class hasher256\n+{\n+ h\bha\bas\bsh\bhe\ber\br2\b25\b56\b6 ();\n+ explicit h\bha\bas\bsh\bhe\ber\br2\b25\b56\b6 (span data);\n+ h\bha\bas\bsh\bhe\ber\br2\b25\b56\b6 (hasher256 const&);\n+ h\bha\bas\bsh\bhe\ber\br2\b25\b56\b6 (char const* data, int len);\n+ hasher256& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (hasher256 const&) &;\n+ hasher256& u\bup\bpd\bda\bat\bte\be (span data);\n+ hasher256& u\bup\bpd\bda\bat\bte\be (char const* data, int len);\n+ sha256_hash f\bfi\bin\bna\bal\bl ();\n+ void r\bre\bes\bse\bet\bt ();\n+ ~\b~h\bha\bas\bsh\bhe\ber\br2\b25\b56\b6 ();\n+};\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* h\bha\bas\bsh\bhe\ber\br2\b25\b56\b6(\b()\b) o\bop\bpe\ber\bra\bat\bto\bor\br=\b=(\b()\b) *\b**\b**\b**\b**\b*\n+explicit h\bha\bas\bsh\bhe\ber\br2\b25\b56\b6 (span data);\n+h\bha\bas\bsh\bhe\ber\br2\b25\b56\b6 (hasher256 const&);\n+h\bha\bas\bsh\bhe\ber\br2\b25\b56\b6 (char const* data, int len);\n+hasher256& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (hasher256 const&) &;\n+this is the same as default constructing followed by a call to update(data,\n+len).\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* u\bup\bpd\bda\bat\bte\be(\b()\b) *\b**\b**\b**\b**\b*\n+hasher256& u\bup\bpd\bda\bat\bte\be (span data);\n+hasher256& u\bup\bpd\bda\bat\bte\be (char const* data, int len);\n+append the following bytes to what is being hashed\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* f\bfi\bin\bna\bal\bl(\b()\b) *\b**\b**\b**\b**\b*\n+sha256_hash f\bfi\bin\bna\bal\bl ();\n+returns the SHA-1 digest of the buffers previously passed to _\bu_\bp_\bd_\ba_\bt_\be_\b(_\b) and the\n+_\bh_\ba_\bs_\bh_\be_\br constructor.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* r\bre\bes\bse\bet\bt(\b()\b) *\b**\b**\b**\b**\b*\n+void r\bre\bes\bse\bet\bt ();\n+restore the _\bh_\ba_\bs_\bh_\be_\br state to be as if the _\bh_\ba_\bs_\bh_\be_\br has just been default\n+constructed.\n _\bh_\bo_\bm_\be\n _\bb_\bl_\bo_\bg\n _\bu_\bT_\bP\n _\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd\n _\bd_\bo_\bc_\bu_\bm_\be_\bn_\bt_\ba_\bt_\bi_\bo_\bn\n _\bD_\bH_\bT_\b _\bp_\bu_\bt_\b _\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn\n _\bp_\by_\bt_\bh_\bo_\bn_\b _\bb_\bi_\bn_\bd_\bi_\bn_\bg_\bs\n"}]}, {"source1": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference.html", "source2": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference.html", "unified_diff": "@@ -19,123 +19,118 @@\n \"libtorrent\n \n
    \n

    reference documentation

    \n \n

    single-page version

    \n
    \n-

    Stats

    \n+

    Session

    \n \n

    Core

    \n \n+

    Torrent Status

    \n+\n+

    Stats

    \n+\n

    Trackers

    \n \n-

    Torrent Status

    \n+

    Add Torrent

    \n \n-

    Session

    \n+

    Torrent Info

    \n \n

    Settings

    \n \n-

    Add Torrent

    \n-\n

    Torrent Handle

    \n \n-

    Torrent Info

    \n-\n

    DHT

    \n \n

    Resume Data

    \n \n
    \n \n \n+

    Utility

    \n+\n+

    PeerClass

    \n+\n

    ed25519

    \n \n
    \n \n \n
    \n
    \n
    \n
    \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,174 +1,175 @@\n >\n _\b[_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b _\bl_\bo_\bg_\bo_\b]\n *\b**\b**\b**\b**\b**\b* r\bre\bef\bfe\ber\bre\ben\bnc\bce\be d\bdo\boc\bcu\bum\bme\ben\bnt\bta\bat\bti\bio\bon\bn *\b**\b**\b**\b**\b**\b*\n _\bs_\bi_\bn_\bg_\bl_\be_\b-_\bp_\ba_\bg_\be_\b _\bv_\be_\br_\bs_\bi_\bo_\bn\n-Stats\n-_\bc_\bo_\bu_\bn_\bt_\be_\br_\bs\n-_\bs_\bt_\ba_\bt_\bs_\b__\bm_\be_\bt_\br_\bi_\bc\n-_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bs_\bt_\ba_\bt_\bs_\b__\bm_\be_\bt_\br_\bi_\bc_\bs_\b(_\b)\n-_\bf_\bi_\bn_\bd_\b__\bm_\be_\bt_\br_\bi_\bc_\b__\bi_\bd_\bx_\b(_\b)\n-_\bm_\be_\bt_\br_\bi_\bc_\b__\bt_\by_\bp_\be_\b__\bt\n+Session\n+_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs\n+_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bh_\ba_\bn_\bd_\bl_\be\n+_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\br_\bo_\bx_\by\n+_\bs_\be_\bs_\bs_\bi_\bo_\bn\n+_\bw_\br_\bi_\bt_\be_\b__\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs_\b(_\b)\n+_\br_\be_\ba_\bd_\b__\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs_\b(_\b)\n+_\bw_\br_\bi_\bt_\be_\b__\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs_\b__\bb_\bu_\bf_\b(_\b)\n Core\n-_\bp_\be_\be_\br_\b__\br_\be_\bq_\bu_\be_\bs_\bt\n-_\bp_\bi_\be_\bc_\be_\b__\bb_\bl_\bo_\bc_\bk\n _\bi_\bn_\bf_\bo_\b__\bh_\ba_\bs_\bh_\b__\bt\n+_\bp_\bi_\be_\bc_\be_\b__\bb_\bl_\bo_\bc_\bk\n+_\bp_\be_\be_\br_\b__\br_\be_\bq_\bu_\be_\bs_\bt\n _\bp_\be_\be_\br_\b__\bi_\bn_\bf_\bo\n+_\bv_\be_\br_\bs_\bi_\bo_\bn_\b(_\b)\n _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\be_\be_\br_\b__\be_\bq_\bu_\ba_\bl_\b(_\b)\n+_\bt_\br_\bu_\bn_\bc_\ba_\bt_\be_\b__\bf_\bi_\bl_\be_\bs_\b(_\b)\n _\bm_\ba_\bk_\be_\b__\bm_\ba_\bg_\bn_\be_\bt_\b__\bu_\br_\bi_\b(_\b)\n _\bp_\ba_\br_\bs_\be_\b__\bm_\ba_\bg_\bn_\be_\bt_\b__\bu_\br_\bi_\b(_\b)\n-_\bt_\br_\bu_\bn_\bc_\ba_\bt_\be_\b__\bf_\bi_\bl_\be_\bs_\b(_\b)\n-_\bv_\be_\br_\bs_\bi_\bo_\bn_\b(_\b)\n-_\bl_\bo_\ba_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bi_\bl_\be_\b(_\b)\n-_\bl_\bo_\ba_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bb_\bu_\bf_\bf_\be_\br_\b(_\b)\n _\bl_\bo_\ba_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\bs_\be_\bd_\b(_\b)\n+_\bl_\bo_\ba_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bb_\bu_\bf_\bf_\be_\br_\b(_\b)\n+_\bl_\bo_\ba_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bi_\bl_\be_\b(_\b)\n+_\bs_\bo_\bc_\bk_\be_\bt_\b__\bt_\by_\bp_\be_\b__\bt\n+_\bp_\br_\bo_\bt_\bo_\bc_\bo_\bl_\b__\bv_\be_\br_\bs_\bi_\bo_\bn\n _\be_\bv_\be_\bn_\bt_\b__\bt\n+_\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b__\bt_\by_\bp_\be\n _\bp_\bo_\br_\bt_\bm_\ba_\bp_\b__\bt_\br_\ba_\bn_\bs_\bp_\bo_\br_\bt\n _\bp_\bo_\br_\bt_\bm_\ba_\bp_\b__\bp_\br_\bo_\bt_\bo_\bc_\bo_\bl\n-_\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b__\bt_\by_\bp_\be\n-_\bp_\br_\bo_\bt_\bo_\bc_\bo_\bl_\b__\bv_\be_\br_\bs_\bi_\bo_\bn\n-_\bs_\bo_\bc_\bk_\be_\bt_\b__\bt_\by_\bp_\be_\b__\bt\n-_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bl_\ba_\bg_\bs_\b__\bt\n-_\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\b__\bp_\br_\bi_\bo_\br_\bi_\bt_\by_\b__\bt\n _\bp_\be_\bx_\b__\bf_\bl_\ba_\bg_\bs_\b__\bt\n+_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bl_\ba_\bg_\bs_\b__\bt\n _\bi_\bn_\bt\n _\bc_\bh_\ba_\br_\b _\bc_\bo_\bn_\bs_\bt_\b*\n _\bs_\bt_\bd_\b:_\b:_\bu_\bi_\bn_\bt_\b6_\b4_\b__\bt\n+_\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\b__\bp_\br_\bi_\bo_\br_\bi_\bt_\by_\b__\bt\n+Torrent Status\n+_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bs_\bt_\ba_\bt_\bu_\bs\n+Stats\n+_\bs_\bt_\ba_\bt_\bs_\b__\bm_\be_\bt_\br_\bi_\bc\n+_\bc_\bo_\bu_\bn_\bt_\be_\br_\bs\n+_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bs_\bt_\ba_\bt_\bs_\b__\bm_\be_\bt_\br_\bi_\bc_\bs_\b(_\b)\n+_\bf_\bi_\bn_\bd_\b__\bm_\be_\bt_\br_\bi_\bc_\b__\bi_\bd_\bx_\b(_\b)\n+_\bm_\be_\bt_\br_\bi_\bc_\b__\bt_\by_\bp_\be_\b__\bt\n Trackers\n _\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\bi_\bn_\bf_\bo_\bh_\ba_\bs_\bh\n _\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\be_\bn_\bd_\bp_\bo_\bi_\bn_\bt\n _\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\be_\bn_\bt_\br_\by\n-Torrent Status\n-_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bs_\bt_\ba_\bt_\bu_\bs\n-Session\n-_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bh_\ba_\bn_\bd_\bl_\be\n-_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\br_\bo_\bx_\by\n-_\bs_\be_\bs_\bs_\bi_\bo_\bn\n-_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs\n-_\bw_\br_\bi_\bt_\be_\b__\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs_\b(_\b)\n-_\bw_\br_\bi_\bt_\be_\b__\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs_\b__\bb_\bu_\bf_\b(_\b)\n-_\br_\be_\ba_\bd_\b__\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs_\b(_\b)\n+Add Torrent\n+_\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs\n+_\bc_\bl_\bi_\be_\bn_\bt_\b__\bd_\ba_\bt_\ba_\b__\bt\n+Torrent Info\n+_\bw_\be_\bb_\b__\bs_\be_\be_\bd_\b__\be_\bn_\bt_\br_\by\n+_\bl_\bo_\ba_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bl_\bi_\bm_\bi_\bt_\bs\n+_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo\n Settings\n _\bo_\bv_\be_\br_\bv_\bi_\be_\bw\n _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk\n-_\bm_\bi_\bn_\b__\bm_\be_\bm_\bo_\br_\by_\b__\bu_\bs_\ba_\bg_\be_\b(_\b)\n+_\bg_\be_\bn_\be_\br_\ba_\bt_\be_\b__\bf_\bi_\bn_\bg_\be_\br_\bp_\br_\bi_\bn_\bt_\b(_\b)\n _\bh_\bi_\bg_\bh_\b__\bp_\be_\br_\bf_\bo_\br_\bm_\ba_\bn_\bc_\be_\b__\bs_\be_\be_\bd_\b(_\b)\n+_\bm_\bi_\bn_\b__\bm_\be_\bm_\bo_\br_\by_\b__\bu_\bs_\ba_\bg_\be_\b(_\b)\n _\bn_\ba_\bm_\be_\b__\bf_\bo_\br_\b__\bs_\be_\bt_\bt_\bi_\bn_\bg_\b(_\b)\n _\bs_\be_\bt_\bt_\bi_\bn_\bg_\b__\bb_\by_\b__\bn_\ba_\bm_\be_\b(_\b)\n _\bd_\be_\bf_\ba_\bu_\bl_\bt_\b__\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b(_\b)\n-_\bg_\be_\bn_\be_\br_\ba_\bt_\be_\b__\bf_\bi_\bn_\bg_\be_\br_\bp_\br_\bi_\bn_\bt_\b(_\b)\n-Add Torrent\n-_\bc_\bl_\bi_\be_\bn_\bt_\b__\bd_\ba_\bt_\ba_\b__\bt\n-_\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs\n Torrent Handle\n _\bb_\bl_\bo_\bc_\bk_\b__\bi_\bn_\bf_\bo\n _\bp_\ba_\br_\bt_\bi_\ba_\bl_\b__\bp_\bi_\be_\bc_\be_\b__\bi_\bn_\bf_\bo\n _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be\n _\bh_\ba_\bs_\bh_\b__\bv_\ba_\bl_\bu_\be_\b(_\b)\n-Torrent Info\n-_\bw_\be_\bb_\b__\bs_\be_\be_\bd_\b__\be_\bn_\bt_\br_\by\n-_\bl_\bo_\ba_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bl_\bi_\bm_\bi_\bt_\bs\n-_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo\n DHT\n _\bd_\bh_\bt_\b__\bs_\bt_\ba_\bt_\be\n _\bd_\bh_\bt_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bc_\bo_\bu_\bn_\bt_\be_\br_\bs\n _\bd_\bh_\bt_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be\n-_\bd_\bh_\bt_\b__\bd_\be_\bf_\ba_\bu_\bl_\bt_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bc_\bo_\bn_\bs_\bt_\br_\bu_\bc_\bt_\bo_\br_\b(_\b)\n _\bs_\bi_\bg_\bn_\b__\bm_\bu_\bt_\ba_\bb_\bl_\be_\b__\bi_\bt_\be_\bm_\b(_\b)\n+_\bd_\bh_\bt_\b__\bd_\be_\bf_\ba_\bu_\bl_\bt_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bc_\bo_\bn_\bs_\bt_\br_\bu_\bc_\bt_\bo_\br_\b(_\b)\n _\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\bf_\bl_\ba_\bg_\bs_\b__\bt\n Resume Data\n+_\br_\be_\ba_\bd_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b)\n _\bw_\br_\bi_\bt_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b)\n _\bw_\br_\bi_\bt_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b__\bb_\bu_\bf_\b(_\b)\n _\bw_\br_\bi_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bi_\bl_\be_\b__\bb_\bu_\bf_\b(_\b)\n _\bw_\br_\bi_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bi_\bl_\be_\b(_\b)\n-_\br_\be_\ba_\bd_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b)\n _\bw_\br_\bi_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bl_\ba_\bg_\bs_\b__\bt\n-Filter\n-_\bi_\bp_\b__\bf_\bi_\bl_\bt_\be_\br\n-_\bp_\bo_\br_\bt_\b__\bf_\bi_\bl_\bt_\be_\br\n Bdecoding\n _\bb_\bd_\be_\bc_\bo_\bd_\be_\b__\bn_\bo_\bd_\be\n _\bp_\br_\bi_\bn_\bt_\b__\be_\bn_\bt_\br_\by_\b(_\b)\n _\bb_\bd_\be_\bc_\bo_\bd_\be_\b(_\b)\n Create Torrents\n _\bo_\bv_\be_\br_\bv_\bi_\be_\bw\n _\bc_\br_\be_\ba_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt\n _\ba_\bd_\bd_\b__\bf_\bi_\bl_\be_\bs_\b(_\b)\n _\bs_\be_\bt_\b__\bp_\bi_\be_\bc_\be_\b__\bh_\ba_\bs_\bh_\be_\bs_\b(_\b)\n Bencoding\n _\bo_\bv_\be_\br_\bv_\bi_\be_\bw\n _\be_\bn_\bt_\br_\by\n _\bb_\be_\bn_\bc_\bo_\bd_\be_\b(_\b)\n _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b<_\b<_\b(_\b)\n+Filter\n+_\bi_\bp_\b__\bf_\bi_\bl_\bt_\be_\br\n+_\bp_\bo_\br_\bt_\b__\bf_\bi_\bl_\bt_\be_\br\n Error Codes\n _\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\be_\br_\br_\bo_\br\n _\bp_\bc_\bp_\b__\bc_\ba_\bt_\be_\bg_\bo_\br_\by_\b(_\b)\n-_\bg_\bz_\bi_\bp_\b__\bc_\ba_\bt_\be_\bg_\bo_\br_\by_\b(_\b)\n _\bb_\bd_\be_\bc_\bo_\bd_\be_\b__\bc_\ba_\bt_\be_\bg_\bo_\br_\by_\b(_\b)\n+_\bg_\bz_\bi_\bp_\b__\bc_\ba_\bt_\be_\bg_\bo_\br_\by_\b(_\b)\n+_\bs_\bo_\bc_\bk_\bs_\b__\bc_\ba_\bt_\be_\bg_\bo_\br_\by_\b(_\b)\n _\bu_\bp_\bn_\bp_\b__\bc_\ba_\bt_\be_\bg_\bo_\br_\by_\b(_\b)\n _\bi_\b2_\bp_\b__\bc_\ba_\bt_\be_\bg_\bo_\br_\by_\b(_\b)\n-_\bs_\bo_\bc_\bk_\bs_\b__\bc_\ba_\bt_\be_\bg_\bo_\br_\by_\b(_\b)\n _\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bc_\ba_\bt_\be_\bg_\bo_\br_\by_\b(_\b)\n _\bh_\bt_\bt_\bp_\b__\bc_\ba_\bt_\be_\bg_\bo_\br_\by_\b(_\b)\n _\bp_\bc_\bp_\b__\be_\br_\br_\bo_\br_\bs\n _\be_\br_\br_\bo_\br_\b__\bc_\bo_\bd_\be_\b__\be_\bn_\bu_\bm\n _\be_\br_\br_\bo_\br_\b__\bc_\bo_\bd_\be_\b__\be_\bn_\bu_\bm\n+_\bs_\bo_\bc_\bk_\bs_\b__\be_\br_\br_\bo_\br_\b__\bc_\bo_\bd_\be\n _\be_\br_\br_\bo_\br_\b__\bc_\bo_\bd_\be_\b__\be_\bn_\bu_\bm\n _\bi_\b2_\bp_\b__\be_\br_\br_\bo_\br_\b__\bc_\bo_\bd_\be\n-_\bs_\bo_\bc_\bk_\bs_\b__\be_\br_\br_\bo_\br_\b__\bc_\bo_\bd_\be\n _\be_\br_\br_\bo_\br_\b__\bc_\bo_\bd_\be_\b__\be_\bn_\bu_\bm\n _\bh_\bt_\bt_\bp_\b__\be_\br_\br_\bo_\br_\bs\n Storage\n _\bf_\bi_\bl_\be_\b__\bs_\bl_\bi_\bc_\be\n _\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be\n _\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bp_\ba_\br_\ba_\bm_\bs\n-_\bm_\bm_\ba_\bp_\b__\bd_\bi_\bs_\bk_\b__\bi_\bo_\b__\bc_\bo_\bn_\bs_\bt_\br_\bu_\bc_\bt_\bo_\br_\b(_\b)\n-_\bd_\bi_\bs_\ba_\bb_\bl_\be_\bd_\b__\bd_\bi_\bs_\bk_\b__\bi_\bo_\b__\bc_\bo_\bn_\bs_\bt_\br_\bu_\bc_\bt_\bo_\br_\b(_\b)\n _\bd_\be_\bf_\ba_\bu_\bl_\bt_\b__\bd_\bi_\bs_\bk_\b__\bi_\bo_\b__\bc_\bo_\bn_\bs_\bt_\br_\bu_\bc_\bt_\bo_\br_\b(_\b)\n+_\bd_\bi_\bs_\ba_\bb_\bl_\be_\bd_\b__\bd_\bi_\bs_\bk_\b__\bi_\bo_\b__\bc_\bo_\bn_\bs_\bt_\br_\bu_\bc_\bt_\bo_\br_\b(_\b)\n _\bp_\bo_\bs_\bi_\bx_\b__\bd_\bi_\bs_\bk_\b__\bi_\bo_\b__\bc_\bo_\bn_\bs_\bt_\br_\bu_\bc_\bt_\bo_\br_\b(_\b)\n+_\bm_\bm_\ba_\bp_\b__\bd_\bi_\bs_\bk_\b__\bi_\bo_\b__\bc_\bo_\bn_\bs_\bt_\br_\bu_\bc_\bt_\bo_\br_\b(_\b)\n _\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bm_\bo_\bd_\be_\b__\bt\n _\bs_\bt_\ba_\bt_\bu_\bs_\b__\bt\n _\bm_\bo_\bv_\be_\b__\bf_\bl_\ba_\bg_\bs_\b__\bt\n-PeerClass\n-_\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b__\bi_\bn_\bf_\bo\n-_\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b__\bt_\by_\bp_\be_\b__\bf_\bi_\bl_\bt_\be_\br\n-Utility\n-_\bh_\ba_\bs_\bh_\be_\br\n-_\bh_\ba_\bs_\bh_\be_\br_\b2_\b5_\b6\n-_\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd\n Custom Storage\n _\bo_\bv_\be_\br_\bv_\bi_\be_\bw\n-_\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be\n _\bd_\bi_\bs_\bk_\b__\bo_\bb_\bs_\be_\br_\bv_\be_\br\n+_\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be\n _\bo_\bp_\be_\bn_\b__\bf_\bi_\bl_\be_\b__\bs_\bt_\ba_\bt_\be\n _\bd_\bi_\bs_\bk_\b__\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be\n _\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bh_\bo_\bl_\bd_\be_\br\n _\bb_\bu_\bf_\bf_\be_\br_\b__\ba_\bl_\bl_\bo_\bc_\ba_\bt_\bo_\br_\b__\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be\n _\bd_\bi_\bs_\bk_\b__\bb_\bu_\bf_\bf_\be_\br_\b__\bh_\bo_\bl_\bd_\be_\br\n _\bf_\bi_\bl_\be_\b__\bo_\bp_\be_\bn_\b__\bm_\bo_\bd_\be_\b__\bt\n Plugins\n _\bo_\bv_\be_\br_\bv_\bi_\be_\bw\n _\bp_\bl_\bu_\bg_\bi_\bn\n _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\bl_\bu_\bg_\bi_\bn\n _\bp_\be_\be_\br_\b__\bp_\bl_\bu_\bg_\bi_\bn\n _\bc_\br_\by_\bp_\bt_\bo_\b__\bp_\bl_\bu_\bg_\bi_\bn\n _\bp_\be_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b__\bh_\ba_\bn_\bd_\bl_\be\n _\bb_\bt_\b__\bp_\be_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b__\bh_\ba_\bn_\bd_\bl_\be\n-_\bc_\br_\be_\ba_\bt_\be_\b__\bu_\bt_\b__\bp_\be_\bx_\b__\bp_\bl_\bu_\bg_\bi_\bn_\b(_\b)\n _\bc_\br_\be_\ba_\bt_\be_\b__\bu_\bt_\b__\bm_\be_\bt_\ba_\bd_\ba_\bt_\ba_\b__\bp_\bl_\bu_\bg_\bi_\bn_\b(_\b)\n+_\bc_\br_\be_\ba_\bt_\be_\b__\bu_\bt_\b__\bp_\be_\bx_\b__\bp_\bl_\bu_\bg_\bi_\bn_\b(_\b)\n _\bc_\br_\be_\ba_\bt_\be_\b__\bs_\bm_\ba_\br_\bt_\b__\bb_\ba_\bn_\b__\bp_\bl_\bu_\bg_\bi_\bn_\b(_\b)\n+Utility\n+_\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd\n+_\bh_\ba_\bs_\bh_\be_\br\n+_\bh_\ba_\bs_\bh_\be_\br_\b2_\b5_\b6\n+PeerClass\n+_\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b__\bt_\by_\bp_\be_\b__\bf_\bi_\bl_\bt_\be_\br\n+_\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b__\bi_\bn_\bf_\bo\n ed25519\n _\be_\bd_\b2_\b5_\b5_\b1_\b9_\b__\bc_\br_\be_\ba_\bt_\be_\b__\bs_\be_\be_\bd_\b(_\b)\n _\be_\bd_\b2_\b5_\b5_\b1_\b9_\b__\bc_\br_\be_\ba_\bt_\be_\b__\bk_\be_\by_\bp_\ba_\bi_\br_\b(_\b)\n _\be_\bd_\b2_\b5_\b5_\b1_\b9_\b__\bs_\bi_\bg_\bn_\b(_\b)\n _\be_\bd_\b2_\b5_\b5_\b1_\b9_\b__\bv_\be_\br_\bi_\bf_\by_\b(_\b)\n _\be_\bd_\b2_\b5_\b5_\b1_\b9_\b__\ba_\bd_\bd_\b__\bs_\bc_\ba_\bl_\ba_\br_\b(_\b)\n _\be_\bd_\b2_\b5_\b5_\b1_\b9_\b__\bk_\be_\by_\b__\be_\bx_\bc_\bh_\ba_\bn_\bg_\be_\b(_\b)\n Alerts\n _\bo_\bv_\be_\br_\bv_\bi_\be_\bw\n+_\ba_\bl_\be_\br_\bt\n _\bd_\bh_\bt_\b__\br_\bo_\bu_\bt_\bi_\bn_\bg_\b__\bb_\bu_\bc_\bk_\be_\bt\n _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\ba_\bl_\be_\br_\bt\n _\bp_\be_\be_\br_\b__\ba_\bl_\be_\br_\bt\n _\bt_\br_\ba_\bc_\bk_\be_\br_\b__\ba_\bl_\be_\br_\bt\n _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\br_\be_\bm_\bo_\bv_\be_\bd_\b__\ba_\bl_\be_\br_\bt\n _\br_\be_\ba_\bd_\b__\bp_\bi_\be_\bc_\be_\b__\ba_\bl_\be_\br_\bt\n _\bf_\bi_\bl_\be_\b__\bc_\bo_\bm_\bp_\bl_\be_\bt_\be_\bd_\b__\ba_\bl_\be_\br_\bt\n@@ -261,20 +262,19 @@\n _\bo_\bv_\be_\br_\bs_\bi_\bz_\be_\bd_\b__\bf_\bi_\bl_\be_\b__\ba_\bl_\be_\br_\bt\n _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bc_\bo_\bn_\bf_\bl_\bi_\bc_\bt_\b__\ba_\bl_\be_\br_\bt\n _\bp_\be_\be_\br_\b__\bi_\bn_\bf_\bo_\b__\ba_\bl_\be_\br_\bt\n _\bf_\bi_\bl_\be_\b__\bp_\br_\bo_\bg_\br_\be_\bs_\bs_\b__\ba_\bl_\be_\br_\bt\n _\bp_\bi_\be_\bc_\be_\b__\bi_\bn_\bf_\bo_\b__\ba_\bl_\be_\br_\bt\n _\bp_\bi_\be_\bc_\be_\b__\ba_\bv_\ba_\bi_\bl_\ba_\bb_\bi_\bl_\bi_\bt_\by_\b__\ba_\bl_\be_\br_\bt\n _\bt_\br_\ba_\bc_\bk_\be_\br_\b__\bl_\bi_\bs_\bt_\b__\ba_\bl_\be_\br_\bt\n-_\ba_\bl_\be_\br_\bt\n-_\ba_\bl_\be_\br_\bt_\b__\bc_\ba_\bs_\bt_\b(_\b)\n _\bo_\bp_\be_\br_\ba_\bt_\bi_\bo_\bn_\b__\bn_\ba_\bm_\be_\b(_\b)\n+_\ba_\bl_\be_\br_\bt_\b__\bc_\ba_\bs_\bt_\b(_\b)\n _\bo_\bp_\be_\br_\ba_\bt_\bi_\bo_\bn_\b__\bt\n-_\bi_\bn_\bt\n _\ba_\bl_\be_\br_\bt_\b__\bc_\ba_\bt_\be_\bg_\bo_\br_\by_\b__\bt\n+_\bi_\bn_\bt\n _\bh_\bo_\bm_\be\n _\bb_\bl_\bo_\bg\n _\bu_\bT_\bP\n _\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd\n _\bd_\bo_\bc_\bu_\bm_\be_\bn_\bt_\ba_\bt_\bi_\bo_\bn\n _\bD_\bH_\bT_\b _\bp_\bu_\bt_\b _\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn\n _\bp_\by_\bt_\bh_\bo_\bn_\b _\bb_\bi_\bn_\bd_\bi_\bn_\bg_\bs\n"}]}, {"source1": "./usr/share/doc/libtorrent-rasterbar-doc/html/single-page-ref.html", "source2": "./usr/share/doc/libtorrent-rasterbar-doc/html/single-page-ref.html", "unified_diff": "@@ -28,726 +28,726 @@\n 2.0.11\n \n \n

    home

    \n
    \n

    Table of contents

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

    counters

    \n-

    Declared in "libtorrent/performance_counters.hpp"

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

    operator[]() inc_stats_counter()

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

    returns the new value

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

    stats_metric

    \n-

    Declared in "libtorrent/session_stats.hpp"

    \n-

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

    \n-
    \n-struct stats_metric\n-{\n-   char const* name;\n-   int value_index;\n-   metric_type_t type;\n-};\n-
    \n-[report issue]
    \n-
    name
    \n-
    the name of the counter or gauge
    \n-
    \n-\n-[report issue]
    \n-
    value_index type
    \n-
    the index into the session stats array, where the underlying value of\n-this counter or gauge is found. The session stats array is part of the\n-session_stats_alert object.
    \n-
    \n-[report issue]
    \n-
    \n-

    session_stats_metrics()

    \n-

    Declared in "libtorrent/session_stats.hpp"

    \n-
    \n-std::vector<stats_metric> session_stats_metrics ();\n-
    \n-

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

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

    find_metric_idx()

    \n-

    Declared in "libtorrent/session_stats.hpp"

    \n-
    \n-int find_metric_idx (string_view name);\n-
    \n-

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

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

    enum metric_type_t

    \n-

    Declared in "libtorrent/session_stats.hpp"

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

    peer_request

    \n-

    Declared in "libtorrent/peer_request.hpp"

    \n-

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

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

    operator==()

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

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

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

    piece_block

    \n-

    Declared in "libtorrent/piece_block.hpp"

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

    info_hash_t

    \n-

    Declared in "libtorrent/info_hash.hpp"

    \n-

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

    \n-
    \n-

    Note

    \n-

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

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

    info_hash_t()

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

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

    \n-

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

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

    has_v2() has_v1() has()

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

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

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

    get()

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

    returns the has for the specified protocol version

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

    get_best()

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

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

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

    for_each()

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

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

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

    peer_info

    \n-

    Declared in "libtorrent/peer_info.hpp"

    \n-

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

    \n-
    \n-struct peer_info\n-{\n-   sha256_hash i2p_destination () const;\n-\n-   std::string client;\n-   typed_bitfield<piece_index_t> pieces;\n-   std::int64_t total_download;\n-   std::int64_t total_upload;\n-   time_duration last_request;\n-   time_duration last_active;\n-   time_duration download_queue_time;\n-   static constexpr peer_flags_t interesting  = 0_bit;\n-   static constexpr peer_flags_t choked  = 1_bit;\n-   static constexpr peer_flags_t remote_interested  = 2_bit;\n-   static constexpr peer_flags_t remote_choked  = 3_bit;\n-   static constexpr peer_flags_t supports_extensions  = 4_bit;\n-   static constexpr peer_flags_t outgoing_connection  = 5_bit;\n-   static constexpr peer_flags_t local_connection  = 5_bit;\n-   static constexpr peer_flags_t handshake  = 6_bit;\n-   static constexpr peer_flags_t connecting  = 7_bit;\n-   static constexpr peer_flags_t on_parole  = 9_bit;\n-   static constexpr peer_flags_t seed  = 10_bit;\n-   static constexpr peer_flags_t optimistic_unchoke  = 11_bit;\n-   static constexpr peer_flags_t snubbed  = 12_bit;\n-   static constexpr peer_flags_t upload_only  = 13_bit;\n-   static constexpr peer_flags_t endgame_mode  = 14_bit;\n-   static constexpr peer_flags_t holepunched  = 15_bit;\n-   static constexpr peer_flags_t i2p_socket  = 16_bit;\n-   static constexpr peer_flags_t utp_socket  = 17_bit;\n-   static constexpr peer_flags_t ssl_socket  = 18_bit;\n-   static constexpr peer_flags_t rc4_encrypted  = 19_bit;\n-   static constexpr peer_flags_t plaintext_encrypted  = 20_bit;\n-   peer_flags_t flags;\n-   static constexpr peer_source_flags_t tracker  = 0_bit;\n-   static constexpr peer_source_flags_t dht  = 1_bit;\n-   static constexpr peer_source_flags_t pex  = 2_bit;\n-   static constexpr peer_source_flags_t lsd  = 3_bit;\n-   static constexpr peer_source_flags_t resume_data  = 4_bit;\n-   static constexpr peer_source_flags_t incoming  = 5_bit;\n-   peer_source_flags_t source;\n-   int up_speed;\n-   int down_speed;\n-   int payload_up_speed;\n-   int payload_down_speed;\n-   peer_id pid;\n-   int queue_bytes;\n-   int request_timeout;\n-   int send_buffer_size;\n-   int used_send_buffer;\n-   int receive_buffer_size;\n-   int used_receive_buffer;\n-   int receive_buffer_watermark;\n-   int num_hashfails;\n-   int download_queue_length;\n-   int timed_out_requests;\n-   int busy_requests;\n-   int requests_in_buffer;\n-   int target_dl_queue_length;\n-   int upload_queue_length;\n-   int failcount;\n-   piece_index_t downloading_piece_index;\n-   int downloading_block_index;\n-   int downloading_progress;\n-   int downloading_total;\n-   static constexpr connection_type_t standard_bittorrent  = 0_bit;\n-   static constexpr connection_type_t web_seed  = 1_bit;\n-   static constexpr connection_type_t http_seed  = 2_bit;\n-   connection_type_t connection_type;\n-   int pending_disk_bytes;\n-   int pending_disk_read_bytes;\n-   int send_quota;\n-   int receive_quota;\n-   int rtt;\n-   int num_pieces;\n-   int download_rate_peak;\n-   int upload_rate_peak;\n-   float progress;\n-   int progress_ppm;\n-   tcp::endpoint ip;\n-   tcp::endpoint local_endpoint;\n-   static constexpr bandwidth_state_flags_t bw_idle  = 0_bit;\n-   static constexpr bandwidth_state_flags_t bw_limit  = 1_bit;\n-   static constexpr bandwidth_state_flags_t bw_network  = 2_bit;\n-   static constexpr bandwidth_state_flags_t bw_disk  = 4_bit;\n-   bandwidth_state_flags_t read_state;\n-   bandwidth_state_flags_t write_state;\n-};\n-
    \n-[report issue]
    \n-

    i2p_destination()

    \n-
    \n-sha256_hash i2p_destination () const;\n-
    \n-

    If this peer is an i2p peer, this function returns the destination\n-address of the peer

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

    torrent_peer_equal()

    \n-

    Declared in "libtorrent/torrent_peer.hpp"

    \n-
    \n-inline bool torrent_peer_equal (torrent_peer const* lhs, torrent_peer const* rhs);\n-
    \n-[report issue]
    \n-
    \n-

    make_magnet_uri()

    \n-

    Declared in "libtorrent/magnet_uri.hpp"

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

    Generates a magnet URI from the specified torrent.

    \n-

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

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

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

    \n-

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

    \n-

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

    \n-

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

    \n-

    For more information about magnet links, see magnet links.

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

    parse_magnet_uri()

    \n-

    Declared in "libtorrent/magnet_uri.hpp"

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

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

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

    truncate_files()

    \n-

    Declared in "libtorrent/truncate.hpp"

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

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

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

    version()

    \n-

    Declared in "libtorrent/version.hpp"

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

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

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

    load_torrent_file() load_torrent_parsed() load_torrent_buffer()

    \n-

    Declared in "libtorrent/load_torrent.hpp"

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

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

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

    enum event_t

    \n-

    Declared in "libtorrent/tracker_manager.hpp"

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

    enum portmap_transport

    \n-

    Declared in "libtorrent/portmap.hpp"

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

    enum portmap_protocol

    \n-

    Declared in "libtorrent/portmap.hpp"

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

    enum connection_type

    \n-

    Declared in "libtorrent/peer_connection.hpp"

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

    enum protocol_version

    \n-

    Declared in "libtorrent/info_hash.hpp"

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

    enum socket_type_t

    \n-

    Declared in "libtorrent/socket_type.hpp"

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

    torrent_flags_t

    \n-

    Declared in "libtorrent/torrent_flags.hpp"

    \n-
    \n-
    seed_mode
    \n-

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

    \n-

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

    \n-

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

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

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

    \n-

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

    \n-

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

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

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

    \n-

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

    \n-

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

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

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

    \n-

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

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

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

    \n-

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

    \n-

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

    \n-

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

    \n-

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

    \n-

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

    \n-

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

    \n-
    \n-
    \n-
    \n-
    override_trackers
    \n-
    when this flag is set, the tracker list in the add_torrent_params\n-object override any trackers from the torrent file. If the flag is\n-not set, the trackers from the add_torrent_params object will be\n-added to the list of trackers used by the torrent.\n-This flag is set by read_resume_data() if there are trackers present in\n-the resume data file. This effectively makes the trackers saved in the\n-resume data take precedence over the original trackers. This includes if\n-there's an empty list of trackers, to support the case where they were\n-explicitly removed in the previous session.\n-This flag is not saved by write_resume_data()
    \n-
    \n-
    \n-
    override_web_seeds
    \n-
    If this flag is set, the web seeds from the add_torrent_params\n-object will override any web seeds in the torrent file. If it's not\n-set, web seeds in the add_torrent_params object will be added to the\n-list of web seeds used by the torrent.\n-This flag is set by read_resume_data() if there are web seeds present in\n-the resume data file. This effectively makes the web seeds saved in the\n-resume data take precedence over the original ones. This includes if\n-there's an empty list of web seeds, to support the case where they were\n-explicitly removed in the previous session.\n-This flag is not saved by write_resume_data()
    \n-
    \n-
    \n-
    need_save_resume
    \n-

    if this flag is set (which it is by default) the torrent will be\n-considered needing to save its resume data immediately, in the\n-category if_metadata_changed. See resume_data_flags_t and\n-save_resume_data() for details.

    \n-

    This flag is cleared by a successful call to save_resume_data()\n-This flag is not saved by write_resume_data(), since it represents an\n-ephemeral state of a running torrent.

    \n-
    \n-
    \n-
    \n-
    disable_dht
    \n-
    set this flag to disable DHT for this torrent. This lets you have the DHT\n-enabled for the whole client, and still have specific torrents not\n-participating in it. i.e. not announcing to the DHT nor picking up peers\n-from it.
    \n-
    \n-
    \n-
    disable_lsd
    \n-
    set this flag to disable local service discovery for this torrent.
    \n-
    \n-
    \n-
    disable_pex
    \n-
    set this flag to disable peer exchange for this torrent.
    \n-
    \n-
    \n-
    no_verify_files
    \n-
    if this flag is set, the resume data will be assumed to be correct\n-without validating it against any files on disk. This may be used when\n-restoring a session by loading resume data from disk. It will save time\n-and also delay any hard disk errors until files are actually needed. If\n-the resume data cannot be trusted, or if a torrent is added for the first\n-time to some save path that may already have some of the files, this flag\n-should not be set.
    \n-
    \n-
    \n-
    default_dont_download
    \n-
    default all file priorities to dont_download. This is useful for adding\n-magnet links where the number of files is unknown, but the\n-file_priorities is still set for some files. Any file not covered by\n-the file_priorities list will be set to normal download priority,\n-unless this flag is set, in which case they will be set to 0\n-(dont_download).
    \n-
    \n-
    \n-
    i2p_torrent
    \n-
    this flag makes the torrent be considered an "i2p torrent" for purposes\n-of the allow_i2p_mixed setting. When mixing regular peers and i2p peers\n-is disabled, i2p torrents won't add normal peers to its peer list.\n-Note that non i2p torrents may still allow i2p peers (on the off-chance\n-that a tracker return them and the session is configured with a SAM\n-connection).\n-This flag is set automatically when adding a torrent that has at least\n-one tracker whose hostname ends with .i2p.\n-It's also set by parse_magnet_uri() if the tracker list contains such\n-URL.
    \n-
    \n-
    \n-
    all
    \n-
    all torrent flags combined. Can conveniently be used when creating masks\n-for flags
    \n-
    \n-[report issue]
    \n-
    \n-

    download_priority_t

    \n-

    Declared in "libtorrent/download_priority.hpp"

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

    pex_flags_t

    \n-

    Declared in "libtorrent/pex_flags.hpp"

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

    int

    \n-

    Declared in "libtorrent/version.hpp"

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

    char const*

    \n-

    Declared in "libtorrent/version.hpp"

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

    std::uint64_t

    \n-

    Declared in "libtorrent/version.hpp"

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

    file_slice

    \n-

    Declared in "libtorrent/file_storage.hpp"

    \n-

    represents a window of a file in a torrent.

    \n-

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

    \n-
    \n-struct file_slice\n-{\n-   file_index_t file_index;\n-   std::int64_t offset;\n-   std::int64_t size;\n-};\n-
    \n-[report issue]
    \n-
    file_index
    \n-
    the index of the file
    \n-
    \n-[report issue]
    \n-
    offset
    \n-
    the offset from the start of the file, in bytes
    \n-
    \n-[report issue]
    \n-
    size
    \n-
    the size of the window, in bytes
    \n-
    \n-[report issue]
    \n-
    \n-

    file_storage

    \n-

    Declared in "libtorrent/file_storage.hpp"

    \n-

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

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

    is_valid()

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

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

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

    reserve()

    \n-
    \n-void reserve (int num_files);\n-
    \n-

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

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

    add_file() add_file_borrow()

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

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

    \n-

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

    \n-

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

    \n-

    file_size is the size of the file in bytes.

    \n-

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

    \n-

    For possible file attributes, see file_storage::flags_t.

    \n-

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

    \n-

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

    \n-

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

    \n-

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

    \n-

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

    \n-

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

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

    rename_file()

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

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

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

    map_block()

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

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

    \n-

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

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

    may not exceed the total size of the torrent.

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

    map_file()

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

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

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

    num_files()

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

    returns the number of files in the file_storage

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

    end_file()

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

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

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

    file_range()

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

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

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

    total_size()

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

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

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

    set_num_pieces() num_pieces()

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

    set and get the number of pieces in the torrent

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

    end_piece()

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

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

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

    last_piece()

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

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

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

    piece_range()

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

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

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

    piece_length() set_piece_length()

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

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

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

    piece_size()

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

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

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

    piece_size2()

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

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

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

    blocks_in_piece2()

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

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

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

    blocks_per_piece()

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

    returns the number of blocks there are in the typical piece. There\n-may be fewer in the last piece)

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

    name() set_name()

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

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

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

    swap()

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

    swap all content of this with ti.

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

    canonicalize()

    \n-
    \n-void canonicalize ();\n-
    \n-

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

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

    file_num_blocks() file_piece_range() file_num_pieces()

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

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

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

    file_first_block_node() file_first_piece_node()

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

    index of first piece node in the merkle tree

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

    file_path_hash()

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

    returns the crc32 hash of file_path(index)

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

    all_path_hashes()

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

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

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

    file_flags()

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

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

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

    file_absolute_path()

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

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

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

    file_index_at_piece() file_index_at_offset()

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

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

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

    file_index_for_root()

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

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

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

    piece_index_at_file()

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

    returns the piece index the given file starts at

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

    sanitize_symlinks()

    \n-
    \n-void sanitize_symlinks ();\n-
    \n-

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

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

    v2()

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

    returns true if this torrent contains v2 metadata.

    \n-[report issue]
    \n-
    flag_pad_file
    \n-
    the file is a pad file. It's required to contain zeros\n-at it will not be saved to disk. Its purpose is to make\n-the following file start on a piece boundary.
    \n-
    \n-[report issue]
    \n-
    flag_hidden
    \n-
    this file has the hidden attribute set. This is primarily\n-a windows attribute
    \n-
    \n-[report issue]
    \n-
    flag_executable
    \n-
    this file has the executable attribute set.
    \n-
    \n-[report issue]
    \n-
    flag_symlink
    \n-
    this file is a symbolic link. It should have a link\n-target string associated with it.
    \n-
    \n-[report issue]
    \n-
    \n-
    \n-

    storage_params

    \n-

    Declared in "libtorrent/storage_defs.hpp"

    \n-

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

    \n-
    \n-struct storage_params\n-{\n-   storage_params (file_storage const& f, file_storage const* mf\n-      , std::string const& sp, storage_mode_t const sm\n-      , aux::vector<download_priority_t, file_index_t> const& prio\n-      , sha1_hash const& ih);\n-\n-   file_storage const& files;\n-   file_storage const* mapped_files  = nullptr;\n-   std::string const& path;\n-   storage_mode_t mode {storage_mode_sparse};\n-   aux::vector<download_priority_t, file_index_t> const& priorities;\n-   sha1_hash info_hash;\n-};\n-
    \n-[report issue]
    \n-
    \n-

    mmap_disk_io_constructor()

    \n-

    Declared in "libtorrent/mmap_disk_io.hpp"

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

    constructs a memory mapped file disk I/O object.

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

    disabled_disk_io_constructor()

    \n-

    Declared in "libtorrent/disabled_disk_io.hpp"

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

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

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

    default_disk_io_constructor()

    \n-

    Declared in "libtorrent/session.hpp"

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

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

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

    posix_disk_io_constructor()

    \n-

    Declared in "libtorrent/posix_disk_io.hpp"

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

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

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

    enum storage_mode_t

    \n-

    Declared in "libtorrent/storage_defs.hpp"

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-
    namevaluedescription
    storage_mode_allocate0All pieces will be written to their final position, all files will be\n-allocated in full when the torrent is first started. This mode minimizes\n-fragmentation but could be a costly operation.
    storage_mode_sparse1All pieces will be written to the place where they belong and sparse files\n-will be used. This is the recommended, and default mode.
    \n-[report issue]
    \n-
    \n-

    enum status_t

    \n-

    Declared in "libtorrent/storage_defs.hpp"

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

    enum move_flags_t

    \n-

    Declared in "libtorrent/storage_defs.hpp"

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-
    namevaluedescription
    always_replace_files0replace any files in the destination when copying\n-or moving the storage
    fail_if_exist1if any files that we want to copy exist in the destination\n-exist, fail the whole operation and don't perform\n-any copy or move. There is an inherent race condition\n-in this mode. The files are checked for existence before\n-the operation starts. In between the check and performing\n-the copy, the destination files may be created, in which\n-case they are replaced.
    dont_replace2if any file exist in the target, take those files instead\n-of the ones we may have in the source.
    reset_save_path3don't move any source files, just forget about them\n-and begin checking files at new save path
    reset_save_path_unchecked4don't move any source files, just change save path\n-and continue working without any checks
    \n-[report issue]
    \n-
    \n-

    peer_class_info

    \n-

    Declared in "libtorrent/peer_class.hpp"

    \n-

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

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

    peer_class_type_filter

    \n-

    Declared in "libtorrent/peer_class_type_filter.hpp"

    \n-

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

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

    add() remove()

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

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

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

    allow() disallow()

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

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

    \n-

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

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

    apply()

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

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

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

    enum socket_type_t

    \n-

    Declared in "libtorrent/peer_class_type_filter.hpp"

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

    announce_infohash

    \n-

    Declared in "libtorrent/announce_entry.hpp"

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

    announce_endpoint

    \n-

    Declared in "libtorrent/announce_entry.hpp"

    \n-

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

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

    announce_entry

    \n-

    Declared in "libtorrent/announce_entry.hpp"

    \n-

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

    \n-
    \n-struct announce_entry\n-{\n-   announce_entry& operator= (announce_entry const&) &;\n-   announce_entry ();\n-   ~announce_entry ();\n-   announce_entry (announce_entry const&);\n-   explicit announce_entry (string_view u);\n-\n-   enum tracker_source\n-   {\n-      source_torrent,\n-      source_client,\n-      source_magnet_link,\n-      source_tex,\n-   };\n-\n-   std::string url;\n-   std::string trackerid;\n-   std::vector<announce_endpoint> endpoints;\n-   std::uint8_t tier  = 0;\n-   std::uint8_t fail_limit  = 0;\n-   std::uint8_t source:4;\n-   bool verified:1;\n-};\n-
    \n-\n-\n-[report issue]
    \n-

    operator=() ~announce_entry() announce_entry()

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

    constructs a tracker announce entry with u as the URL.

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

    enum tracker_source

    \n-

    Declared in "libtorrent/announce_entry.hpp"

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-
    namevaluedescription
    source_torrent1the tracker was part of the .torrent file
    source_client2the tracker was added programmatically via the add_tracker() function
    source_magnet_link4the tracker was part of a magnet link
    source_tex8the tracker was received from the swarm via tracker exchange
    \n-[report issue]
    \n-
    url
    \n-
    tracker URL as it appeared in the torrent file
    \n-
    \n-[report issue]
    \n-
    trackerid
    \n-
    the current &trackerid= argument passed to the tracker.\n-this is optional and is normally empty (in which case no\n-trackerid is sent).
    \n-
    \n-[report issue]
    \n-
    endpoints
    \n-
    each local listen socket (endpoint) will announce to the tracker. This\n-list contains state per endpoint.
    \n-
    \n-[report issue]
    \n-
    tier
    \n-
    the tier this tracker belongs to
    \n-
    \n-[report issue]
    \n-
    fail_limit
    \n-
    the max number of failures to announce to this tracker in\n-a row, before this tracker is not used anymore. 0 means unlimited
    \n-
    \n-[report issue]
    \n-
    source
    \n-
    a bitmask specifying which sources we got this tracker from.
    \n-
    \n-[report issue]
    \n-
    verified
    \n-
    set to true the first time we receive a valid response\n-from this tracker.
    \n-
    \n-[report issue]
    \n-
    \n-
    \n-

    torrent_status

    \n-

    Declared in "libtorrent/torrent_status.hpp"

    \n-

    holds a snapshot of the status of a torrent, as queried by\n-torrent_handle::status().

    \n-
    \n-struct torrent_status\n-{\n-   bool operator== (torrent_status const& st) const;\n-\n-   enum state_t\n-   {\n-      checking_files,\n-      downloading_metadata,\n-      downloading,\n-      finished,\n-      seeding,\n-      unused_enum_for_backwards_compatibility_allocating,\n-      checking_resume_data,\n-   };\n-\n-   torrent_handle handle;\n-   error_code errc;\n-   file_index_t error_file  = torrent_status::error_file_none;\n-   static constexpr file_index_t error_file_none {-1};\n-   static constexpr file_index_t error_file_ssl_ctx {-3};\n-   static constexpr file_index_t error_file_metadata {-4};\n-   static constexpr file_index_t error_file_exception {-5};\n-   static constexpr file_index_t error_file_partfile {-6};\n-   std::string save_path;\n-   std::string name;\n-   std::weak_ptr<const torrent_info> torrent_file;\n-   time_duration next_announce  = seconds{0};\n-   std::string current_tracker;\n-   std::int64_t total_download  = 0;\n-   std::int64_t total_upload  = 0;\n-   std::int64_t total_payload_download  = 0;\n-   std::int64_t total_payload_upload  = 0;\n-   std::int64_t total_failed_bytes  = 0;\n-   std::int64_t total_redundant_bytes  = 0;\n-   typed_bitfield<piece_index_t> pieces;\n-   typed_bitfield<piece_index_t> verified_pieces;\n-   std::int64_t total_done  = 0;\n-   std::int64_t total  = 0;\n-   std::int64_t total_wanted_done  = 0;\n-   std::int64_t total_wanted  = 0;\n-   std::int64_t all_time_upload  = 0;\n-   std::int64_t all_time_download  = 0;\n-   std::time_t added_time  = 0;\n-   std::time_t completed_time  = 0;\n-   std::time_t last_seen_complete  = 0;\n-   storage_mode_t storage_mode  = storage_mode_sparse;\n-   float progress  = 0.f;\n-   int progress_ppm  = 0;\n-   queue_position_t queue_position {};\n-   int download_rate  = 0;\n-   int upload_rate  = 0;\n-   int download_payload_rate  = 0;\n-   int upload_payload_rate  = 0;\n-   int num_seeds  = 0;\n-   int num_peers  = 0;\n-   int num_complete  = -1;\n-   int num_incomplete  = -1;\n-   int list_seeds  = 0;\n-   int list_peers  = 0;\n-   int connect_candidates  = 0;\n-   int num_pieces  = 0;\n-   int distributed_full_copies  = 0;\n-   int distributed_fraction  = 0;\n-   float distributed_copies  = 0.f;\n-   int block_size  = 0;\n-   int num_uploads  = 0;\n-   int num_connections  = 0;\n-   int uploads_limit  = 0;\n-   int connections_limit  = 0;\n-   int up_bandwidth_queue  = 0;\n-   int down_bandwidth_queue  = 0;\n-   int seed_rank  = 0;\n-   state_t state  = checking_resume_data;\n-   bool need_save_resume  = false;\n-   bool is_seeding  = false;\n-   bool is_finished  = false;\n-   bool has_metadata  = false;\n-   bool has_incoming  = false;\n-   bool moving_storage  = false;\n-   bool announcing_to_trackers  = false;\n-   bool announcing_to_lsd  = false;\n-   bool announcing_to_dht  = false;\n-   info_hash_t info_hashes;\n-   time_point last_upload;\n-   time_point last_download;\n-   seconds active_duration;\n-   seconds finished_duration;\n-   seconds seeding_duration;\n-   torrent_flags_t flags {};\n-};\n-
    \n-[report issue]
    \n-

    operator==()

    \n-
    \n-bool operator== (torrent_status const& st) const;\n-
    \n-

    compares if the torrent status objects come from the same torrent. i.e.\n-only the torrent_handle field is compared.

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

    enum state_t

    \n-

    Declared in "libtorrent/torrent_status.hpp"

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-
    namevaluedescription
    checking_files1The torrent has not started its download yet, and is\n-currently checking existing files.
    downloading_metadata2The torrent is trying to download metadata from peers.\n-This implies the ut_metadata extension is in use.
    downloading3The torrent is being downloaded. This is the state\n-most torrents will be in most of the time. The progress\n-meter will tell how much of the files that has been\n-downloaded.
    finished4In this state the torrent has finished downloading but\n-still doesn't have the entire torrent. i.e. some pieces\n-are filtered and won't get downloaded.
    seeding5In this state the torrent has finished downloading and\n-is a pure seeder.
    unused_enum_for_backwards_compatibility_allocating6If the torrent was started in full allocation mode, this\n-indicates that the (disk) storage for the torrent is\n-allocated.
    checking_resume_data7The torrent is currently checking the fast resume data and\n-comparing it to the files on disk. This is typically\n-completed in a fraction of a second, but if you add a\n-large number of torrents at once, they will queue up.
    \n-[report issue]
    \n-
    handle
    \n-
    a handle to the torrent whose status the object represents.
    \n-
    \n-[report issue]
    \n-
    errc
    \n-
    may be set to an error code describing why the torrent was paused, in\n-case it was paused by an error. If the torrent is not paused or if it's\n-paused but not because of an error, this error_code is not set.\n-if the error is attributed specifically to a file, error_file is set to\n-the index of that file in the .torrent file.
    \n-
    \n-[report issue]
    \n-
    error_file
    \n-
    if the torrent is stopped because of an disk I/O error, this field\n-contains the index of the file in the torrent that encountered the\n-error. If the error did not originate in a file in the torrent, there\n-are a few special values this can be set to: error_file_none,\n-error_file_ssl_ctx, error_file_exception, error_file_partfile or\n-error_file_metadata;
    \n-
    \n-[report issue]
    \n-
    error_file_none
    \n-
    special values for error_file to describe which file or component\n-encountered the error (errc).\n-the error did not occur on a file
    \n-
    \n-[report issue]
    \n-
    error_file_ssl_ctx
    \n-
    the error occurred setting up the SSL context
    \n-
    \n-[report issue]
    \n-
    error_file_metadata
    \n-
    the error occurred while loading the metadata for the torrent
    \n-
    \n-[report issue]
    \n-
    error_file_exception
    \n-
    there was a serious error reported in this torrent. The error code\n-or a torrent log alert may provide more information.
    \n-
    \n-[report issue]
    \n-
    error_file_partfile
    \n-
    the error occurred with the partfile
    \n-
    \n-[report issue]
    \n-
    save_path
    \n-
    the path to the directory where this torrent's files are stored.\n-It's typically the path as was given to async_add_torrent() or\n-add_torrent() when this torrent was started. This field is only\n-included if the torrent status is queried with\n-torrent_handle::query_save_path.
    \n-
    \n-[report issue]
    \n-
    name
    \n-
    the name of the torrent. Typically this is derived from the\n-.torrent file. In case the torrent was started without metadata,\n-and hasn't completely received it yet, it returns the name given\n-to it when added to the session. See session::add_torrent.\n-This field is only included if the torrent status is queried\n-with torrent_handle::query_name.
    \n-
    \n-[report issue]
    \n-
    torrent_file
    \n-
    set to point to the torrent_info object for this torrent. It's\n-only included if the torrent status is queried with\n-torrent_handle::query_torrent_file.
    \n-
    \n-[report issue]
    \n-
    next_announce
    \n-
    the time until the torrent will announce itself to the tracker.
    \n-
    \n-[report issue]
    \n-
    current_tracker
    \n-
    the URL of the last working tracker. If no tracker request has\n-been successful yet, it's set to an empty string.
    \n-
    \n-\n-[report issue]
    \n-
    total_download total_upload
    \n-
    the number of bytes downloaded and uploaded to all peers, accumulated,\n-this session only. The session is considered to restart when a\n-torrent is paused and restarted again. When a torrent is paused, these\n-counters are reset to 0. If you want complete, persistent, stats, see\n-all_time_upload and all_time_download.
    \n-
    \n-\n-[report issue]
    \n-
    total_payload_download total_payload_upload
    \n-
    counts the amount of bytes send and received this session, but only\n-the actual payload data (i.e the interesting data), these counters\n-ignore any protocol overhead. The session is considered to restart\n-when a torrent is paused and restarted again. When a torrent is\n-paused, these counters are reset to 0.
    \n-
    \n-[report issue]
    \n-
    total_failed_bytes
    \n-
    the number of bytes that has been downloaded and that has failed the\n-piece hash test. In other words, this is just how much crap that has\n-been downloaded since the torrent was last started. If a torrent is\n-paused and then restarted again, this counter will be reset.
    \n-
    \n-[report issue]
    \n-
    total_redundant_bytes
    \n-
    the number of bytes that has been downloaded even though that data\n-already was downloaded. The reason for this is that in some situations\n-the same data can be downloaded by mistake. When libtorrent sends\n-requests to a peer, and the peer doesn't send a response within a\n-certain timeout, libtorrent will re-request that block. Another\n-situation when libtorrent may re-request blocks is when the requests\n-it sends out are not replied in FIFO-order (it will re-request blocks\n-that are skipped by an out of order block). This is supposed to be as\n-low as possible. This only counts bytes since the torrent was last\n-started. If a torrent is paused and then restarted again, this counter\n-will be reset.
    \n-
    \n-[report issue]
    \n-
    pieces
    \n-
    a bitmask that represents which pieces we have (set to true) and the\n-pieces we don't have. It's a pointer and may be set to 0 if the\n-torrent isn't downloading or seeding.
    \n-
    \n-[report issue]
    \n-
    verified_pieces
    \n-
    a bitmask representing which pieces has had their hash checked. This\n-only applies to torrents in seed mode. If the torrent is not in seed\n-mode, this bitmask may be empty.
    \n-
    \n-[report issue]
    \n-
    total_done
    \n-
    the total number of bytes of the file(s) that we have. All this does\n-not necessarily has to be downloaded during this session (that's\n-total_payload_download).
    \n-
    \n-[report issue]
    \n-
    total
    \n-
    the total number of bytes to download for this torrent. This\n-may be less than the size of the torrent in case there are\n-pad files. This number only counts bytes that will actually\n-be requested from peers.
    \n-
    \n-[report issue]
    \n-
    total_wanted_done
    \n-
    the number of bytes we have downloaded, only counting the pieces that\n-we actually want to download. i.e. excluding any pieces that we have\n-but have priority 0 (i.e. not wanted).\n-Once a torrent becomes seed, any piece- and file priorities are\n-forgotten and all bytes are considered "wanted".
    \n-
    \n-[report issue]
    \n-
    total_wanted
    \n-
    The total number of bytes we want to download. This may be smaller\n-than the total torrent size in case any pieces are prioritized to 0,\n-i.e. not wanted.\n-Once a torrent becomes seed, any piece- and file priorities are\n-forgotten and all bytes are considered "wanted".
    \n-
    \n-\n-[report issue]
    \n-
    all_time_upload all_time_download
    \n-
    are accumulated upload and download payload byte counters. They are\n-saved in and restored from resume data to keep totals across sessions.
    \n-
    \n-[report issue]
    \n-
    added_time
    \n-
    the posix-time when this torrent was added. i.e. what time(nullptr)\n-returned at the time.
    \n-
    \n-[report issue]
    \n-
    completed_time
    \n-
    the posix-time when this torrent was finished. If the torrent is not\n-yet finished, this is 0.
    \n-
    \n-[report issue]
    \n-
    last_seen_complete
    \n-
    the time when we, or one of our peers, last saw a complete copy of\n-this torrent.
    \n-
    \n-[report issue]
    \n-
    storage_mode
    \n-
    The allocation mode for the torrent. See storage_mode_t for the\n-options. For more information, see storage allocation.
    \n-
    \n-[report issue]
    \n-
    progress
    \n-
    a value in the range [0, 1], that represents the progress of the\n-torrent's current task. It may be checking files or downloading.
    \n-
    \n-[report issue]
    \n-
    progress_ppm
    \n-

    progress parts per million (progress * 1000000) when disabling\n-floating point operations, this is the only option to query progress

    \n-

    reflects the same value as progress, but instead in a range [0,\n-1000000] (ppm = parts per million). When floating point operations are\n-disabled, this is the only alternative to the floating point value in\n-progress.

    \n-
    \n-
    \n-[report issue]
    \n-
    queue_position
    \n-
    the position this torrent has in the download\n-queue. If the torrent is a seed or finished, this is -1.
    \n-
    \n-\n-[report issue]
    \n-
    download_rate upload_rate
    \n-
    the total rates for all peers for this torrent. These will usually\n-have better precision than summing the rates from all peers. The rates\n-are given as the number of bytes per second.
    \n-
    \n-\n-[report issue]
    \n-
    download_payload_rate upload_payload_rate
    \n-
    the total transfer rate of payload only, not counting protocol\n-chatter. This might be slightly smaller than the other rates, but if\n-projected over a long time (e.g. when calculating ETA:s) the\n-difference may be noticeable.
    \n-
    \n-[report issue]
    \n-
    num_seeds
    \n-
    the number of peers that are seeding that this client is\n-currently connected to.
    \n-
    \n-[report issue]
    \n-
    num_peers
    \n-
    the number of peers this torrent currently is connected to. Peer\n-connections that are in the half-open state (is attempting to connect)\n-or are queued for later connection attempt do not count. Although they\n-are visible in the peer list when you call get_peer_info().
    \n-
    \n-\n-[report issue]
    \n-
    num_complete num_incomplete
    \n-
    if the tracker sends scrape info in its announce reply, these fields\n-will be set to the total number of peers that have the whole file and\n-the total number of peers that are still downloading. set to -1 if the\n-tracker did not send any scrape data in its announce reply.
    \n-
    \n-\n-[report issue]
    \n-
    list_seeds list_peers
    \n-
    the number of seeds in our peer list and the total number of peers\n-(including seeds). We are not necessarily connected to all the peers\n-in our peer list. This is the number of peers we know of in total,\n-including banned peers and peers that we have failed to connect to.
    \n-
    \n-[report issue]
    \n-
    connect_candidates
    \n-
    the number of peers in this torrent's peer list that is a candidate to\n-be connected to. i.e. It has fewer connect attempts than the max fail\n-count, it is not a seed if we are a seed, it is not banned etc. If\n-this is 0, it means we don't know of any more peers that we can try.
    \n-
    \n-[report issue]
    \n-
    num_pieces
    \n-
    the number of pieces that has been downloaded. It is equivalent to:\n-std::accumulate(pieces->begin(), pieces->end()). So you don't have\n-to count yourself. This can be used to see if anything has updated\n-since last time if you want to keep a graph of the pieces up to date.\n-Note that these pieces have not necessarily been written to disk yet,\n-and there is a risk the write to disk will fail.
    \n-
    \n-[report issue]
    \n-
    distributed_full_copies
    \n-
    the number of distributed copies of the torrent. Note that one copy\n-may be spread out among many peers. It tells how many copies there are\n-currently of the rarest piece(s) among the peers this client is\n-connected to.
    \n-
    \n-[report issue]
    \n-
    distributed_fraction
    \n-

    tells the share of pieces that have more copies than the rarest\n-piece(s). Divide this number by 1000 to get the fraction.

    \n-

    For example, if distributed_full_copies is 2 and\n-distributed_fraction is 500, it means that the rarest pieces have\n-only 2 copies among the peers this torrent is connected to, and that\n-50% of all the pieces have more than two copies.

    \n-

    If we are a seed, the piece picker is deallocated as an optimization,\n-and piece availability is no longer tracked. In this case the\n-distributed copies members are set to -1.

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

    the number of distributed copies of the file. note that one copy may\n-be spread out among many peers. This is a floating point\n-representation of the distributed copies.

    \n-
    \n-
    the integer part tells how many copies
    \n-
    there are of the rarest piece(s)
    \n-
    the fractional part tells the fraction of pieces that
    \n-
    have more copies than the rarest piece(s).
    \n-
    \n-
    \n-
    \n-[report issue]
    \n-
    block_size
    \n-
    the size of a block, in bytes. A block is a sub piece, it is the\n-number of bytes that each piece request asks for and the number of\n-bytes that each bit in the partial_piece_info's bitset represents,\n-see get_download_queue(). This is typically 16 kB, but it may be\n-smaller, if the pieces are smaller.
    \n-
    \n-[report issue]
    \n-
    num_uploads
    \n-
    the number of unchoked peers in this torrent.
    \n-
    \n-[report issue]
    \n-
    num_connections
    \n-
    the number of peer connections this torrent has, including half-open\n-connections that hasn't completed the bittorrent handshake yet. This\n-is always >= num_peers.
    \n-
    \n-[report issue]
    \n-
    uploads_limit
    \n-
    the set limit of upload slots (unchoked peers) for this torrent.
    \n-
    \n-[report issue]
    \n-
    connections_limit
    \n-
    the set limit of number of connections for this torrent.
    \n-
    \n-\n-[report issue]
    \n-
    up_bandwidth_queue down_bandwidth_queue
    \n-
    the number of peers in this torrent that are waiting for more\n-bandwidth quota from the torrent rate limiter. This can determine if\n-the rate you get from this torrent is bound by the torrents limit or\n-not. If there is no limit set on this torrent, the peers might still\n-be waiting for bandwidth quota from the global limiter, but then they\n-are counted in the session_status object.
    \n-
    \n-[report issue]
    \n-
    seed_rank
    \n-
    A rank of how important it is to seed the torrent, it is used to\n-determine which torrents to seed and which to queue. It is based on\n-the peer to seed ratio from the tracker scrape. For more information,\n-see queuing. Higher value means more important to seed
    \n-
    \n-[report issue]
    \n-
    state
    \n-
    the main state the torrent is in. See torrent_status::state_t.
    \n-
    \n-[report issue]
    \n-
    need_save_resume
    \n-
    true if this torrent has unsaved changes\n-to its download state and statistics since the last resume data\n-was saved.
    \n-
    \n-[report issue]
    \n-
    is_seeding
    \n-
    true if all pieces have been downloaded.
    \n-
    \n-[report issue]
    \n-
    is_finished
    \n-
    true if all pieces that have a priority > 0 are downloaded. There is\n-only a distinction between finished and seeding if some pieces or\n-files have been set to priority 0, i.e. are not downloaded.
    \n-
    \n-[report issue]
    \n-
    has_metadata
    \n-
    true if this torrent has metadata (either it was started from a\n-.torrent file or the metadata has been downloaded). The only scenario\n-where this can be false is when the torrent was started torrent-less\n-(i.e. with just an info-hash and tracker ip, a magnet link for\n-instance).
    \n-
    \n-[report issue]
    \n-
    has_incoming
    \n-
    true if there has ever been an incoming connection attempt to this\n-torrent.
    \n-
    \n-[report issue]
    \n-
    moving_storage
    \n-
    this is true if this torrent's storage is currently being moved from\n-one location to another. This may potentially be a long operation\n-if a large file ends up being copied from one drive to another.
    \n-
    \n-\n-\n-[report issue]
    \n-
    announcing_to_trackers announcing_to_lsd announcing_to_dht
    \n-
    these are set to true if this torrent is allowed to announce to the\n-respective peer source. Whether they are true or false is determined by\n-the queue logic/auto manager. Torrents that are not auto managed will\n-always be allowed to announce to all peer sources.
    \n-
    \n-[report issue]
    \n-
    info_hashes
    \n-
    the info-hash for this torrent
    \n-
    \n-\n-[report issue]
    \n-
    last_upload last_download
    \n-
    the timestamps of the last time this torrent uploaded or downloaded\n-payload to any peer.
    \n-
    \n-\n-\n-[report issue]
    \n-
    active_duration finished_duration seeding_duration
    \n-
    these are cumulative counters of for how long the torrent has been in\n-different states. active means not paused and added to session. Whether\n-it has found any peers or not is not relevant.\n-finished means all selected files/pieces were downloaded and available\n-to other peers (this is always a subset of active time).\n-seeding means all files/pieces were downloaded and available to\n-peers. Being available to peers does not imply there are other peers\n-asking for the payload.
    \n-
    \n-[report issue]
    \n-
    flags
    \n-
    reflects several of the torrent's flags. For more\n-information, see torrent_handle::flags().
    \n-
    \n-[report issue]
    \n-
    \n-
    \n-

    session_handle

    \n-

    Declared in "libtorrent/session_handle.hpp"

    \n-

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

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

    is_valid()

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

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

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

    session_state()

    \n-
    \n-session_params session_state (save_state_flags_t flags = save_state_flags_t::all()) const;\n-
    \n-

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

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

    refresh_torrent_status() get_torrent_status()

    \n-
    \n-void refresh_torrent_status (std::vector<torrent_status>* ret\n-      , status_flags_t flags = {}) const;\n-std::vector<torrent_status> get_torrent_status (\n-      std::function<bool(torrent_status const&)> const& pred\n-      , status_flags_t flags = {}) const;\n-
    \n-
    \n-

    Note

    \n-

    these calls are potentially expensive and won't scale well with\n-lots of torrents. If you're concerned about performance, consider\n-using post_torrent_updates() instead.

    \n-
    \n-

    get_torrent_status returns a vector of the torrent_status for\n-every torrent which satisfies pred, which is a predicate function\n-which determines if a torrent should be included in the returned set\n-or not. Returning true means it should be included and false means\n-excluded. The flags argument is the same as to\n-torrent_handle::status(). Since pred is guaranteed to be\n-called for every torrent, it may be used to count the number of\n-torrents of different categories as well.

    \n-

    refresh_torrent_status takes a vector of torrent_status structs\n-(for instance the same vector that was returned by\n-get_torrent_status() ) and refreshes the status based on the\n-handle member. It is possible to use this function by first\n-setting up a vector of default constructed torrent_status objects,\n-only initializing the handle member, in order to request the\n-torrent status for multiple torrents in a single call. This can save a\n-significant amount of time if you have a lot of torrents.

    \n-

    Any torrent_status object whose handle member is not referring to\n-a valid torrent are ignored.

    \n-

    The intended use of these functions is to start off by calling\n-get_torrent_status() to get a list of all torrents that match your\n-criteria. Then call refresh_torrent_status() on that list. This\n-will only refresh the status for the torrents in your list, and thus\n-ignore all other torrents you might be running. This may save a\n-significant amount of time, especially if the number of torrents you're\n-interested in is small. In order to keep your list of interested\n-torrents up to date, you can either call get_torrent_status() from\n-time to time, to include torrents you might have become interested in\n-since the last time. In order to stop refreshing a certain torrent,\n-simply remove it from the list.

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

    post_torrent_updates()

    \n-
    \n-void post_torrent_updates (status_flags_t flags = status_flags_t::all());\n-
    \n-

    This functions instructs the session to post the state_update_alert,\n-containing the status of all torrents whose state changed since the\n-last time this function was called.

    \n-

    Only torrents who has the state subscription flag set will be\n-included. This flag is on by default. See add_torrent_params.\n-the flags argument is the same as for torrent_handle::status().\n-see status_flags_t in torrent_handle.

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

    post_session_stats()

    \n-
    \n-void post_session_stats ();\n-
    \n-

    This function will post a session_stats_alert object, containing a\n-snapshot of the performance counters from the internals of libtorrent.\n-To interpret these counters, query the session via\n-session_stats_metrics().

    \n-

    For more information, see the session statistics section.

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

    post_dht_stats()

    \n-
    \n-void post_dht_stats ();\n-
    \n-

    This will cause a dht_stats_alert to be posted.

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

    set_dht_state()

    \n-
    \n-void set_dht_state (dht::dht_state const& st);\n-void set_dht_state (dht::dht_state&& st);\n-
    \n-

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

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

    get_torrents() find_torrent()

    \n-
    \n-std::vector<torrent_handle> get_torrents () const;\n-torrent_handle find_torrent (sha1_hash const& info_hash) const;\n-
    \n-

    find_torrent() looks for a torrent with the given info-hash. In\n-case there is such a torrent in the session, a torrent_handle to that\n-torrent is returned. In case the torrent cannot be found, an invalid\n-torrent_handle is returned.

    \n-

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

    \n-

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

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

    add_torrent() async_add_torrent()

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

    You add torrents through the add_torrent() function where you give an\n-object with all the parameters. The add_torrent() overloads will block\n-until the torrent has been added (or failed to be added) and returns\n-an error code and a torrent_handle. In order to add torrents more\n-efficiently, consider using async_add_torrent() which returns\n-immediately, without waiting for the torrent to add. Notification of\n-the torrent being added is sent as add_torrent_alert.

    \n-

    The save_path field in add_torrent_params must be set to a valid\n-path where the files for the torrent will be saved. Even when using a\n-custom storage, this needs to be set to something. If the save_path\n-is empty, the call to add_torrent() will throw a system_error\n-exception.

    \n-

    The overload that does not take an error_code throws an exception on\n-error and is not available when building without exception support.\n-The torrent_handle returned by add_torrent() can be used to retrieve\n-information about the torrent's progress, its peers etc. It is also\n-used to abort a torrent.

    \n-

    If the torrent you are trying to add already exists in the session (is\n-either queued for checking, being checked or downloading)\n-add_torrent() will throw system_error which derives from\n-std::exception unless duplicate_is_error is set to false. In that\n-case, add_torrent() will return the handle to the existing torrent.

    \n-

    The add_torrent_params class has a flags field. It can be used to\n-control what state the new torrent will be added in. Common flags to\n-want to control are torrent_flags::paused and\n-torrent_flags::auto_managed. In order to add a magnet link that will\n-just download the metadata, but no payload, set the\n-torrent_flags::upload_mode flag.

    \n-

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

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

    is_paused() resume() pause()

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

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

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

    is_dht_running()

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

    is_dht_running() returns true if the DHT support has been started\n-and false otherwise.

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

    set_dht_storage()

    \n-
    \n-void set_dht_storage (dht::dht_storage_constructor_type sc);\n-
    \n-

    set_dht_storage set a dht custom storage constructor function\n-to be used internally when the dht is created.

    \n-

    Since the dht storage is a critical component for the dht behavior,\n-this function will only be effective the next time the dht is started.\n-If you never touch this feature, a default map-memory based storage\n-is used.

    \n-

    If you want to make sure the dht is initially created with your\n-custom storage, create a session with the setting\n-settings_pack::enable_dht to false, set your constructor function\n-and call apply_settings with settings_pack::enable_dht to true.

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

    add_dht_node()

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

    add_dht_node takes a host name and port pair. That endpoint will be\n-pinged, and if a valid DHT reply is received, the node will be added to\n-the routing table.

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

    dht_get_item()

    \n-
    \n-void dht_get_item (sha1_hash const& target);\n-
    \n-

    query the DHT for an immutable item at the target hash.\n-the result is posted as a dht_immutable_item_alert.

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

    dht_get_item()

    \n-
    \n-void dht_get_item (std::array<char, 32> key\n-      , std::string salt = std::string());\n-
    \n-

    query the DHT for a mutable item under the public key key.\n-this is an ed25519 key. salt is optional and may be left\n-as an empty string if no salt is to be used.\n-if the item is found in the DHT, a dht_mutable_item_alert is\n-posted.

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

    dht_put_item()

    \n-
    \n-sha1_hash dht_put_item (entry data);\n-
    \n-

    store the given bencoded data as an immutable item in the DHT.\n-the returned hash is the key that is to be used to look the item\n-up again. It's just the SHA-1 hash of the bencoded form of the\n-structure.

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

    dht_put_item()

    \n-
    \n-void dht_put_item (std::array<char, 32> key\n-      , std::function<void(entry&, std::array<char, 64>&\n-      , std::int64_t&, std::string const&)> cb\n-      , std::string salt = std::string());\n-
    \n-

    store a mutable item. The key is the public key the blob is\n-to be stored under. The optional salt argument is a string that\n-is to be mixed in with the key when determining where in the DHT\n-the value is to be stored. The callback function is called from within\n-the libtorrent network thread once we've found where to store the blob,\n-possibly with the current value stored under the key.\n-The values passed to the callback functions are:

    \n-
    \n-
    entry& value
    \n-
    the current value stored under the key (may be empty). Also expected\n-to be set to the value to be stored by the function.
    \n-
    std::array<char,64>& signature
    \n-
    the signature authenticating the current value. This may be zeros\n-if there is currently no value stored. The function is expected to\n-fill in this buffer with the signature of the new value to store.\n-To generate the signature, you may want to use the\n-sign_mutable_item function.
    \n-
    std::int64_t& seq
    \n-
    current sequence number. May be zero if there is no current value.\n-The function is expected to set this to the new sequence number of\n-the value that is to be stored. Sequence numbers must be monotonically\n-increasing. Attempting to overwrite a value with a lower or equal\n-sequence number will fail, even if the signature is correct.
    \n-
    std::string const& salt
    \n-
    this is the salt that was used for this put call.
    \n-
    \n-

    Since the callback function cb is called from within libtorrent,\n-it is critical to not perform any blocking operations. Ideally not\n-even locking a mutex. Pass any data required for this function along\n-with the function object's context and make the function entirely\n-self-contained. The only reason data blob's value is computed\n-via a function instead of just passing in the new value is to avoid\n-race conditions. If you want to update the value in the DHT, you\n-must first retrieve it, then modify it, then write it back. The way\n-the DHT works, it is natural to always do a lookup before storing and\n-calling the callback in between is convenient.

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

    dht_get_peers() dht_announce()

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

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

    \n-

    dht_announce() will issue a DHT announce request to the DHT to the\n-specified info-hash, advertising the specified port. If the port is\n-left at its default, 0, the port will be implied by the DHT message's\n-source port (which may improve connectivity through a NAT).\n-dht_announce() is not affected by the announce_port override setting.

    \n-

    Both these functions are exposed for advanced custom use of the DHT.\n-All torrents eligible to be announce to the DHT will be automatically,\n-by libtorrent.

    \n-

    For possible flags, see announce_flags_t.

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

    dht_live_nodes()

    \n-
    \n-void dht_live_nodes (sha1_hash const& nid);\n-
    \n-

    Retrieve all the live DHT (identified by nid) nodes. All the\n-nodes id and endpoint will be returned in the list of nodes in the\n-alert dht_live_nodes_alert.\n-Since this alert is a response to an explicit call, it will always be\n-posted, regardless of the alert mask.

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

    dht_sample_infohashes()

    \n-
    \n-void dht_sample_infohashes (udp::endpoint const& ep, sha1_hash const& target);\n-
    \n-

    Query the DHT node specified by ep to retrieve a sample of the\n-info-hashes that the node currently have in their storage.\n-The target is included for iterative lookups so that indexing nodes\n-can perform a key space traversal with a single RPC per node by adjusting\n-the target value for each RPC. It has no effect on the returned sample value.\n-The result is posted as a dht_sample_infohashes_alert.

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

    dht_direct_request()

    \n-
    \n-void dht_direct_request (udp::endpoint const& ep, entry const& e, client_data_t userdata = {});\n-
    \n-

    Send an arbitrary DHT request directly to the specified endpoint. This\n-function is intended for use by plugins. When a response is received\n-or the request times out, a dht_direct_response_alert will be posted\n-with the response (if any) and the userdata pointer passed in here.\n-Since this alert is a response to an explicit call, it will always be\n-posted, regardless of the alert mask.

    \n-[report issue]
    \n-
    \n-

    add_extension()

    \n-
    \n-void add_extension (std::function<std::shared_ptr<torrent_plugin>(\n-      torrent_handle const&, client_data_t)> ext);\n-void add_extension (std::shared_ptr<plugin> ext);\n-
    \n-

    This function adds an extension to this session. The argument is a\n-function object that is called with a torrent_handle and which should\n-return a std::shared_ptr<torrent_plugin>. To write custom\n-plugins, see libtorrent plugins. For the typical bittorrent client\n-all of these extensions should be added. The main plugins implemented\n-in libtorrent are:

    \n-
    \n-
    uTorrent metadata
    \n-
    Allows peers to download the metadata (.torrent files) from the swarm\n-directly. Makes it possible to join a swarm with just a tracker and\n-info-hash.
    \n-
    \n-
    \n-#include <libtorrent/extensions/ut_metadata.hpp>\n-ses.add_extension(&lt::create_ut_metadata_plugin);\n-
    \n-
    \n-
    uTorrent peer exchange
    \n-
    Exchanges peers between clients.
    \n-
    \n-
    \n-#include <libtorrent/extensions/ut_pex.hpp>\n-ses.add_extension(&lt::create_ut_pex_plugin);\n-
    \n-
    \n-
    smart ban plugin
    \n-
    A plugin that, with a small overhead, can ban peers\n-that sends bad data with very high accuracy. Should\n-eliminate most problems on poisoned torrents.
    \n-
    \n-
    \n-#include <libtorrent/extensions/smart_ban.hpp>\n-ses.add_extension(&lt::create_smart_ban_plugin);\n-
    \n-\n-[report issue]
    \n-
    \n-

    get_ip_filter() set_ip_filter()

    \n-
    \n-ip_filter get_ip_filter () const;\n-void set_ip_filter (ip_filter f);\n-
    \n-

    Sets a filter that will be used to reject and accept incoming as well\n-as outgoing connections based on their originating ip address. The\n-default filter will allow connections to any ip address. To build a\n-set of rules for which addresses are accepted and not, see ip_filter.

    \n-

    Each time a peer is blocked because of the IP filter, a\n-peer_blocked_alert is generated. get_ip_filter() Returns the\n-ip_filter currently in the session. See ip_filter.

    \n-[report issue]
    \n-
    \n-

    set_port_filter()

    \n-
    \n-void set_port_filter (port_filter const& f);\n-
    \n-

    apply port_filter f to incoming and outgoing peers. a port filter\n-will reject making outgoing peer connections to certain remote ports.\n-The main intention is to be able to avoid triggering certain\n-anti-virus software by connecting to SMTP, FTP ports.

    \n-\n-\n-[report issue]
    \n-
    \n-

    is_listening() ssl_listen_port() listen_port()

    \n-
    \n-unsigned short listen_port () const;\n-bool is_listening () const;\n-unsigned short ssl_listen_port () const;\n-
    \n-

    is_listening() will tell you whether or not the session has\n-successfully opened a listening port. If it hasn't, this function will\n-return false, and then you can set a new\n-settings_pack::listen_interfaces to try another interface and port to\n-bind to.

    \n-

    listen_port() returns the port we ended up listening on.

    \n-\n-[report issue]
    \n-
    \n-

    set_peer_class_filter() get_peer_class_filter()

    \n-
    \n-void set_peer_class_filter (ip_filter const& f);\n-ip_filter get_peer_class_filter () const;\n-
    \n-

    Sets the peer class filter for this session. All new peer connections\n-will take this into account and be added to the peer classes specified\n-by this filter, based on the peer's IP address.

    \n-

    The ip-filter essentially maps an IP -> uint32. Each bit in that 32\n-bit integer represents a peer class. The least significant bit\n-represents class 0, the next bit class 1 and so on.

    \n-

    For more info, see ip_filter.

    \n-

    For example, to make all peers in the range 200.1.1.0 - 200.1.255.255\n-belong to their own peer class, apply the following filter:

    \n-
    \n-ip_filter f = ses.get_peer_class_filter();\n-peer_class_t my_class = ses.create_peer_class("200.1.x.x IP range");\n-f.add_rule(make_address("200.1.1.0"), make_address("200.1.255.255")\n-        , 1 << static_cast<std::uint32_t>(my_class));\n-ses.set_peer_class_filter(f);\n-
    \n-

    This setting only applies to new connections, it won't affect existing\n-peer connections.

    \n-

    This function is limited to only peer class 0-31, since there are only\n-32 bits in the IP range mapping. Only the set bits matter; no peer\n-class will be removed from a peer as a result of this call, peer\n-classes are only added.

    \n-

    The peer_class argument cannot be greater than 31. The bitmasks\n-representing peer classes in the peer_class_filter are 32 bits.

    \n-

    The get_peer_class_filter() function returns the current filter.

    \n-

    For more information, see peer classes.

    \n-\n-[report issue]
    \n-
    \n-

    get_peer_class_type_filter() set_peer_class_type_filter()

    \n-
    \n-void set_peer_class_type_filter (peer_class_type_filter const& f);\n-peer_class_type_filter get_peer_class_type_filter () const;\n-
    \n-

    Sets and gets the peer class type filter. This is controls automatic\n-peer class assignments to peers based on what kind of socket it is.

    \n-

    It does not only support assigning peer classes, it also supports\n-removing peer classes based on socket type.

    \n-

    The order of these rules being applied are:

    \n-
      \n-
    1. peer-class IP filter
    2. \n-
    3. peer-class type filter, removing classes
    4. \n-
    5. peer-class type filter, adding classes
    6. \n-
    \n-

    For more information, see peer classes.

    \n-[report issue]
    \n-
    \n-

    create_peer_class()

    \n-
    \n-peer_class_t create_peer_class (char const* name);\n-
    \n-

    Creates a new peer class (see peer classes) with the given name. The\n-returned integer is the new peer class identifier. Peer classes may\n-have the same name, so each invocation of this function creates a new\n-class and returns a unique identifier.

    \n-

    Identifiers are assigned from low numbers to higher. So if you plan on\n-using certain peer classes in a call to set_peer_class_filter(),\n-make sure to create those early on, to get low identifiers.

    \n-

    For more information on peer classes, see peer classes.

    \n-[report issue]
    \n-
    \n-

    delete_peer_class()

    \n-
    \n-void delete_peer_class (peer_class_t cid);\n-
    \n-

    This call dereferences the reference count of the specified peer\n-class. When creating a peer class it's automatically referenced by 1.\n-If you want to recycle a peer class, you may call this function. You\n-may only call this function once per peer class you create.\n-Calling it more than once for the same class will lead to memory\n-corruption.

    \n-

    Since peer classes are reference counted, this function will not\n-remove the peer class if it's still assigned to torrents or peers. It\n-will however remove it once the last peer and torrent drops their\n-references to it.

    \n-

    There is no need to call this function for custom peer classes. All\n-peer classes will be properly destructed when the session object\n-destructs.

    \n-

    For more information on peer classes, see peer classes.

    \n-\n-[report issue]
    \n-
    \n-

    set_peer_class() get_peer_class()

    \n-
    \n-peer_class_info get_peer_class (peer_class_t cid) const;\n-void set_peer_class (peer_class_t cid, peer_class_info const& pci);\n-
    \n-

    These functions queries information from a peer class and updates the\n-configuration of a peer class, respectively.

    \n-

    cid must refer to an existing peer class. If it does not, the\n-return value of get_peer_class() is undefined.

    \n-

    set_peer_class() sets all the information in the\n-peer_class_info object in the specified peer class. There is no\n-option to only update a single property.

    \n-

    A peer or torrent belonging to more than one class, the highest\n-priority among any of its classes is the one that is taken into\n-account.

    \n-

    For more information, see peer classes.

    \n-[report issue]
    \n-
    \n-

    remove_torrent()

    \n-
    \n-void remove_torrent (const torrent_handle&, remove_flags_t = {});\n-
    \n-

    remove_torrent() will close all peer connections associated with\n-the torrent and tell the tracker that we've stopped participating in\n-the swarm. This operation cannot fail. When it completes, you will\n-receive a torrent_removed_alert.

    \n-

    remove_torrent() is non-blocking, but will remove the torrent from the\n-session synchronously. Calling session_handle::add_torrent() immediately\n-afterward with the same torrent will succeed. Note that this creates a\n-new handle which is not equal to the removed one.

    \n-

    The optional second argument options can be used to delete all the\n-files downloaded by this torrent. To do so, pass in the value\n-session_handle::delete_files. Once the torrent is deleted, a\n-torrent_deleted_alert is posted.

    \n-

    The torrent_handle remains valid for some time after remove_torrent() is\n-called. It will become invalid only after all libtorrent tasks (such as\n-I/O tasks) release their references to the torrent. Until this happens,\n-torrent_handle::is_valid() will return true, and other calls such\n-as torrent_handle::status() will succeed. Because of this, and because\n-remove_torrent() is non-blocking, the following sequence usually\n-succeeds (does not throw system_error):\n-.. code:: c++

    \n-
    \n-session.remove_handle(handle);\n-handle.save_resume_data();
    \n-

    Note that when a queued or downloading torrent is removed, its position\n-in the download queue is vacated and every subsequent torrent in the\n-queue has their queue positions updated. This can potentially cause a\n-large state_update to be posted. When removing all torrents, it is\n-advised to remove them from the back of the queue, to minimize the\n-shifting.

    \n-\n-[report issue]
    \n-
    \n-

    get_settings() apply_settings()

    \n-
    \n-void apply_settings (settings_pack&&);\n-settings_pack get_settings () const;\n-void apply_settings (settings_pack const&);\n-
    \n-

    Applies the settings specified by the settings_pack s. This is an\n-asynchronous operation that will return immediately and actually apply\n-the settings to the main thread of libtorrent some time later.

    \n-\n-\n-[report issue]
    \n-
    \n-

    wait_for_alert() set_alert_notify() pop_alerts()

    \n-
    \n-alert* wait_for_alert (time_duration max_wait);\n-void set_alert_notify (std::function<void()> const& fun);\n-void pop_alerts (std::vector<alert*>* alerts);\n-
    \n-

    Alerts is the main mechanism for libtorrent to report errors and\n-events. pop_alerts fills in the vector passed to it with pointers\n-to new alerts. The session still owns these alerts and they will stay\n-valid until the next time pop_alerts is called. You may not delete\n-the alert objects.

    \n-

    It is safe to call pop_alerts from multiple different threads, as\n-long as the alerts themselves are not accessed once another thread\n-calls pop_alerts. Doing this requires manual synchronization\n-between the popping threads.

    \n-

    wait_for_alert will block the current thread for max_wait time\n-duration, or until another alert is posted. If an alert is available\n-at the time of the call, it returns immediately. The returned alert\n-pointer is the head of the alert queue. wait_for_alert does not\n-pop alerts from the queue, it merely peeks at it. The returned alert\n-will stay valid until pop_alerts is called twice. The first time\n-will pop it and the second will free it.

    \n-

    If there is no alert in the queue and no alert arrives within the\n-specified timeout, wait_for_alert returns nullptr.

    \n-

    In the python binding, wait_for_alert takes the number of\n-milliseconds to wait as an integer.

    \n-

    The alert queue in the session will not grow indefinitely. Make sure\n-to pop periodically to not miss notifications. To control the max\n-number of alerts that's queued by the session, see\n-settings_pack::alert_queue_size.

    \n-

    Some alerts are considered so important that they are posted even when\n-the alert queue is full. Some alerts are considered mandatory and cannot\n-be disabled by the alert_mask. For instance,\n-save_resume_data_alert and save_resume_data_failed_alert are always\n-posted, regardless of the alert mask.

    \n-

    To control which alerts are posted, set the alert_mask\n-(settings_pack::alert_mask).

    \n-

    If the alert queue fills up to the point where alerts are dropped, this\n-will be indicated by a alerts_dropped_alert, which contains a bitmask\n-of which types of alerts were dropped. Generally it is a good idea to\n-make sure the alert queue is large enough, the alert_mask doesn't have\n-unnecessary categories enabled and to call pop_alert() frequently, to\n-avoid alerts being dropped.

    \n-

    the set_alert_notify function lets the client set a function object\n-to be invoked every time the alert queue goes from having 0 alerts to\n-1 alert. This function is called from within libtorrent, it may be the\n-main thread, or it may be from within a user call. The intention of\n-of the function is that the client wakes up its main thread, to poll\n-for more alerts using pop_alerts(). If the notify function fails\n-to do so, it won't be called again, until pop_alerts is called for\n-some other reason. For instance, it could signal an eventfd, post a\n-message to an HWND or some other main message pump. The actual\n-retrieval of alerts should not be done in the callback. In fact, the\n-callback should not block. It should not perform any expensive work.\n-It really should just notify the main application thread.

    \n-

    The type of an alert is returned by the polymorphic function\n-alert::type() but can also be queries from a concrete type via\n-T::alert_type, as a static constant.

    \n-\n-[report issue]
    \n-
    \n-

    add_port_mapping() delete_port_mapping()

    \n-
    \n-std::vector<port_mapping_t> add_port_mapping (portmap_protocol t, int external_port, int local_port);\n-void delete_port_mapping (port_mapping_t handle);\n-
    \n-

    add_port_mapping adds one or more port forwards on UPnP and/or NAT-PMP,\n-whichever is enabled. A mapping is created for each listen socket\n-in the session. The return values are all handles referring to the\n-port mappings that were just created. Pass them to delete_port_mapping()\n-to remove them.

    \n-[report issue]
    \n-
    \n-

    reopen_network_sockets()

    \n-
    \n-void reopen_network_sockets (reopen_network_flags_t options = reopen_map_ports);\n-
    \n-

    Instructs the session to reopen all listen and outgoing sockets.

    \n-

    It's useful in the case your platform doesn't support the built in\n-IP notifier mechanism, or if you have a better more reliable way to\n-detect changes in the IP routing table.

    \n-[report issue]
    \n-
    \n-

    native_handle()

    \n-
    \n-std::shared_ptr<aux::session_impl> native_handle () const;\n-
    \n-

    This function is intended only for use by plugins. This type does\n-not have a stable API and should be relied on as little as possible.

    \n-[report issue]
    \n-
    save_settings
    \n-
    saves settings (i.e. the settings_pack)
    \n-
    \n-[report issue]
    \n-
    save_dht_state
    \n-
    saves dht state such as nodes and node-id, possibly accelerating\n-joining the DHT if provided at next session startup.
    \n-
    \n-[report issue]
    \n-
    save_extension_state
    \n-
    load or save state from plugins
    \n-
    \n-[report issue]
    \n-
    save_ip_filter
    \n-
    load or save the IP filter set on the session
    \n-
    \n-\n-\n-[report issue]
    \n-
    global_peer_class_id tcp_peer_class_id local_peer_class_id
    \n-
    built-in peer classes
    \n-
    \n-[report issue]
    \n-
    delete_files
    \n-
    delete the files belonging to the torrent from disk.\n-including the part-file, if there is one
    \n-
    \n-[report issue]
    \n-
    delete_partfile
    \n-
    delete just the part-file associated with this torrent
    \n-
    \n-[report issue]
    \n-
    paused
    \n-
    when set, the session will start paused. Call\n-session_handle::resume() to start
    \n-
    \n-\n-[report issue]
    \n-
    udp tcp
    \n-
    protocols used by add_port_mapping()
    \n-
    \n-[report issue]
    \n-
    reopen_map_ports
    \n-
    This option indicates if the ports are mapped using natpmp\n-and upnp. If mapping was already made, they are deleted and added\n-again. This only works if natpmp and/or upnp are configured to be\n-enable.
    \n-
    \n-[report issue]
    \n-
    \n-
    \n-

    session_proxy

    \n-

    Declared in "libtorrent/session.hpp"

    \n-

    this is a holder for the internal session implementation object. Once the\n-session destruction is explicitly initiated, this holder is used to\n-synchronize the completion of the shutdown. The lifetime of this object\n-may outlive session, causing the session destructor to not block. The\n-session_proxy destructor will block however, until the underlying session\n-is done shutting down.

    \n-
    \n-struct session_proxy\n-{\n-   session_proxy (session_proxy const&);\n-   session_proxy& operator= (session_proxy const&) &;\n-   session_proxy (session_proxy&&) noexcept;\n-   session_proxy& operator= (session_proxy&&) & noexcept;\n-   session_proxy ();\n-   ~session_proxy ();\n-};\n-
    \n-\n-\n-[report issue]
    \n-

    session_proxy() ~session_proxy() operator=()

    \n-
    \n-session_proxy (session_proxy const&);\n-session_proxy& operator= (session_proxy const&) &;\n-session_proxy (session_proxy&&) noexcept;\n-session_proxy& operator= (session_proxy&&) & noexcept;\n-session_proxy ();\n-~session_proxy ();\n-
    \n-

    default constructor, does not refer to any session\n-implementation object.

    \n-[report issue]
    \n-
    \n-
    \n-

    session

    \n-

    Declared in "libtorrent/session.hpp"

    \n-

    The session holds all state that spans multiple torrents. Among other\n-things it runs the network loop and manages all torrents. Once it's\n-created, the session object will spawn the main thread that will do all\n-the work. The main thread will be idle as long it doesn't have any\n-torrents to participate in.

    \n-

    You have some control over session configuration through the\n-session_handle::apply_settings() member function. To change one or more\n-configuration options, create a settings_pack. object and fill it with\n-the settings to be set and pass it in to session::apply_settings().

    \n-

    see apply_settings().

    \n-
    \n-struct session : session_handle\n-{\n-   session (session_params const& params, session_flags_t flags);\n-   explicit session (session_params const& params);\n-   session ();\n-   session (session_params&& params, session_flags_t flags);\n-   explicit session (session_params&& params);\n-   session (session_params&& params, io_context& ios);\n-   session (session_params const& params, io_context& ios);\n-   session (session_params&& params, io_context& ios, session_flags_t);\n-   session (session_params const& params, io_context& ios, session_flags_t);\n-   ~session ();\n-   session_proxy abort ();\n-};\n-
    \n-[report issue]
    \n-

    session()

    \n-
    \n-session (session_params const& params, session_flags_t flags);\n-explicit session (session_params const& params);\n-session ();\n-session (session_params&& params, session_flags_t flags);\n-explicit session (session_params&& params);\n-
    \n-

    Constructs the session objects which acts as the container of torrents.\n-In order to avoid a race condition between starting the session and\n-configuring it, you can pass in a session_params object. Its settings\n-will take effect before the session starts up.

    \n-

    The overloads taking flags can be used to start a session in\n-paused mode (by passing in session::paused). Note that\n-add_default_plugins do not have an affect on constructors that\n-take a session_params object. It already contains the plugins to use.

    \n-[report issue]
    \n-
    \n-

    session()

    \n-
    \n-session (session_params&& params, io_context& ios);\n-session (session_params const& params, io_context& ios);\n-session (session_params&& params, io_context& ios, session_flags_t);\n-session (session_params const& params, io_context& ios, session_flags_t);\n-
    \n-

    Overload of the constructor that takes an external io_context to run\n-the session object on. This is primarily useful for tests that may want\n-to run multiple sessions on a single io_context, or low resource\n-systems where additional threads are expensive and sharing an\n-io_context with other events is fine.

    \n-
    \n-

    Warning

    \n-

    The session object does not cleanly terminate with an external\n-io_context. The io_context::run() call must have returned\n-before it's safe to destruct the session. Which means you MUST\n-call session::abort() and save the session_proxy first, then\n-destruct the session object, then sync with the io_context, then\n-destruct the session_proxy object.

    \n-
    \n-[report issue]
    \n-
    \n-

    ~session()

    \n-
    \n-~session ();\n-
    \n-

    The destructor of session will notify all trackers that our torrents\n-have been shut down. If some trackers are down, they will time out.\n-All this before the destructor of session returns. So, it's advised\n-that any kind of interface (such as windows) are closed before\n-destructing the session object. Because it can take a few second for\n-it to finish. The timeout can be set with apply_settings().

    \n-[report issue]
    \n-
    \n-

    abort()

    \n-
    \n-session_proxy abort ();\n-
    \n-

    In case you want to destruct the session asynchronously, you can\n-request a session destruction proxy. If you don't do this, the\n-destructor of the session object will block while the trackers are\n-contacted. If you keep one session_proxy to the session when\n-destructing it, the destructor will not block, but start to close down\n-the session, the destructor of the proxy will then synchronize the\n-threads. So, the destruction of the session is performed from the\n-session destructor call until the session_proxy destructor\n-call. The session_proxy does not have any operations on it (since\n-the session is being closed down, no operations are allowed on it).\n-The only valid operation is calling the destructor:

    \n-
    \n-struct session_proxy {};\n-
    \n-[report issue]
    \n-
    \n-
    \n-

    session_params

    \n-

    Declared in "libtorrent/session_params.hpp"

    \n-

    The session_params is a parameters pack for configuring the session\n-before it's started.

    \n-
    \n-struct session_params\n-{\n-   session_params (settings_pack&& sp);\n-   session_params (settings_pack const& sp);\n-   session_params ();\n-   session_params (settings_pack&& sp\n-      , std::vector<std::shared_ptr<plugin>> exts);\n-   session_params (settings_pack const& sp\n-      , std::vector<std::shared_ptr<plugin>> exts);\n-\n-   settings_pack settings;\n-   std::vector<std::shared_ptr<plugin>> extensions;\n-   dht::dht_state dht_state;\n-   dht::dht_storage_constructor_type dht_storage_constructor;\n-   disk_io_constructor_type disk_io_constructor;\n-   std::map<std::string, std::string> ext_state;\n-   libtorrent::ip_filter ip_filter;\n-};\n-
    \n-[report issue]
    \n-

    session_params()

    \n-
    \n-session_params (settings_pack&& sp);\n-session_params (settings_pack const& sp);\n-session_params ();\n-
    \n-

    This constructor can be used to start with the default plugins\n-(ut_metadata, ut_pex and smart_ban). Pass a settings_pack to set the\n-initial settings when the session starts.

    \n-[report issue]
    \n-
    \n-

    session_params()

    \n-
    \n-session_params (settings_pack&& sp\n-      , std::vector<std::shared_ptr<plugin>> exts);\n-session_params (settings_pack const& sp\n-      , std::vector<std::shared_ptr<plugin>> exts);\n-
    \n-

    This constructor helps to configure the set of initial plugins\n-to be added to the session before it's started.

    \n-[report issue]
    \n-
    settings
    \n-
    The settings to configure the session with
    \n-
    \n-[report issue]
    \n-
    extensions
    \n-
    the plugins to add to the session as it is constructed
    \n-
    \n-[report issue]
    \n-
    dht_state
    \n-
    DHT node ID and node addresses to bootstrap the DHT with.
    \n-
    \n-[report issue]
    \n-
    dht_storage_constructor
    \n-
    function object to construct the storage object for DHT items.
    \n-
    \n-[report issue]
    \n-
    disk_io_constructor
    \n-
    function object to create the disk I/O subsystem. Defaults to\n-default_disk_io_constructor.
    \n-
    \n-[report issue]
    \n-
    ext_state
    \n-
    this container can be used by extensions/plugins to store settings. It's\n-primarily here to make it convenient to save and restore state across\n-sessions, using read_session_params() and write_session_params().
    \n-
    \n-[report issue]
    \n-
    ip_filter
    \n-
    the IP filter to use for the session. This restricts which peers are allowed\n-to connect. As if passed to set_ip_filter().
    \n-
    \n-\n-\n-[report issue]
    \n-
    \n-
    \n-

    write_session_params_buf() read_session_params() write_session_params()

    \n-

    Declared in "libtorrent/session_params.hpp"

    \n-
    \n-session_params read_session_params (bdecode_node const& e\n-   , save_state_flags_t flags = save_state_flags_t::all());\n-session_params read_session_params (span<char const> buf\n-   , save_state_flags_t flags = save_state_flags_t::all());\n-entry write_session_params (session_params const& sp\n-   , save_state_flags_t flags = save_state_flags_t::all());\n-std::vector<char> write_session_params_buf (session_params const& sp\n-   , save_state_flags_t flags = save_state_flags_t::all());\n-
    \n-

    These functions serialize and de-serialize a session_params object to and\n-from bencoded form. The session_params object is used to initialize a new\n-session using the state from a previous one (or by programmatically configure\n-the session up-front).\n-The flags parameter can be used to only save and load certain aspects of the\n-session's state.\n-The _buf suffix indicates the function operates on buffer rather than the\n-bencoded structure.\n-The torrents in a session are not part of the session_params state, they have\n-to be restored separately.

    \n-[report issue]
    \n-
    \n-

    ip_filter

    \n-

    Declared in "libtorrent/ip_filter.hpp"

    \n-

    The ip_filter class is a set of rules that uniquely categorizes all\n-ip addresses as allowed or disallowed. The default constructor creates\n-a single rule that allows all addresses (0.0.0.0 - 255.255.255.255 for\n-the IPv4 range, and the equivalent range covering all addresses for the\n-IPv6 range).

    \n-

    A default constructed ip_filter does not filter any address.

    \n-
    \n-struct ip_filter\n-{\n-   ip_filter& operator= (ip_filter&&);\n-   ~ip_filter ();\n-   ip_filter& operator= (ip_filter const&);\n-   ip_filter (ip_filter&&);\n-   ip_filter ();\n-   ip_filter (ip_filter const&);\n-   bool empty () const;\n-   void add_rule (address const& first, address const& last, std::uint32_t flags);\n-   std::uint32_t access (address const& addr) const;\n-   filter_tuple_t export_filter () const;\n-\n-   enum access_flags\n-   {\n-      blocked,\n-   };\n-};\n-
    \n-[report issue]
    \n-

    empty()

    \n-
    \n-bool empty () const;\n-
    \n-

    returns true if the filter does not contain any rules

    \n-[report issue]
    \n-
    \n-

    add_rule()

    \n-
    \n-void add_rule (address const& first, address const& last, std::uint32_t flags);\n-
    \n-

    Adds a rule to the filter. first and last defines a range of\n-ip addresses that will be marked with the given flags. The flags\n-can currently be 0, which means allowed, or ip_filter::blocked, which\n-means disallowed.

    \n-

    precondition:\n-first.is_v4() == last.is_v4() && first.is_v6() == last.is_v6()

    \n-

    postcondition:\n-access(x) == flags for every x in the range [first, last]

    \n-

    This means that in a case of overlapping ranges, the last one applied takes\n-precedence.

    \n-[report issue]
    \n-
    \n-

    access()

    \n-
    \n-std::uint32_t access (address const& addr) const;\n-
    \n-

    Returns the access permissions for the given address (addr). The permission\n-can currently be 0 or ip_filter::blocked. The complexity of this operation\n-is O(log n), where n is the minimum number of non-overlapping ranges to describe\n-the current filter.

    \n-[report issue]
    \n-
    \n-

    export_filter()

    \n-
    \n-filter_tuple_t export_filter () const;\n-
    \n-

    This function will return the current state of the filter in the minimum number of\n-ranges possible. They are sorted from ranges in low addresses to high addresses. Each\n-entry in the returned vector is a range with the access control specified in its\n-flags field.

    \n-

    The return value is a tuple containing two range-lists. One for IPv4 addresses\n-and one for IPv6 addresses.

    \n-[report issue]
    \n-
    \n-

    enum access_flags

    \n-

    Declared in "libtorrent/ip_filter.hpp"

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-
    namevaluedescription
    blocked1indicates that IPs in this range should not be connected\n-to nor accepted as incoming connections
    \n-[report issue]
    \n-
    \n-
    \n-

    port_filter

    \n-

    Declared in "libtorrent/ip_filter.hpp"

    \n-

    the port filter maps non-overlapping port ranges to flags. This\n-is primarily used to indicate whether a range of ports should\n-be connected to or not. The default is to have the full port\n-range (0-65535) set to flag 0.

    \n-
    \n-class port_filter\n-{\n-   ~port_filter ();\n-   port_filter (port_filter const&);\n-   port_filter& operator= (port_filter const&);\n-   port_filter (port_filter&&);\n-   port_filter ();\n-   port_filter& operator= (port_filter&&);\n-   void add_rule (std::uint16_t first, std::uint16_t last, std::uint32_t flags);\n-   std::uint32_t access (std::uint16_t port) const;\n-\n-   enum access_flags\n-   {\n-      blocked,\n-   };\n-};\n-
    \n-[report issue]
    \n-

    add_rule()

    \n-
    \n-void add_rule (std::uint16_t first, std::uint16_t last, std::uint32_t flags);\n-
    \n-

    set the flags for the specified port range (first, last) to\n-flags overwriting any existing rule for those ports. The range\n-is inclusive, i.e. the port last also has the flag set on it.

    \n-[report issue]
    \n-
    \n-

    access()

    \n-
    \n-std::uint32_t access (std::uint16_t port) const;\n-
    \n-

    test the specified port (port) for whether it is blocked\n-or not. The returned value is the flags set for this port.\n-see access_flags.

    \n-[report issue]
    \n-
    \n-

    enum access_flags

    \n-

    Declared in "libtorrent/ip_filter.hpp"

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-
    namevaluedescription
    blocked1this flag indicates that destination ports in the\n-range should not be connected to
    \n-[report issue]
    \n-
    \n-
    \n-

    bdecode_node

    \n-

    Declared in "libtorrent/bdecode.hpp"

    \n-

    Sometimes it's important to get a non-owning reference to the root node (\n-to be able to copy it as a reference for instance). For that, use the\n-non_owning() member function.

    \n-

    There are 5 different types of nodes, see type_t.

    \n-
    \n-struct bdecode_node\n-{\n-   bdecode_node () = default;\n-   bdecode_node& operator= (bdecode_node&&) & = default;\n-   bdecode_node (bdecode_node const&);\n-   bdecode_node (bdecode_node&&) noexcept;\n-   bdecode_node& operator= (bdecode_node const&) &;\n-   type_t type () const noexcept;\n-   explicit operator bool () const noexcept;\n-   bdecode_node non_owning () const;\n-   std::ptrdiff_t data_offset () const noexcept;\n-   span<char const> data_section () const noexcept;\n-   int list_size () const;\n-   string_view list_string_value_at (int i\n-      , string_view default_val = string_view()) const;\n-   std::int64_t list_int_value_at (int i\n-      , std::int64_t default_val = 0) const;\n-   bdecode_node list_at (int i) const;\n-   std::pair<string_view, bdecode_node> dict_at (int i) const;\n-   bdecode_node dict_find_dict (string_view key) const;\n-   bdecode_node dict_find_list (string_view key) const;\n-   bdecode_node dict_find_int (string_view key) const;\n-   string_view dict_find_string_value (string_view key\n-      , string_view default_value = string_view()) const;\n-   bdecode_node dict_find_string (string_view key) const;\n-   std::int64_t dict_find_int_value (string_view key\n-      , std::int64_t default_val = 0) const;\n-   int dict_size () const;\n-   bdecode_node dict_find (string_view key) const;\n-   std::pair<bdecode_node, bdecode_node> dict_at_node (int i) const;\n-   std::int64_t int_value () const;\n-   string_view string_value () const;\n-   std::ptrdiff_t string_offset () const;\n-   char const* string_ptr () const;\n-   int string_length () const;\n-   void clear ();\n-   void swap (bdecode_node& n);\n-   void reserve (int tokens);\n-   void switch_underlying_buffer (char const* buf) noexcept;\n-   bool has_soft_error (span<char> error) const;\n-\n-   enum type_t\n-   {\n-      none_t,\n-      dict_t,\n-      list_t,\n-      string_t,\n-      int_t,\n-   };\n-};\n-
    \n-[report issue]
    \n-

    bdecode_node()

    \n-
    \n-bdecode_node () = default;\n-
    \n-

    creates a default constructed node, it will have the type none_t.

    \n-\n-[report issue]
    \n-
    \n-

    bdecode_node() operator=()

    \n-
    \n-bdecode_node& operator= (bdecode_node&&) & = default;\n-bdecode_node (bdecode_node const&);\n-bdecode_node (bdecode_node&&) noexcept;\n-bdecode_node& operator= (bdecode_node const&) &;\n-
    \n-

    For owning nodes, the copy will create a copy of the tree, but the\n-underlying buffer remains the same.

    \n-[report issue]
    \n-
    \n-

    type()

    \n-
    \n-type_t type () const noexcept;\n-
    \n-

    the type of this node. See type_t.

    \n-[report issue]
    \n-
    \n-

    bool()

    \n-
    \n-explicit operator bool () const noexcept;\n-
    \n-

    returns true if type() != none_t.

    \n-[report issue]
    \n-
    \n-

    non_owning()

    \n-
    \n-bdecode_node non_owning () const;\n-
    \n-

    return a non-owning reference to this node. This is useful to refer to\n-the root node without copying it in assignments.

    \n-\n-[report issue]
    \n-
    \n-

    data_section() data_offset()

    \n-
    \n-std::ptrdiff_t data_offset () const noexcept;\n-span<char const> data_section () const noexcept;\n-
    \n-

    returns the buffer and length of the section in the original bencoded\n-buffer where this node is defined. For a dictionary for instance, this\n-starts with d and ends with e, and has all the content of the\n-dictionary in between.\n-the data_offset() function returns the byte-offset to this node in,\n-starting from the beginning of the buffer that was parsed.

    \n-\n-\n-\n-[report issue]
    \n-
    \n-

    list_at() list_int_value_at() list_string_value_at() list_size()

    \n-
    \n-int list_size () const;\n-string_view list_string_value_at (int i\n-      , string_view default_val = string_view()) const;\n-std::int64_t list_int_value_at (int i\n-      , std::int64_t default_val = 0) const;\n-bdecode_node list_at (int i) const;\n-
    \n-

    functions with the list_ prefix operate on lists. These functions are\n-only valid if type() == list_t. list_at() returns the item\n-in the list at index i. i may not be greater than or equal to the\n-size of the list. size() returns the size of the list.

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-[report issue]
    \n-
    \n-

    dict_find_string_value() dict_at() dict_at_node() dict_find() dict_find_list() dict_find_int_value() dict_size() dict_find_int() dict_find_string() dict_find_dict()

    \n-
    \n-std::pair<string_view, bdecode_node> dict_at (int i) const;\n-bdecode_node dict_find_dict (string_view key) const;\n-bdecode_node dict_find_list (string_view key) const;\n-bdecode_node dict_find_int (string_view key) const;\n-string_view dict_find_string_value (string_view key\n-      , string_view default_value = string_view()) const;\n-bdecode_node dict_find_string (string_view key) const;\n-std::int64_t dict_find_int_value (string_view key\n-      , std::int64_t default_val = 0) const;\n-int dict_size () const;\n-bdecode_node dict_find (string_view key) const;\n-std::pair<bdecode_node, bdecode_node> dict_at_node (int i) const;\n-
    \n-

    Functions with the dict_ prefix operates on dictionaries. They are\n-only valid if type() == dict_t. In case a key you're looking up\n-contains a 0 byte, you cannot use the 0-terminated string overloads,\n-but have to use string_view instead. dict_find_list will return a\n-valid bdecode_node if the key is found _and_ it is a list. Otherwise\n-it will return a default-constructed bdecode_node.

    \n-

    Functions with the _value suffix return the value of the node\n-directly, rather than the nodes. In case the node is not found, or it has\n-a different type, a default value is returned (which can be specified).

    \n-

    dict_at() returns the (key, value)-pair at the specified index in a\n-dictionary. Keys are only allowed to be strings. dict_at_node() also\n-returns the (key, value)-pair, but the key is returned as a\n-bdecode_node (and it will always be a string).

    \n-[report issue]
    \n-
    \n-

    int_value()

    \n-
    \n-std::int64_t int_value () const;\n-
    \n-

    this function is only valid if type() == int_t. It returns the\n-value of the integer.

    \n-\n-\n-\n-[report issue]
    \n-
    \n-

    string_offset() string_length() string_ptr() string_value()

    \n-
    \n-string_view string_value () const;\n-std::ptrdiff_t string_offset () const;\n-char const* string_ptr () const;\n-int string_length () const;\n-
    \n-

    these functions are only valid if type() == string_t. They return\n-the string values. Note that string_ptr() is not 0-terminated.\n-string_length() returns the number of bytes in the string.\n-string_offset() returns the byte offset from the start of the parsed\n-bencoded buffer this string can be found.

    \n-[report issue]
    \n-
    \n-

    clear()

    \n-
    \n-void clear ();\n-
    \n-

    resets the bdecoded_node to a default constructed state. If this is\n-an owning node, the tree is freed and all child nodes are invalidated.

    \n-[report issue]
    \n-
    \n-

    swap()

    \n-
    \n-void swap (bdecode_node& n);\n-
    \n-

    Swap contents.

    \n-[report issue]
    \n-
    \n-

    reserve()

    \n-
    \n-void reserve (int tokens);\n-
    \n-

    preallocate memory for the specified numbers of tokens. This is\n-useful if you know approximately how many tokens are in the file\n-you are about to parse. Doing so will save realloc operations\n-while parsing. You should only call this on the root node, before\n-passing it in to bdecode().

    \n-[report issue]
    \n-
    \n-

    switch_underlying_buffer()

    \n-
    \n-void switch_underlying_buffer (char const* buf) noexcept;\n-
    \n-

    this buffer MUST be identical to the one originally parsed. This\n-operation is only defined on owning root nodes, i.e. the one passed in to\n-decode().

    \n-[report issue]
    \n-
    \n-

    has_soft_error()

    \n-
    \n-bool has_soft_error (span<char> error) const;\n-
    \n-

    returns true if there is a non-fatal error in the bencoding of this node\n-or its children

    \n-[report issue]
    \n-
    \n-

    enum type_t

    \n-

    Declared in "libtorrent/bdecode.hpp"

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-
    namevaluedescription
    none_t0uninitialized or default constructed. This is also used\n-to indicate that a node was not found in some cases.
    dict_t1a dictionary node. The dict_find_ functions are valid.
    list_t2a list node. The list_ functions are valid.
    string_t3a string node, the string_ functions are valid.
    int_t4an integer node. The int_ functions are valid.
    \n-[report issue]
    \n-
    \n-
    \n-

    print_entry()

    \n-

    Declared in "libtorrent/bdecode.hpp"

    \n-
    \n-std::string print_entry (bdecode_node const& e\n-   , bool single_line = false, int indent = 0);\n-
    \n-

    print the bencoded structure in a human-readable format to a string\n-that's returned.

    \n-[report issue]
    \n-
    \n-

    bdecode()

    \n-

    Declared in "libtorrent/bdecode.hpp"

    \n-
    \n-int bdecode (char const* start, char const* end, bdecode_node& ret\n-   , error_code& ec, int* error_pos = nullptr, int depth_limit = 100\n-   , int token_limit = 2000000);\n-bdecode_node bdecode (span<char const> buffer\n-   , int depth_limit = 100, int token_limit = 2000000);\n-bdecode_node bdecode (span<char const> buffer\n-   , error_code& ec, int* error_pos = nullptr, int depth_limit = 100\n-   , int token_limit = 2000000);\n-
    \n-

    This function decodes/parses bdecoded data (for example a .torrent file).\n-The data structure is returned in the ret argument. the buffer to parse\n-is specified by the start of the buffer as well as the end, i.e. one\n-byte past the end. If the buffer fails to parse, the function returns a\n-non-zero value and fills in ec with the error code. The optional\n-argument error_pos, if set to non-nullptr, will be set to the byte offset\n-into the buffer where the parse failure occurred.

    \n-

    depth_limit specifies the max number of nested lists or dictionaries are\n-allowed in the data structure. (This affects the stack usage of the\n-function, be careful not to set it too high).

    \n-

    token_limit is the max number of tokens allowed to be parsed from the\n-buffer. This is simply a sanity check to not have unbounded memory usage.

    \n-

    The resulting bdecode_node is an owning node. That means it will\n-be holding the whole parsed tree. When iterating lists and dictionaries,\n-those bdecode_node objects will simply have references to the root or\n-owning bdecode_node. If the root node is destructed, all other nodes\n-that refer to anything in that tree become invalid.

    \n-

    However, the underlying buffer passed in to this function (start, end)\n-must also remain valid while the bdecoded tree is used. The parsed tree\n-produced by this function does not copy any data out of the buffer, but\n-simply produces references back into it.

    \n-[report issue]
    \n-
    \n-

    hasher

    \n-

    Declared in "libtorrent/hasher.hpp"

    \n-

    this is a SHA-1 hash class.

    \n-

    You use it by first instantiating it, then call update() to feed it\n-with data. i.e. you don't have to keep the entire buffer of which you want to\n-create the hash in memory. You can feed the hasher parts of it at a time. When\n-You have fed the hasher with all the data, you call final() and it\n-will return the sha1-hash of the data.

    \n-

    The constructor that takes a char const* and an integer will construct the\n-sha1 context and feed it the data passed in.

    \n-

    If you want to reuse the hasher object once you have created a hash, you have to\n-call reset() to reinitialize it.

    \n-

    The built-in software version of sha1-algorithm was implemented\n-by Steve Reid and released as public domain.\n-For more info, see src/sha1.cpp.

    \n-
    \n-class hasher\n-{\n-   hasher ();\n-   hasher& operator= (hasher const&) &;\n-   hasher (char const* data, int len);\n-   hasher (hasher const&);\n-   explicit hasher (span<char const> data);\n-   hasher& update (span<char const> data);\n-   hasher& update (char const* data, int len);\n-   sha1_hash final ();\n-   void reset ();\n-};\n-
    \n-\n-[report issue]
    \n-

    operator=() hasher()

    \n-
    \n-hasher& operator= (hasher const&) &;\n-hasher (char const* data, int len);\n-hasher (hasher const&);\n-explicit hasher (span<char const> data);\n-
    \n-

    this is the same as default constructing followed by a call to\n-update(data, len).

    \n-[report issue]
    \n-
    \n-

    update()

    \n-
    \n-hasher& update (span<char const> data);\n-hasher& update (char const* data, int len);\n-
    \n-

    append the following bytes to what is being hashed

    \n-[report issue]
    \n-
    \n-

    final()

    \n-
    \n-sha1_hash final ();\n-
    \n-

    returns the SHA-1 digest of the buffers previously passed to\n-update() and the hasher constructor.

    \n-[report issue]
    \n-
    \n-

    reset()

    \n-
    \n-void reset ();\n-
    \n-

    restore the hasher state to be as if the hasher has just been\n-default constructed.

    \n-[report issue]
    \n-
    \n-
    \n-

    hasher256

    \n-

    Declared in "libtorrent/hasher.hpp"

    \n-
    \n-class hasher256\n-{\n-   hasher256 ();\n-   hasher256& operator= (hasher256 const&) &;\n-   hasher256 (char const* data, int len);\n-   explicit hasher256 (span<char const> data);\n-   hasher256 (hasher256 const&);\n-   hasher256& update (span<char const> data);\n-   hasher256& update (char const* data, int len);\n-   sha256_hash final ();\n-   void reset ();\n-   ~hasher256 ();\n-};\n-
    \n-\n-[report issue]
    \n-

    hasher256() operator=()

    \n-
    \n-hasher256& operator= (hasher256 const&) &;\n-hasher256 (char const* data, int len);\n-explicit hasher256 (span<char const> data);\n-hasher256 (hasher256 const&);\n-
    \n-

    this is the same as default constructing followed by a call to\n-update(data, len).

    \n-[report issue]
    \n-
    \n-

    update()

    \n-
    \n-hasher256& update (span<char const> data);\n-hasher256& update (char const* data, int len);\n-
    \n-

    append the following bytes to what is being hashed

    \n-[report issue]
    \n-
    \n-

    final()

    \n-
    \n-sha256_hash final ();\n-
    \n-

    returns the SHA-1 digest of the buffers previously passed to\n-update() and the hasher constructor.

    \n-[report issue]
    \n-
    \n-

    reset()

    \n-
    \n-void reset ();\n-
    \n-

    restore the hasher state to be as if the hasher has just been\n-default constructed.

    \n-[report issue]
    \n-
    \n-
    \n-

    bitfield

    \n-

    Declared in "libtorrent/bitfield.hpp"

    \n-

    The bitfield type stores any number of bits as a bitfield\n-in a heap allocated array.

    \n-
    \n-struct bitfield\n-{\n-   bitfield () noexcept = default;\n-   bitfield (char const* b, int bits);\n-   bitfield (bitfield&& rhs) noexcept = default;\n-   explicit bitfield (int bits);\n-   bitfield (int bits, bool val);\n-   bitfield (bitfield const& rhs);\n-   void assign (char const* b, int const bits);\n-   bool get_bit (int index) const noexcept;\n-   bool operator[] (int index) const noexcept;\n-   void set_bit (int index) noexcept;\n-   void clear_bit (int index) noexcept;\n-   bool all_set () const noexcept;\n-   bool none_set () const noexcept;\n-   int size () const noexcept;\n-   int num_words () const noexcept;\n-   int num_bytes () const noexcept;\n-   bool empty () const noexcept;\n-   char* data () noexcept;\n-   char const* data () const noexcept;\n-   void swap (bitfield& rhs) noexcept;\n-   int count () const noexcept;\n-   int find_first_set () const noexcept;\n-   int find_last_clear () const noexcept;\n-   bool operator== (lt::bitfield const& rhs) const;\n-};\n-
    \n-[report issue]
    \n-

    bitfield()

    \n-
    \n-bitfield () noexcept = default;\n-bitfield (char const* b, int bits);\n-bitfield (bitfield&& rhs) noexcept = default;\n-explicit bitfield (int bits);\n-bitfield (int bits, bool val);\n-bitfield (bitfield const& rhs);\n-
    \n-

    constructs a new bitfield. The default constructor creates an empty\n-bitfield. bits is the size of the bitfield (specified in bits).\n-val is the value to initialize the bits to. If not specified\n-all bits are initialized to 0.

    \n-

    The constructor taking a pointer b and bits copies a bitfield\n-from the specified buffer, and bits number of bits (rounded up to\n-the nearest byte boundary).

    \n-[report issue]
    \n-
    \n-

    assign()

    \n-
    \n-void assign (char const* b, int const bits);\n-
    \n-

    copy bitfield from buffer b of bits number of bits, rounded up to\n-the nearest byte boundary.

    \n-\n-[report issue]
    \n-
    \n-

    operator[]() get_bit()

    \n-
    \n-bool get_bit (int index) const noexcept;\n-bool operator[] (int index) const noexcept;\n-
    \n-

    query bit at index. Returns true if bit is 1, otherwise false.

    \n-\n-[report issue]
    \n-
    \n-

    clear_bit() set_bit()

    \n-
    \n-void set_bit (int index) noexcept;\n-void clear_bit (int index) noexcept;\n-
    \n-

    set bit at index to 0 (clear_bit) or 1 (set_bit).

    \n-[report issue]
    \n-
    \n-

    all_set()

    \n-
    \n-bool all_set () const noexcept;\n-
    \n-

    returns true if all bits in the bitfield are set

    \n-[report issue]
    \n-
    \n-

    none_set()

    \n-
    \n-bool none_set () const noexcept;\n-
    \n-

    returns true if no bit in the bitfield is set

    \n-[report issue]
    \n-
    \n-

    size()

    \n-
    \n-int size () const noexcept;\n-
    \n-

    returns the size of the bitfield in bits.

    \n-[report issue]
    \n-
    \n-

    num_words()

    \n-
    \n-int num_words () const noexcept;\n-
    \n-

    returns the number of 32 bit words are needed to represent all bits in\n-this bitfield.

    \n-[report issue]
    \n-
    \n-

    num_bytes()

    \n-
    \n-int num_bytes () const noexcept;\n-
    \n-

    returns the number of bytes needed to represent all bits in this\n-bitfield

    \n-[report issue]
    \n-
    \n-

    empty()

    \n-
    \n-bool empty () const noexcept;\n-
    \n-

    returns true if the bitfield has zero size.

    \n-[report issue]
    \n-
    \n-

    data()

    \n-
    \n-char* data () noexcept;\n-char const* data () const noexcept;\n-
    \n-

    returns a pointer to the internal buffer of the bitfield, or\n-nullptr if it's empty.

    \n-[report issue]
    \n-
    \n-

    swap()

    \n-
    \n-void swap (bitfield& rhs) noexcept;\n-
    \n-

    swaps the bit-fields two variables refer to

    \n-[report issue]
    \n-
    \n-

    count()

    \n-
    \n-int count () const noexcept;\n-
    \n-

    count the number of bits in the bitfield that are set to 1.

    \n-[report issue]
    \n-
    \n-

    find_first_set()

    \n-
    \n-int find_first_set () const noexcept;\n-
    \n-

    returns the index of the first set bit in the bitfield, i.e. 1 bit.

    \n-[report issue]
    \n-
    \n-

    find_last_clear()

    \n-
    \n-int find_last_clear () const noexcept;\n-
    \n-

    returns the index to the last cleared bit in the bitfield, i.e. 0 bit.

    \n

    The pop_alerts() function on session is the main interface for retrieving\n alerts (warnings, messages and errors from libtorrent). If no alerts have\n been posted by libtorrent pop_alerts() will return an empty list.

    \n

    By default, only errors are reported. settings_pack::alert_mask can be\n used to specify which kinds of events should be reported. The alert mask is\n a combination of the alert_category_t flags in the alert class.

    \n

    Every alert belongs to one or more category. There is a cost associated with\n@@ -5644,14 +795,121 @@\n

    There are other alert base classes that some alerts derive from, all the\n alerts that are generated for a specific torrent are derived from\n torrent_alert, and tracker events derive from tracker_alert.

    \n

    Alerts returned by pop_alerts() are only valid until the next call to\n pop_alerts(). You may not copy an alert object to access it after the next\n call to pop_alerts(). Internal members of alerts also become invalid once\n pop_alerts() is called again.

    \n+[report issue]
    \n+

    alert

    \n+

    Declared in "libtorrent/alert.hpp"

    \n+

    The alert class is the base class that specific messages are derived from.\n+alert types are not copyable, and cannot be constructed by the client. The\n+pointers returned by libtorrent are short lived (the details are described\n+under session_handle::pop_alerts())

    \n+
    \n+struct alert\n+{\n+   time_point timestamp () const;\n+   virtual int type () const noexcept = 0;\n+   virtual char const* what () const noexcept = 0;\n+   virtual std::string message () const = 0;\n+   virtual alert_category_t category () const noexcept = 0;\n+\n+   static constexpr alert_category_t error_notification  = 0_bit;\n+   static constexpr alert_category_t peer_notification  = 1_bit;\n+   static constexpr alert_category_t port_mapping_notification  = 2_bit;\n+   static constexpr alert_category_t storage_notification  = 3_bit;\n+   static constexpr alert_category_t tracker_notification  = 4_bit;\n+   static constexpr alert_category_t connect_notification  = 5_bit;\n+   static constexpr alert_category_t status_notification  = 6_bit;\n+   static constexpr alert_category_t ip_block_notification  = 8_bit;\n+   static constexpr alert_category_t performance_warning  = 9_bit;\n+   static constexpr alert_category_t dht_notification  = 10_bit;\n+   static constexpr alert_category_t session_log_notification  = 13_bit;\n+   static constexpr alert_category_t torrent_log_notification  = 14_bit;\n+   static constexpr alert_category_t peer_log_notification  = 15_bit;\n+   static constexpr alert_category_t incoming_request_notification  = 16_bit;\n+   static constexpr alert_category_t dht_log_notification  = 17_bit;\n+   static constexpr alert_category_t dht_operation_notification  = 18_bit;\n+   static constexpr alert_category_t port_mapping_log_notification  = 19_bit;\n+   static constexpr alert_category_t picker_log_notification  = 20_bit;\n+   static constexpr alert_category_t file_progress_notification  = 21_bit;\n+   static constexpr alert_category_t piece_progress_notification  = 22_bit;\n+   static constexpr alert_category_t upload_notification  = 23_bit;\n+   static constexpr alert_category_t block_progress_notification  = 24_bit;\n+   static constexpr alert_category_t all_categories  = alert_category_t::all();\n+};\n+
    \n+[report issue]
    \n+

    timestamp()

    \n+
    \n+time_point timestamp () const;\n+
    \n+

    a timestamp is automatically created in the constructor

    \n+[report issue]
    \n+
    \n+

    type()

    \n+
    \n+virtual int type () const noexcept = 0;\n+
    \n+

    returns an integer that is unique to this alert type. It can be\n+compared against a specific alert by querying a static constant called alert_type\n+in the alert. It can be used to determine the run-time type of an alert* in\n+order to cast to that alert type and access specific members.

    \n+

    e.g:

    \n+
    \n+std::vector<alert*> alerts;\n+ses.pop_alerts(&alerts);\n+for (alert* a : alerts) {\n+        switch (a->type()) {\n+\n+                case read_piece_alert::alert_type:\n+                {\n+                        auto* p = static_cast<read_piece_alert*>(a);\n+                        if (p->ec) {\n+                                // read_piece failed\n+                                break;\n+                        }\n+                        // use p\n+                        break;\n+                }\n+                case file_renamed_alert::alert_type:\n+                {\n+                        // etc...\n+                }\n+        }\n+}\n+
    \n+[report issue]
    \n+
    \n+

    what()

    \n+
    \n+virtual char const* what () const noexcept = 0;\n+
    \n+

    returns a string literal describing the type of the alert. It does\n+not include any information that might be bundled with the alert.

    \n+[report issue]
    \n+
    \n+

    message()

    \n+
    \n+virtual std::string message () const = 0;\n+
    \n+

    generate a string describing the alert and the information bundled\n+with it. This is mainly intended for debug and development use. It is not suitable\n+to use this for applications that may be localized. Instead, handle each alert\n+type individually and extract and render the information from the alert depending\n+on the locale.

    \n+[report issue]
    \n+
    \n+

    category()

    \n+
    \n+virtual alert_category_t category () const noexcept = 0;\n+
    \n+

    returns a bitmask specifying which categories this alert belong to.

    \n [report issue]
    \n
    \n
    \n

    dht_routing_bucket

    \n

    Declared in "libtorrent/alert_types.hpp"

    \n

    struct to hold information about a single DHT routing table bucket

    \n
    \n@@ -5685,15 +943,15 @@\n {\n    std::string message () const override;\n    char const* torrent_name () const;\n \n    torrent_handle handle;\n };\n 
    \n-[report issue]
    \n+[report issue]
    \n

    message()

    \n
    \n std::string message () const override;\n 
    \n

    returns the message associated with this alert

    \n [report issue]
    \n
    handle
    \n@@ -7509,15 +2767,15 @@\n {\n std::string message () const override;\n span<std::int64_t const> counters () const;\n \n static constexpr alert_category_t static_category = {};\n };\n \n-[report issue]
    \n+[report issue]
    \n

    counters()

    \n
    \n span<std::int64_t const> counters () const;\n 
    \n

    An array are a mix of counters and gauges, which meanings can be\n queries via the session_stats_metrics() function on the session. The\n mapping from a specific metric to an index into this array is constant\n@@ -8025,1066 +3283,4181 @@\n

    the log message

    \n [report issue]
    \n
    \n

    enum dht_module_t

    \n

    Declared in "libtorrent/alert_types.hpp"

    \n \n \n-\n-\n-\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    namevaluedescription
    tracker0 
    node1 
    routing_table2 
    rpc_manager3 
    traversal4 
    \n+[report issue]
    \n+
    module
    \n+
    the module, or part, of the DHT that produced this log message.
    \n+
    \n+[report issue]
    \n+
    \n+
    \n+

    dht_pkt_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    This alert is posted every time a DHT message is sent or received. It is\n+only posted if the alert_category::dht_log alert category is\n+enabled. It contains a verbatim copy of the message.

    \n+
    \n+struct dht_pkt_alert final : alert\n+{\n+   std::string message () const override;\n+   span<char const> pkt_buf () const;\n+\n+   enum direction_t\n+   {\n+      incoming,\n+      outgoing,\n+   };\n+\n+   static constexpr alert_category_t static_category  = alert_category::dht_log;\n+   direction_t direction;\n+   aux::noexcept_movable<udp::endpoint> node;\n+};\n+
    \n+[report issue]
    \n+

    pkt_buf()

    \n+
    \n+span<char const> pkt_buf () const;\n+
    \n+

    returns a pointer to the packet buffer and size of the packet,\n+respectively. This buffer is only valid for as long as the alert itself\n+is valid, which is owned by libtorrent and reclaimed whenever\n+pop_alerts() is called on the session.

    \n+[report issue]
    \n+
    \n+

    enum direction_t

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    namevaluedescription
    incoming0 
    outgoing1 
    \n+[report issue]
    \n+
    direction
    \n+
    whether this is an incoming or outgoing packet.
    \n+
    \n+[report issue]
    \n+
    node
    \n+
    the DHT node we received this packet from, or sent this packet to\n+(depending on direction).
    \n+
    \n+[report issue]
    \n+
    \n+
    \n+

    dht_get_peers_reply_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    Posted when we receive a response to a DHT get_peers request.

    \n+
    \n+struct dht_get_peers_reply_alert final : alert\n+{\n+   std::string message () const override;\n+   int num_peers () const;\n+   std::vector<tcp::endpoint> peers () const;\n+\n+   static constexpr alert_category_t static_category  = alert_category::dht_operation;\n+   sha1_hash info_hash;\n+};\n+
    \n+[report issue]
    \n+
    \n+

    dht_direct_response_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    This is posted exactly once for every call to session_handle::dht_direct_request.\n+If the request failed, response() will return a default constructed bdecode_node.

    \n+
    \n+struct dht_direct_response_alert final : alert\n+{\n+   std::string message () const override;\n+   bdecode_node response () const;\n+\n+   static constexpr alert_category_t static_category  = alert_category::dht;\n+   client_data_t userdata;\n+   aux::noexcept_movable<udp::endpoint> endpoint;\n+};\n+
    \n+[report issue]
    \n+
    \n+

    picker_log_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    this is posted when one or more blocks are picked by the piece picker,\n+assuming the verbose piece picker logging is enabled (see\n+alert_category::picker_log).

    \n+
    \n+struct picker_log_alert final : peer_alert\n+{\n+   std::string message () const override;\n+   std::vector<piece_block> blocks () const;\n+\n+   static constexpr alert_category_t static_category  = alert_category::picker_log;\n+   static constexpr picker_flags_t partial_ratio  = 0_bit;\n+   static constexpr picker_flags_t prioritize_partials  = 1_bit;\n+   static constexpr picker_flags_t rarest_first_partials  = 2_bit;\n+   static constexpr picker_flags_t rarest_first  = 3_bit;\n+   static constexpr picker_flags_t reverse_rarest_first  = 4_bit;\n+   static constexpr picker_flags_t suggested_pieces  = 5_bit;\n+   static constexpr picker_flags_t prio_sequential_pieces  = 6_bit;\n+   static constexpr picker_flags_t sequential_pieces  = 7_bit;\n+   static constexpr picker_flags_t reverse_pieces  = 8_bit;\n+   static constexpr picker_flags_t time_critical  = 9_bit;\n+   static constexpr picker_flags_t random_pieces  = 10_bit;\n+   static constexpr picker_flags_t prefer_contiguous  = 11_bit;\n+   static constexpr picker_flags_t reverse_sequential  = 12_bit;\n+   static constexpr picker_flags_t backup1  = 13_bit;\n+   static constexpr picker_flags_t backup2  = 14_bit;\n+   static constexpr picker_flags_t end_game  = 15_bit;\n+   static constexpr picker_flags_t extent_affinity  = 16_bit;\n+   picker_flags_t const picker_flags;\n+};\n+
    \n+[report issue]
    \n+
    picker_flags
    \n+
    this is a bitmask of which features were enabled for this particular\n+pick. The bits are defined in the picker_flags_t enum.
    \n+
    \n+[report issue]
    \n+
    \n+

    session_error_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    this alert is posted when the session encounters a serious error,\n+potentially fatal

    \n+
    \n+struct session_error_alert final : alert\n+{\n+   std::string message () const override;\n+\n+   static constexpr alert_category_t static_category  = alert_category::error;\n+   error_code const error;\n+};\n+
    \n+[report issue]
    \n+
    error
    \n+
    The error code, if one is associated with this error
    \n+
    \n+[report issue]
    \n+
    \n+

    dht_live_nodes_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    posted in response to a call to session::dht_live_nodes(). It contains the\n+live nodes from the DHT routing table of one of the DHT nodes running\n+locally.

    \n+
    \n+struct dht_live_nodes_alert final : alert\n+{\n+   std::string message () const override;\n+   int num_nodes () const;\n+   std::vector<std::pair<sha1_hash, udp::endpoint>> nodes () const;\n+\n+   static constexpr alert_category_t static_category  = alert_category::dht;\n+   sha1_hash node_id;\n+};\n+
    \n+\n+[report issue]
    \n+

    num_nodes() nodes()

    \n+
    \n+int num_nodes () const;\n+std::vector<std::pair<sha1_hash, udp::endpoint>> nodes () const;\n+
    \n+

    the number of nodes in the routing table and the actual nodes.

    \n+[report issue]
    \n+
    node_id
    \n+
    the local DHT node's node-ID this routing table belongs to
    \n+
    \n+[report issue]
    \n+
    \n+
    \n+

    session_stats_header_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    The session_stats_header alert is posted the first time\n+post_session_stats() is called

    \n+

    the message() member function returns a string representation of the\n+header that properly match the stats values string returned in\n+session_stats_alert::message().

    \n+

    this specific output is parsed by tools/parse_session_stats.py\n+if this is changed, that parser should also be changed

    \n+
    \n+struct session_stats_header_alert final : alert\n+{\n+   std::string message () const override;\n+\n+   static constexpr alert_category_t static_category  = {};\n+};\n+
    \n+[report issue]
    \n+
    \n+

    dht_sample_infohashes_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    posted as a response to a call to session::dht_sample_infohashes() with\n+the information from the DHT response message.

    \n+
    \n+struct dht_sample_infohashes_alert final : alert\n+{\n+   std::string message () const override;\n+   int num_samples () const;\n+   std::vector<sha1_hash> samples () const;\n+   int num_nodes () const;\n+   std::vector<std::pair<sha1_hash, udp::endpoint>> nodes () const;\n+\n+   static constexpr alert_category_t static_category  = alert_category::dht_operation;\n+   sha1_hash node_id;\n+   aux::noexcept_movable<udp::endpoint> endpoint;\n+   time_duration const interval;\n+   int const num_infohashes;\n+};\n+
    \n+\n+[report issue]
    \n+

    samples() num_samples()

    \n+
    \n+int num_samples () const;\n+std::vector<sha1_hash> samples () const;\n+
    \n+

    returns the number of info-hashes returned by the node, as well as the\n+actual info-hashes. num_samples() is more efficient than\n+samples().size().

    \n+[report issue]
    \n+
    \n+

    num_nodes()

    \n+
    \n+int num_nodes () const;\n+
    \n+

    The total number of nodes returned by nodes().

    \n+[report issue]
    \n+
    \n+

    nodes()

    \n+
    \n+std::vector<std::pair<sha1_hash, udp::endpoint>> nodes () const;\n+
    \n+

    This is the set of more DHT nodes returned by the request.

    \n+

    The information is included so that indexing nodes can perform a key\n+space traversal with a single RPC per node by adjusting the target\n+value for each RPC.

    \n+[report issue]
    \n+
    node_id
    \n+
    id of the node the request was sent to (and this response was received from)
    \n+
    \n+[report issue]
    \n+
    endpoint
    \n+
    the node the request was sent to (and this response was received from)
    \n+
    \n+[report issue]
    \n+
    interval
    \n+
    the interval to wait before making another request to this node
    \n+
    \n+[report issue]
    \n+
    num_infohashes
    \n+
    This field indicates how many info-hash keys are currently in the node's storage.\n+If the value is larger than the number of returned samples it indicates that the\n+indexer may obtain additional samples after waiting out the interval.
    \n+
    \n+[report issue]
    \n+
    \n+
    \n+

    block_uploaded_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    This alert is posted when a block intended to be sent to a peer is placed in the\n+send buffer. Note that if the connection is closed before the send buffer is sent,\n+the alert may be posted without the bytes having been sent to the peer.\n+It belongs to the alert_category::upload category.

    \n+
    \n+struct block_uploaded_alert final : peer_alert\n+{\n+   std::string message () const override;\n+\n+   int const block_index;\n+   piece_index_t const piece_index;\n+};\n+
    \n+[report issue]
    \n+
    \n+

    alerts_dropped_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    this alert is posted to indicate to the client that some alerts were\n+dropped. Dropped meaning that the alert failed to be delivered to the\n+client. The most common cause of such failure is that the internal alert\n+queue grew too big (controlled by alert_queue_size).

    \n+
    \n+struct alerts_dropped_alert final : alert\n+{\n+   std::string message () const override;\n+   static_assert (num_alert_types <= abi_alert_count, "need to increase bitset. This is an ABI break");\n+\n+   static constexpr alert_category_t static_category  = alert_category::error;\n+   std::bitset<abi_alert_count> dropped_alerts;\n+};\n+
    \n+[report issue]
    \n+
    dropped_alerts
    \n+
    a bitmask indicating which alerts were dropped. Each bit represents the\n+alert type ID, where bit 0 represents whether any alert of type 0 has\n+been dropped, and so on.
    \n+
    \n+[report issue]
    \n+
    \n+

    socks5_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    this alert is posted with SOCKS5 related errors, when a SOCKS5 proxy is\n+configured. It's enabled with the alert_category::error alert category.

    \n+
    \n+struct socks5_alert final : alert\n+{\n+   std::string message () const override;\n+\n+   static constexpr alert_category_t static_category  = alert_category::error;\n+   error_code error;\n+   operation_t op;\n+   aux::noexcept_movable<tcp::endpoint> ip;\n+};\n+
    \n+[report issue]
    \n+
    error
    \n+
    the error
    \n+
    \n+[report issue]
    \n+
    op
    \n+
    the operation that failed
    \n+
    \n+[report issue]
    \n+
    ip
    \n+
    the endpoint configured as the proxy
    \n+
    \n+[report issue]
    \n+
    \n+

    file_prio_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    posted when a prioritize_files() or file_priority() update of the file\n+priorities complete, which requires a round-trip to the disk thread.

    \n+

    If the disk operation fails this alert won't be posted, but a\n+file_error_alert is posted instead, and the torrent is stopped.

    \n+
    \n+struct file_prio_alert final : torrent_alert\n+{\n+   std::string message () const override;\n+\n+   static constexpr alert_category_t static_category  = alert_category::storage;\n+   error_code error;\n+   operation_t op;\n+};\n+
    \n+[report issue]
    \n+
    error
    \n+
    the error
    \n+
    \n+[report issue]
    \n+
    op
    \n+
    the operation that failed
    \n+
    \n+[report issue]
    \n+
    \n+

    oversized_file_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    this alert may be posted when the initial checking of resume data and files\n+on disk (just existence, not piece hashes) completes. If a file belonging\n+to the torrent is found on disk, but is larger than the file in the\n+torrent, that's when this alert is posted.\n+the client may want to call truncate_files() in that case, or perhaps\n+interpret it as a sign that some other file is in the way, that shouldn't\n+be overwritten.

    \n+
    \n+struct oversized_file_alert final : torrent_alert\n+{\n+   std::string message () const override;\n+\n+   static constexpr alert_category_t static_category  = alert_category::storage;\n+};\n+
    \n+[report issue]
    \n+
    \n+

    torrent_conflict_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    this alert is posted when two separate torrents (magnet links) resolve to\n+the same torrent, thus causing the same torrent being added twice. In\n+that case, both torrents enter an error state with duplicate_torrent\n+as the error code. This alert is posted containing the metadata. For more\n+information, see BitTorrent v2 torrents.\n+The torrent this alert originated from was the one that downloaded the

    \n+

    metadata (i.e. the handle member from the torrent_alert base class).

    \n+
    \n+struct torrent_conflict_alert final : torrent_alert\n+{\n+   std::string message () const override;\n+\n+   static constexpr alert_category_t static_category  = alert_category::error;\n+   torrent_handle conflicting_torrent;\n+   std::shared_ptr<torrent_info> metadata;\n+};\n+
    \n+[report issue]
    \n+
    conflicting_torrent
    \n+
    the handle to the torrent in conflict. The swarm associated with this\n+torrent handle did not download the metadata, but the downloaded\n+metadata collided with this swarm's info-hash.
    \n+
    \n+[report issue]
    \n+
    metadata
    \n+
    the metadata that was received by one of the torrents in conflict.\n+One way to resolve the conflict is to remove both failing torrents\n+and re-add it using this metadata
    \n+
    \n+[report issue]
    \n+
    \n+

    peer_info_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    posted when torrent_handle::post_peer_info() is called

    \n+
    \n+struct peer_info_alert final : torrent_alert\n+{\n+   std::string message () const override;\n+\n+   static constexpr alert_category_t static_category  = alert_category::status;\n+   std::vector<lt::peer_info> peer_info;\n+};\n+
    \n+[report issue]
    \n+
    peer_info
    \n+
    the list of the currently connected peers
    \n+
    \n+[report issue]
    \n+
    \n+

    file_progress_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    posted when torrent_handle::post_file_progress() is called

    \n+
    \n+struct file_progress_alert final : torrent_alert\n+{\n+   std::string message () const override;\n+\n+   static constexpr alert_category_t static_category  = alert_category::file_progress;\n+   aux::vector<std::int64_t, file_index_t> files;\n+};\n+
    \n+[report issue]
    \n+
    files
    \n+
    the list of the files in the torrent
    \n+
    \n+[report issue]
    \n+
    \n+

    piece_info_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    posted when torrent_handle::post_download_queue() is called

    \n+
    \n+struct piece_info_alert final : torrent_alert\n+{\n+   std::string message () const override;\n+\n+   static constexpr alert_category_t static_category  = alert_category::piece_progress;\n+   std::vector<partial_piece_info> piece_info;\n+   std::vector<block_info> block_data;\n+};\n+
    \n+[report issue]
    \n+
    piece_info
    \n+
    info about pieces being downloaded for the torrent
    \n+
    \n+[report issue]
    \n+
    block_data
    \n+
    storage for block_info pointers in partial_piece_info objects
    \n+
    \n+[report issue]
    \n+
    \n+

    piece_availability_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    posted when torrent_handle::post_piece_availability() is called

    \n+
    \n+struct piece_availability_alert final : torrent_alert\n+{\n+   std::string message () const override;\n+\n+   static constexpr alert_category_t static_category  = alert_category::status;\n+   std::vector<int> piece_availability;\n+};\n+
    \n+[report issue]
    \n+
    piece_availability
    \n+
    info about pieces being downloaded for the torrent
    \n+
    \n+[report issue]
    \n+
    \n+

    tracker_list_alert

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+

    posted when torrent_handle::post_trackers() is called

    \n+
    \n+struct tracker_list_alert final : torrent_alert\n+{\n+   std::string message () const override;\n+\n+   static constexpr alert_category_t static_category  = alert_category::status;\n+   std::vector<announce_entry> trackers;\n+};\n+
    \n+[report issue]
    \n+
    trackers
    \n+
    list of trackers and their status for the torrent
    \n+
    \n+[report issue]
    \n+
    \n+

    operation_name()

    \n+

    Declared in "libtorrent/operations.hpp"

    \n+
    \n+char const* operation_name (operation_t op);\n+
    \n+

    maps an operation id (from peer_error_alert and peer_disconnected_alert)\n+to its name. See operation_t for the constants

    \n+[report issue]
    \n+
    \n+

    alert_cast()

    \n+

    Declared in "libtorrent/alert.hpp"

    \n+
    \n+template <typename T> T* alert_cast (alert* a);\n+template <typename T> T const* alert_cast (alert const* a);\n+
    \n+

    When you get an alert, you can use alert_cast<> to attempt to cast the\n+pointer to a specific alert type, in order to query it for more\n+information.

    \n+
    \n+

    Note

    \n+

    alert_cast<> can only cast to an exact alert type, not a base class

    \n+
    \n+[report issue]
    \n+
    \n+

    enum operation_t

    \n+

    Declared in "libtorrent/operations.hpp"

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    namevaluedescription
    unknown0the error was unexpected and it is unknown which operation caused it
    bittorrent1this is used when the bittorrent logic\n+determines to disconnect
    iocontrol2a call to iocontrol failed
    getpeername3a call to getpeername() failed (querying the remote IP of a\n+connection)
    getname4a call to getname failed (querying the local IP of a\n+connection)
    alloc_recvbuf5an attempt to allocate a receive buffer failed
    alloc_sndbuf6an attempt to allocate a send buffer failed
    file_write7writing to a file failed
    file_read8reading from a file failed
    file9a non-read and non-write file operation failed
    sock_write10a socket write operation failed
    sock_read11a socket read operation failed
    sock_open12a call to open(), to create a socket socket failed
    sock_bind13a call to bind() on a socket failed
    available14an attempt to query the number of bytes available to read from a socket\n+failed
    encryption15a call related to bittorrent protocol encryption failed
    connect16an attempt to connect a socket failed
    ssl_handshake17establishing an SSL connection failed
    get_interface18a connection failed to satisfy the bind interface setting
    sock_listen19a call to listen() on a socket
    sock_bind_to_device20a call to the ioctl to bind a socket to a specific network device or\n+adapter
    sock_accept21a call to accept() on a socket
    parse_address22convert a string into a valid network address
    enum_if23enumeration network devices or adapters
    file_stat24invoking stat() on a file
    file_copy25copying a file
    file_fallocate26allocating storage for a file
    file_hard_link27creating a hard link
    file_remove28removing a file
    file_rename29renaming a file
    file_open30opening a file
    mkdir31creating a directory
    check_resume32check fast resume data against files on disk
    exception33an unknown exception
    alloc_cache_piece34allocate space for a piece in the cache
    partfile_move35move a part-file
    partfile_read36read from a part file
    partfile_write37write to a part-file
    hostname_lookup38a hostname lookup
    symlink39create or read a symlink
    handshake40handshake with a peer or server
    sock_option41set socket option
    enum_route42enumeration of network routes
    file_seek43moving read/write position in a file, operation_t::hostname_lookup
    timer44an async wait operation on a timer
    file_mmap45call to mmap() (or windows counterpart)
    file_truncate46call to ftruncate() (or SetEndOfFile() on windows)
    \n+[report issue]
    \n+
    \n+

    alert_category_t

    \n+

    Declared in "libtorrent/alert.hpp"

    \n+
    \n+
    error
    \n+

    Enables alerts that report an error. This includes:

    \n+
      \n+
    • tracker errors
    • \n+
    • tracker warnings
    • \n+
    • file errors
    • \n+
    • resume data failures
    • \n+
    • web seed errors
    • \n+
    • .torrent files errors
    • \n+
    • listen socket errors
    • \n+
    • port mapping errors
    • \n+
    \n+
    \n+
    \n+
    \n+
    peer
    \n+
    Enables alerts when peers send invalid requests, get banned or\n+snubbed.
    \n+
    \n+
    \n+
    port_mapping
    \n+
    Enables alerts for port mapping events. For NAT-PMP and UPnP.
    \n+
    \n+
    \n+
    storage
    \n+
    Enables alerts for events related to the storage. File errors and\n+synchronization events for moving the storage, renaming files etc.
    \n+
    \n+
    \n+
    tracker
    \n+
    Enables all tracker events. Includes announcing to trackers,\n+receiving responses, warnings and errors.
    \n+
    \n+
    \n+
    connect
    \n+
    Low level alerts for when peers are connected and disconnected.
    \n+
    \n+
    \n+
    status
    \n+
    Enables alerts for when a torrent or the session changes state.
    \n+
    \n+
    \n+
    ip_block
    \n+
    Alerts when a peer is blocked by the ip blocker or port blocker.
    \n+
    \n+
    \n+
    performance_warning
    \n+
    Alerts when some limit is reached that might limit the download\n+or upload rate.
    \n+
    \n+
    \n+
    dht
    \n+
    Alerts on events in the DHT node. For incoming searches or\n+bootstrapping being done etc.
    \n+
    \n+
    \n+
    stats
    \n+
    If you enable these alerts, you will receive a stats_alert\n+approximately once every second, for every active torrent.\n+These alerts contain all statistics counters for the interval since\n+the lasts stats alert.
    \n+
    \n+
    \n+
    session_log
    \n+
    Enables debug logging alerts. These are available unless libtorrent\n+was built with logging disabled (TORRENT_DISABLE_LOGGING). The\n+alerts being posted are log_alert and are session wide.
    \n+
    \n+
    \n+
    torrent_log
    \n+
    Enables debug logging alerts for torrents. These are available\n+unless libtorrent was built with logging disabled\n+(TORRENT_DISABLE_LOGGING). The alerts being posted are\n+torrent_log_alert and are torrent wide debug events.
    \n+
    \n+
    \n+
    peer_log
    \n+
    Enables debug logging alerts for peers. These are available unless\n+libtorrent was built with logging disabled\n+(TORRENT_DISABLE_LOGGING). The alerts being posted are\n+peer_log_alert and low-level peer events and messages.
    \n+
    \n+
    \n+
    incoming_request
    \n+
    enables the incoming_request_alert.
    \n+
    \n+
    \n+
    dht_log
    \n+
    enables dht_log_alert, debug logging for the DHT
    \n+
    \n+
    \n+
    dht_operation
    \n+
    enable events from pure dht operations not related to torrents
    \n+
    \n+
    \n+
    port_mapping_log
    \n+
    enables port mapping log events. This log is useful\n+for debugging the UPnP or NAT-PMP implementation
    \n+
    \n+
    \n+
    picker_log
    \n+
    enables verbose logging from the piece picker.
    \n+
    \n+
    \n+
    file_progress
    \n+
    alerts when files complete downloading
    \n+
    \n+
    \n+
    piece_progress
    \n+
    alerts when pieces complete downloading or fail hash check
    \n+
    \n+
    \n+
    upload
    \n+
    alerts when we upload blocks to other peers
    \n+
    \n+
    \n+
    block_progress
    \n+
    alerts on individual blocks being requested, downloading, finished,\n+rejected, time-out and cancelled. This is likely to post alerts at a\n+high rate.
    \n+
    \n+
    \n+
    all
    \n+

    The full bitmask, representing all available categories.

    \n+

    since the enum is signed, make sure this isn't\n+interpreted as -1. For instance, boost.python\n+does that and fails when assigning it to an\n+unsigned parameter.

    \n+
    \n+
    \n+[report issue]
    \n+
    \n+

    int

    \n+

    Declared in "libtorrent/alert_types.hpp"

    \n+
    \n+
    user_alert_id
    \n+
    user defined alerts should use IDs greater than this
    \n+
    \n+
    \n+
    num_alert_types
    \n+
    this constant represents "max_alert_index" + 1
    \n+
    \n+[report issue]
    \n+
    \n+

    session_params

    \n+

    Declared in "libtorrent/session_params.hpp"

    \n+

    The session_params is a parameters pack for configuring the session\n+before it's started.

    \n+
    \n+struct session_params\n+{\n+   session_params (settings_pack&& sp);\n+   session_params (settings_pack const& sp);\n+   session_params ();\n+   session_params (settings_pack&& sp\n+      , std::vector<std::shared_ptr<plugin>> exts);\n+   session_params (settings_pack const& sp\n+      , std::vector<std::shared_ptr<plugin>> exts);\n+\n+   settings_pack settings;\n+   std::vector<std::shared_ptr<plugin>> extensions;\n+   dht::dht_state dht_state;\n+   dht::dht_storage_constructor_type dht_storage_constructor;\n+   disk_io_constructor_type disk_io_constructor;\n+   std::map<std::string, std::string> ext_state;\n+   libtorrent::ip_filter ip_filter;\n+};\n+
    \n+[report issue]
    \n+

    session_params()

    \n+
    \n+session_params (settings_pack&& sp);\n+session_params (settings_pack const& sp);\n+session_params ();\n+
    \n+

    This constructor can be used to start with the default plugins\n+(ut_metadata, ut_pex and smart_ban). Pass a settings_pack to set the\n+initial settings when the session starts.

    \n+[report issue]
    \n+
    \n+

    session_params()

    \n+
    \n+session_params (settings_pack&& sp\n+      , std::vector<std::shared_ptr<plugin>> exts);\n+session_params (settings_pack const& sp\n+      , std::vector<std::shared_ptr<plugin>> exts);\n+
    \n+

    This constructor helps to configure the set of initial plugins\n+to be added to the session before it's started.

    \n+[report issue]
    \n+
    settings
    \n+
    The settings to configure the session with
    \n+
    \n+[report issue]
    \n+
    extensions
    \n+
    the plugins to add to the session as it is constructed
    \n+
    \n+[report issue]
    \n+
    dht_state
    \n+
    DHT node ID and node addresses to bootstrap the DHT with.
    \n+
    \n+[report issue]
    \n+
    dht_storage_constructor
    \n+
    function object to construct the storage object for DHT items.
    \n+
    \n+[report issue]
    \n+
    disk_io_constructor
    \n+
    function object to create the disk I/O subsystem. Defaults to\n+default_disk_io_constructor.
    \n+
    \n+[report issue]
    \n+
    ext_state
    \n+
    this container can be used by extensions/plugins to store settings. It's\n+primarily here to make it convenient to save and restore state across\n+sessions, using read_session_params() and write_session_params().
    \n+
    \n+[report issue]
    \n+
    ip_filter
    \n+
    the IP filter to use for the session. This restricts which peers are allowed\n+to connect. As if passed to set_ip_filter().
    \n+
    \n+[report issue]
    \n+
    \n+
    \n+

    session_handle

    \n+

    Declared in "libtorrent/session_handle.hpp"

    \n+

    this class provides a non-owning handle to a session and a subset of the\n+interface of the session class. If the underlying session is destructed\n+any handle to it will no longer be valid. is_valid() will return false and\n+any operation on it will throw a system_error exception, with error code\n+invalid_session_handle.

    \n+
    \n+struct session_handle\n+{\n+   bool is_valid () const;\n+   session_params session_state (save_state_flags_t flags = save_state_flags_t::all()) const;\n+   void refresh_torrent_status (std::vector<torrent_status>* ret\n+      , status_flags_t flags = {}) const;\n+   std::vector<torrent_status> get_torrent_status (\n+      std::function<bool(torrent_status const&)> const& pred\n+      , status_flags_t flags = {}) const;\n+   void post_torrent_updates (status_flags_t flags = status_flags_t::all());\n+   void post_session_stats ();\n+   void post_dht_stats ();\n+   void set_dht_state (dht::dht_state&& st);\n+   void set_dht_state (dht::dht_state const& st);\n+   std::vector<torrent_handle> get_torrents () const;\n+   torrent_handle find_torrent (sha1_hash const& info_hash) const;\n+   torrent_handle add_torrent (add_torrent_params const& params, error_code& ec);\n+   torrent_handle add_torrent (add_torrent_params const& params);\n+   torrent_handle add_torrent (add_torrent_params&& params, error_code& ec);\n+   void async_add_torrent (add_torrent_params&& params);\n+   torrent_handle add_torrent (add_torrent_params&& params);\n+   void async_add_torrent (add_torrent_params const& params);\n+   void pause ();\n+   bool is_paused () const;\n+   void resume ();\n+   bool is_dht_running () const;\n+   void set_dht_storage (dht::dht_storage_constructor_type sc);\n+   void add_dht_node (std::pair<std::string, int> const& node);\n+   void dht_get_item (sha1_hash const& target);\n+   void dht_get_item (std::array<char, 32> key\n+      , std::string salt = std::string());\n+   sha1_hash dht_put_item (entry data);\n+   void dht_put_item (std::array<char, 32> key\n+      , std::function<void(entry&, std::array<char, 64>&\n+      , std::int64_t&, std::string const&)> cb\n+      , std::string salt = std::string());\n+   void dht_get_peers (sha1_hash const& info_hash);\n+   void dht_announce (sha1_hash const& info_hash, int port = 0, dht::announce_flags_t flags = {});\n+   void dht_live_nodes (sha1_hash const& nid);\n+   void dht_sample_infohashes (udp::endpoint const& ep, sha1_hash const& target);\n+   void dht_direct_request (udp::endpoint const& ep, entry const& e, client_data_t userdata = {});\n+   void add_extension (std::function<std::shared_ptr<torrent_plugin>(\n+      torrent_handle const&, client_data_t)> ext);\n+   void add_extension (std::shared_ptr<plugin> ext);\n+   void set_ip_filter (ip_filter f);\n+   ip_filter get_ip_filter () const;\n+   void set_port_filter (port_filter const& f);\n+   unsigned short listen_port () const;\n+   bool is_listening () const;\n+   unsigned short ssl_listen_port () const;\n+   ip_filter get_peer_class_filter () const;\n+   void set_peer_class_filter (ip_filter const& f);\n+   void set_peer_class_type_filter (peer_class_type_filter const& f);\n+   peer_class_type_filter get_peer_class_type_filter () const;\n+   peer_class_t create_peer_class (char const* name);\n+   void delete_peer_class (peer_class_t cid);\n+   peer_class_info get_peer_class (peer_class_t cid) const;\n+   void set_peer_class (peer_class_t cid, peer_class_info const& pci);\n+   void remove_torrent (const torrent_handle&, remove_flags_t = {});\n+   void apply_settings (settings_pack&&);\n+   settings_pack get_settings () const;\n+   void apply_settings (settings_pack const&);\n+   void pop_alerts (std::vector<alert*>* alerts);\n+   void set_alert_notify (std::function<void()> const& fun);\n+   alert* wait_for_alert (time_duration max_wait);\n+   std::vector<port_mapping_t> add_port_mapping (portmap_protocol t, int external_port, int local_port);\n+   void delete_port_mapping (port_mapping_t handle);\n+   void reopen_network_sockets (reopen_network_flags_t options = reopen_map_ports);\n+   std::shared_ptr<aux::session_impl> native_handle () const;\n+\n+   static constexpr save_state_flags_t save_settings  = 0_bit;\n+   static constexpr save_state_flags_t save_dht_state  = 2_bit;\n+   static constexpr save_state_flags_t save_extension_state  = 11_bit;\n+   static constexpr save_state_flags_t save_ip_filter  = 12_bit;\n+   static constexpr peer_class_t global_peer_class_id {0};\n+   static constexpr peer_class_t tcp_peer_class_id {1};\n+   static constexpr peer_class_t local_peer_class_id {2};\n+   static constexpr remove_flags_t delete_files  = 0_bit;\n+   static constexpr remove_flags_t delete_partfile  = 1_bit;\n+   static constexpr session_flags_t paused  = 2_bit;\n+   static constexpr portmap_protocol udp  = portmap_protocol::udp;\n+   static constexpr portmap_protocol tcp  = portmap_protocol::tcp;\n+   static constexpr reopen_network_flags_t reopen_map_ports  = 0_bit;\n+};\n+
    \n+[report issue]
    \n+

    is_valid()

    \n+
    \n+bool is_valid () const;\n+
    \n+

    returns true if this handle refers to a valid session object. If the\n+session has been destroyed, all session_handle objects will expire and\n+not be valid.

    \n+[report issue]
    \n+
    \n+

    session_state()

    \n+
    \n+session_params session_state (save_state_flags_t flags = save_state_flags_t::all()) const;\n+
    \n+

    returns the current session state. This can be passed to\n+write_session_params() to save the state to disk and restored using\n+read_session_params() when constructing a new session. The kind of\n+state that's included is all settings, the DHT routing table, possibly\n+plugin-specific state.\n+the flags parameter can be used to only save certain parts of the\n+session state

    \n+\n+[report issue]
    \n+
    \n+

    refresh_torrent_status() get_torrent_status()

    \n+
    \n+void refresh_torrent_status (std::vector<torrent_status>* ret\n+      , status_flags_t flags = {}) const;\n+std::vector<torrent_status> get_torrent_status (\n+      std::function<bool(torrent_status const&)> const& pred\n+      , status_flags_t flags = {}) const;\n+
    \n+
    \n+

    Note

    \n+

    these calls are potentially expensive and won't scale well with\n+lots of torrents. If you're concerned about performance, consider\n+using post_torrent_updates() instead.

    \n+
    \n+

    get_torrent_status returns a vector of the torrent_status for\n+every torrent which satisfies pred, which is a predicate function\n+which determines if a torrent should be included in the returned set\n+or not. Returning true means it should be included and false means\n+excluded. The flags argument is the same as to\n+torrent_handle::status(). Since pred is guaranteed to be\n+called for every torrent, it may be used to count the number of\n+torrents of different categories as well.

    \n+

    refresh_torrent_status takes a vector of torrent_status structs\n+(for instance the same vector that was returned by\n+get_torrent_status() ) and refreshes the status based on the\n+handle member. It is possible to use this function by first\n+setting up a vector of default constructed torrent_status objects,\n+only initializing the handle member, in order to request the\n+torrent status for multiple torrents in a single call. This can save a\n+significant amount of time if you have a lot of torrents.

    \n+

    Any torrent_status object whose handle member is not referring to\n+a valid torrent are ignored.

    \n+

    The intended use of these functions is to start off by calling\n+get_torrent_status() to get a list of all torrents that match your\n+criteria. Then call refresh_torrent_status() on that list. This\n+will only refresh the status for the torrents in your list, and thus\n+ignore all other torrents you might be running. This may save a\n+significant amount of time, especially if the number of torrents you're\n+interested in is small. In order to keep your list of interested\n+torrents up to date, you can either call get_torrent_status() from\n+time to time, to include torrents you might have become interested in\n+since the last time. In order to stop refreshing a certain torrent,\n+simply remove it from the list.

    \n+[report issue]
    \n+
    \n+

    post_torrent_updates()

    \n+
    \n+void post_torrent_updates (status_flags_t flags = status_flags_t::all());\n+
    \n+

    This functions instructs the session to post the state_update_alert,\n+containing the status of all torrents whose state changed since the\n+last time this function was called.

    \n+

    Only torrents who has the state subscription flag set will be\n+included. This flag is on by default. See add_torrent_params.\n+the flags argument is the same as for torrent_handle::status().\n+see status_flags_t in torrent_handle.

    \n+[report issue]
    \n+
    \n+

    post_session_stats()

    \n+
    \n+void post_session_stats ();\n+
    \n+

    This function will post a session_stats_alert object, containing a\n+snapshot of the performance counters from the internals of libtorrent.\n+To interpret these counters, query the session via\n+session_stats_metrics().

    \n+

    For more information, see the session statistics section.

    \n+[report issue]
    \n+
    \n+

    post_dht_stats()

    \n+
    \n+void post_dht_stats ();\n+
    \n+

    This will cause a dht_stats_alert to be posted.

    \n+[report issue]
    \n+
    \n+

    set_dht_state()

    \n+
    \n+void set_dht_state (dht::dht_state&& st);\n+void set_dht_state (dht::dht_state const& st);\n+
    \n+

    set the DHT state for the session. This will be taken into account the\n+next time the DHT is started, as if it had been passed in via the\n+session_params on startup.

    \n+\n+[report issue]
    \n+
    \n+

    find_torrent() get_torrents()

    \n+
    \n+std::vector<torrent_handle> get_torrents () const;\n+torrent_handle find_torrent (sha1_hash const& info_hash) const;\n+
    \n+

    find_torrent() looks for a torrent with the given info-hash. In\n+case there is such a torrent in the session, a torrent_handle to that\n+torrent is returned. In case the torrent cannot be found, an invalid\n+torrent_handle is returned.

    \n+

    See torrent_handle::is_valid() to know if the torrent was found or\n+not.

    \n+

    get_torrents() returns a vector of torrent_handles to all the\n+torrents currently in the session.

    \n+\n+[report issue]
    \n+
    \n+

    async_add_torrent() add_torrent()

    \n+
    \n+torrent_handle add_torrent (add_torrent_params const& params, error_code& ec);\n+torrent_handle add_torrent (add_torrent_params const& params);\n+torrent_handle add_torrent (add_torrent_params&& params, error_code& ec);\n+void async_add_torrent (add_torrent_params&& params);\n+torrent_handle add_torrent (add_torrent_params&& params);\n+void async_add_torrent (add_torrent_params const& params);\n+
    \n+

    You add torrents through the add_torrent() function where you give an\n+object with all the parameters. The add_torrent() overloads will block\n+until the torrent has been added (or failed to be added) and returns\n+an error code and a torrent_handle. In order to add torrents more\n+efficiently, consider using async_add_torrent() which returns\n+immediately, without waiting for the torrent to add. Notification of\n+the torrent being added is sent as add_torrent_alert.

    \n+

    The save_path field in add_torrent_params must be set to a valid\n+path where the files for the torrent will be saved. Even when using a\n+custom storage, this needs to be set to something. If the save_path\n+is empty, the call to add_torrent() will throw a system_error\n+exception.

    \n+

    The overload that does not take an error_code throws an exception on\n+error and is not available when building without exception support.\n+The torrent_handle returned by add_torrent() can be used to retrieve\n+information about the torrent's progress, its peers etc. It is also\n+used to abort a torrent.

    \n+

    If the torrent you are trying to add already exists in the session (is\n+either queued for checking, being checked or downloading)\n+add_torrent() will throw system_error which derives from\n+std::exception unless duplicate_is_error is set to false. In that\n+case, add_torrent() will return the handle to the existing torrent.

    \n+

    The add_torrent_params class has a flags field. It can be used to\n+control what state the new torrent will be added in. Common flags to\n+want to control are torrent_flags::paused and\n+torrent_flags::auto_managed. In order to add a magnet link that will\n+just download the metadata, but no payload, set the\n+torrent_flags::upload_mode flag.

    \n+

    Special consideration has to be taken when adding hybrid torrents\n+(i.e. torrents that are BitTorrent v2 torrents that are backwards\n+compatible with v1). For more details, see BitTorrent v2 torrents.

    \n+\n+\n+[report issue]
    \n+
    \n+

    pause() resume() is_paused()

    \n+
    \n+void pause ();\n+bool is_paused () const;\n+void resume ();\n+
    \n+

    Pausing the session has the same effect as pausing every torrent in\n+it, except that torrents will not be resumed by the auto-manage\n+mechanism. Resuming will restore the torrents to their previous paused\n+state. i.e. the session pause state is separate from the torrent pause\n+state. A torrent is inactive if it is paused or if the session is\n+paused.

    \n+[report issue]
    \n+
    \n+

    is_dht_running()

    \n+
    \n+bool is_dht_running () const;\n+
    \n+

    is_dht_running() returns true if the DHT support has been started\n+and false otherwise.

    \n+[report issue]
    \n+
    \n+

    set_dht_storage()

    \n+
    \n+void set_dht_storage (dht::dht_storage_constructor_type sc);\n+
    \n+

    set_dht_storage set a dht custom storage constructor function\n+to be used internally when the dht is created.

    \n+

    Since the dht storage is a critical component for the dht behavior,\n+this function will only be effective the next time the dht is started.\n+If you never touch this feature, a default map-memory based storage\n+is used.

    \n+

    If you want to make sure the dht is initially created with your\n+custom storage, create a session with the setting\n+settings_pack::enable_dht to false, set your constructor function\n+and call apply_settings with settings_pack::enable_dht to true.

    \n+[report issue]
    \n+
    \n+

    add_dht_node()

    \n+
    \n+void add_dht_node (std::pair<std::string, int> const& node);\n+
    \n+

    add_dht_node takes a host name and port pair. That endpoint will be\n+pinged, and if a valid DHT reply is received, the node will be added to\n+the routing table.

    \n+[report issue]
    \n+
    \n+

    dht_get_item()

    \n+
    \n+void dht_get_item (sha1_hash const& target);\n+
    \n+

    query the DHT for an immutable item at the target hash.\n+the result is posted as a dht_immutable_item_alert.

    \n+[report issue]
    \n+
    \n+

    dht_get_item()

    \n+
    \n+void dht_get_item (std::array<char, 32> key\n+      , std::string salt = std::string());\n+
    \n+

    query the DHT for a mutable item under the public key key.\n+this is an ed25519 key. salt is optional and may be left\n+as an empty string if no salt is to be used.\n+if the item is found in the DHT, a dht_mutable_item_alert is\n+posted.

    \n+[report issue]
    \n+
    \n+

    dht_put_item()

    \n+
    \n+sha1_hash dht_put_item (entry data);\n+
    \n+

    store the given bencoded data as an immutable item in the DHT.\n+the returned hash is the key that is to be used to look the item\n+up again. It's just the SHA-1 hash of the bencoded form of the\n+structure.

    \n+[report issue]
    \n+
    \n+

    dht_put_item()

    \n+
    \n+void dht_put_item (std::array<char, 32> key\n+      , std::function<void(entry&, std::array<char, 64>&\n+      , std::int64_t&, std::string const&)> cb\n+      , std::string salt = std::string());\n+
    \n+

    store a mutable item. The key is the public key the blob is\n+to be stored under. The optional salt argument is a string that\n+is to be mixed in with the key when determining where in the DHT\n+the value is to be stored. The callback function is called from within\n+the libtorrent network thread once we've found where to store the blob,\n+possibly with the current value stored under the key.\n+The values passed to the callback functions are:

    \n+
    \n+
    entry& value
    \n+
    the current value stored under the key (may be empty). Also expected\n+to be set to the value to be stored by the function.
    \n+
    std::array<char,64>& signature
    \n+
    the signature authenticating the current value. This may be zeros\n+if there is currently no value stored. The function is expected to\n+fill in this buffer with the signature of the new value to store.\n+To generate the signature, you may want to use the\n+sign_mutable_item function.
    \n+
    std::int64_t& seq
    \n+
    current sequence number. May be zero if there is no current value.\n+The function is expected to set this to the new sequence number of\n+the value that is to be stored. Sequence numbers must be monotonically\n+increasing. Attempting to overwrite a value with a lower or equal\n+sequence number will fail, even if the signature is correct.
    \n+
    std::string const& salt
    \n+
    this is the salt that was used for this put call.
    \n+
    \n+

    Since the callback function cb is called from within libtorrent,\n+it is critical to not perform any blocking operations. Ideally not\n+even locking a mutex. Pass any data required for this function along\n+with the function object's context and make the function entirely\n+self-contained. The only reason data blob's value is computed\n+via a function instead of just passing in the new value is to avoid\n+race conditions. If you want to update the value in the DHT, you\n+must first retrieve it, then modify it, then write it back. The way\n+the DHT works, it is natural to always do a lookup before storing and\n+calling the callback in between is convenient.

    \n+\n+[report issue]
    \n+
    \n+

    dht_announce() dht_get_peers()

    \n+
    \n+void dht_get_peers (sha1_hash const& info_hash);\n+void dht_announce (sha1_hash const& info_hash, int port = 0, dht::announce_flags_t flags = {});\n+
    \n+

    dht_get_peers() will issue a DHT get_peer request to the DHT for the\n+specified info-hash. The response (the peers) will be posted back in a\n+dht_get_peers_reply_alert.

    \n+

    dht_announce() will issue a DHT announce request to the DHT to the\n+specified info-hash, advertising the specified port. If the port is\n+left at its default, 0, the port will be implied by the DHT message's\n+source port (which may improve connectivity through a NAT).\n+dht_announce() is not affected by the announce_port override setting.

    \n+

    Both these functions are exposed for advanced custom use of the DHT.\n+All torrents eligible to be announce to the DHT will be automatically,\n+by libtorrent.

    \n+

    For possible flags, see announce_flags_t.

    \n+[report issue]
    \n+
    \n+

    dht_live_nodes()

    \n+
    \n+void dht_live_nodes (sha1_hash const& nid);\n+
    \n+

    Retrieve all the live DHT (identified by nid) nodes. All the\n+nodes id and endpoint will be returned in the list of nodes in the\n+alert dht_live_nodes_alert.\n+Since this alert is a response to an explicit call, it will always be\n+posted, regardless of the alert mask.

    \n+[report issue]
    \n+
    \n+

    dht_sample_infohashes()

    \n+
    \n+void dht_sample_infohashes (udp::endpoint const& ep, sha1_hash const& target);\n+
    \n+

    Query the DHT node specified by ep to retrieve a sample of the\n+info-hashes that the node currently have in their storage.\n+The target is included for iterative lookups so that indexing nodes\n+can perform a key space traversal with a single RPC per node by adjusting\n+the target value for each RPC. It has no effect on the returned sample value.\n+The result is posted as a dht_sample_infohashes_alert.

    \n+[report issue]
    \n+
    \n+

    dht_direct_request()

    \n+
    \n+void dht_direct_request (udp::endpoint const& ep, entry const& e, client_data_t userdata = {});\n+
    \n+

    Send an arbitrary DHT request directly to the specified endpoint. This\n+function is intended for use by plugins. When a response is received\n+or the request times out, a dht_direct_response_alert will be posted\n+with the response (if any) and the userdata pointer passed in here.\n+Since this alert is a response to an explicit call, it will always be\n+posted, regardless of the alert mask.

    \n+[report issue]
    \n+
    \n+

    add_extension()

    \n+
    \n+void add_extension (std::function<std::shared_ptr<torrent_plugin>(\n+      torrent_handle const&, client_data_t)> ext);\n+void add_extension (std::shared_ptr<plugin> ext);\n+
    \n+

    This function adds an extension to this session. The argument is a\n+function object that is called with a torrent_handle and which should\n+return a std::shared_ptr<torrent_plugin>. To write custom\n+plugins, see libtorrent plugins. For the typical bittorrent client\n+all of these extensions should be added. The main plugins implemented\n+in libtorrent are:

    \n+
    \n+
    uTorrent metadata
    \n+
    Allows peers to download the metadata (.torrent files) from the swarm\n+directly. Makes it possible to join a swarm with just a tracker and\n+info-hash.
    \n+
    \n+
    \n+#include <libtorrent/extensions/ut_metadata.hpp>\n+ses.add_extension(&lt::create_ut_metadata_plugin);\n+
    \n+
    \n+
    uTorrent peer exchange
    \n+
    Exchanges peers between clients.
    \n+
    \n+
    \n+#include <libtorrent/extensions/ut_pex.hpp>\n+ses.add_extension(&lt::create_ut_pex_plugin);\n+
    \n+
    \n+
    smart ban plugin
    \n+
    A plugin that, with a small overhead, can ban peers\n+that sends bad data with very high accuracy. Should\n+eliminate most problems on poisoned torrents.
    \n+
    \n+
    \n+#include <libtorrent/extensions/smart_ban.hpp>\n+ses.add_extension(&lt::create_smart_ban_plugin);\n+
    \n+\n+[report issue]
    \n+
    \n+

    get_ip_filter() set_ip_filter()

    \n+
    \n+void set_ip_filter (ip_filter f);\n+ip_filter get_ip_filter () const;\n+
    \n+

    Sets a filter that will be used to reject and accept incoming as well\n+as outgoing connections based on their originating ip address. The\n+default filter will allow connections to any ip address. To build a\n+set of rules for which addresses are accepted and not, see ip_filter.

    \n+

    Each time a peer is blocked because of the IP filter, a\n+peer_blocked_alert is generated. get_ip_filter() Returns the\n+ip_filter currently in the session. See ip_filter.

    \n+[report issue]
    \n+
    \n+

    set_port_filter()

    \n+
    \n+void set_port_filter (port_filter const& f);\n+
    \n+

    apply port_filter f to incoming and outgoing peers. a port filter\n+will reject making outgoing peer connections to certain remote ports.\n+The main intention is to be able to avoid triggering certain\n+anti-virus software by connecting to SMTP, FTP ports.

    \n+\n+\n+[report issue]
    \n+
    \n+

    is_listening() listen_port() ssl_listen_port()

    \n+
    \n+unsigned short listen_port () const;\n+bool is_listening () const;\n+unsigned short ssl_listen_port () const;\n+
    \n+

    is_listening() will tell you whether or not the session has\n+successfully opened a listening port. If it hasn't, this function will\n+return false, and then you can set a new\n+settings_pack::listen_interfaces to try another interface and port to\n+bind to.

    \n+

    listen_port() returns the port we ended up listening on.

    \n+\n+[report issue]
    \n+
    \n+

    get_peer_class_filter() set_peer_class_filter()

    \n+
    \n+ip_filter get_peer_class_filter () const;\n+void set_peer_class_filter (ip_filter const& f);\n+
    \n+

    Sets the peer class filter for this session. All new peer connections\n+will take this into account and be added to the peer classes specified\n+by this filter, based on the peer's IP address.

    \n+

    The ip-filter essentially maps an IP -> uint32. Each bit in that 32\n+bit integer represents a peer class. The least significant bit\n+represents class 0, the next bit class 1 and so on.

    \n+

    For more info, see ip_filter.

    \n+

    For example, to make all peers in the range 200.1.1.0 - 200.1.255.255\n+belong to their own peer class, apply the following filter:

    \n+
    \n+ip_filter f = ses.get_peer_class_filter();\n+peer_class_t my_class = ses.create_peer_class("200.1.x.x IP range");\n+f.add_rule(make_address("200.1.1.0"), make_address("200.1.255.255")\n+        , 1 << static_cast<std::uint32_t>(my_class));\n+ses.set_peer_class_filter(f);\n+
    \n+

    This setting only applies to new connections, it won't affect existing\n+peer connections.

    \n+

    This function is limited to only peer class 0-31, since there are only\n+32 bits in the IP range mapping. Only the set bits matter; no peer\n+class will be removed from a peer as a result of this call, peer\n+classes are only added.

    \n+

    The peer_class argument cannot be greater than 31. The bitmasks\n+representing peer classes in the peer_class_filter are 32 bits.

    \n+

    The get_peer_class_filter() function returns the current filter.

    \n+

    For more information, see peer classes.

    \n+\n+[report issue]
    \n+
    \n+

    set_peer_class_type_filter() get_peer_class_type_filter()

    \n+
    \n+void set_peer_class_type_filter (peer_class_type_filter const& f);\n+peer_class_type_filter get_peer_class_type_filter () const;\n+
    \n+

    Sets and gets the peer class type filter. This is controls automatic\n+peer class assignments to peers based on what kind of socket it is.

    \n+

    It does not only support assigning peer classes, it also supports\n+removing peer classes based on socket type.

    \n+

    The order of these rules being applied are:

    \n+
      \n+
    1. peer-class IP filter
    2. \n+
    3. peer-class type filter, removing classes
    4. \n+
    5. peer-class type filter, adding classes
    6. \n+
    \n+

    For more information, see peer classes.

    \n+[report issue]
    \n+
    \n+

    create_peer_class()

    \n+
    \n+peer_class_t create_peer_class (char const* name);\n+
    \n+

    Creates a new peer class (see peer classes) with the given name. The\n+returned integer is the new peer class identifier. Peer classes may\n+have the same name, so each invocation of this function creates a new\n+class and returns a unique identifier.

    \n+

    Identifiers are assigned from low numbers to higher. So if you plan on\n+using certain peer classes in a call to set_peer_class_filter(),\n+make sure to create those early on, to get low identifiers.

    \n+

    For more information on peer classes, see peer classes.

    \n+[report issue]
    \n+
    \n+

    delete_peer_class()

    \n+
    \n+void delete_peer_class (peer_class_t cid);\n+
    \n+

    This call dereferences the reference count of the specified peer\n+class. When creating a peer class it's automatically referenced by 1.\n+If you want to recycle a peer class, you may call this function. You\n+may only call this function once per peer class you create.\n+Calling it more than once for the same class will lead to memory\n+corruption.

    \n+

    Since peer classes are reference counted, this function will not\n+remove the peer class if it's still assigned to torrents or peers. It\n+will however remove it once the last peer and torrent drops their\n+references to it.

    \n+

    There is no need to call this function for custom peer classes. All\n+peer classes will be properly destructed when the session object\n+destructs.

    \n+

    For more information on peer classes, see peer classes.

    \n+\n+[report issue]
    \n+
    \n+

    set_peer_class() get_peer_class()

    \n+
    \n+peer_class_info get_peer_class (peer_class_t cid) const;\n+void set_peer_class (peer_class_t cid, peer_class_info const& pci);\n+
    \n+

    These functions queries information from a peer class and updates the\n+configuration of a peer class, respectively.

    \n+

    cid must refer to an existing peer class. If it does not, the\n+return value of get_peer_class() is undefined.

    \n+

    set_peer_class() sets all the information in the\n+peer_class_info object in the specified peer class. There is no\n+option to only update a single property.

    \n+

    A peer or torrent belonging to more than one class, the highest\n+priority among any of its classes is the one that is taken into\n+account.

    \n+

    For more information, see peer classes.

    \n+[report issue]
    \n+
    \n+

    remove_torrent()

    \n+
    \n+void remove_torrent (const torrent_handle&, remove_flags_t = {});\n+
    \n+

    remove_torrent() will close all peer connections associated with\n+the torrent and tell the tracker that we've stopped participating in\n+the swarm. This operation cannot fail. When it completes, you will\n+receive a torrent_removed_alert.

    \n+

    remove_torrent() is non-blocking, but will remove the torrent from the\n+session synchronously. Calling session_handle::add_torrent() immediately\n+afterward with the same torrent will succeed. Note that this creates a\n+new handle which is not equal to the removed one.

    \n+

    The optional second argument options can be used to delete all the\n+files downloaded by this torrent. To do so, pass in the value\n+session_handle::delete_files. Once the torrent is deleted, a\n+torrent_deleted_alert is posted.

    \n+

    The torrent_handle remains valid for some time after remove_torrent() is\n+called. It will become invalid only after all libtorrent tasks (such as\n+I/O tasks) release their references to the torrent. Until this happens,\n+torrent_handle::is_valid() will return true, and other calls such\n+as torrent_handle::status() will succeed. Because of this, and because\n+remove_torrent() is non-blocking, the following sequence usually\n+succeeds (does not throw system_error):\n+.. code:: c++

    \n+
    \n+session.remove_handle(handle);\n+handle.save_resume_data();
    \n+

    Note that when a queued or downloading torrent is removed, its position\n+in the download queue is vacated and every subsequent torrent in the\n+queue has their queue positions updated. This can potentially cause a\n+large state_update to be posted. When removing all torrents, it is\n+advised to remove them from the back of the queue, to minimize the\n+shifting.

    \n+\n+[report issue]
    \n+
    \n+

    apply_settings() get_settings()

    \n+
    \n+void apply_settings (settings_pack&&);\n+settings_pack get_settings () const;\n+void apply_settings (settings_pack const&);\n+
    \n+

    Applies the settings specified by the settings_pack s. This is an\n+asynchronous operation that will return immediately and actually apply\n+the settings to the main thread of libtorrent some time later.

    \n+\n+\n+[report issue]
    \n+
    \n+

    wait_for_alert() set_alert_notify() pop_alerts()

    \n+
    \n+void pop_alerts (std::vector<alert*>* alerts);\n+void set_alert_notify (std::function<void()> const& fun);\n+alert* wait_for_alert (time_duration max_wait);\n+
    \n+

    Alerts is the main mechanism for libtorrent to report errors and\n+events. pop_alerts fills in the vector passed to it with pointers\n+to new alerts. The session still owns these alerts and they will stay\n+valid until the next time pop_alerts is called. You may not delete\n+the alert objects.

    \n+

    It is safe to call pop_alerts from multiple different threads, as\n+long as the alerts themselves are not accessed once another thread\n+calls pop_alerts. Doing this requires manual synchronization\n+between the popping threads.

    \n+

    wait_for_alert will block the current thread for max_wait time\n+duration, or until another alert is posted. If an alert is available\n+at the time of the call, it returns immediately. The returned alert\n+pointer is the head of the alert queue. wait_for_alert does not\n+pop alerts from the queue, it merely peeks at it. The returned alert\n+will stay valid until pop_alerts is called twice. The first time\n+will pop it and the second will free it.

    \n+

    If there is no alert in the queue and no alert arrives within the\n+specified timeout, wait_for_alert returns nullptr.

    \n+

    In the python binding, wait_for_alert takes the number of\n+milliseconds to wait as an integer.

    \n+

    The alert queue in the session will not grow indefinitely. Make sure\n+to pop periodically to not miss notifications. To control the max\n+number of alerts that's queued by the session, see\n+settings_pack::alert_queue_size.

    \n+

    Some alerts are considered so important that they are posted even when\n+the alert queue is full. Some alerts are considered mandatory and cannot\n+be disabled by the alert_mask. For instance,\n+save_resume_data_alert and save_resume_data_failed_alert are always\n+posted, regardless of the alert mask.

    \n+

    To control which alerts are posted, set the alert_mask\n+(settings_pack::alert_mask).

    \n+

    If the alert queue fills up to the point where alerts are dropped, this\n+will be indicated by a alerts_dropped_alert, which contains a bitmask\n+of which types of alerts were dropped. Generally it is a good idea to\n+make sure the alert queue is large enough, the alert_mask doesn't have\n+unnecessary categories enabled and to call pop_alert() frequently, to\n+avoid alerts being dropped.

    \n+

    the set_alert_notify function lets the client set a function object\n+to be invoked every time the alert queue goes from having 0 alerts to\n+1 alert. This function is called from within libtorrent, it may be the\n+main thread, or it may be from within a user call. The intention of\n+of the function is that the client wakes up its main thread, to poll\n+for more alerts using pop_alerts(). If the notify function fails\n+to do so, it won't be called again, until pop_alerts is called for\n+some other reason. For instance, it could signal an eventfd, post a\n+message to an HWND or some other main message pump. The actual\n+retrieval of alerts should not be done in the callback. In fact, the\n+callback should not block. It should not perform any expensive work.\n+It really should just notify the main application thread.

    \n+

    The type of an alert is returned by the polymorphic function\n+alert::type() but can also be queries from a concrete type via\n+T::alert_type, as a static constant.

    \n+\n+[report issue]
    \n+
    \n+

    add_port_mapping() delete_port_mapping()

    \n+
    \n+std::vector<port_mapping_t> add_port_mapping (portmap_protocol t, int external_port, int local_port);\n+void delete_port_mapping (port_mapping_t handle);\n+
    \n+

    add_port_mapping adds one or more port forwards on UPnP and/or NAT-PMP,\n+whichever is enabled. A mapping is created for each listen socket\n+in the session. The return values are all handles referring to the\n+port mappings that were just created. Pass them to delete_port_mapping()\n+to remove them.

    \n+[report issue]
    \n+
    \n+

    reopen_network_sockets()

    \n+
    \n+void reopen_network_sockets (reopen_network_flags_t options = reopen_map_ports);\n+
    \n+

    Instructs the session to reopen all listen and outgoing sockets.

    \n+

    It's useful in the case your platform doesn't support the built in\n+IP notifier mechanism, or if you have a better more reliable way to\n+detect changes in the IP routing table.

    \n+[report issue]
    \n+
    \n+

    native_handle()

    \n+
    \n+std::shared_ptr<aux::session_impl> native_handle () const;\n+
    \n+

    This function is intended only for use by plugins. This type does\n+not have a stable API and should be relied on as little as possible.

    \n+[report issue]
    \n+
    save_settings
    \n+
    saves settings (i.e. the settings_pack)
    \n+
    \n+[report issue]
    \n+
    save_dht_state
    \n+
    saves dht state such as nodes and node-id, possibly accelerating\n+joining the DHT if provided at next session startup.
    \n+
    \n+[report issue]
    \n+
    save_extension_state
    \n+
    load or save state from plugins
    \n+
    \n+[report issue]
    \n+
    save_ip_filter
    \n+
    load or save the IP filter set on the session
    \n+
    \n+\n+\n+[report issue]
    \n+
    global_peer_class_id tcp_peer_class_id local_peer_class_id
    \n+
    built-in peer classes
    \n+
    \n+[report issue]
    \n+
    delete_files
    \n+
    delete the files belonging to the torrent from disk.\n+including the part-file, if there is one
    \n+
    \n+[report issue]
    \n+
    delete_partfile
    \n+
    delete just the part-file associated with this torrent
    \n+
    \n+[report issue]
    \n+
    paused
    \n+
    when set, the session will start paused. Call\n+session_handle::resume() to start
    \n+
    \n+\n+[report issue]
    \n+
    udp tcp
    \n+
    protocols used by add_port_mapping()
    \n+
    \n+[report issue]
    \n+
    reopen_map_ports
    \n+
    This option indicates if the ports are mapped using natpmp\n+and upnp. If mapping was already made, they are deleted and added\n+again. This only works if natpmp and/or upnp are configured to be\n+enable.
    \n+
    \n+[report issue]
    \n+
    \n+
    \n+

    session_proxy

    \n+

    Declared in "libtorrent/session.hpp"

    \n+

    this is a holder for the internal session implementation object. Once the\n+session destruction is explicitly initiated, this holder is used to\n+synchronize the completion of the shutdown. The lifetime of this object\n+may outlive session, causing the session destructor to not block. The\n+session_proxy destructor will block however, until the underlying session\n+is done shutting down.

    \n+
    \n+struct session_proxy\n+{\n+   ~session_proxy ();\n+   session_proxy ();\n+   session_proxy (session_proxy const&);\n+   session_proxy& operator= (session_proxy const&) &;\n+   session_proxy (session_proxy&&) noexcept;\n+   session_proxy& operator= (session_proxy&&) & noexcept;\n+};\n+
    \n+\n+\n+[report issue]
    \n+

    operator=() ~session_proxy() session_proxy()

    \n+
    \n+~session_proxy ();\n+session_proxy ();\n+session_proxy (session_proxy const&);\n+session_proxy& operator= (session_proxy const&) &;\n+session_proxy (session_proxy&&) noexcept;\n+session_proxy& operator= (session_proxy&&) & noexcept;\n+
    \n+

    default constructor, does not refer to any session\n+implementation object.

    \n+[report issue]
    \n+
    \n+
    \n+

    session

    \n+

    Declared in "libtorrent/session.hpp"

    \n+

    The session holds all state that spans multiple torrents. Among other\n+things it runs the network loop and manages all torrents. Once it's\n+created, the session object will spawn the main thread that will do all\n+the work. The main thread will be idle as long it doesn't have any\n+torrents to participate in.

    \n+

    You have some control over session configuration through the\n+session_handle::apply_settings() member function. To change one or more\n+configuration options, create a settings_pack. object and fill it with\n+the settings to be set and pass it in to session::apply_settings().

    \n+

    see apply_settings().

    \n+
    \n+struct session : session_handle\n+{\n+   session (session_params&& params, session_flags_t flags);\n+   session ();\n+   session (session_params const& params, session_flags_t flags);\n+   explicit session (session_params const& params);\n+   explicit session (session_params&& params);\n+   session (session_params const& params, io_context& ios, session_flags_t);\n+   session (session_params&& params, io_context& ios, session_flags_t);\n+   session (session_params const& params, io_context& ios);\n+   session (session_params&& params, io_context& ios);\n+   ~session ();\n+   session_proxy abort ();\n+};\n+
    \n+[report issue]
    \n+

    session()

    \n+
    \n+session (session_params&& params, session_flags_t flags);\n+session ();\n+session (session_params const& params, session_flags_t flags);\n+explicit session (session_params const& params);\n+explicit session (session_params&& params);\n+
    \n+

    Constructs the session objects which acts as the container of torrents.\n+In order to avoid a race condition between starting the session and\n+configuring it, you can pass in a session_params object. Its settings\n+will take effect before the session starts up.

    \n+

    The overloads taking flags can be used to start a session in\n+paused mode (by passing in session::paused). Note that\n+add_default_plugins do not have an affect on constructors that\n+take a session_params object. It already contains the plugins to use.

    \n+[report issue]
    \n+
    \n+

    session()

    \n+
    \n+session (session_params const& params, io_context& ios, session_flags_t);\n+session (session_params&& params, io_context& ios, session_flags_t);\n+session (session_params const& params, io_context& ios);\n+session (session_params&& params, io_context& ios);\n+
    \n+

    Overload of the constructor that takes an external io_context to run\n+the session object on. This is primarily useful for tests that may want\n+to run multiple sessions on a single io_context, or low resource\n+systems where additional threads are expensive and sharing an\n+io_context with other events is fine.

    \n+
    \n+

    Warning

    \n+

    The session object does not cleanly terminate with an external\n+io_context. The io_context::run() call must have returned\n+before it's safe to destruct the session. Which means you MUST\n+call session::abort() and save the session_proxy first, then\n+destruct the session object, then sync with the io_context, then\n+destruct the session_proxy object.

    \n+
    \n+[report issue]
    \n+
    \n+

    ~session()

    \n+
    \n+~session ();\n+
    \n+

    The destructor of session will notify all trackers that our torrents\n+have been shut down. If some trackers are down, they will time out.\n+All this before the destructor of session returns. So, it's advised\n+that any kind of interface (such as windows) are closed before\n+destructing the session object. Because it can take a few second for\n+it to finish. The timeout can be set with apply_settings().

    \n+[report issue]
    \n+
    \n+

    abort()

    \n+
    \n+session_proxy abort ();\n+
    \n+

    In case you want to destruct the session asynchronously, you can\n+request a session destruction proxy. If you don't do this, the\n+destructor of the session object will block while the trackers are\n+contacted. If you keep one session_proxy to the session when\n+destructing it, the destructor will not block, but start to close down\n+the session, the destructor of the proxy will then synchronize the\n+threads. So, the destruction of the session is performed from the\n+session destructor call until the session_proxy destructor\n+call. The session_proxy does not have any operations on it (since\n+the session is being closed down, no operations are allowed on it).\n+The only valid operation is calling the destructor:

    \n+
    \n+struct session_proxy {};\n+
    \n+\n+\n+[report issue]
    \n+
    \n+
    \n+

    read_session_params() write_session_params_buf() write_session_params()

    \n+

    Declared in "libtorrent/session_params.hpp"

    \n+
    \n+entry write_session_params (session_params const& sp\n+   , save_state_flags_t flags = save_state_flags_t::all());\n+session_params read_session_params (span<char const> buf\n+   , save_state_flags_t flags = save_state_flags_t::all());\n+session_params read_session_params (bdecode_node const& e\n+   , save_state_flags_t flags = save_state_flags_t::all());\n+std::vector<char> write_session_params_buf (session_params const& sp\n+   , save_state_flags_t flags = save_state_flags_t::all());\n+
    \n+

    These functions serialize and de-serialize a session_params object to and\n+from bencoded form. The session_params object is used to initialize a new\n+session using the state from a previous one (or by programmatically configure\n+the session up-front).\n+The flags parameter can be used to only save and load certain aspects of the\n+session's state.\n+The _buf suffix indicates the function operates on buffer rather than the\n+bencoded structure.\n+The torrents in a session are not part of the session_params state, they have\n+to be restored separately.

    \n+[report issue]
    \n+
    \n+

    bdecode_node

    \n+

    Declared in "libtorrent/bdecode.hpp"

    \n+

    Sometimes it's important to get a non-owning reference to the root node (\n+to be able to copy it as a reference for instance). For that, use the\n+non_owning() member function.

    \n+

    There are 5 different types of nodes, see type_t.

    \n+
    \n+struct bdecode_node\n+{\n+   bdecode_node () = default;\n+   bdecode_node& operator= (bdecode_node&&) & = default;\n+   bdecode_node (bdecode_node&&) noexcept;\n+   bdecode_node (bdecode_node const&);\n+   bdecode_node& operator= (bdecode_node const&) &;\n+   type_t type () const noexcept;\n+   explicit operator bool () const noexcept;\n+   bdecode_node non_owning () const;\n+   span<char const> data_section () const noexcept;\n+   std::ptrdiff_t data_offset () const noexcept;\n+   int list_size () const;\n+   std::int64_t list_int_value_at (int i\n+      , std::int64_t default_val = 0) const;\n+   bdecode_node list_at (int i) const;\n+   string_view list_string_value_at (int i\n+      , string_view default_val = string_view()) const;\n+   bdecode_node dict_find_int (string_view key) const;\n+   bdecode_node dict_find_list (string_view key) const;\n+   bdecode_node dict_find_string (string_view key) const;\n+   std::pair<string_view, bdecode_node> dict_at (int i) const;\n+   string_view dict_find_string_value (string_view key\n+      , string_view default_value = string_view()) const;\n+   int dict_size () const;\n+   bdecode_node dict_find (string_view key) const;\n+   bdecode_node dict_find_dict (string_view key) const;\n+   std::int64_t dict_find_int_value (string_view key\n+      , std::int64_t default_val = 0) const;\n+   std::pair<bdecode_node, bdecode_node> dict_at_node (int i) const;\n+   std::int64_t int_value () const;\n+   string_view string_value () const;\n+   int string_length () const;\n+   std::ptrdiff_t string_offset () const;\n+   char const* string_ptr () const;\n+   void clear ();\n+   void swap (bdecode_node& n);\n+   void reserve (int tokens);\n+   void switch_underlying_buffer (char const* buf) noexcept;\n+   bool has_soft_error (span<char> error) const;\n+\n+   enum type_t\n+   {\n+      none_t,\n+      dict_t,\n+      list_t,\n+      string_t,\n+      int_t,\n+   };\n+};\n+
    \n+[report issue]
    \n+

    bdecode_node()

    \n+
    \n+bdecode_node () = default;\n+
    \n+

    creates a default constructed node, it will have the type none_t.

    \n+\n+[report issue]
    \n+
    \n+

    bdecode_node() operator=()

    \n+
    \n+bdecode_node& operator= (bdecode_node&&) & = default;\n+bdecode_node (bdecode_node&&) noexcept;\n+bdecode_node (bdecode_node const&);\n+bdecode_node& operator= (bdecode_node const&) &;\n+
    \n+

    For owning nodes, the copy will create a copy of the tree, but the\n+underlying buffer remains the same.

    \n+[report issue]
    \n+
    \n+

    type()

    \n+
    \n+type_t type () const noexcept;\n+
    \n+

    the type of this node. See type_t.

    \n+[report issue]
    \n+
    \n+

    bool()

    \n+
    \n+explicit operator bool () const noexcept;\n+
    \n+

    returns true if type() != none_t.

    \n+[report issue]
    \n+
    \n+

    non_owning()

    \n+
    \n+bdecode_node non_owning () const;\n+
    \n+

    return a non-owning reference to this node. This is useful to refer to\n+the root node without copying it in assignments.

    \n+\n+[report issue]
    \n+
    \n+

    data_section() data_offset()

    \n+
    \n+span<char const> data_section () const noexcept;\n+std::ptrdiff_t data_offset () const noexcept;\n+
    \n+

    returns the buffer and length of the section in the original bencoded\n+buffer where this node is defined. For a dictionary for instance, this\n+starts with d and ends with e, and has all the content of the\n+dictionary in between.\n+the data_offset() function returns the byte-offset to this node in,\n+starting from the beginning of the buffer that was parsed.

    \n+\n+\n+\n+[report issue]
    \n+
    \n+

    list_at() list_string_value_at() list_int_value_at() list_size()

    \n+
    \n+int list_size () const;\n+std::int64_t list_int_value_at (int i\n+      , std::int64_t default_val = 0) const;\n+bdecode_node list_at (int i) const;\n+string_view list_string_value_at (int i\n+      , string_view default_val = string_view()) const;\n+
    \n+

    functions with the list_ prefix operate on lists. These functions are\n+only valid if type() == list_t. list_at() returns the item\n+in the list at index i. i may not be greater than or equal to the\n+size of the list. size() returns the size of the list.

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+[report issue]
    \n+
    \n+

    dict_find_list() dict_find_string_value() dict_find_string() dict_find_int_value() dict_find_dict() dict_size() dict_find_int() dict_at() dict_find() dict_at_node()

    \n+
    \n+bdecode_node dict_find_int (string_view key) const;\n+bdecode_node dict_find_list (string_view key) const;\n+bdecode_node dict_find_string (string_view key) const;\n+std::pair<string_view, bdecode_node> dict_at (int i) const;\n+string_view dict_find_string_value (string_view key\n+      , string_view default_value = string_view()) const;\n+int dict_size () const;\n+bdecode_node dict_find (string_view key) const;\n+bdecode_node dict_find_dict (string_view key) const;\n+std::int64_t dict_find_int_value (string_view key\n+      , std::int64_t default_val = 0) const;\n+std::pair<bdecode_node, bdecode_node> dict_at_node (int i) const;\n+
    \n+

    Functions with the dict_ prefix operates on dictionaries. They are\n+only valid if type() == dict_t. In case a key you're looking up\n+contains a 0 byte, you cannot use the 0-terminated string overloads,\n+but have to use string_view instead. dict_find_list will return a\n+valid bdecode_node if the key is found _and_ it is a list. Otherwise\n+it will return a default-constructed bdecode_node.

    \n+

    Functions with the _value suffix return the value of the node\n+directly, rather than the nodes. In case the node is not found, or it has\n+a different type, a default value is returned (which can be specified).

    \n+

    dict_at() returns the (key, value)-pair at the specified index in a\n+dictionary. Keys are only allowed to be strings. dict_at_node() also\n+returns the (key, value)-pair, but the key is returned as a\n+bdecode_node (and it will always be a string).

    \n+[report issue]
    \n+
    \n+

    int_value()

    \n+
    \n+std::int64_t int_value () const;\n+
    \n+

    this function is only valid if type() == int_t. It returns the\n+value of the integer.

    \n+\n+\n+\n+[report issue]
    \n+
    \n+

    string_value() string_length() string_offset() string_ptr()

    \n+
    \n+string_view string_value () const;\n+int string_length () const;\n+std::ptrdiff_t string_offset () const;\n+char const* string_ptr () const;\n+
    \n+

    these functions are only valid if type() == string_t. They return\n+the string values. Note that string_ptr() is not 0-terminated.\n+string_length() returns the number of bytes in the string.\n+string_offset() returns the byte offset from the start of the parsed\n+bencoded buffer this string can be found.

    \n+[report issue]
    \n+
    \n+

    clear()

    \n+
    \n+void clear ();\n+
    \n+

    resets the bdecoded_node to a default constructed state. If this is\n+an owning node, the tree is freed and all child nodes are invalidated.

    \n+[report issue]
    \n+
    \n+

    swap()

    \n+
    \n+void swap (bdecode_node& n);\n+
    \n+

    Swap contents.

    \n+[report issue]
    \n+
    \n+

    reserve()

    \n+
    \n+void reserve (int tokens);\n+
    \n+

    preallocate memory for the specified numbers of tokens. This is\n+useful if you know approximately how many tokens are in the file\n+you are about to parse. Doing so will save realloc operations\n+while parsing. You should only call this on the root node, before\n+passing it in to bdecode().

    \n+[report issue]
    \n+
    \n+

    switch_underlying_buffer()

    \n+
    \n+void switch_underlying_buffer (char const* buf) noexcept;\n+
    \n+

    this buffer MUST be identical to the one originally parsed. This\n+operation is only defined on owning root nodes, i.e. the one passed in to\n+decode().

    \n+[report issue]
    \n+
    \n+

    has_soft_error()

    \n+
    \n+bool has_soft_error (span<char> error) const;\n+
    \n+

    returns true if there is a non-fatal error in the bencoding of this node\n+or its children

    \n+[report issue]
    \n+
    \n+

    enum type_t

    \n+

    Declared in "libtorrent/bdecode.hpp"

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    namevaluedescription
    none_t0uninitialized or default constructed. This is also used\n+to indicate that a node was not found in some cases.
    dict_t1a dictionary node. The dict_find_ functions are valid.
    list_t2a list node. The list_ functions are valid.
    string_t3a string node, the string_ functions are valid.
    int_t4an integer node. The int_ functions are valid.
    \n+[report issue]
    \n+
    \n+
    \n+

    print_entry()

    \n+

    Declared in "libtorrent/bdecode.hpp"

    \n+
    \n+std::string print_entry (bdecode_node const& e\n+   , bool single_line = false, int indent = 0);\n+
    \n+

    print the bencoded structure in a human-readable format to a string\n+that's returned.

    \n+[report issue]
    \n+
    \n+

    bdecode()

    \n+

    Declared in "libtorrent/bdecode.hpp"

    \n+
    \n+bdecode_node bdecode (span<char const> buffer\n+   , error_code& ec, int* error_pos = nullptr, int depth_limit = 100\n+   , int token_limit = 2000000);\n+int bdecode (char const* start, char const* end, bdecode_node& ret\n+   , error_code& ec, int* error_pos = nullptr, int depth_limit = 100\n+   , int token_limit = 2000000);\n+bdecode_node bdecode (span<char const> buffer\n+   , int depth_limit = 100, int token_limit = 2000000);\n+
    \n+

    This function decodes/parses bdecoded data (for example a .torrent file).\n+The data structure is returned in the ret argument. the buffer to parse\n+is specified by the start of the buffer as well as the end, i.e. one\n+byte past the end. If the buffer fails to parse, the function returns a\n+non-zero value and fills in ec with the error code. The optional\n+argument error_pos, if set to non-nullptr, will be set to the byte offset\n+into the buffer where the parse failure occurred.

    \n+

    depth_limit specifies the max number of nested lists or dictionaries are\n+allowed in the data structure. (This affects the stack usage of the\n+function, be careful not to set it too high).

    \n+

    token_limit is the max number of tokens allowed to be parsed from the\n+buffer. This is simply a sanity check to not have unbounded memory usage.

    \n+

    The resulting bdecode_node is an owning node. That means it will\n+be holding the whole parsed tree. When iterating lists and dictionaries,\n+those bdecode_node objects will simply have references to the root or\n+owning bdecode_node. If the root node is destructed, all other nodes\n+that refer to anything in that tree become invalid.

    \n+

    However, the underlying buffer passed in to this function (start, end)\n+must also remain valid while the bdecoded tree is used. The parsed tree\n+produced by this function does not copy any data out of the buffer, but\n+simply produces references back into it.

    \n+[report issue]
    \n+
    \n+

    info_hash_t

    \n+

    Declared in "libtorrent/info_hash.hpp"

    \n+

    class holding the info-hash of a torrent. It can hold a v1 info-hash\n+(SHA-1) or a v2 info-hash (SHA-256) or both.

    \n+
    \n+

    Note

    \n+

    If has_v2() is false then the v1 hash might actually be a truncated\n+v2 hash

    \n+
    \n+
    \n+struct info_hash_t\n+{\n+   info_hash_t () noexcept = default;\n+   explicit info_hash_t (sha256_hash h2) noexcept;\n+   explicit info_hash_t (sha1_hash h1) noexcept;\n+   info_hash_t (sha1_hash h1, sha256_hash h2) noexcept;\n+   bool has (protocol_version v) const;\n+   bool has_v2 () const;\n+   bool has_v1 () const;\n+   sha1_hash get (protocol_version v) const;\n+   sha1_hash get_best () const;\n+   friend bool operator!= (info_hash_t const& lhs, info_hash_t const& rhs);\n+   friend bool operator== (info_hash_t const& lhs, info_hash_t const& rhs) noexcept;\n+   template <typename F> void for_each (F f) const;\n+   bool operator< (info_hash_t const& o) const;\n+   friend std::ostream& operator<< (std::ostream& os, info_hash_t const& ih);\n+\n+   sha1_hash v1;\n+   sha256_hash v2;\n+};\n+
    \n+[report issue]
    \n+

    info_hash_t()

    \n+
    \n+info_hash_t () noexcept = default;\n+explicit info_hash_t (sha256_hash h2) noexcept;\n+explicit info_hash_t (sha1_hash h1) noexcept;\n+info_hash_t (sha1_hash h1, sha256_hash h2) noexcept;\n+
    \n+

    The default constructor creates an object that has neither a v1 or v2\n+hash.

    \n+

    For backwards compatibility, make it possible to construct directly\n+from a v1 hash. This constructor allows implicit conversion from a\n+v1 hash, but the implicitness is deprecated.

    \n+\n+\n+[report issue]
    \n+
    \n+

    has_v2() has_v1() has()

    \n+
    \n+bool has (protocol_version v) const;\n+bool has_v2 () const;\n+bool has_v1 () const;\n+
    \n+

    returns true if the corresponding info hash is present in this\n+object.

    \n+[report issue]
    \n+
    \n+

    get()

    \n+
    \n+sha1_hash get (protocol_version v) const;\n+
    \n+

    returns the has for the specified protocol version

    \n+[report issue]
    \n+
    \n+

    get_best()

    \n+
    \n+sha1_hash get_best () const;\n+
    \n+

    returns the v2 (truncated) info-hash, if there is one, otherwise\n+returns the v1 info-hash

    \n+[report issue]
    \n+
    \n+

    for_each()

    \n+
    \n+template <typename F> void for_each (F f) const;\n+
    \n+

    calls the function object f for each hash that is available.\n+starting with v1. The signature of F is:

    \n+
    \n+void(sha1_hash const&, protocol_version);\n+
    \n+[report issue]
    \n+
    \n+
    \n+

    piece_block

    \n+

    Declared in "libtorrent/piece_block.hpp"

    \n+
    \n+struct piece_block\n+{\n+   piece_block () = default;\n+   piece_block (piece_index_t p_index, int b_index);\n+   bool operator< (piece_block const& b) const;\n+   bool operator== (piece_block const& b) const;\n+   bool operator!= (piece_block const& b) const;\n+\n+   static const piece_block invalid;\n+   piece_index_t piece_index {0};\n+   int block_index  = 0;\n+};\n+
    \n+[report issue]
    \n+
    \n+

    peer_request

    \n+

    Declared in "libtorrent/peer_request.hpp"

    \n+

    represents a byte range within a piece. Internally this is is used for\n+incoming piece requests.

    \n+
    \n+struct peer_request\n+{\n+   bool operator== (peer_request const& r) const;\n+\n+   piece_index_t piece;\n+   int start;\n+   int length;\n+};\n+
    \n+[report issue]
    \n+

    operator==()

    \n+
    \n+bool operator== (peer_request const& r) const;\n+
    \n+

    returns true if the right hand side peer_request refers to the same\n+range as this does.

    \n+[report issue]
    \n+
    piece
    \n+
    The index of the piece in which the range starts.
    \n+
    \n+[report issue]
    \n+
    start
    \n+
    The byte offset within that piece where the range starts.
    \n+
    \n+[report issue]
    \n+
    length
    \n+
    The size of the range, in bytes.
    \n+
    \n+[report issue]
    \n+
    \n+
    \n+

    peer_info

    \n+

    Declared in "libtorrent/peer_info.hpp"

    \n+

    holds information and statistics about one peer\n+that libtorrent is connected to

    \n+
    \n+struct peer_info\n+{\n+   sha256_hash i2p_destination () const;\n+\n+   std::string client;\n+   typed_bitfield<piece_index_t> pieces;\n+   std::int64_t total_download;\n+   std::int64_t total_upload;\n+   time_duration last_request;\n+   time_duration last_active;\n+   time_duration download_queue_time;\n+   static constexpr peer_flags_t interesting  = 0_bit;\n+   static constexpr peer_flags_t choked  = 1_bit;\n+   static constexpr peer_flags_t remote_interested  = 2_bit;\n+   static constexpr peer_flags_t remote_choked  = 3_bit;\n+   static constexpr peer_flags_t supports_extensions  = 4_bit;\n+   static constexpr peer_flags_t outgoing_connection  = 5_bit;\n+   static constexpr peer_flags_t local_connection  = 5_bit;\n+   static constexpr peer_flags_t handshake  = 6_bit;\n+   static constexpr peer_flags_t connecting  = 7_bit;\n+   static constexpr peer_flags_t on_parole  = 9_bit;\n+   static constexpr peer_flags_t seed  = 10_bit;\n+   static constexpr peer_flags_t optimistic_unchoke  = 11_bit;\n+   static constexpr peer_flags_t snubbed  = 12_bit;\n+   static constexpr peer_flags_t upload_only  = 13_bit;\n+   static constexpr peer_flags_t endgame_mode  = 14_bit;\n+   static constexpr peer_flags_t holepunched  = 15_bit;\n+   static constexpr peer_flags_t i2p_socket  = 16_bit;\n+   static constexpr peer_flags_t utp_socket  = 17_bit;\n+   static constexpr peer_flags_t ssl_socket  = 18_bit;\n+   static constexpr peer_flags_t rc4_encrypted  = 19_bit;\n+   static constexpr peer_flags_t plaintext_encrypted  = 20_bit;\n+   peer_flags_t flags;\n+   static constexpr peer_source_flags_t tracker  = 0_bit;\n+   static constexpr peer_source_flags_t dht  = 1_bit;\n+   static constexpr peer_source_flags_t pex  = 2_bit;\n+   static constexpr peer_source_flags_t lsd  = 3_bit;\n+   static constexpr peer_source_flags_t resume_data  = 4_bit;\n+   static constexpr peer_source_flags_t incoming  = 5_bit;\n+   peer_source_flags_t source;\n+   int up_speed;\n+   int down_speed;\n+   int payload_up_speed;\n+   int payload_down_speed;\n+   peer_id pid;\n+   int queue_bytes;\n+   int request_timeout;\n+   int send_buffer_size;\n+   int used_send_buffer;\n+   int receive_buffer_size;\n+   int used_receive_buffer;\n+   int receive_buffer_watermark;\n+   int num_hashfails;\n+   int download_queue_length;\n+   int timed_out_requests;\n+   int busy_requests;\n+   int requests_in_buffer;\n+   int target_dl_queue_length;\n+   int upload_queue_length;\n+   int failcount;\n+   piece_index_t downloading_piece_index;\n+   int downloading_block_index;\n+   int downloading_progress;\n+   int downloading_total;\n+   static constexpr connection_type_t standard_bittorrent  = 0_bit;\n+   static constexpr connection_type_t web_seed  = 1_bit;\n+   static constexpr connection_type_t http_seed  = 2_bit;\n+   connection_type_t connection_type;\n+   int pending_disk_bytes;\n+   int pending_disk_read_bytes;\n+   int send_quota;\n+   int receive_quota;\n+   int rtt;\n+   int num_pieces;\n+   int download_rate_peak;\n+   int upload_rate_peak;\n+   float progress;\n+   int progress_ppm;\n+   tcp::endpoint ip;\n+   tcp::endpoint local_endpoint;\n+   static constexpr bandwidth_state_flags_t bw_idle  = 0_bit;\n+   static constexpr bandwidth_state_flags_t bw_limit  = 1_bit;\n+   static constexpr bandwidth_state_flags_t bw_network  = 2_bit;\n+   static constexpr bandwidth_state_flags_t bw_disk  = 4_bit;\n+   bandwidth_state_flags_t read_state;\n+   bandwidth_state_flags_t write_state;\n+};\n+
    \n+[report issue]
    \n+

    i2p_destination()

    \n+
    \n+sha256_hash i2p_destination () const;\n+
    \n+

    If this peer is an i2p peer, this function returns the destination\n+address of the peer

    \n+[report issue]
    \n+
    client
    \n+
    A human readable string describing the software at the other end of\n+the connection. In some cases this information is not available, then\n+it will contain a string that may give away something about which\n+software is running in the other end. In the case of a web seed, the\n+server type and version will be a part of this string. This is UTF-8\n+encoded.
    \n+
    \n+[report issue]
    \n+
    pieces
    \n+
    a bitfield, with one bit per piece in the torrent. Each bit tells you\n+if the peer has that piece (if it's set to 1) or if the peer miss that\n+piece (set to 0).
    \n+
    \n+\n+[report issue]
    \n+
    total_download total_upload
    \n+
    the total number of bytes downloaded from and uploaded to this peer.\n+These numbers do not include the protocol chatter, but only the\n+payload data.
    \n+
    \n+\n+[report issue]
    \n+
    last_request last_active
    \n+
    the time since we last sent a request to this peer and since any\n+transfer occurred with this peer
    \n+
    \n+[report issue]
    \n+
    download_queue_time
    \n+
    the time until all blocks in the request queue will be downloaded
    \n+
    \n+[report issue]
    \n+
    interesting
    \n+
    we are interested in pieces from this peer.
    \n+
    \n+[report issue]
    \n+
    choked
    \n+
    we have choked this peer.
    \n+
    \n+[report issue]
    \n+
    remote_interested
    \n+
    the peer is interested in us
    \n+
    \n+[report issue]
    \n+
    remote_choked
    \n+
    the peer has choked us.
    \n+
    \n+[report issue]
    \n+
    supports_extensions
    \n+
    means that this peer supports the\n+extension protocol.
    \n+
    \n+[report issue]
    \n+
    outgoing_connection
    \n+
    The connection was initiated by us, the peer has a\n+listen port open, and that port is the same as in the\n+address of this peer. If this flag is not set, this\n+peer connection was opened by this peer connecting to\n+us.
    \n+
    \n+[report issue]
    \n+
    local_connection
    \n+
    deprecated synonym for outgoing_connection
    \n+
    \n+[report issue]
    \n+
    handshake
    \n+
    The connection is opened, and waiting for the\n+handshake. Until the handshake is done, the peer\n+cannot be identified.
    \n+
    \n+[report issue]
    \n+
    connecting
    \n+
    The connection is in a half-open state (i.e. it is\n+being connected).
    \n+
    \n+[report issue]
    \n+
    on_parole
    \n+
    The peer has participated in a piece that failed the\n+hash check, and is now "on parole", which means we're\n+only requesting whole pieces from this peer until\n+it either fails that piece or proves that it doesn't\n+send bad data.
    \n+
    \n+[report issue]
    \n+
    seed
    \n+
    This peer is a seed (it has all the pieces).
    \n+
    \n+[report issue]
    \n+
    optimistic_unchoke
    \n+
    This peer is subject to an optimistic unchoke. It has\n+been unchoked for a while to see if it might unchoke\n+us in return an earn an upload/unchoke slot. If it\n+doesn't within some period of time, it will be choked\n+and another peer will be optimistically unchoked.
    \n+
    \n+[report issue]
    \n+
    snubbed
    \n+
    This peer has recently failed to send a block within\n+the request timeout from when the request was sent.\n+We're currently picking one block at a time from this\n+peer.
    \n+
    \n+[report issue]
    \n+
    upload_only
    \n+
    This peer has either explicitly (with an extension)\n+or implicitly (by becoming a seed) told us that it\n+will not downloading anything more, regardless of\n+which pieces we have.
    \n+
    \n+[report issue]
    \n+
    endgame_mode
    \n+
    This means the last time this peer picket a piece,\n+it could not pick as many as it wanted because there\n+were not enough free ones. i.e. all pieces this peer\n+has were already requested from other peers.
    \n+
    \n+[report issue]
    \n+
    holepunched
    \n+
    This flag is set if the peer was in holepunch mode\n+when the connection succeeded. This typically only\n+happens if both peers are behind a NAT and the peers\n+connect via the NAT holepunch mechanism.
    \n+
    \n+[report issue]
    \n+
    i2p_socket
    \n+
    indicates that this socket is running on top of the\n+I2P transport.
    \n+
    \n+[report issue]
    \n+
    utp_socket
    \n+
    indicates that this socket is a uTP socket
    \n+
    \n+[report issue]
    \n+
    ssl_socket
    \n+
    indicates that this socket is running on top of an SSL\n+(TLS) channel
    \n+
    \n+[report issue]
    \n+
    rc4_encrypted
    \n+
    this connection is obfuscated with RC4
    \n+
    \n+[report issue]
    \n+
    plaintext_encrypted
    \n+
    the handshake of this connection was obfuscated\n+with a Diffie-Hellman exchange
    \n+
    \n+[report issue]
    \n+
    flags
    \n+
    tells you in which state the peer is in. It is set to\n+any combination of the peer_flags_t flags above.
    \n+
    \n+[report issue]
    \n+
    tracker
    \n+
    The peer was received from the tracker.
    \n+
    \n+[report issue]
    \n+
    dht
    \n+
    The peer was received from the kademlia DHT.
    \n+
    \n+[report issue]
    \n+
    pex
    \n+
    The peer was received from the peer exchange\n+extension.
    \n+
    \n+[report issue]
    \n+
    lsd
    \n+
    The peer was received from the local service\n+discovery (The peer is on the local network).
    \n+
    \n+[report issue]
    \n+
    resume_data
    \n+
    The peer was added from the fast resume data.
    \n+
    \n+[report issue]
    \n+
    incoming
    \n+
    we received an incoming connection from this peer
    \n+
    \n+[report issue]
    \n+
    source
    \n+
    a combination of flags describing from which sources this peer\n+was received. A combination of the peer_source_flags_t above.
    \n+
    \n+\n+[report issue]
    \n+
    up_speed down_speed
    \n+
    the current upload and download speed we have to and from this peer\n+(including any protocol messages). updated about once per second
    \n+
    \n+\n+[report issue]
    \n+
    payload_up_speed payload_down_speed
    \n+
    The transfer rates of payload data only updated about once per second
    \n+
    \n+[report issue]
    \n+
    pid
    \n+
    the peer's id as used in the bittorrent protocol. This id can be used\n+to extract 'fingerprints' from the peer. Sometimes it can tell you\n+which client the peer is using. See identify_client()_
    \n+
    \n+[report issue]
    \n+
    queue_bytes
    \n+
    the number of bytes we have requested from this peer, but not yet\n+received.
    \n+
    \n+[report issue]
    \n+
    request_timeout
    \n+
    the number of seconds until the current front piece request will time\n+out. This timeout can be adjusted through\n+settings_pack::request_timeout.\n+-1 means that there is not outstanding request.
    \n+
    \n+\n+[report issue]
    \n+
    send_buffer_size used_send_buffer
    \n+
    the number of bytes allocated\n+and used for the peer's send buffer, respectively.
    \n+
    \n+\n+\n+[report issue]
    \n+
    receive_buffer_size used_receive_buffer receive_buffer_watermark
    \n+
    the number of bytes\n+allocated and used as receive buffer, respectively.
    \n+
    \n+[report issue]
    \n+
    num_hashfails
    \n+
    the number of pieces this peer has participated in sending us that\n+turned out to fail the hash check.
    \n+
    \n+[report issue]
    \n+
    download_queue_length
    \n+
    this is the number of requests we have sent to this peer that we\n+haven't got a response for yet
    \n+
    \n+[report issue]
    \n+
    timed_out_requests
    \n+
    the number of block requests that have timed out, and are still in the\n+download queue
    \n+
    \n+[report issue]
    \n+
    busy_requests
    \n+
    the number of busy requests in the download queue. A busy request is a\n+request for a block we've also requested from a different peer
    \n+
    \n+[report issue]
    \n+
    requests_in_buffer
    \n+
    the number of requests messages that are currently in the send buffer\n+waiting to be sent.
    \n+
    \n+[report issue]
    \n+
    target_dl_queue_length
    \n+
    the number of requests that is tried to be maintained (this is\n+typically a function of download speed)
    \n+
    \n+[report issue]
    \n+
    upload_queue_length
    \n+
    the number of piece-requests we have received from this peer\n+that we haven't answered with a piece yet.
    \n+
    \n+[report issue]
    \n+
    failcount
    \n+
    the number of times this peer has "failed". i.e. failed to connect or\n+disconnected us. The failcount is decremented when we see this peer in\n+a tracker response or peer exchange message.
    \n+
    \n+\n+\n+\n+[report issue]
    \n+
    downloading_piece_index downloading_block_index downloading_progress downloading_total
    \n+
    You can know which piece, and which part of that piece, that is\n+currently being downloaded from a specific peer by looking at these\n+four members. downloading_piece_index is the index of the piece\n+that is currently being downloaded. This may be set to -1 if there's\n+currently no piece downloading from this peer. If it is >= 0, the\n+other three members are valid. downloading_block_index is the\n+index of the block (or sub-piece) that is being downloaded.\n+downloading_progress is the number of bytes of this block we have\n+received from the peer, and downloading_total is the total number\n+of bytes in this block.
    \n+
    \n+[report issue]
    \n+
    standard_bittorrent
    \n+
    Regular bittorrent connection
    \n+
    \n+[report issue]
    \n+
    web_seed
    \n+
    HTTP connection using the BEP 19 protocol
    \n+
    \n+[report issue]
    \n+
    http_seed
    \n+
    HTTP connection using the BEP 17 protocol
    \n+
    \n+[report issue]
    \n+
    connection_type
    \n+
    the kind of connection this peer uses. See connection_type_t.
    \n+
    \n+[report issue]
    \n+
    pending_disk_bytes
    \n+
    the number of bytes this peer has pending in the disk-io thread.\n+Downloaded and waiting to be written to disk. This is what is capped\n+by settings_pack::max_queued_disk_bytes.
    \n+
    \n+[report issue]
    \n+
    pending_disk_read_bytes
    \n+
    number of outstanding bytes to read\n+from disk
    \n+
    \n+\n+[report issue]
    \n+
    send_quota receive_quota
    \n+
    the number of bytes this peer has been assigned to be allowed to send\n+and receive until it has to request more quota from the bandwidth\n+manager.
    \n+
    \n+[report issue]
    \n+
    rtt
    \n+
    an estimated round trip time to this peer, in milliseconds. It is\n+estimated by timing the TCP connect(). It may be 0 for\n+incoming connections.
    \n+
    \n+[report issue]
    \n+
    num_pieces
    \n+
    the number of pieces this peer has.
    \n+
    \n+\n+[report issue]
    \n+
    download_rate_peak upload_rate_peak
    \n+
    the highest download and upload rates seen on this connection. They\n+are given in bytes per second. This number is reset to 0 on reconnect.
    \n+
    \n+[report issue]
    \n+
    progress
    \n+
    the progress of the peer in the range [0, 1]. This is always 0 when\n+floating point operations are disabled, instead use progress_ppm.
    \n+
    \n+[report issue]
    \n+
    progress_ppm
    \n+
    indicates the download progress of the peer in the range [0, 1000000]\n+(parts per million).
    \n+
    \n+[report issue]
    \n+
    ip
    \n+
    the IP-address to this peer. The type is an asio endpoint. For\n+more info, see the asio documentation. This field is not valid for\n+i2p peers. Instead use the i2p_destination() function.
    \n+
    \n+[report issue]
    \n+
    local_endpoint
    \n+
    the IP and port pair the socket is bound to locally. i.e. the IP\n+address of the interface it's going out over. This may be useful for\n+multi-homed clients with multiple interfaces to the internet.\n+This field is not valid for i2p peers.
    \n+
    \n+[report issue]
    \n+
    bw_idle
    \n+
    The peer is not waiting for any external events to\n+send or receive data.
    \n+
    \n+[report issue]
    \n+
    bw_limit
    \n+
    The peer is waiting for the rate limiter.
    \n+
    \n+[report issue]
    \n+
    bw_network
    \n+
    The peer has quota and is currently waiting for a\n+network read or write operation to complete. This is\n+the state all peers are in if there are no bandwidth\n+limits.
    \n+
    \n+[report issue]
    \n+
    bw_disk
    \n+
    The peer is waiting for the disk I/O thread to catch\n+up writing buffers to disk before downloading more.
    \n+
    \n+\n+[report issue]
    \n+
    read_state write_state
    \n+
    bitmasks indicating what state this peer\n+is in with regards to sending and receiving data. The states are\n+defined as independent flags of type bandwidth_state_flags_t, in this\n+class.
    \n+
    \n+[report issue]
    \n+
    \n+
    \n+

    version()

    \n+

    Declared in "libtorrent/version.hpp"

    \n+
    \n+char const* version ();\n+
    \n+

    returns the libtorrent version as string form in this format:\n+"<major>.<minor>.<tiny>.<tag>"

    \n+[report issue]
    \n+
    \n+

    torrent_peer_equal()

    \n+

    Declared in "libtorrent/torrent_peer.hpp"

    \n+
    \n+inline bool torrent_peer_equal (torrent_peer const* lhs, torrent_peer const* rhs);\n+
    \n+[report issue]
    \n+
    \n+

    truncate_files()

    \n+

    Declared in "libtorrent/truncate.hpp"

    \n+
    \n+void truncate_files (file_storage const& fs, std::string const& save_path, storage_error& ec);\n+
    \n+

    Truncates files larger than specified in the file_storage, saved under\n+the specified save_path.

    \n+[report issue]
    \n+
    \n+

    make_magnet_uri()

    \n+

    Declared in "libtorrent/magnet_uri.hpp"

    \n+
    \n+std::string make_magnet_uri (add_torrent_params const& atp);\n+std::string make_magnet_uri (torrent_info const& info);\n+std::string make_magnet_uri (torrent_handle const& handle);\n+
    \n+

    Generates a magnet URI from the specified torrent.

    \n+

    Several fields from the add_torrent_params objects are recorded in the\n+magnet link. In order to not include them, they have to be cleared before\n+calling make_magnet_uri(). These fields are used:

    \n+
    \n+ti, info_hashes, url_seeds, dht_nodes,\n+file_priorities, trackers, name, peers.
    \n+

    Depending on what the use case for the resulting magnet link is, clearing\n+peers and dht_nodes is probably a good idea if the add_torrent_params\n+came from a running torrent. Those lists may be long and be ephemeral.

    \n+

    If none of the info_hashes or ti fields are set, there is not\n+info-hash available, and a magnet link cannot be created. In this case\n+make_magnet_uri() returns an empty string.

    \n+

    The recommended way to generate a magnet link from a torrent_handle is to\n+call save_resume_data(), which will post a save_resume_data_alert\n+containing an add_torrent_params object. This can then be passed to\n+make_magnet_uri().

    \n+

    The overload that takes a torrent_handle will make blocking calls to\n+query information about the torrent. If the torrent handle is invalid,\n+an empty string is returned.

    \n+

    For more information about magnet links, see magnet links.

    \n+[report issue]
    \n+
    \n+

    parse_magnet_uri()

    \n+

    Declared in "libtorrent/magnet_uri.hpp"

    \n+
    \n+add_torrent_params parse_magnet_uri (string_view uri, error_code& ec);\n+add_torrent_params parse_magnet_uri (string_view uri);\n+void parse_magnet_uri (string_view uri, add_torrent_params& p, error_code& ec);\n+
    \n+

    This function parses out information from the magnet link and populates the\n+add_torrent_params object. The overload that does not take an\n+error_code reference will throw a system_error on error\n+The overload taking an add_torrent_params reference will fill in the\n+fields specified in the magnet URI.

    \n+\n+\n+[report issue]
    \n+
    \n+

    load_torrent_file() load_torrent_buffer() load_torrent_parsed()

    \n+

    Declared in "libtorrent/load_torrent.hpp"

    \n+
    \n+add_torrent_params load_torrent_file (\n+   std::string const& filename, load_torrent_limits const& cfg);\n+add_torrent_params load_torrent_parsed (\n+   bdecode_node const& torrent_file, load_torrent_limits const& cfg);\n+add_torrent_params load_torrent_parsed (\n+   bdecode_node const& torrent_file);\n+add_torrent_params load_torrent_buffer (\n+   span<char const> buffer, load_torrent_limits const& cfg);\n+add_torrent_params load_torrent_file (\n+   std::string const& filename);\n+add_torrent_params load_torrent_buffer (\n+   span<char const> buffer);\n+
    \n+

    These functions load the content of a .torrent file into an\n+add_torrent_params object.\n+The immutable part of a torrent file (the info-dictionary) is stored in\n+the ti field in the add_torrent_params object (as a torrent_info\n+object).\n+The returned object is suitable to be:

    \n+
    \n+\n+
    \n+[report issue]
    \n+
    \n+

    enum socket_type_t

    \n+

    Declared in "libtorrent/socket_type.hpp"

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    namevaluedescription
    tcp0 
    socks51 
    http2 
    utp3 
    i2p4 
    tcp_ssl5 
    socks5_ssl6 
    http_ssl7 
    utp_ssl8 
    \n+[report issue]
    \n+
    \n+

    enum protocol_version

    \n+

    Declared in "libtorrent/info_hash.hpp"

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    namevaluedescription
    V10The original BitTorrent version, using SHA-1 hashes
    V21Version 2 of the BitTorrent protocol, using SHA-256 hashes
    NUM2 
    \n+[report issue]
    \n+
    \n+

    enum event_t

    \n+

    Declared in "libtorrent/tracker_manager.hpp"

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    namevaluedescription
    none0 
    completed1 
    started2 
    stopped3 
    paused4 
    \n+[report issue]
    \n+
    \n+

    enum connection_type

    \n+

    Declared in "libtorrent/peer_connection.hpp"

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    namevaluedescription
    bittorrent0 
    url_seed1 
    http_seed2 
    \n+[report issue]
    \n+
    \n+

    enum portmap_transport

    \n+

    Declared in "libtorrent/portmap.hpp"

    \n+\n+\n+\n+\n+\n \n \n \n \n \n \n \n \n-\n+\n \n-\n+\n \n-\n+\n \n \n \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n \n
    namevaluedescription
    tracker
    natpmp0 natpmp can be NAT-PMP or PCP
    node
    upnp1 
    routing_table2 
    rpc_manager3 
    traversal4 
    \n-[report issue]
    \n-
    module
    \n-
    the module, or part, of the DHT that produced this log message.
    \n-
    \n-[report issue]
    \n-
    \n-
    \n-

    dht_pkt_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    This alert is posted every time a DHT message is sent or received. It is\n-only posted if the alert_category::dht_log alert category is\n-enabled. It contains a verbatim copy of the message.

    \n-
    \n-struct dht_pkt_alert final : alert\n-{\n-   std::string message () const override;\n-   span<char const> pkt_buf () const;\n-\n-   enum direction_t\n-   {\n-      incoming,\n-      outgoing,\n-   };\n-\n-   static constexpr alert_category_t static_category  = alert_category::dht_log;\n-   direction_t direction;\n-   aux::noexcept_movable<udp::endpoint> node;\n-};\n-
    \n-[report issue]
    \n-

    pkt_buf()

    \n-
    \n-span<char const> pkt_buf () const;\n-
    \n-

    returns a pointer to the packet buffer and size of the packet,\n-respectively. This buffer is only valid for as long as the alert itself\n-is valid, which is owned by libtorrent and reclaimed whenever\n-pop_alerts() is called on the session.

    \n-[report issue]
    \n-
    \n-

    enum direction_t

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n+[report issue]
    \n+
    \n+

    enum portmap_protocol

    \n+

    Declared in "libtorrent/portmap.hpp"

    \n \n \n-\n \n-\n+\n+\n \n \n \n \n \n \n \n \n-\n+\n \n \n \n-\n+\n \n \n \n+\n+\n+\n+\n \n
    namevaluedescription
    incoming
    none0 
    outgoing
    tcp1 
    udp2 
    \n-[report issue]
    \n-
    direction
    \n-
    whether this is an incoming or outgoing packet.
    \n+[report issue]
    \n+
    \n+

    pex_flags_t

    \n+

    Declared in "libtorrent/pex_flags.hpp"

    \n+
    \n+
    pex_encryption
    \n+
    the peer supports protocol encryption
    \n
    \n-[report issue]
    \n-
    node
    \n-
    the DHT node we received this packet from, or sent this packet to\n-(depending on direction).
    \n+
    \n+
    pex_seed
    \n+
    the peer is a seed
    \n
    \n-[report issue]
    \n-
    \n-
    \n-

    dht_get_peers_reply_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    Posted when we receive a response to a DHT get_peers request.

    \n-
    \n-struct dht_get_peers_reply_alert final : alert\n-{\n-   std::string message () const override;\n-   int num_peers () const;\n-   std::vector<tcp::endpoint> peers () const;\n-\n-   static constexpr alert_category_t static_category  = alert_category::dht_operation;\n-   sha1_hash info_hash;\n-};\n-
    \n-[report issue]
    \n-
    \n-

    dht_direct_response_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    This is posted exactly once for every call to session_handle::dht_direct_request.\n-If the request failed, response() will return a default constructed bdecode_node.

    \n-
    \n-struct dht_direct_response_alert final : alert\n-{\n-   std::string message () const override;\n-   bdecode_node response () const;\n-\n-   static constexpr alert_category_t static_category  = alert_category::dht;\n-   client_data_t userdata;\n-   aux::noexcept_movable<udp::endpoint> endpoint;\n-};\n-
    \n-[report issue]
    \n-
    \n-

    picker_log_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    this is posted when one or more blocks are picked by the piece picker,\n-assuming the verbose piece picker logging is enabled (see\n-alert_category::picker_log).

    \n-
    \n-struct picker_log_alert final : peer_alert\n-{\n-   std::string message () const override;\n-   std::vector<piece_block> blocks () const;\n-\n-   static constexpr alert_category_t static_category  = alert_category::picker_log;\n-   static constexpr picker_flags_t partial_ratio  = 0_bit;\n-   static constexpr picker_flags_t prioritize_partials  = 1_bit;\n-   static constexpr picker_flags_t rarest_first_partials  = 2_bit;\n-   static constexpr picker_flags_t rarest_first  = 3_bit;\n-   static constexpr picker_flags_t reverse_rarest_first  = 4_bit;\n-   static constexpr picker_flags_t suggested_pieces  = 5_bit;\n-   static constexpr picker_flags_t prio_sequential_pieces  = 6_bit;\n-   static constexpr picker_flags_t sequential_pieces  = 7_bit;\n-   static constexpr picker_flags_t reverse_pieces  = 8_bit;\n-   static constexpr picker_flags_t time_critical  = 9_bit;\n-   static constexpr picker_flags_t random_pieces  = 10_bit;\n-   static constexpr picker_flags_t prefer_contiguous  = 11_bit;\n-   static constexpr picker_flags_t reverse_sequential  = 12_bit;\n-   static constexpr picker_flags_t backup1  = 13_bit;\n-   static constexpr picker_flags_t backup2  = 14_bit;\n-   static constexpr picker_flags_t end_game  = 15_bit;\n-   static constexpr picker_flags_t extent_affinity  = 16_bit;\n-   picker_flags_t const picker_flags;\n-};\n-
    \n-[report issue]
    \n-
    picker_flags
    \n-
    this is a bitmask of which features were enabled for this particular\n-pick. The bits are defined in the picker_flags_t enum.
    \n+
    \n+
    pex_utp
    \n+
    the peer supports the uTP, transport protocol over UDP.
    \n
    \n-[report issue]
    \n-
    \n-

    session_error_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    this alert is posted when the session encounters a serious error,\n-potentially fatal

    \n-
    \n-struct session_error_alert final : alert\n-{\n-   std::string message () const override;\n-\n-   static constexpr alert_category_t static_category  = alert_category::error;\n-   error_code const error;\n-};\n-
    \n-[report issue]
    \n-
    error
    \n-
    The error code, if one is associated with this error
    \n+
    \n+
    pex_holepunch
    \n+
    the peer supports the holepunch extension If this flag is received from a\n+peer, it can be used as a rendezvous point in case direct connections to\n+the peer fail
    \n
    \n-[report issue]
    \n-
    \n-

    dht_live_nodes_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    posted in response to a call to session::dht_live_nodes(). It contains the\n-live nodes from the DHT routing table of one of the DHT nodes running\n-locally.

    \n-
    \n-struct dht_live_nodes_alert final : alert\n-{\n-   std::string message () const override;\n-   int num_nodes () const;\n-   std::vector<std::pair<sha1_hash, udp::endpoint>> nodes () const;\n-\n-   static constexpr alert_category_t static_category  = alert_category::dht;\n-   sha1_hash node_id;\n-};\n-
    \n-\n-[report issue]
    \n-

    num_nodes() nodes()

    \n-
    \n-int num_nodes () const;\n-std::vector<std::pair<sha1_hash, udp::endpoint>> nodes () const;\n-
    \n-

    the number of nodes in the routing table and the actual nodes.

    \n-[report issue]
    \n-
    node_id
    \n-
    the local DHT node's node-ID this routing table belongs to
    \n+
    \n+
    pex_lt_v2
    \n+
    protocol v2\n+this is not a standard flag, it is only used internally
    \n
    \n-[report issue]
    \n-
    \n-
    \n-

    session_stats_header_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    The session_stats_header alert is posted the first time\n-post_session_stats() is called

    \n-

    the message() member function returns a string representation of the\n-header that properly match the stats values string returned in\n-session_stats_alert::message().

    \n-

    this specific output is parsed by tools/parse_session_stats.py\n-if this is changed, that parser should also be changed

    \n-
    \n-struct session_stats_header_alert final : alert\n-{\n-   std::string message () const override;\n-\n-   static constexpr alert_category_t static_category  = {};\n-};\n-
    \n-[report issue]
    \n-
    \n-

    dht_sample_infohashes_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    posted as a response to a call to session::dht_sample_infohashes() with\n-the information from the DHT response message.

    \n-
    \n-struct dht_sample_infohashes_alert final : alert\n-{\n-   std::string message () const override;\n-   int num_samples () const;\n-   std::vector<sha1_hash> samples () const;\n-   int num_nodes () const;\n-   std::vector<std::pair<sha1_hash, udp::endpoint>> nodes () const;\n-\n-   static constexpr alert_category_t static_category  = alert_category::dht_operation;\n-   sha1_hash node_id;\n-   aux::noexcept_movable<udp::endpoint> endpoint;\n-   time_duration const interval;\n-   int const num_infohashes;\n-};\n-
    \n-\n-[report issue]
    \n-

    samples() num_samples()

    \n-
    \n-int num_samples () const;\n-std::vector<sha1_hash> samples () const;\n-
    \n-

    returns the number of info-hashes returned by the node, as well as the\n-actual info-hashes. num_samples() is more efficient than\n-samples().size().

    \n-[report issue]
    \n-
    \n-

    num_nodes()

    \n-
    \n-int num_nodes () const;\n-
    \n-

    The total number of nodes returned by nodes().

    \n-[report issue]
    \n-
    \n-

    nodes()

    \n-
    \n-std::vector<std::pair<sha1_hash, udp::endpoint>> nodes () const;\n-
    \n-

    This is the set of more DHT nodes returned by the request.

    \n-

    The information is included so that indexing nodes can perform a key\n-space traversal with a single RPC per node by adjusting the target\n-value for each RPC.

    \n-[report issue]
    \n-
    node_id
    \n-
    id of the node the request was sent to (and this response was received from)
    \n+[report issue]
    \n+
    \n+

    torrent_flags_t

    \n+

    Declared in "libtorrent/torrent_flags.hpp"

    \n+
    \n+
    seed_mode
    \n+

    If seed_mode is set, libtorrent will assume that all files\n+are present for this torrent and that they all match the hashes in\n+the torrent file. Each time a peer requests to download a block,\n+the piece is verified against the hash, unless it has been verified\n+already. If a hash fails, the torrent will automatically leave the\n+seed mode and recheck all the files. The use case for this mode is\n+if a torrent is created and seeded, or if the user already know\n+that the files are complete, this is a way to avoid the initial\n+file checks, and significantly reduce the startup time.

    \n+

    Setting seed_mode on a torrent without metadata (a\n+.torrent file) is a no-op and will be ignored.

    \n+

    It is not possible to set the seed_mode flag on a torrent after it has\n+been added to a session. It is possible to clear it though.

    \n+
    \n
    \n-[report issue]
    \n-
    endpoint
    \n-
    the node the request was sent to (and this response was received from)
    \n+
    \n+
    upload_mode
    \n+

    If upload_mode is set, the torrent will be initialized in\n+upload-mode, which means it will not make any piece requests. This\n+state is typically entered on disk I/O errors, and if the torrent\n+is also auto managed, it will be taken out of this state\n+periodically (see settings_pack::optimistic_disk_retry).

    \n+

    This mode can be used to avoid race conditions when\n+adjusting priorities of pieces before allowing the torrent to start\n+downloading.

    \n+

    If the torrent is auto-managed (auto_managed), the torrent\n+will eventually be taken out of upload-mode, regardless of how it\n+got there. If it's important to manually control when the torrent\n+leaves upload mode, don't make it auto managed.

    \n+
    \n
    \n-[report issue]
    \n-
    interval
    \n-
    the interval to wait before making another request to this node
    \n+
    \n+
    share_mode
    \n+

    determines if the torrent should be added in share mode or not.\n+Share mode indicates that we are not interested in downloading the\n+torrent, but merely want to improve our share ratio (i.e. increase\n+it). A torrent started in share mode will do its best to never\n+download more than it uploads to the swarm. If the swarm does not\n+have enough demand for upload capacity, the torrent will not\n+download anything. This mode is intended to be safe to add any\n+number of torrents to, without manual screening, without the risk\n+of downloading more than is uploaded.

    \n+

    A torrent in share mode sets the priority to all pieces to 0,\n+except for the pieces that are downloaded, when pieces are decided\n+to be downloaded. This affects the progress bar, which might be set\n+to "100% finished" most of the time. Do not change file or piece\n+priorities for torrents in share mode, it will make it not work.

    \n+

    The share mode has one setting, the share ratio target, see\n+settings_pack::share_mode_target for more info.

    \n+
    \n
    \n-[report issue]
    \n-
    num_infohashes
    \n-
    This field indicates how many info-hash keys are currently in the node's storage.\n-If the value is larger than the number of returned samples it indicates that the\n-indexer may obtain additional samples after waiting out the interval.
    \n+
    \n+
    apply_ip_filter
    \n+
    determines if the IP filter should apply to this torrent or not. By\n+default all torrents are subject to filtering by the IP filter\n+(i.e. this flag is set by default). This is useful if certain\n+torrents needs to be exempt for some reason, being an auto-update\n+torrent for instance.
    \n
    \n-[report issue]
    \n-
    \n-
    \n-

    block_uploaded_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    This alert is posted when a block intended to be sent to a peer is placed in the\n-send buffer. Note that if the connection is closed before the send buffer is sent,\n-the alert may be posted without the bytes having been sent to the peer.\n-It belongs to the alert_category::upload category.

    \n-
    \n-struct block_uploaded_alert final : peer_alert\n-{\n-   std::string message () const override;\n-\n-   int const block_index;\n-   piece_index_t const piece_index;\n-};\n-
    \n-[report issue]
    \n-
    \n-

    alerts_dropped_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    this alert is posted to indicate to the client that some alerts were\n-dropped. Dropped meaning that the alert failed to be delivered to the\n-client. The most common cause of such failure is that the internal alert\n-queue grew too big (controlled by alert_queue_size).

    \n-
    \n-struct alerts_dropped_alert final : alert\n-{\n-   static_assert (num_alert_types <= abi_alert_count, "need to increase bitset. This is an ABI break");\n-   std::string message () const override;\n-\n-   static constexpr alert_category_t static_category  = alert_category::error;\n-   std::bitset<abi_alert_count> dropped_alerts;\n-};\n-
    \n-[report issue]
    \n-
    dropped_alerts
    \n-
    a bitmask indicating which alerts were dropped. Each bit represents the\n-alert type ID, where bit 0 represents whether any alert of type 0 has\n-been dropped, and so on.
    \n+
    \n+
    paused
    \n+
    specifies whether or not the torrent is paused. i.e. it won't connect to the tracker or any of the peers\n+until it's resumed. Note that a paused torrent that also has the\n+auto_managed flag set can be started at any time by libtorrent's queuing\n+logic. See queuing.
    \n
    \n-[report issue]
    \n-
    \n-

    socks5_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    this alert is posted with SOCKS5 related errors, when a SOCKS5 proxy is\n-configured. It's enabled with the alert_category::error alert category.

    \n-
    \n-struct socks5_alert final : alert\n-{\n-   std::string message () const override;\n-\n-   static constexpr alert_category_t static_category  = alert_category::error;\n-   error_code error;\n-   operation_t op;\n-   aux::noexcept_movable<tcp::endpoint> ip;\n-};\n-
    \n-[report issue]
    \n-
    error
    \n-
    the error
    \n+
    \n+
    auto_managed
    \n+

    If the torrent is auto-managed (auto_managed), the torrent\n+may be resumed at any point, regardless of how it paused. If it's\n+important to manually control when the torrent is paused and\n+resumed, don't make it auto managed.

    \n+

    If auto_managed is set, the torrent will be queued,\n+started and seeded automatically by libtorrent. When this is set,\n+the torrent should also be started as paused. The default queue\n+order is the order the torrents were added. They are all downloaded\n+in that order. For more details, see queuing.

    \n+
    \n
    \n-[report issue]
    \n-
    op
    \n-
    the operation that failed
    \n+
    \n+
    duplicate_is_error
    \n+
    used in add_torrent_params to indicate that it's an error to attempt\n+to add a torrent that's already in the session. If it's not considered an\n+error, a handle to the existing torrent is returned.\n+This flag is not saved by write_resume_data(), since it is only meant for\n+adding torrents.
    \n
    \n-[report issue]
    \n-
    ip
    \n-
    the endpoint configured as the proxy
    \n+
    \n+
    update_subscribe
    \n+
    on by default and means that this torrent will be part of state\n+updates when calling post_torrent_updates().\n+This flag is not saved by write_resume_data().
    \n
    \n-[report issue]
    \n-
    \n-

    file_prio_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    posted when a prioritize_files() or file_priority() update of the file\n-priorities complete, which requires a round-trip to the disk thread.

    \n-

    If the disk operation fails this alert won't be posted, but a\n-file_error_alert is posted instead, and the torrent is stopped.

    \n-
    \n-struct file_prio_alert final : torrent_alert\n-{\n-   std::string message () const override;\n-\n-   static constexpr alert_category_t static_category  = alert_category::storage;\n-   error_code error;\n-   operation_t op;\n-};\n-
    \n-[report issue]
    \n-
    error
    \n-
    the error
    \n+
    \n+
    super_seeding
    \n+
    sets the torrent into super seeding/initial seeding mode. If the torrent\n+is not a seed, this flag has no effect.
    \n
    \n-[report issue]
    \n-
    op
    \n-
    the operation that failed
    \n+
    \n+
    sequential_download
    \n+
    sets the sequential download state for the torrent. In this mode the\n+piece picker will pick pieces with low index numbers before pieces with\n+high indices. The actual pieces that are picked depend on other factors\n+still, such as which pieces a peer has and whether it is in parole mode\n+or "prefer whole pieces"-mode. Sequential mode is not ideal for streaming\n+media. For that, see set_piece_deadline() instead.
    \n
    \n-[report issue]
    \n-
    \n-

    oversized_file_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    this alert may be posted when the initial checking of resume data and files\n-on disk (just existence, not piece hashes) completes. If a file belonging\n-to the torrent is found on disk, but is larger than the file in the\n-torrent, that's when this alert is posted.\n-the client may want to call truncate_files() in that case, or perhaps\n-interpret it as a sign that some other file is in the way, that shouldn't\n-be overwritten.

    \n-
    \n-struct oversized_file_alert final : torrent_alert\n-{\n-   std::string message () const override;\n-\n-   static constexpr alert_category_t static_category  = alert_category::storage;\n-};\n-
    \n-[report issue]
    \n-
    \n-

    torrent_conflict_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    this alert is posted when two separate torrents (magnet links) resolve to\n-the same torrent, thus causing the same torrent being added twice. In\n-that case, both torrents enter an error state with duplicate_torrent\n-as the error code. This alert is posted containing the metadata. For more\n-information, see BitTorrent v2 torrents.\n-The torrent this alert originated from was the one that downloaded the

    \n-

    metadata (i.e. the handle member from the torrent_alert base class).

    \n-
    \n-struct torrent_conflict_alert final : torrent_alert\n-{\n-   std::string message () const override;\n-\n-   static constexpr alert_category_t static_category  = alert_category::error;\n-   torrent_handle conflicting_torrent;\n-   std::shared_ptr<torrent_info> metadata;\n-};\n-
    \n-[report issue]
    \n-
    conflicting_torrent
    \n-
    the handle to the torrent in conflict. The swarm associated with this\n-torrent handle did not download the metadata, but the downloaded\n-metadata collided with this swarm's info-hash.
    \n+
    \n+
    stop_when_ready
    \n+

    When this flag is set, the torrent will force stop whenever it\n+transitions from a non-data-transferring state into a data-transferring\n+state (referred to as being ready to download or seed). This is useful\n+for torrents that should not start downloading or seeding yet, but want\n+to be made ready to do so. A torrent may need to have its files checked\n+for instance, so it needs to be started and possibly queued for checking\n+(auto-managed and started) but as soon as it's done, it should be\n+stopped.

    \n+

    Force stopped means auto-managed is set to false and it's paused. As\n+if the auto_manages flag is cleared and the paused flag is set on the torrent.

    \n+

    Note that the torrent may transition into a downloading state while\n+setting this flag, and since the logic is edge triggered you may\n+miss the edge. To avoid this race, if the torrent already is in a\n+downloading state when this call is made, it will trigger the\n+stop-when-ready immediately.

    \n+

    When the stop-when-ready logic fires, the flag is cleared. Any\n+subsequent transitions between downloading and non-downloading states\n+will not be affected, until this flag is set again.

    \n+

    The behavior is more robust when setting this flag as part of adding\n+the torrent. See add_torrent_params.

    \n+

    The stop-when-ready flag fixes the inherent race condition of waiting\n+for the state_changed_alert and then call pause(). The download/seeding\n+will most likely start in between posting the alert and receiving the\n+call to pause.

    \n+

    A downloading state is one where peers are being connected. Which means\n+just downloading the metadata via the ut_metadata extension counts\n+as a downloading state. In order to stop a torrent once the metadata\n+has been downloaded, instead set all file priorities to dont_download

    \n+
    \n
    \n-[report issue]
    \n-
    metadata
    \n-
    the metadata that was received by one of the torrents in conflict.\n-One way to resolve the conflict is to remove both failing torrents\n-and re-add it using this metadata
    \n+
    \n+
    override_trackers
    \n+
    when this flag is set, the tracker list in the add_torrent_params\n+object override any trackers from the torrent file. If the flag is\n+not set, the trackers from the add_torrent_params object will be\n+added to the list of trackers used by the torrent.\n+This flag is set by read_resume_data() if there are trackers present in\n+the resume data file. This effectively makes the trackers saved in the\n+resume data take precedence over the original trackers. This includes if\n+there's an empty list of trackers, to support the case where they were\n+explicitly removed in the previous session.\n+This flag is not saved by write_resume_data()
    \n
    \n-[report issue]
    \n-
    \n-

    peer_info_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    posted when torrent_handle::post_peer_info() is called

    \n-
    \n-struct peer_info_alert final : torrent_alert\n-{\n-   std::string message () const override;\n-\n-   static constexpr alert_category_t static_category  = alert_category::status;\n-   std::vector<lt::peer_info> peer_info;\n-};\n-
    \n-[report issue]
    \n-
    peer_info
    \n-
    the list of the currently connected peers
    \n+
    \n+
    override_web_seeds
    \n+
    If this flag is set, the web seeds from the add_torrent_params\n+object will override any web seeds in the torrent file. If it's not\n+set, web seeds in the add_torrent_params object will be added to the\n+list of web seeds used by the torrent.\n+This flag is set by read_resume_data() if there are web seeds present in\n+the resume data file. This effectively makes the web seeds saved in the\n+resume data take precedence over the original ones. This includes if\n+there's an empty list of web seeds, to support the case where they were\n+explicitly removed in the previous session.\n+This flag is not saved by write_resume_data()
    \n
    \n-[report issue]
    \n-
    \n-

    file_progress_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    posted when torrent_handle::post_file_progress() is called

    \n-
    \n-struct file_progress_alert final : torrent_alert\n-{\n-   std::string message () const override;\n-\n-   static constexpr alert_category_t static_category  = alert_category::file_progress;\n-   aux::vector<std::int64_t, file_index_t> files;\n-};\n-
    \n-[report issue]
    \n-
    files
    \n-
    the list of the files in the torrent
    \n+
    \n+
    need_save_resume
    \n+

    if this flag is set (which it is by default) the torrent will be\n+considered needing to save its resume data immediately, in the\n+category if_metadata_changed. See resume_data_flags_t and\n+save_resume_data() for details.

    \n+

    This flag is cleared by a successful call to save_resume_data()\n+This flag is not saved by write_resume_data(), since it represents an\n+ephemeral state of a running torrent.

    \n+
    \n
    \n-[report issue]
    \n-
    \n-

    piece_info_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    posted when torrent_handle::post_download_queue() is called

    \n-
    \n-struct piece_info_alert final : torrent_alert\n-{\n-   std::string message () const override;\n-\n-   static constexpr alert_category_t static_category  = alert_category::piece_progress;\n-   std::vector<partial_piece_info> piece_info;\n-   std::vector<block_info> block_data;\n-};\n-
    \n-[report issue]
    \n-
    piece_info
    \n-
    info about pieces being downloaded for the torrent
    \n+
    \n+
    disable_dht
    \n+
    set this flag to disable DHT for this torrent. This lets you have the DHT\n+enabled for the whole client, and still have specific torrents not\n+participating in it. i.e. not announcing to the DHT nor picking up peers\n+from it.
    \n
    \n-[report issue]
    \n-
    block_data
    \n-
    storage for block_info pointers in partial_piece_info objects
    \n+
    \n+
    disable_lsd
    \n+
    set this flag to disable local service discovery for this torrent.
    \n
    \n-[report issue]
    \n-
    \n-

    piece_availability_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    posted when torrent_handle::post_piece_availability() is called

    \n-
    \n-struct piece_availability_alert final : torrent_alert\n-{\n-   std::string message () const override;\n-\n-   static constexpr alert_category_t static_category  = alert_category::status;\n-   std::vector<int> piece_availability;\n-};\n-
    \n-[report issue]
    \n-
    piece_availability
    \n-
    info about pieces being downloaded for the torrent
    \n+
    \n+
    disable_pex
    \n+
    set this flag to disable peer exchange for this torrent.
    \n
    \n-[report issue]
    \n-
    \n-

    tracker_list_alert

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-

    posted when torrent_handle::post_trackers() is called

    \n-
    \n-struct tracker_list_alert final : torrent_alert\n-{\n-   std::string message () const override;\n-\n-   static constexpr alert_category_t static_category  = alert_category::status;\n-   std::vector<announce_entry> trackers;\n-};\n-
    \n-[report issue]
    \n-
    trackers
    \n-
    list of trackers and their status for the torrent
    \n+
    \n+
    no_verify_files
    \n+
    if this flag is set, the resume data will be assumed to be correct\n+without validating it against any files on disk. This may be used when\n+restoring a session by loading resume data from disk. It will save time\n+and also delay any hard disk errors until files are actually needed. If\n+the resume data cannot be trusted, or if a torrent is added for the first\n+time to some save path that may already have some of the files, this flag\n+should not be set.
    \n
    \n-[report issue]
    \n-
    \n-

    alert

    \n-

    Declared in "libtorrent/alert.hpp"

    \n-

    The alert class is the base class that specific messages are derived from.\n-alert types are not copyable, and cannot be constructed by the client. The\n-pointers returned by libtorrent are short lived (the details are described\n-under session_handle::pop_alerts())

    \n+
    \n+
    default_dont_download
    \n+
    default all file priorities to dont_download. This is useful for adding\n+magnet links where the number of files is unknown, but the\n+file_priorities is still set for some files. Any file not covered by\n+the file_priorities list will be set to normal download priority,\n+unless this flag is set, in which case they will be set to 0\n+(dont_download).
    \n+
    \n+
    \n+
    i2p_torrent
    \n+
    this flag makes the torrent be considered an "i2p torrent" for purposes\n+of the allow_i2p_mixed setting. When mixing regular peers and i2p peers\n+is disabled, i2p torrents won't add normal peers to its peer list.\n+Note that non i2p torrents may still allow i2p peers (on the off-chance\n+that a tracker return them and the session is configured with a SAM\n+connection).\n+This flag is set automatically when adding a torrent that has at least\n+one tracker whose hostname ends with .i2p.\n+It's also set by parse_magnet_uri() if the tracker list contains such\n+URL.
    \n+
    \n+
    \n+
    all
    \n+
    all torrent flags combined. Can conveniently be used when creating masks\n+for flags
    \n+
    \n+[report issue]
    \n+
    \n+

    int

    \n+

    Declared in "libtorrent/version.hpp"

    \n+
    \n+
    version_major
    \n+
    the major, minor and tiny versions of libtorrent
    \n+
    \n+
    \n+
    version_minor
    \n+
    the major, minor and tiny versions of libtorrent
    \n+
    \n+
    \n+
    version_tiny
    \n+
    the major, minor and tiny versions of libtorrent
    \n+
    \n+[report issue]
    \n+
    \n+

    char const*

    \n+

    Declared in "libtorrent/version.hpp"

    \n+
    \n+
    version_str
    \n+
    the libtorrent version in string form
    \n+
    \n+[report issue]
    \n+
    \n+

    std::uint64_t

    \n+

    Declared in "libtorrent/version.hpp"

    \n+
    \n+
    version_revision
    \n+
    the git commit of this libtorrent version
    \n+
    \n+[report issue]
    \n+
    \n+

    download_priority_t

    \n+

    Declared in "libtorrent/download_priority.hpp"

    \n+
    \n+
    dont_download
    \n+
    Don't download the file or piece. Partial pieces may still be downloaded when\n+setting file priorities.
    \n+
    \n+
    \n+
    default_priority
    \n+
    The default priority for files and pieces.
    \n+
    \n+
    \n+
    low_priority
    \n+
    The lowest priority for files and pieces.
    \n+
    \n+
    \n+
    top_priority
    \n+
    The highest priority for files and pieces.
    \n+
    \n+[report issue]
    \n+
    \n+

    torrent_status

    \n+

    Declared in "libtorrent/torrent_status.hpp"

    \n+

    holds a snapshot of the status of a torrent, as queried by\n+torrent_handle::status().

    \n
    \n-struct alert\n+struct torrent_status\n {\n-   time_point timestamp () const;\n-   virtual int type () const noexcept = 0;\n-   virtual char const* what () const noexcept = 0;\n-   virtual std::string message () const = 0;\n-   virtual alert_category_t category () const noexcept = 0;\n+   bool operator== (torrent_status const& st) const;\n \n-   static constexpr alert_category_t error_notification  = 0_bit;\n-   static constexpr alert_category_t peer_notification  = 1_bit;\n-   static constexpr alert_category_t port_mapping_notification  = 2_bit;\n-   static constexpr alert_category_t storage_notification  = 3_bit;\n-   static constexpr alert_category_t tracker_notification  = 4_bit;\n-   static constexpr alert_category_t connect_notification  = 5_bit;\n-   static constexpr alert_category_t status_notification  = 6_bit;\n-   static constexpr alert_category_t ip_block_notification  = 8_bit;\n-   static constexpr alert_category_t performance_warning  = 9_bit;\n-   static constexpr alert_category_t dht_notification  = 10_bit;\n-   static constexpr alert_category_t session_log_notification  = 13_bit;\n-   static constexpr alert_category_t torrent_log_notification  = 14_bit;\n-   static constexpr alert_category_t peer_log_notification  = 15_bit;\n-   static constexpr alert_category_t incoming_request_notification  = 16_bit;\n-   static constexpr alert_category_t dht_log_notification  = 17_bit;\n-   static constexpr alert_category_t dht_operation_notification  = 18_bit;\n-   static constexpr alert_category_t port_mapping_log_notification  = 19_bit;\n-   static constexpr alert_category_t picker_log_notification  = 20_bit;\n-   static constexpr alert_category_t file_progress_notification  = 21_bit;\n-   static constexpr alert_category_t piece_progress_notification  = 22_bit;\n-   static constexpr alert_category_t upload_notification  = 23_bit;\n-   static constexpr alert_category_t block_progress_notification  = 24_bit;\n-   static constexpr alert_category_t all_categories  = alert_category_t::all();\n-};\n-
    \n-[report issue]
    \n-

    timestamp()

    \n-
    \n-time_point timestamp () const;\n-
    \n-

    a timestamp is automatically created in the constructor

    \n-[report issue]
    \n-
    \n-

    type()

    \n-
    \n-virtual int type () const noexcept = 0;\n-
    \n-

    returns an integer that is unique to this alert type. It can be\n-compared against a specific alert by querying a static constant called alert_type\n-in the alert. It can be used to determine the run-time type of an alert* in\n-order to cast to that alert type and access specific members.

    \n-

    e.g:

    \n-
    \n-std::vector<alert*> alerts;\n-ses.pop_alerts(&alerts);\n-for (alert* a : alerts) {\n-        switch (a->type()) {\n+   enum state_t\n+   {\n+      checking_files,\n+      downloading_metadata,\n+      downloading,\n+      finished,\n+      seeding,\n+      unused_enum_for_backwards_compatibility_allocating,\n+      checking_resume_data,\n+   };\n \n-                case read_piece_alert::alert_type:\n-                {\n-                        auto* p = static_cast<read_piece_alert*>(a);\n-                        if (p->ec) {\n-                                // read_piece failed\n-                                break;\n-                        }\n-                        // use p\n-                        break;\n-                }\n-                case file_renamed_alert::alert_type:\n-                {\n-                        // etc...\n-                }\n-        }\n-}\n-
    \n-[report issue]
    \n-
    \n-

    what()

    \n-
    \n-virtual char const* what () const noexcept = 0;\n-
    \n-

    returns a string literal describing the type of the alert. It does\n-not include any information that might be bundled with the alert.

    \n-[report issue]
    \n-
    \n-

    message()

    \n-
    \n-virtual std::string message () const = 0;\n-
    \n-

    generate a string describing the alert and the information bundled\n-with it. This is mainly intended for debug and development use. It is not suitable\n-to use this for applications that may be localized. Instead, handle each alert\n-type individually and extract and render the information from the alert depending\n-on the locale.

    \n-[report issue]
    \n-
    \n-

    category()

    \n-
    \n-virtual alert_category_t category () const noexcept = 0;\n-
    \n-

    returns a bitmask specifying which categories this alert belong to.

    \n-[report issue]
    \n-
    \n-
    \n-

    alert_cast()

    \n-

    Declared in "libtorrent/alert.hpp"

    \n-
    \n-template <typename T> T const* alert_cast (alert const* a);\n-template <typename T> T* alert_cast (alert* a);\n+   torrent_handle handle;\n+   error_code errc;\n+   file_index_t error_file  = torrent_status::error_file_none;\n+   static constexpr file_index_t error_file_none {-1};\n+   static constexpr file_index_t error_file_ssl_ctx {-3};\n+   static constexpr file_index_t error_file_metadata {-4};\n+   static constexpr file_index_t error_file_exception {-5};\n+   static constexpr file_index_t error_file_partfile {-6};\n+   std::string save_path;\n+   std::string name;\n+   std::weak_ptr<const torrent_info> torrent_file;\n+   time_duration next_announce  = seconds{0};\n+   std::string current_tracker;\n+   std::int64_t total_download  = 0;\n+   std::int64_t total_upload  = 0;\n+   std::int64_t total_payload_download  = 0;\n+   std::int64_t total_payload_upload  = 0;\n+   std::int64_t total_failed_bytes  = 0;\n+   std::int64_t total_redundant_bytes  = 0;\n+   typed_bitfield<piece_index_t> pieces;\n+   typed_bitfield<piece_index_t> verified_pieces;\n+   std::int64_t total_done  = 0;\n+   std::int64_t total  = 0;\n+   std::int64_t total_wanted_done  = 0;\n+   std::int64_t total_wanted  = 0;\n+   std::int64_t all_time_upload  = 0;\n+   std::int64_t all_time_download  = 0;\n+   std::time_t added_time  = 0;\n+   std::time_t completed_time  = 0;\n+   std::time_t last_seen_complete  = 0;\n+   storage_mode_t storage_mode  = storage_mode_sparse;\n+   float progress  = 0.f;\n+   int progress_ppm  = 0;\n+   queue_position_t queue_position {};\n+   int download_rate  = 0;\n+   int upload_rate  = 0;\n+   int download_payload_rate  = 0;\n+   int upload_payload_rate  = 0;\n+   int num_seeds  = 0;\n+   int num_peers  = 0;\n+   int num_complete  = -1;\n+   int num_incomplete  = -1;\n+   int list_seeds  = 0;\n+   int list_peers  = 0;\n+   int connect_candidates  = 0;\n+   int num_pieces  = 0;\n+   int distributed_full_copies  = 0;\n+   int distributed_fraction  = 0;\n+   float distributed_copies  = 0.f;\n+   int block_size  = 0;\n+   int num_uploads  = 0;\n+   int num_connections  = 0;\n+   int uploads_limit  = 0;\n+   int connections_limit  = 0;\n+   int up_bandwidth_queue  = 0;\n+   int down_bandwidth_queue  = 0;\n+   int seed_rank  = 0;\n+   state_t state  = checking_resume_data;\n+   bool need_save_resume  = false;\n+   bool is_seeding  = false;\n+   bool is_finished  = false;\n+   bool has_metadata  = false;\n+   bool has_incoming  = false;\n+   bool moving_storage  = false;\n+   bool announcing_to_trackers  = false;\n+   bool announcing_to_lsd  = false;\n+   bool announcing_to_dht  = false;\n+   info_hash_t info_hashes;\n+   time_point last_upload;\n+   time_point last_download;\n+   seconds active_duration;\n+   seconds finished_duration;\n+   seconds seeding_duration;\n+   torrent_flags_t flags {};\n+};\n 
    \n-

    When you get an alert, you can use alert_cast<> to attempt to cast the\n-pointer to a specific alert type, in order to query it for more\n-information.

    \n-
    \n-

    Note

    \n-

    alert_cast<> can only cast to an exact alert type, not a base class

    \n-
    \n-[report issue]
    \n-
    \n-

    operation_name()

    \n-

    Declared in "libtorrent/operations.hpp"

    \n+[report issue]
    \n+

    operator==()

    \n
    \n-char const* operation_name (operation_t op);\n+bool operator== (torrent_status const& st) const;\n 
    \n-

    maps an operation id (from peer_error_alert and peer_disconnected_alert)\n-to its name. See operation_t for the constants

    \n-[report issue]
    \n-
    \n-

    enum operation_t

    \n-

    Declared in "libtorrent/operations.hpp"

    \n+

    compares if the torrent status objects come from the same torrent. i.e.\n+only the torrent_handle field is compared.

    \n+[report issue]
    \n+
    \n+

    enum state_t

    \n+

    Declared in "libtorrent/torrent_status.hpp"

    \n \n \n-\n-\n-\n+\n+\n+\n \n \n \n \n \n \n \n \n-\n-\n-\n-\n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n \n \n
    namevaluedescription
    unknown0the error was unexpected and it is unknown which operation caused it
    bittorrent
    checking_files1this is used when the bittorrent logic\n-determines to disconnectThe torrent has not started its download yet, and is\n+currently checking existing files.
    iocontrol
    downloading_metadata2a call to iocontrol failedThe torrent is trying to download metadata from peers.\n+This implies the ut_metadata extension is in use.
    getpeername
    downloading3a call to getpeername() failed (querying the remote IP of a\n-connection)The torrent is being downloaded. This is the state\n+most torrents will be in most of the time. The progress\n+meter will tell how much of the files that has been\n+downloaded.
    getname
    finished4a call to getname failed (querying the local IP of a\n-connection)In this state the torrent has finished downloading but\n+still doesn't have the entire torrent. i.e. some pieces\n+are filtered and won't get downloaded.
    alloc_recvbuf
    seeding5an attempt to allocate a receive buffer failedIn this state the torrent has finished downloading and\n+is a pure seeder.
    alloc_sndbuf
    unused_enum_for_backwards_compatibility_allocating6an attempt to allocate a send buffer failedIf the torrent was started in full allocation mode, this\n+indicates that the (disk) storage for the torrent is\n+allocated.
    file_write
    checking_resume_data7writing to a file failed
    file_read8reading from a file failed
    file9a non-read and non-write file operation failed
    sock_write10a socket write operation failed
    sock_read11a socket read operation failed
    sock_open12a call to open(), to create a socket socket failed
    sock_bind13a call to bind() on a socket failed
    available14an attempt to query the number of bytes available to read from a socket\n-failed
    encryption15a call related to bittorrent protocol encryption failed
    connect16an attempt to connect a socket failed
    ssl_handshake17establishing an SSL connection failed
    get_interface18a connection failed to satisfy the bind interface setting
    sock_listen19a call to listen() on a socket
    sock_bind_to_device20a call to the ioctl to bind a socket to a specific network device or\n-adapter
    sock_accept21a call to accept() on a socket
    parse_address22convert a string into a valid network address
    enum_if23enumeration network devices or adapters
    file_stat24invoking stat() on a file
    file_copy25copying a file
    file_fallocate26allocating storage for a file
    file_hard_link27creating a hard link
    file_remove28removing a file
    file_rename29renaming a file
    file_open30opening a file
    mkdir31creating a directory
    check_resume32check fast resume data against files on disk
    exception33an unknown exception
    alloc_cache_piece34allocate space for a piece in the cache
    partfile_move35move a part-file
    partfile_read36read from a part file
    partfile_write37write to a part-file
    hostname_lookup38a hostname lookup
    symlink39create or read a symlink
    handshake40handshake with a peer or server
    sock_option41set socket option
    enum_route42enumeration of network routes
    file_seek43moving read/write position in a file, operation_t::hostname_lookup
    timer44an async wait operation on a timer
    file_mmap45call to mmap() (or windows counterpart)
    file_truncate46call to ftruncate() (or SetEndOfFile() on windows)The torrent is currently checking the fast resume data and\n+comparing it to the files on disk. This is typically\n+completed in a fraction of a second, but if you add a\n+large number of torrents at once, they will queue up.
    \n-[report issue]
    \n-
    \n-

    int

    \n-

    Declared in "libtorrent/alert_types.hpp"

    \n-
    \n-
    user_alert_id
    \n-
    user defined alerts should use IDs greater than this
    \n+[report issue]
    \n+
    handle
    \n+
    a handle to the torrent whose status the object represents.
    \n
    \n-
    \n-
    num_alert_types
    \n-
    this constant represents "max_alert_index" + 1
    \n+[report issue]
    \n+
    errc
    \n+
    may be set to an error code describing why the torrent was paused, in\n+case it was paused by an error. If the torrent is not paused or if it's\n+paused but not because of an error, this error_code is not set.\n+if the error is attributed specifically to a file, error_file is set to\n+the index of that file in the .torrent file.
    \n
    \n-[report issue]
    \n-
    \n-

    alert_category_t

    \n-

    Declared in "libtorrent/alert.hpp"

    \n-
    \n-
    error
    \n-

    Enables alerts that report an error. This includes:

    \n-
      \n-
    • tracker errors
    • \n-
    • tracker warnings
    • \n-
    • file errors
    • \n-
    • resume data failures
    • \n-
    • web seed errors
    • \n-
    • .torrent files errors
    • \n-
    • listen socket errors
    • \n-
    • port mapping errors
    • \n-
    \n-
    \n+[report issue]
    \n+
    error_file
    \n+
    if the torrent is stopped because of an disk I/O error, this field\n+contains the index of the file in the torrent that encountered the\n+error. If the error did not originate in a file in the torrent, there\n+are a few special values this can be set to: error_file_none,\n+error_file_ssl_ctx, error_file_exception, error_file_partfile or\n+error_file_metadata;
    \n
    \n-
    \n-
    peer
    \n-
    Enables alerts when peers send invalid requests, get banned or\n-snubbed.
    \n+[report issue]
    \n+
    error_file_none
    \n+
    special values for error_file to describe which file or component\n+encountered the error (errc).\n+the error did not occur on a file
    \n
    \n-
    \n-
    port_mapping
    \n-
    Enables alerts for port mapping events. For NAT-PMP and UPnP.
    \n+[report issue]
    \n+
    error_file_ssl_ctx
    \n+
    the error occurred setting up the SSL context
    \n
    \n-
    \n-
    storage
    \n-
    Enables alerts for events related to the storage. File errors and\n-synchronization events for moving the storage, renaming files etc.
    \n+[report issue]
    \n+
    error_file_metadata
    \n+
    the error occurred while loading the metadata for the torrent
    \n
    \n-
    \n-
    tracker
    \n-
    Enables all tracker events. Includes announcing to trackers,\n-receiving responses, warnings and errors.
    \n+[report issue]
    \n+
    error_file_exception
    \n+
    there was a serious error reported in this torrent. The error code\n+or a torrent log alert may provide more information.
    \n
    \n-
    \n-
    connect
    \n-
    Low level alerts for when peers are connected and disconnected.
    \n+[report issue]
    \n+
    error_file_partfile
    \n+
    the error occurred with the partfile
    \n
    \n-
    \n-
    status
    \n-
    Enables alerts for when a torrent or the session changes state.
    \n+[report issue]
    \n+
    save_path
    \n+
    the path to the directory where this torrent's files are stored.\n+It's typically the path as was given to async_add_torrent() or\n+add_torrent() when this torrent was started. This field is only\n+included if the torrent status is queried with\n+torrent_handle::query_save_path.
    \n
    \n-
    \n-
    ip_block
    \n-
    Alerts when a peer is blocked by the ip blocker or port blocker.
    \n+[report issue]
    \n+
    name
    \n+
    the name of the torrent. Typically this is derived from the\n+.torrent file. In case the torrent was started without metadata,\n+and hasn't completely received it yet, it returns the name given\n+to it when added to the session. See session::add_torrent.\n+This field is only included if the torrent status is queried\n+with torrent_handle::query_name.
    \n
    \n-
    \n-
    performance_warning
    \n-
    Alerts when some limit is reached that might limit the download\n-or upload rate.
    \n+[report issue]
    \n+
    torrent_file
    \n+
    set to point to the torrent_info object for this torrent. It's\n+only included if the torrent status is queried with\n+torrent_handle::query_torrent_file.
    \n
    \n-
    \n-
    dht
    \n-
    Alerts on events in the DHT node. For incoming searches or\n-bootstrapping being done etc.
    \n+[report issue]
    \n+
    next_announce
    \n+
    the time until the torrent will announce itself to the tracker.
    \n
    \n-
    \n-
    stats
    \n-
    If you enable these alerts, you will receive a stats_alert\n-approximately once every second, for every active torrent.\n-These alerts contain all statistics counters for the interval since\n-the lasts stats alert.
    \n+[report issue]
    \n+
    current_tracker
    \n+
    the URL of the last working tracker. If no tracker request has\n+been successful yet, it's set to an empty string.
    \n
    \n-
    \n-
    session_log
    \n-
    Enables debug logging alerts. These are available unless libtorrent\n-was built with logging disabled (TORRENT_DISABLE_LOGGING). The\n-alerts being posted are log_alert and are session wide.
    \n+\n+[report issue]
    \n+
    total_download total_upload
    \n+
    the number of bytes downloaded and uploaded to all peers, accumulated,\n+this session only. The session is considered to restart when a\n+torrent is paused and restarted again. When a torrent is paused, these\n+counters are reset to 0. If you want complete, persistent, stats, see\n+all_time_upload and all_time_download.
    \n
    \n-
    \n-
    torrent_log
    \n-
    Enables debug logging alerts for torrents. These are available\n-unless libtorrent was built with logging disabled\n-(TORRENT_DISABLE_LOGGING). The alerts being posted are\n-torrent_log_alert and are torrent wide debug events.
    \n+\n+[report issue]
    \n+
    total_payload_download total_payload_upload
    \n+
    counts the amount of bytes send and received this session, but only\n+the actual payload data (i.e the interesting data), these counters\n+ignore any protocol overhead. The session is considered to restart\n+when a torrent is paused and restarted again. When a torrent is\n+paused, these counters are reset to 0.
    \n
    \n-
    \n-
    peer_log
    \n-
    Enables debug logging alerts for peers. These are available unless\n-libtorrent was built with logging disabled\n-(TORRENT_DISABLE_LOGGING). The alerts being posted are\n-peer_log_alert and low-level peer events and messages.
    \n+[report issue]
    \n+
    total_failed_bytes
    \n+
    the number of bytes that has been downloaded and that has failed the\n+piece hash test. In other words, this is just how much crap that has\n+been downloaded since the torrent was last started. If a torrent is\n+paused and then restarted again, this counter will be reset.
    \n
    \n-
    \n-
    incoming_request
    \n-
    enables the incoming_request_alert.
    \n+[report issue]
    \n+
    total_redundant_bytes
    \n+
    the number of bytes that has been downloaded even though that data\n+already was downloaded. The reason for this is that in some situations\n+the same data can be downloaded by mistake. When libtorrent sends\n+requests to a peer, and the peer doesn't send a response within a\n+certain timeout, libtorrent will re-request that block. Another\n+situation when libtorrent may re-request blocks is when the requests\n+it sends out are not replied in FIFO-order (it will re-request blocks\n+that are skipped by an out of order block). This is supposed to be as\n+low as possible. This only counts bytes since the torrent was last\n+started. If a torrent is paused and then restarted again, this counter\n+will be reset.
    \n
    \n-
    \n-
    dht_log
    \n-
    enables dht_log_alert, debug logging for the DHT
    \n+[report issue]
    \n+
    pieces
    \n+
    a bitmask that represents which pieces we have (set to true) and the\n+pieces we don't have. It's a pointer and may be set to 0 if the\n+torrent isn't downloading or seeding.
    \n
    \n-
    \n-
    dht_operation
    \n-
    enable events from pure dht operations not related to torrents
    \n+[report issue]
    \n+
    verified_pieces
    \n+
    a bitmask representing which pieces has had their hash checked. This\n+only applies to torrents in seed mode. If the torrent is not in seed\n+mode, this bitmask may be empty.
    \n
    \n-
    \n-
    port_mapping_log
    \n-
    enables port mapping log events. This log is useful\n-for debugging the UPnP or NAT-PMP implementation
    \n+[report issue]
    \n+
    total_done
    \n+
    the total number of bytes of the file(s) that we have. All this does\n+not necessarily has to be downloaded during this session (that's\n+total_payload_download).
    \n
    \n-
    \n-
    picker_log
    \n-
    enables verbose logging from the piece picker.
    \n+[report issue]
    \n+
    total
    \n+
    the total number of bytes to download for this torrent. This\n+may be less than the size of the torrent in case there are\n+pad files. This number only counts bytes that will actually\n+be requested from peers.
    \n
    \n-
    \n-
    file_progress
    \n-
    alerts when files complete downloading
    \n+[report issue]
    \n+
    total_wanted_done
    \n+
    the number of bytes we have downloaded, only counting the pieces that\n+we actually want to download. i.e. excluding any pieces that we have\n+but have priority 0 (i.e. not wanted).\n+Once a torrent becomes seed, any piece- and file priorities are\n+forgotten and all bytes are considered "wanted".
    \n
    \n-
    \n-
    piece_progress
    \n-
    alerts when pieces complete downloading or fail hash check
    \n+[report issue]
    \n+
    total_wanted
    \n+
    The total number of bytes we want to download. This may be smaller\n+than the total torrent size in case any pieces are prioritized to 0,\n+i.e. not wanted.\n+Once a torrent becomes seed, any piece- and file priorities are\n+forgotten and all bytes are considered "wanted".
    \n
    \n-
    \n-
    upload
    \n-
    alerts when we upload blocks to other peers
    \n+\n+[report issue]
    \n+
    all_time_upload all_time_download
    \n+
    are accumulated upload and download payload byte counters. They are\n+saved in and restored from resume data to keep totals across sessions.
    \n
    \n-
    \n-
    block_progress
    \n-
    alerts on individual blocks being requested, downloading, finished,\n-rejected, time-out and cancelled. This is likely to post alerts at a\n-high rate.
    \n+[report issue]
    \n+
    added_time
    \n+
    the posix-time when this torrent was added. i.e. what time(nullptr)\n+returned at the time.
    \n+
    \n+[report issue]
    \n+
    completed_time
    \n+
    the posix-time when this torrent was finished. If the torrent is not\n+yet finished, this is 0.
    \n+
    \n+[report issue]
    \n+
    last_seen_complete
    \n+
    the time when we, or one of our peers, last saw a complete copy of\n+this torrent.
    \n+
    \n+[report issue]
    \n+
    storage_mode
    \n+
    The allocation mode for the torrent. See storage_mode_t for the\n+options. For more information, see storage allocation.
    \n+
    \n+[report issue]
    \n+
    progress
    \n+
    a value in the range [0, 1], that represents the progress of the\n+torrent's current task. It may be checking files or downloading.
    \n+
    \n+[report issue]
    \n+
    progress_ppm
    \n+

    progress parts per million (progress * 1000000) when disabling\n+floating point operations, this is the only option to query progress

    \n+

    reflects the same value as progress, but instead in a range [0,\n+1000000] (ppm = parts per million). When floating point operations are\n+disabled, this is the only alternative to the floating point value in\n+progress.

    \n+
    \n+
    \n+[report issue]
    \n+
    queue_position
    \n+
    the position this torrent has in the download\n+queue. If the torrent is a seed or finished, this is -1.
    \n+
    \n+\n+[report issue]
    \n+
    download_rate upload_rate
    \n+
    the total rates for all peers for this torrent. These will usually\n+have better precision than summing the rates from all peers. The rates\n+are given as the number of bytes per second.
    \n+
    \n+\n+[report issue]
    \n+
    download_payload_rate upload_payload_rate
    \n+
    the total transfer rate of payload only, not counting protocol\n+chatter. This might be slightly smaller than the other rates, but if\n+projected over a long time (e.g. when calculating ETA:s) the\n+difference may be noticeable.
    \n+
    \n+[report issue]
    \n+
    num_seeds
    \n+
    the number of peers that are seeding that this client is\n+currently connected to.
    \n+
    \n+[report issue]
    \n+
    num_peers
    \n+
    the number of peers this torrent currently is connected to. Peer\n+connections that are in the half-open state (is attempting to connect)\n+or are queued for later connection attempt do not count. Although they\n+are visible in the peer list when you call get_peer_info().
    \n+
    \n+\n+[report issue]
    \n+
    num_complete num_incomplete
    \n+
    if the tracker sends scrape info in its announce reply, these fields\n+will be set to the total number of peers that have the whole file and\n+the total number of peers that are still downloading. set to -1 if the\n+tracker did not send any scrape data in its announce reply.
    \n+
    \n+\n+[report issue]
    \n+
    list_seeds list_peers
    \n+
    the number of seeds in our peer list and the total number of peers\n+(including seeds). We are not necessarily connected to all the peers\n+in our peer list. This is the number of peers we know of in total,\n+including banned peers and peers that we have failed to connect to.
    \n+
    \n+[report issue]
    \n+
    connect_candidates
    \n+
    the number of peers in this torrent's peer list that is a candidate to\n+be connected to. i.e. It has fewer connect attempts than the max fail\n+count, it is not a seed if we are a seed, it is not banned etc. If\n+this is 0, it means we don't know of any more peers that we can try.
    \n+
    \n+[report issue]
    \n+
    num_pieces
    \n+
    the number of pieces that has been downloaded. It is equivalent to:\n+std::accumulate(pieces->begin(), pieces->end()). So you don't have\n+to count yourself. This can be used to see if anything has updated\n+since last time if you want to keep a graph of the pieces up to date.\n+Note that these pieces have not necessarily been written to disk yet,\n+and there is a risk the write to disk will fail.
    \n+
    \n+[report issue]
    \n+
    distributed_full_copies
    \n+
    the number of distributed copies of the torrent. Note that one copy\n+may be spread out among many peers. It tells how many copies there are\n+currently of the rarest piece(s) among the peers this client is\n+connected to.
    \n+
    \n+[report issue]
    \n+
    distributed_fraction
    \n+

    tells the share of pieces that have more copies than the rarest\n+piece(s). Divide this number by 1000 to get the fraction.

    \n+

    For example, if distributed_full_copies is 2 and\n+distributed_fraction is 500, it means that the rarest pieces have\n+only 2 copies among the peers this torrent is connected to, and that\n+50% of all the pieces have more than two copies.

    \n+

    If we are a seed, the piece picker is deallocated as an optimization,\n+and piece availability is no longer tracked. In this case the\n+distributed copies members are set to -1.

    \n+
    \n+
    \n+[report issue]
    \n+
    distributed_copies
    \n+

    the number of distributed copies of the file. note that one copy may\n+be spread out among many peers. This is a floating point\n+representation of the distributed copies.

    \n+
    \n+
    the integer part tells how many copies
    \n+
    there are of the rarest piece(s)
    \n+
    the fractional part tells the fraction of pieces that
    \n+
    have more copies than the rarest piece(s).
    \n
    \n-
    \n-
    all
    \n-

    The full bitmask, representing all available categories.

    \n-

    since the enum is signed, make sure this isn't\n-interpreted as -1. For instance, boost.python\n-does that and fails when assigning it to an\n-unsigned parameter.

    \n
    \n
    \n+[report issue]
    \n+
    block_size
    \n+
    the size of a block, in bytes. A block is a sub piece, it is the\n+number of bytes that each piece request asks for and the number of\n+bytes that each bit in the partial_piece_info's bitset represents,\n+see get_download_queue(). This is typically 16 kB, but it may be\n+smaller, if the pieces are smaller.
    \n+
    \n+[report issue]
    \n+
    num_uploads
    \n+
    the number of unchoked peers in this torrent.
    \n+
    \n+[report issue]
    \n+
    num_connections
    \n+
    the number of peer connections this torrent has, including half-open\n+connections that hasn't completed the bittorrent handshake yet. This\n+is always >= num_peers.
    \n+
    \n+[report issue]
    \n+
    uploads_limit
    \n+
    the set limit of upload slots (unchoked peers) for this torrent.
    \n+
    \n+[report issue]
    \n+
    connections_limit
    \n+
    the set limit of number of connections for this torrent.
    \n+
    \n+\n+[report issue]
    \n+
    up_bandwidth_queue down_bandwidth_queue
    \n+
    the number of peers in this torrent that are waiting for more\n+bandwidth quota from the torrent rate limiter. This can determine if\n+the rate you get from this torrent is bound by the torrents limit or\n+not. If there is no limit set on this torrent, the peers might still\n+be waiting for bandwidth quota from the global limiter, but then they\n+are counted in the session_status object.
    \n+
    \n+[report issue]
    \n+
    seed_rank
    \n+
    A rank of how important it is to seed the torrent, it is used to\n+determine which torrents to seed and which to queue. It is based on\n+the peer to seed ratio from the tracker scrape. For more information,\n+see queuing. Higher value means more important to seed
    \n+
    \n+[report issue]
    \n+
    state
    \n+
    the main state the torrent is in. See torrent_status::state_t.
    \n+
    \n+[report issue]
    \n+
    need_save_resume
    \n+
    true if this torrent has unsaved changes\n+to its download state and statistics since the last resume data\n+was saved.
    \n+
    \n+[report issue]
    \n+
    is_seeding
    \n+
    true if all pieces have been downloaded.
    \n+
    \n+[report issue]
    \n+
    is_finished
    \n+
    true if all pieces that have a priority > 0 are downloaded. There is\n+only a distinction between finished and seeding if some pieces or\n+files have been set to priority 0, i.e. are not downloaded.
    \n+
    \n+[report issue]
    \n+
    has_metadata
    \n+
    true if this torrent has metadata (either it was started from a\n+.torrent file or the metadata has been downloaded). The only scenario\n+where this can be false is when the torrent was started torrent-less\n+(i.e. with just an info-hash and tracker ip, a magnet link for\n+instance).
    \n+
    \n+[report issue]
    \n+
    has_incoming
    \n+
    true if there has ever been an incoming connection attempt to this\n+torrent.
    \n+
    \n+[report issue]
    \n+
    moving_storage
    \n+
    this is true if this torrent's storage is currently being moved from\n+one location to another. This may potentially be a long operation\n+if a large file ends up being copied from one drive to another.
    \n+
    \n+\n+\n+[report issue]
    \n+
    announcing_to_trackers announcing_to_lsd announcing_to_dht
    \n+
    these are set to true if this torrent is allowed to announce to the\n+respective peer source. Whether they are true or false is determined by\n+the queue logic/auto manager. Torrents that are not auto managed will\n+always be allowed to announce to all peer sources.
    \n+
    \n+[report issue]
    \n+
    info_hashes
    \n+
    the info-hash for this torrent
    \n+
    \n+\n+[report issue]
    \n+
    last_upload last_download
    \n+
    the timestamps of the last time this torrent uploaded or downloaded\n+payload to any peer.
    \n+
    \n+\n+\n+[report issue]
    \n+
    active_duration finished_duration seeding_duration
    \n+
    these are cumulative counters of for how long the torrent has been in\n+different states. active means not paused and added to session. Whether\n+it has found any peers or not is not relevant.\n+finished means all selected files/pieces were downloaded and available\n+to other peers (this is always a subset of active time).\n+seeding means all files/pieces were downloaded and available to\n+peers. Being available to peers does not imply there are other peers\n+asking for the payload.
    \n+
    \n+[report issue]
    \n+
    flags
    \n+
    reflects several of the torrent's flags. For more\n+information, see torrent_handle::flags().
    \n+
    \n

    This section describes the functions and classes that are used\n to create torrent files. It is a layered API with low level classes\n and higher level convenience functions. A torrent is created in 4\n steps:

    \n
      \n
    1. first the files that will be part of the torrent are determined.
    2. \n
    3. the torrent properties are set, such as tracker url, web seeds,\n@@ -9118,71 +7491,72 @@\n out.write(buf.data(), buf.size());\n \n // alternatively, generate an entry and encode it directly to an ostream\n // iterator\n bencode(std::ostream_iterator<char>(out), t.generate());\n \n [report issue]
    \n+
    \n
    \n

    create_torrent

    \n

    Declared in "libtorrent/create_torrent.hpp"

    \n

    This class holds state for creating a torrent. After having added\n all information to it, call create_torrent::generate() to generate\n the torrent. The entry that's returned can then be bencoded into a\n .torrent file using bencode().

    \n
    \n struct create_torrent\n {\n+   explicit create_torrent (torrent_info const& ti);\n    explicit create_torrent (file_storage& fs, int piece_size = 0\n       , create_flags_t flags = {});\n-   explicit create_torrent (torrent_info const& ti);\n    entry generate () const;\n    std::vector<char> generate_buf () const;\n    file_storage const& files () const;\n    void set_comment (char const* str);\n    void set_creator (char const* str);\n    void set_creation_date (std::time_t timestamp);\n    void set_hash (piece_index_t index, sha1_hash const& h);\n    void set_hash2 (file_index_t file, piece_index_t::diff_type piece, sha256_hash const& h);\n    void add_http_seed (string_view url);\n    void add_url_seed (string_view url);\n    void add_node (std::pair<std::string, int> node);\n    void add_tracker (string_view url, int tier = 0);\n    void set_root_cert (string_view cert);\n-   bool priv () const;\n    void set_priv (bool p);\n-   bool is_v2_only () const;\n+   bool priv () const;\n    bool is_v1_only () const;\n+   bool is_v2_only () const;\n    int num_pieces () const;\n    piece_index_t end_piece () const;\n    index_range<piece_index_t> piece_range () const noexcept;\n    file_index_t end_file () const;\n    index_range<file_index_t> file_range () const noexcept;\n    index_range<piece_index_t::diff_type> file_piece_range (file_index_t f);\n    std::int64_t total_size () const;\n    int piece_size (piece_index_t i) const;\n    int piece_length () const;\n-   void add_collection (string_view c);\n    void add_similar_torrent (sha1_hash ih);\n+   void add_collection (string_view c);\n \n    static constexpr create_flags_t modification_time  = 2_bit;\n    static constexpr create_flags_t symlinks  = 3_bit;\n    static constexpr create_flags_t v2_only  = 5_bit;\n    static constexpr create_flags_t v1_only  = 6_bit;\n    static constexpr create_flags_t canonical_files  = 7_bit;\n    static constexpr create_flags_t no_attributes  = 8_bit;\n    static constexpr create_flags_t canonical_files_no_tail_padding  = 9_bit;\n };\n 
    \n [report issue]
    \n

    create_torrent()

    \n
    \n+explicit create_torrent (torrent_info const& ti);\n explicit create_torrent (file_storage& fs, int piece_size = 0\n       , create_flags_t flags = {});\n-explicit create_torrent (torrent_info const& ti);\n 
    \n

    The piece_size is the size of each piece in bytes. It must be a\n power of 2 and a minimum of 16 kiB. If a piece size of 0 is\n specified, a piece_size will be set automatically.\n Piece sizes greater than 128 MiB are considered unreasonable and will\n be rejected (with an lt::system_error exception).

    \n

    The flags arguments specifies options for the torrent creation. It can\n@@ -9295,18 +7669,18 @@\n 16 kiB blocks. Note that piece sizes must be powers-of-2, so all\n per-piece merkle trees are complete.\n A SHA-256 hash of all zeros is internally used to indicate a hash\n that has not been set. Setting such hash will not be considered set\n when calling generate().\n This function will throw std::system_error if it is called on an\n object constructed with the v1_only flag.

    \n-\n-[report issue]
    \n-
    \n-

    add_url_seed() add_http_seed()

    \n+\n+[report issue]
    \n+
    \n+

    add_http_seed() add_url_seed()

    \n
    \n void add_http_seed (string_view url);\n void add_url_seed (string_view url);\n 
    \n

    This adds a url seed to the torrent. You can have any number of url seeds. For a\n single file torrent, this should be an HTTP url, pointing to a file with identical\n content as the file of the torrent. For a multi-file torrent, it should point to\n@@ -9343,42 +7717,42 @@\n \n

    This function sets an X.509 certificate in PEM format to the torrent. This makes the\n torrent an SSL torrent. An SSL torrent requires that each peer has a valid certificate\n signed by this root certificate. For SSL torrents, all peers are connecting over SSL\n connections. For more information, see the section on ssl torrents.

    \n

    The string is not the path to the cert, it's the actual content of the\n certificate.

    \n-\n-[report issue]
    \n-
    \n-

    priv() set_priv()

    \n+\n+[report issue]
    \n+
    \n+

    set_priv() priv()

    \n
    \n-bool priv () const;\n void set_priv (bool p);\n+bool priv () const;\n 
    \n

    Sets and queries the private flag of the torrent.\n Torrents with the private flag set ask the client to not use any other\n sources than the tracker for peers, and to not use DHT to advertise itself publicly,\n only the tracker.

    \n [report issue]
    \n
    \n

    num_pieces()

    \n
    \n int num_pieces () const;\n 
    \n

    returns the number of pieces in the associated file_storage object.

    \n [report issue]
    \n-
    \n+
    \n

    piece_range()

    \n
    \n index_range<piece_index_t> piece_range () const noexcept;\n 
    \n

    all piece indices in the torrent to be created

    \n [report issue]
    \n-
    \n+
    \n

    file_range()

    \n
    \n index_range<file_index_t> file_range () const noexcept;\n 
    \n

    all file indices in the torrent to be created

    \n [report issue]
    \n
    \n@@ -9386,38 +7760,38 @@\n
    \n index_range<piece_index_t::diff_type> file_piece_range (file_index_t f);\n 
    \n

    for v2 and hybrid torrents only, the pieces in the\n specified file, specified as delta from the first piece in the file.\n i.e. the first index is 0.

    \n [report issue]
    \n-
    \n+
    \n

    total_size()

    \n
    \n std::int64_t total_size () const;\n 
    \n

    the total number of bytes of all files and pad files

    \n-\n-[report issue]
    \n-
    \n-

    piece_size() piece_length()

    \n+\n+[report issue]
    \n+
    \n+

    piece_length() piece_size()

    \n
    \n int piece_size (piece_index_t i) const;\n int piece_length () const;\n 
    \n

    piece_length() returns the piece size of all pieces but the\n last one. piece_size() returns the size of the specified piece.\n these functions are just forwarding to the associated file_storage.

    \n-\n-[report issue]
    \n-
    \n-

    add_collection() add_similar_torrent()

    \n+\n+[report issue]
    \n+
    \n+

    add_similar_torrent() add_collection()

    \n
    \n-void add_collection (string_view c);\n void add_similar_torrent (sha1_hash ih);\n+void add_collection (string_view c);\n 
    \n

    Add similar torrents (by info-hash) or collections of similar torrents.\n Similar torrents are expected to share some files with this torrent.\n Torrents sharing a collection name with this torrent are also expected\n to share files with this torrent. A torrent may have more than one\n collection and more than one similar torrents. For more information,\n see BEP 38.

    \n@@ -9505,332 +7879,1056 @@\n

    The flags argument should be the same as the flags passed to the create_torrent\n constructor.

    \n [report issue]
    \n
    \n

    set_piece_hashes()

    \n

    Declared in "libtorrent/create_torrent.hpp"

    \n
    \n-inline void set_piece_hashes (create_torrent& t, std::string const& p\n-   , std::function<void(piece_index_t)> const& f);\n+inline void set_piece_hashes (create_torrent& t, std::string const& p);\n+inline void set_piece_hashes (create_torrent& t, std::string const& p, error_code& ec);\n void set_piece_hashes (create_torrent& t, std::string const& p\n+   , settings_interface const& settings\n    , std::function<void(piece_index_t)> const& f, error_code& ec);\n inline void set_piece_hashes (create_torrent& t, std::string const& p\n    , settings_interface const& settings\n    , std::function<void(piece_index_t)> const& f);\n+inline void set_piece_hashes (create_torrent& t, std::string const& p\n+   , std::function<void(piece_index_t)> const& f);\n void set_piece_hashes (create_torrent& t, std::string const& p\n    , settings_interface const& settings, disk_io_constructor_type disk_io\n    , std::function<void(piece_index_t)> const& f, error_code& ec);\n-inline void set_piece_hashes (create_torrent& t, std::string const& p);\n-inline void set_piece_hashes (create_torrent& t, std::string const& p, error_code& ec);\n void set_piece_hashes (create_torrent& t, std::string const& p\n-   , settings_interface const& settings\n    , std::function<void(piece_index_t)> const& f, error_code& ec);\n 
    \n

    This function will assume that the files added to the torrent file exists at path\n p, read those files and hash the content and set the hashes in the create_torrent\n object. The optional function f is called in between every hash that is set. f\n must have the following signature:

    \n
    \n void Fun(piece_index_t);\n 
    \n

    The overloads taking a settings_pack may be used to configure the\n underlying disk access. Such as settings_pack::aio_threads.

    \n

    The overloads that don't take an error_code& may throw an exception in case of a\n file error, the other overloads sets the error code to reflect the error, if any.

    \n-

    Bencoding is a common representation in bittorrent used for dictionary,\n-list, int and string hierarchies. It's used to encode .torrent files and\n-some messages in the network protocol. libtorrent also uses it to store\n-settings, resume data and other session state.

    \n-

    Strings in bencoded structures do not necessarily represent text.\n-Strings are raw byte buffers of a certain length. If a string is meant to be\n-interpreted as text, it is required to be UTF-8 encoded. See BEP 3.

    \n-

    The function for decoding bencoded data bdecode(), returning a bdecode_node.\n-This function builds a tree that points back into the original buffer. The\n-returned bdecode_node will not be valid once the buffer it was parsed out of\n-is discarded.

    \n-

    It's possible to construct an entry from a bdecode_node, if a structure needs\n-to be altered and re-encoded.

    \n-[report issue]
    \n-
    \n-

    entry

    \n-

    Declared in "libtorrent/entry.hpp"

    \n-

    The entry class represents one node in a bencoded hierarchy. It works as a\n-variant type, it can be either a list, a dictionary (std::map), an integer\n-or a string.

    \n+[report issue]
    \n+
    \n+

    stats_metric

    \n+

    Declared in "libtorrent/session_stats.hpp"

    \n+

    describes one statistics metric from the session. For more information,\n+see the session statistics section.

    \n
    \n-class entry\n+struct stats_metric\n {\n-   data_type type () const;\n-   entry (dictionary_type);\n-   entry (preformatted_type);\n-   entry (list_type);\n-   entry (span<char const>);\n-   entry (integer_type);\n-   entry (U v);\n-   entry (data_type t);\n-   entry (bdecode_node const& n);\n-   entry& operator= (preformatted_type) &;\n-   entry& operator= (entry&&) & noexcept;\n-   entry& operator= (dictionary_type) &;\n-   entry& operator= (entry const&) &;\n-   entry& operator= (bdecode_node const&) &;\n-   entry& operator= (span<char const>) &;\n-   entry& operator= (list_type) &;\n-   entry& operator= (integer_type) &;\n-   entry& operator= (U v) &;\n-   string_type const& string () const;\n-   string_type& string ();\n-   dictionary_type& dict ();\n-   list_type const& list () const;\n-   integer_type const& integer () const;\n-   list_type& list ();\n-   integer_type& integer ();\n-   preformatted_type const& preformatted () const;\n-   preformatted_type& preformatted ();\n-   dictionary_type const& dict () const;\n-   void swap (entry& e);\n-   entry const& operator[] (string_view key) const;\n-   entry& operator[] (string_view key);\n-   entry const* find_key (string_view key) const;\n-   entry* find_key (string_view key);\n-   std::string to_string (bool single_line = false) const;\n+   char const* name;\n+   int value_index;\n+   metric_type_t type;\n+};\n+
    \n+[report issue]
    \n+
    name
    \n+
    the name of the counter or gauge
    \n+
    \n+\n+[report issue]
    \n+
    value_index type
    \n+
    the index into the session stats array, where the underlying value of\n+this counter or gauge is found. The session stats array is part of the\n+session_stats_alert object.
    \n+
    \n+[report issue]
    \n+
    \n+

    counters

    \n+

    Declared in "libtorrent/performance_counters.hpp"

    \n+
    \n+struct counters\n+{\n+   counters () ;\n+   counters (counters const&) ;\n+   counters& operator= (counters const&) & ;\n+   std::int64_t inc_stats_counter (int c, std::int64_t value = 1) ;\n+   std::int64_t operator[] (int i) const ;\n+   void blend_stats_counter (int c, std::int64_t value, int ratio) ;\n+   void set_value (int c, std::int64_t value) ;\n+};\n+
    \n+\n+[report issue]
    \n+

    operator[]() inc_stats_counter()

    \n+
    \n+std::int64_t inc_stats_counter (int c, std::int64_t value = 1) ;\n+std::int64_t operator[] (int i) const ;\n+
    \n+

    returns the new value

    \n+[report issue]
    \n+
    \n+
    \n+

    session_stats_metrics()

    \n+

    Declared in "libtorrent/session_stats.hpp"

    \n+
    \n+std::vector<stats_metric> session_stats_metrics ();\n+
    \n+

    This free function returns the list of available metrics exposed by\n+libtorrent's statistics API. Each metric has a name and a value index.\n+The value index is the index into the array in session_stats_alert where\n+this metric's value can be found when the session stats is sampled (by\n+calling post_session_stats()).

    \n+[report issue]
    \n+
    \n+

    find_metric_idx()

    \n+

    Declared in "libtorrent/session_stats.hpp"

    \n+
    \n+int find_metric_idx (string_view name);\n+
    \n+

    given a name of a metric, this function returns the counter index of it,\n+or -1 if it could not be found. The counter index is the index into the\n+values array returned by session_stats_alert.

    \n+[report issue]
    \n+
    \n+

    enum metric_type_t

    \n+

    Declared in "libtorrent/session_stats.hpp"

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    namevaluedescription
    counter0 
    gauge1 
    \n+[report issue]
    \n+
    \n+

    file_slice

    \n+

    Declared in "libtorrent/file_storage.hpp"

    \n+

    represents a window of a file in a torrent.

    \n+

    The file_index refers to the index of the file (in the torrent_info).\n+To get the path and filename, use file_path() and give the file_index\n+as argument. The offset is the byte offset in the file where the range\n+starts, and size is the number of bytes this range is. The size + offset\n+will never be greater than the file size.

    \n+
    \n+struct file_slice\n+{\n+   file_index_t file_index;\n+   std::int64_t offset;\n+   std::int64_t size;\n+};\n+
    \n+[report issue]
    \n+
    file_index
    \n+
    the index of the file
    \n+
    \n+[report issue]
    \n+
    offset
    \n+
    the offset from the start of the file, in bytes
    \n+
    \n+[report issue]
    \n+
    size
    \n+
    the size of the window, in bytes
    \n+
    \n+[report issue]
    \n+
    \n+

    file_storage

    \n+

    Declared in "libtorrent/file_storage.hpp"

    \n+

    The file_storage class represents a file list and the piece\n+size. Everything necessary to interpret a regular bittorrent storage\n+file structure.

    \n+
    \n+class file_storage\n+{\n+   bool is_valid () const;\n+   void reserve (int num_files);\n+   void add_file_borrow (string_view filename\n+      , std::string const& path, std::int64_t file_size\n+      , file_flags_t file_flags = {}, char const* filehash = nullptr\n+      , std::int64_t mtime = 0, string_view symlink_path = string_view()\n+      , char const* root_hash = nullptr);\n+   void add_file (std::string const& path, std::int64_t file_size\n+      , file_flags_t file_flags = {}\n+      , std::time_t mtime = 0, string_view symlink_path = string_view()\n+      , char const* root_hash = nullptr);\n+   void add_file_borrow (error_code& ec, string_view filename\n+      , std::string const& path, std::int64_t file_size\n+      , file_flags_t file_flags = {}, char const* filehash = nullptr\n+      , std::int64_t mtime = 0, string_view symlink_path = string_view()\n+      , char const* root_hash = nullptr);\n+   void add_file (error_code& ec, std::string const& path, std::int64_t file_size\n+      , file_flags_t file_flags = {}\n+      , std::time_t mtime = 0, string_view symlink_path = string_view()\n+      , char const* root_hash = nullptr);\n+   void rename_file (file_index_t index, std::string const& new_filename);\n+   std::vector<file_slice> map_block (piece_index_t piece, std::int64_t offset\n+      , std::int64_t size) const;\n+   peer_request map_file (file_index_t file, std::int64_t offset, int size) const;\n+   int num_files () const noexcept;\n+   file_index_t end_file () const noexcept;\n+   index_range<file_index_t> file_range () const noexcept;\n+   std::int64_t total_size () const;\n+   int num_pieces () const;\n+   void set_num_pieces (int n);\n+   piece_index_t end_piece () const;\n+   piece_index_t last_piece () const;\n+   index_range<piece_index_t> piece_range () const noexcept;\n+   void set_piece_length (int l);\n+   int piece_length () const;\n+   int piece_size (piece_index_t index) const;\n+   int piece_size2 (piece_index_t index) const;\n+   int blocks_in_piece2 (piece_index_t index) const;\n+   int blocks_per_piece () const;\n+   std::string const& name () const;\n+   void set_name (std::string const& n);\n+   void swap (file_storage& ti) noexcept;\n+   void canonicalize ();\n+   sha1_hash hash (file_index_t index) const;\n+   std::string symlink (file_index_t index) const;\n+   std::string file_path (file_index_t index, std::string const& save_path = "") const;\n+   bool pad_file_at (file_index_t index) const;\n+   std::int64_t file_size (file_index_t index) const;\n+   std::time_t mtime (file_index_t index) const;\n+   sha256_hash root (file_index_t index) const;\n+   std::int64_t file_offset (file_index_t index) const;\n+   char const* root_ptr (file_index_t const index) const;\n+   string_view file_name (file_index_t index) const;\n+   int file_num_pieces (file_index_t index) const;\n+   index_range<piece_index_t::diff_type> file_piece_range (file_index_t) const;\n+   int file_num_blocks (file_index_t index) const;\n+   int file_first_piece_node (file_index_t index) const;\n+   int file_first_block_node (file_index_t index) const;\n+   std::uint32_t file_path_hash (file_index_t index, std::string const& save_path) const;\n+   void all_path_hashes (std::unordered_set<std::uint32_t>& table) const;\n+   file_flags_t file_flags (file_index_t index) const;\n+   bool file_absolute_path (file_index_t index) const;\n+   file_index_t file_index_at_offset (std::int64_t offset) const;\n+   file_index_t file_index_at_piece (piece_index_t piece) const;\n+   file_index_t file_index_for_root (sha256_hash const& root_hash) const;\n+   piece_index_t piece_index_at_file (file_index_t f) const;\n+   void sanitize_symlinks ();\n+   bool v2 () const;\n \n-   enum data_type\n-   {\n-      int_t,\n-      string_t,\n-      list_t,\n-      dictionary_t,\n-      undefined_t,\n-      preformatted_t,\n-   };\n+   static constexpr file_flags_t flag_pad_file  = 0_bit;\n+   static constexpr file_flags_t flag_hidden  = 1_bit;\n+   static constexpr file_flags_t flag_executable  = 2_bit;\n+   static constexpr file_flags_t flag_symlink  = 3_bit;\n };\n 
    \n-[report issue]
    \n-

    type()

    \n+[report issue]
    \n+

    is_valid()

    \n
    \n-data_type type () const;\n+bool is_valid () const;\n 
    \n-

    returns the concrete type of the entry

    \n-[report issue]
    \n-
    \n-

    entry()

    \n+

    returns true if the piece length has been initialized\n+on the file_storage. This is typically taken as a proxy\n+of whether the file_storage as a whole is initialized or\n+not.

    \n+[report issue]
    \n+
    \n+

    reserve()

    \n
    \n-entry (dictionary_type);\n-entry (preformatted_type);\n-entry (list_type);\n-entry (span<char const>);\n-entry (integer_type);\n+void reserve (int num_files);\n 
    \n-

    constructors directly from a specific type.\n-The content of the argument is copied into the\n-newly constructed entry

    \n-[report issue]
    \n-
    \n-

    entry()

    \n+

    allocates space for num_files in the internal file list. This can\n+be used to avoid reallocating the internal file list when the number\n+of files to be added is known up-front.

    \n+\n+[report issue]
    \n+
    \n+

    add_file() add_file_borrow()

    \n
    \n-entry (data_type t);\n+void add_file_borrow (string_view filename\n+      , std::string const& path, std::int64_t file_size\n+      , file_flags_t file_flags = {}, char const* filehash = nullptr\n+      , std::int64_t mtime = 0, string_view symlink_path = string_view()\n+      , char const* root_hash = nullptr);\n+void add_file (std::string const& path, std::int64_t file_size\n+      , file_flags_t file_flags = {}\n+      , std::time_t mtime = 0, string_view symlink_path = string_view()\n+      , char const* root_hash = nullptr);\n+void add_file_borrow (error_code& ec, string_view filename\n+      , std::string const& path, std::int64_t file_size\n+      , file_flags_t file_flags = {}, char const* filehash = nullptr\n+      , std::int64_t mtime = 0, string_view symlink_path = string_view()\n+      , char const* root_hash = nullptr);\n+void add_file (error_code& ec, std::string const& path, std::int64_t file_size\n+      , file_flags_t file_flags = {}\n+      , std::time_t mtime = 0, string_view symlink_path = string_view()\n+      , char const* root_hash = nullptr);\n 
    \n-

    construct an empty entry of the specified type.\n-see data_type enum.

    \n-[report issue]
    \n-
    \n-

    entry()

    \n+

    Adds a file to the file storage. The add_file_borrow version\n+expects that filename is the file name (without a path) of\n+the file that's being added.\n+This memory is borrowed, i.e. it is the caller's\n+responsibility to make sure it stays valid throughout the lifetime\n+of this file_storage object or any copy of it. The same thing applies\n+to filehash, which is an optional pointer to a 20 byte binary\n+SHA-1 hash of the file.

    \n+

    if filename is empty, the filename from path is used and not\n+borrowed.

    \n+

    The path argument is the full path (in the torrent file) to\n+the file to add. Note that this is not supposed to be an absolute\n+path, but it is expected to include the name of the torrent as the\n+first path element.

    \n+

    file_size is the size of the file in bytes.

    \n+

    The file_flags argument sets attributes on the file. The file\n+attributes is an extension and may not work in all bittorrent clients.

    \n+

    For possible file attributes, see file_storage::flags_t.

    \n+

    The mtime argument is optional and can be set to 0. If non-zero,\n+it is the posix time of the last modification time of this file.

    \n+

    symlink_path is the path the file is a symlink to. To make this a\n+symlink you also need to set the file_storage::flag_symlink file flag.

    \n+

    root_hash is an optional pointer to a 32 byte SHA-256 hash, being\n+the merkle tree root hash for this file. This is only used for v2\n+torrents. If the root hash is specified for one file, it has to\n+be specified for all, otherwise this function will fail.\n+Note that the buffer root_hash points to must out-live the\n+file_storage object, it will not be copied. This parameter is only\n+used when loading torrents, that already have their file hashes\n+computed. When creating torrents, the file hashes will be computed by\n+the piece hashes.

    \n+

    If more files than one are added, certain restrictions to their paths\n+apply. In a multi-file file storage (torrent), all files must share\n+the same root directory.

    \n+

    That is, the first path element of all files must be the same.\n+This shared path element is also set to the name of the torrent. It\n+can be changed by calling set_name.

    \n+

    The overloads that take an error_code reference will report failures\n+via that variable, otherwise system_error is thrown.

    \n+[report issue]
    \n+
    \n+

    rename_file()

    \n
    \n-entry (bdecode_node const& n);\n+void rename_file (file_index_t index, std::string const& new_filename);\n 
    \n-

    construct from bdecode_node parsed form (see bdecode())

    \n-[report issue]
    \n-
    \n-

    operator=()

    \n+

    renames the file at index to new_filename. Keep in mind\n+that filenames are expected to be UTF-8 encoded.

    \n+[report issue]
    \n+
    \n+

    map_block()

    \n
    \n-entry& operator= (preformatted_type) &;\n-entry& operator= (entry&&) & noexcept;\n-entry& operator= (dictionary_type) &;\n-entry& operator= (entry const&) &;\n-entry& operator= (bdecode_node const&) &;\n-entry& operator= (span<char const>) &;\n-entry& operator= (list_type) &;\n-entry& operator= (integer_type) &;\n+std::vector<file_slice> map_block (piece_index_t piece, std::int64_t offset\n+      , std::int64_t size) const;\n 
    \n-

    copies the structure of the right hand side into this\n-entry.

    \n-\n-\n-\n-\n-[report issue]
    \n-
    \n-

    string() dict() list() integer() preformatted()

    \n+

    returns a list of file_slice objects representing the portions of\n+files the specified piece index, byte offset and size range overlaps.\n+this is the inverse mapping of map_file().

    \n+

    Preconditions of this function is that the input range is within the\n+torrents address space. piece may not be negative and

    \n+
    \n+piece * piece_size + offset + size
    \n+

    may not exceed the total size of the torrent.

    \n+[report issue]
    \n+
    \n+

    map_file()

    \n
    \n-string_type const& string () const;\n-string_type& string ();\n-dictionary_type& dict ();\n-list_type const& list () const;\n-integer_type const& integer () const;\n-list_type& list ();\n-integer_type& integer ();\n-preformatted_type const& preformatted () const;\n-preformatted_type& preformatted ();\n-dictionary_type const& dict () const;\n+peer_request map_file (file_index_t file, std::int64_t offset, int size) const;\n 
    \n-

    The integer(), string(), list() and dict() functions\n-are accessors that return the respective type. If the entry object\n-isn't of the type you request, the accessor will throw\n-system_error. You can ask an entry for its type through the\n-type() function.

    \n-

    If you want to create an entry you give it the type you want it to\n-have in its constructor, and then use one of the non-const accessors\n-to get a reference which you then can assign the value you want it to\n-have.

    \n-

    The typical code to get info from a torrent file will then look like\n-this:

    \n-
    \n-entry torrent_file;\n-// ...\n-\n-// throws if this is not a dictionary\n-entry::dictionary_type const& dict = torrent_file.dict();\n-entry::dictionary_type::const_iterator i;\n-i = dict.find("announce");\n-if (i != dict.end())\n-{\n-        std::string tracker_url = i->second.string();\n-        std::cout << tracker_url << "\\n";\n-}\n+

    returns a peer_request representing the piece index, byte offset\n+and size the specified file range overlaps. This is the inverse\n+mapping over map_block(). Note that the peer_request return type\n+is meant to hold bittorrent block requests, which may not be larger\n+than 16 kiB. Mapping a range larger than that may return an overflown\n+integer.

    \n+[report issue]
    \n+
    \n+

    num_files()

    \n+
    \n+int num_files () const noexcept;\n 
    \n-

    The following code is equivalent, but a little bit shorter:

    \n-
    \n-entry torrent_file;\n-// ...\n-\n-// throws if this is not a dictionary\n-if (entry* i = torrent_file.find_key("announce"))\n-{\n-        std::string tracker_url = i->string();\n-        std::cout << tracker_url << "\\n";\n-}\n+

    returns the number of files in the file_storage

    \n+[report issue]
    \n+
    \n+

    end_file()

    \n+
    \n+file_index_t end_file () const noexcept;\n 
    \n-

    To make it easier to extract information from a torrent file, the\n-class torrent_info exists.

    \n-[report issue]
    \n-
    \n+

    returns the index of the one-past-end file in the file storage

    \n+[report issue]
    \n+
    \n+

    file_range()

    \n+
    \n+index_range<file_index_t> file_range () const noexcept;\n+
    \n+

    returns an implementation-defined type that can be used as the\n+container in a range-for loop. Where the values are the indices of all\n+files in the file_storage.

    \n+[report issue]
    \n+
    \n+

    total_size()

    \n+
    \n+std::int64_t total_size () const;\n+
    \n+

    returns the total number of bytes all the files in this torrent spans

    \n+\n+[report issue]
    \n+
    \n+

    set_num_pieces() num_pieces()

    \n+
    \n+int num_pieces () const;\n+void set_num_pieces (int n);\n+
    \n+

    set and get the number of pieces in the torrent

    \n+[report issue]
    \n+
    \n+

    end_piece()

    \n+
    \n+piece_index_t end_piece () const;\n+
    \n+

    returns the index of the one-past-end piece in the file storage

    \n+[report issue]
    \n+
    \n+

    last_piece()

    \n+
    \n+piece_index_t last_piece () const;\n+
    \n+

    returns the index of the last piece in the torrent. The last piece is\n+special in that it may be smaller than the other pieces (and the other\n+pieces are all the same size).

    \n+[report issue]
    \n+
    \n+

    piece_range()

    \n+
    \n+index_range<piece_index_t> piece_range () const noexcept;\n+
    \n+

    returns an implementation-defined type that can be used as the\n+container in a range-for loop. Where the values are the indices of all\n+pieces in the file_storage.

    \n+\n+[report issue]
    \n+
    \n+

    set_piece_length() piece_length()

    \n+
    \n+void set_piece_length (int l);\n+int piece_length () const;\n+
    \n+

    set and get the size of each piece in this torrent. It must be a power of two\n+and at least 16 kiB.

    \n+[report issue]
    \n+
    \n+

    piece_size()

    \n+
    \n+int piece_size (piece_index_t index) const;\n+
    \n+

    returns the piece size of index. This will be the same as piece_length(), except\n+for the last piece, which may be shorter.

    \n+[report issue]
    \n+
    \n+

    piece_size2()

    \n+
    \n+int piece_size2 (piece_index_t index) const;\n+
    \n+

    Returns the size of the given piece. If the piece spans multiple files,\n+only the first file is considered part of the piece. This is used for\n+v2 torrents, where all files are piece aligned and padded. i.e. The pad\n+files are not considered part of the piece for this purpose.

    \n+[report issue]
    \n+
    \n+

    blocks_in_piece2()

    \n+
    \n+int blocks_in_piece2 (piece_index_t index) const;\n+
    \n+

    returns the number of blocks in the specified piece, for v2 torrents.

    \n+[report issue]
    \n+
    \n+

    blocks_per_piece()

    \n+
    \n+int blocks_per_piece () const;\n+
    \n+

    returns the number of blocks there are in the typical piece. There\n+may be fewer in the last piece)

    \n+\n+[report issue]
    \n+
    \n+

    set_name() name()

    \n+
    \n+std::string const& name () const;\n+void set_name (std::string const& n);\n+
    \n+

    set and get the name of this torrent. For multi-file torrents, this is also\n+the name of the root directory all the files are stored in.

    \n+[report issue]
    \n+
    \n

    swap()

    \n
    \n-void swap (entry& e);\n+void swap (file_storage& ti) noexcept;\n 
    \n-

    swaps the content of this with e.

    \n-[report issue]
    \n-
    \n-

    operator[]()

    \n+

    swap all content of this with ti.

    \n+[report issue]
    \n+
    \n+

    canonicalize()

    \n
    \n-entry const& operator[] (string_view key) const;\n-entry& operator[] (string_view key);\n+void canonicalize ();\n 
    \n-

    All of these functions requires the entry to be a dictionary, if it\n-isn't they will throw system_error.

    \n-

    The non-const versions of the operator[] will return a reference\n-to either the existing element at the given key or, if there is no\n-element with the given key, a reference to a newly inserted element at\n-that key.

    \n-

    The const version of operator[] will only return a reference to an\n-existing element at the given key. If the key is not found, it will\n-throw system_error.

    \n-[report issue]
    \n-
    \n-

    find_key()

    \n+

    arrange files and padding to match the canonical form required\n+by BEP 52

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+[report issue]
    \n+\n-
    \n-

    to_string()

    \n+

    These functions are used to query attributes of files at\n+a given index.

    \n+

    The hash() is a SHA-1 hash of the file, or 0 if none was\n+provided in the torrent file. This can potentially be used to\n+join a bittorrent network with other file sharing networks.

    \n+

    root() returns the SHA-256 merkle tree root of the specified file,\n+in case this is a v2 torrent. Otherwise returns zeros.\n+root_ptr() returns a pointer to the SHA-256 merkle tree root hash\n+for the specified file. The pointer points into storage referred to\n+when the file was added, it is not owned by this object. Torrents\n+that are not v2 torrents return nullptr.

    \n+

    The mtime() is the modification time is the posix\n+time when a file was last modified when the torrent\n+was created, or 0 if it was not included in the torrent file.

    \n+

    file_path() returns the full path to a file.

    \n+

    file_size() returns the size of a file.

    \n+

    pad_file_at() returns true if the file at the given\n+index is a pad-file.

    \n+

    file_name() returns just the name of the file, whereas\n+file_path() returns the path (inside the torrent file) with\n+the filename appended.

    \n+

    file_offset() returns the byte offset within the torrent file\n+where this file starts. It can be used to map the file to a piece\n+index (given the piece size).

    \n+\n+\n+[report issue]
    \n+
    \n+

    file_piece_range() file_num_pieces() file_num_blocks()

    \n
    \n-std::string to_string (bool single_line = false) const;\n+int file_num_pieces (file_index_t index) const;\n+index_range<piece_index_t::diff_type> file_piece_range (file_index_t) const;\n+int file_num_blocks (file_index_t index) const;\n 
    \n-

    returns a pretty-printed string representation\n-of the bencoded structure, with JSON-style syntax

    \n-[report issue]
    \n-
    \n-

    enum data_type

    \n-

    Declared in "libtorrent/entry.hpp"

    \n+

    Returns the number of pieces or blocks the file at index spans,\n+under the assumption that the file is aligned to the start of a piece.\n+This is only meaningful for v2 torrents, where files are guaranteed\n+such alignment.\n+These numbers are used to size and navigate the merkle hash tree for\n+each file.

    \n+\n+[report issue]
    \n+
    \n+

    file_first_piece_node() file_first_block_node()

    \n+
    \n+int file_first_piece_node (file_index_t index) const;\n+int file_first_block_node (file_index_t index) const;\n+
    \n+

    index of first piece node in the merkle tree

    \n+[report issue]
    \n+
    \n+

    file_path_hash()

    \n+
    \n+std::uint32_t file_path_hash (file_index_t index, std::string const& save_path) const;\n+
    \n+

    returns the crc32 hash of file_path(index)

    \n+[report issue]
    \n+
    \n+

    all_path_hashes()

    \n+
    \n+void all_path_hashes (std::unordered_set<std::uint32_t>& table) const;\n+
    \n+

    this will add the CRC32 hash of all directory entries to the table. No\n+filename will be included, just directories. Every depth of directories\n+are added separately to allow test for collisions with files at all\n+levels. i.e. if one path in the torrent is foo/bar/baz, the CRC32\n+hashes for foo, foo/bar and foo/bar/baz will be added to\n+the set.

    \n+[report issue]
    \n+
    \n+

    file_flags()

    \n+
    \n+file_flags_t file_flags (file_index_t index) const;\n+
    \n+

    returns a bitmask of flags from file_flags_t that apply\n+to file at index.

    \n+[report issue]
    \n+
    \n+

    file_absolute_path()

    \n+
    \n+bool file_absolute_path (file_index_t index) const;\n+
    \n+

    returns true if the file at the specified index has been renamed to\n+have an absolute path, i.e. is not anchored in the save path of the\n+torrent.

    \n+\n+[report issue]
    \n+
    \n+

    file_index_at_piece() file_index_at_offset()

    \n+
    \n+file_index_t file_index_at_offset (std::int64_t offset) const;\n+file_index_t file_index_at_piece (piece_index_t piece) const;\n+
    \n+

    returns the index of the file at the given offset in the torrent

    \n+[report issue]
    \n+
    \n+

    file_index_for_root()

    \n+
    \n+file_index_t file_index_for_root (sha256_hash const& root_hash) const;\n+
    \n+

    finds the file with the given root hash and returns its index\n+if there is no file with the root hash, file_index_t{-1} is returned

    \n+[report issue]
    \n+
    \n+

    piece_index_at_file()

    \n+
    \n+piece_index_t piece_index_at_file (file_index_t f) const;\n+
    \n+

    returns the piece index the given file starts at

    \n+[report issue]
    \n+
    \n+

    sanitize_symlinks()

    \n+
    \n+void sanitize_symlinks ();\n+
    \n+

    validate any symlinks, to ensure they all point to\n+other files or directories inside this storage. Any invalid symlinks\n+are updated to point to themselves.

    \n+[report issue]
    \n+
    \n+

    v2()

    \n+
    \n+bool v2 () const;\n+
    \n+

    returns true if this torrent contains v2 metadata.

    \n+[report issue]
    \n+
    flag_pad_file
    \n+
    the file is a pad file. It's required to contain zeros\n+at it will not be saved to disk. Its purpose is to make\n+the following file start on a piece boundary.
    \n+
    \n+[report issue]
    \n+
    flag_hidden
    \n+
    this file has the hidden attribute set. This is primarily\n+a windows attribute
    \n+
    \n+[report issue]
    \n+
    flag_executable
    \n+
    this file has the executable attribute set.
    \n+
    \n+[report issue]
    \n+
    flag_symlink
    \n+
    this file is a symbolic link. It should have a link\n+target string associated with it.
    \n+
    \n+[report issue]
    \n+
    \n+
    \n+

    storage_params

    \n+

    Declared in "libtorrent/storage_defs.hpp"

    \n+

    a parameter pack used to construct the storage for a torrent, used in\n+disk_interface

    \n+
    \n+struct storage_params\n+{\n+   storage_params (file_storage const& f, file_storage const* mf\n+      , std::string const& sp, storage_mode_t const sm\n+      , aux::vector<download_priority_t, file_index_t> const& prio\n+      , sha1_hash const& ih);\n+\n+   file_storage const& files;\n+   file_storage const* mapped_files  = nullptr;\n+   std::string const& path;\n+   storage_mode_t mode {storage_mode_sparse};\n+   aux::vector<download_priority_t, file_index_t> const& priorities;\n+   sha1_hash info_hash;\n+};\n+
    \n+[report issue]
    \n+
    \n+

    default_disk_io_constructor()

    \n+

    Declared in "libtorrent/session.hpp"

    \n+
    \n+std::unique_ptr<disk_interface> default_disk_io_constructor (\n+   io_context& ios, settings_interface const&, counters& cnt);\n+
    \n+

    the constructor function for the default storage. On systems that support\n+memory mapped files (and a 64 bit address space) the memory mapped storage\n+will be constructed, otherwise the portable posix storage.

    \n+[report issue]
    \n+
    \n+

    disabled_disk_io_constructor()

    \n+

    Declared in "libtorrent/disabled_disk_io.hpp"

    \n+
    \n+std::unique_ptr<disk_interface> disabled_disk_io_constructor (\n+   io_context& ios, settings_interface const&, counters& cnt);\n+
    \n+

    creates a disk io object that discards all data written to it, and only\n+returns zero-buffers when read from. May be useful for testing and\n+benchmarking.

    \n+[report issue]
    \n+
    \n+

    posix_disk_io_constructor()

    \n+

    Declared in "libtorrent/posix_disk_io.hpp"

    \n+
    \n+std::unique_ptr<disk_interface> posix_disk_io_constructor (\n+   io_context& ios, settings_interface const&, counters& cnt);\n+
    \n+

    this is a simple posix disk I/O back-end, used for systems that don't\n+have a 64 bit virtual address space or don't support memory mapped files.\n+It's implemented using portable C file functions and is single-threaded.

    \n+[report issue]
    \n+
    \n+

    mmap_disk_io_constructor()

    \n+

    Declared in "libtorrent/mmap_disk_io.hpp"

    \n+
    \n+std::unique_ptr<disk_interface> mmap_disk_io_constructor (\n+   io_context& ios, settings_interface const&, counters& cnt);\n+
    \n+

    constructs a memory mapped file disk I/O object.

    \n+[report issue]
    \n+
    \n+

    enum storage_mode_t

    \n+

    Declared in "libtorrent/storage_defs.hpp"

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    namevaluedescription
    storage_mode_allocate0All pieces will be written to their final position, all files will be\n+allocated in full when the torrent is first started. This mode minimizes\n+fragmentation but could be a costly operation.
    storage_mode_sparse1All pieces will be written to the place where they belong and sparse files\n+will be used. This is the recommended, and default mode.
    \n+[report issue]
    \n+
    \n+

    enum status_t

    \n+

    Declared in "libtorrent/storage_defs.hpp"

    \n \n \n-\n \n-\n+\n+\n \n \n \n \n \n \n \n \n-\n+\n \n \n \n-\n+\n \n \n \n-\n+\n \n \n \n-\n+\n \n \n \n-\n-\n-\n+\n+\n+\n \n-\n-\n-\n+\n+
    namevaluedescription
    int_t
    no_error0 
    string_t
    fatal_disk_error1 
    list_t
    need_full_check2 
    dictionary_t
    file_exist3 
    undefined_t4 
    oversized_file16this is not an enum value, but a flag that can be set in the return\n+from async_check_files, in case an existing file was found larger than\n+specified in the torrent. i.e. it has garbage at the end\n+the status_t field is used for this to preserve ABI.
    preformatted_t5 
    \n+[report issue]
    \n+
    \n+

    enum move_flags_t

    \n+

    Declared in "libtorrent/storage_defs.hpp"

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n \n \n
    namevaluedescription
    always_replace_files0replace any files in the destination when copying\n+or moving the storage
    fail_if_exist1if any files that we want to copy exist in the destination\n+exist, fail the whole operation and don't perform\n+any copy or move. There is an inherent race condition\n+in this mode. The files are checked for existence before\n+the operation starts. In between the check and performing\n+the copy, the destination files may be created, in which\n+case they are replaced.
    dont_replace2if any file exist in the target, take those files instead\n+of the ones we may have in the source.
    reset_save_path3don't move any source files, just forget about them\n+and begin checking files at new save path
    reset_save_path_unchecked4don't move any source files, just change save path\n+and continue working without any checks
    \n-[report issue]
    \n-
    \n-
    \n-

    bencode()

    \n-

    Declared in "libtorrent/bencode.hpp"

    \n+[report issue]
    \n+
    \n+

    announce_infohash

    \n+

    Declared in "libtorrent/announce_entry.hpp"

    \n
    \n-template<class OutIt> int bencode (OutIt out, const entry& e);\n+struct announce_infohash\n+{\n+   std::string message;\n+   error_code last_error;\n+   int scrape_incomplete  = -1;\n+   int scrape_complete  = -1;\n+   int scrape_downloaded  = -1;\n+   std::uint8_t fails : 7;\n+   bool updating : 1;\n+   bool start_sent : 1;\n+   bool complete_sent : 1;\n+};\n 
    \n-

    This function will encode data to bencoded form.

    \n-

    The entry class is the internal representation of the bencoded data\n-and it can be used to retrieve information, an entry can also be build by\n-the program and given to bencode() to encode it into the OutIt\n-iterator.

    \n-

    OutIt is an OutputIterator. It's a template and usually\n-instantiated as ostream_iterator or back_insert_iterator. This\n-function assumes the value_type of the iterator is a char.\n-In order to encode entry e into a buffer, do:

    \n+[report issue]
    \n+
    message
    \n+
    if this tracker has returned an error or warning message\n+that message is stored here
    \n+
    \n+[report issue]
    \n+
    last_error
    \n+
    if this tracker failed the last time it was contacted\n+this error code specifies what error occurred
    \n+
    \n+\n+\n+[report issue]
    \n+
    scrape_incomplete scrape_complete scrape_downloaded
    \n+
    if this tracker has returned scrape data, these fields are filled in\n+with valid numbers. Otherwise they are set to -1. incomplete counts\n+the number of current downloaders. complete counts the number of\n+current peers completed the download, or "seeds". downloaded is the\n+cumulative number of completed downloads.
    \n+
    \n+[report issue]
    \n+
    fails
    \n+
    the number of times in a row we have failed to announce to this\n+tracker.
    \n+
    \n+[report issue]
    \n+
    updating
    \n+
    true while we're waiting for a response from the tracker.
    \n+
    \n+[report issue]
    \n+
    start_sent
    \n+
    set to true when we get a valid response from an announce\n+with event=started. If it is set, we won't send start in the subsequent\n+announces.
    \n+
    \n+[report issue]
    \n+
    complete_sent
    \n+
    set to true when we send a event=completed.
    \n+
    \n+[report issue]
    \n+
    \n+

    announce_endpoint

    \n+

    Declared in "libtorrent/announce_entry.hpp"

    \n+

    announces are sent to each tracker using every listen socket\n+this class holds information about one listen socket for one tracker

    \n
    \n-std::vector<char> buf;\n-bencode(std::back_inserter(buf), e);\n+struct announce_endpoint\n+{\n+   announce_endpoint ();\n+\n+   tcp::endpoint local_endpoint;\n+   aux::array<announce_infohash, num_protocols, protocol_version> info_hashes;\n+   bool enabled  = true;\n+};\n 
    \n-[report issue]
    \n-
    \n-

    operator<<()

    \n-

    Declared in "libtorrent/entry.hpp"

    \n+[report issue]
    \n+
    local_endpoint
    \n+
    the local endpoint of the listen interface associated with this endpoint
    \n+
    \n+[report issue]
    \n+
    info_hashes
    \n+
    info_hashes[0] is the v1 info hash (SHA1)\n+info_hashes[1] is the v2 info hash (truncated SHA-256)
    \n+
    \n+[report issue]
    \n+
    enabled
    \n+
    set to false to not announce from this endpoint
    \n+
    \n+[report issue]
    \n+
    \n+

    announce_entry

    \n+

    Declared in "libtorrent/announce_entry.hpp"

    \n+

    this class holds information about one bittorrent tracker, as it\n+relates to a specific torrent.

    \n
    \n-inline std::ostream& operator<< (std::ostream& os, const entry& e);\n+struct announce_entry\n+{\n+   announce_entry& operator= (announce_entry const&) &;\n+   announce_entry (announce_entry const&);\n+   explicit announce_entry (string_view u);\n+   ~announce_entry ();\n+   announce_entry ();\n+\n+   enum tracker_source\n+   {\n+      source_torrent,\n+      source_client,\n+      source_magnet_link,\n+      source_tex,\n+   };\n+\n+   std::string url;\n+   std::string trackerid;\n+   std::vector<announce_endpoint> endpoints;\n+   std::uint8_t tier  = 0;\n+   std::uint8_t fail_limit  = 0;\n+   std::uint8_t source:4;\n+   bool verified:1;\n+};\n 
    \n-

    prints the bencoded structure to the ostream as a JSON-style structure.

    \n+\n+\n+[report issue]
    \n+

    ~announce_entry() announce_entry() operator=()

    \n+
    \n+announce_entry& operator= (announce_entry const&) &;\n+announce_entry (announce_entry const&);\n+explicit announce_entry (string_view u);\n+~announce_entry ();\n+announce_entry ();\n+
    \n+

    constructs a tracker announce entry with u as the URL.

    \n+[report issue]
    \n+
    \n+

    enum tracker_source

    \n+

    Declared in "libtorrent/announce_entry.hpp"

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    namevaluedescription
    source_torrent1the tracker was part of the .torrent file
    source_client2the tracker was added programmatically via the add_tracker() function
    source_magnet_link4the tracker was part of a magnet link
    source_tex8the tracker was received from the swarm via tracker exchange
    \n+[report issue]
    \n+
    url
    \n+
    tracker URL as it appeared in the torrent file
    \n+
    \n+[report issue]
    \n+
    trackerid
    \n+
    the current &trackerid= argument passed to the tracker.\n+this is optional and is normally empty (in which case no\n+trackerid is sent).
    \n+
    \n+[report issue]
    \n+
    endpoints
    \n+
    each local listen socket (endpoint) will announce to the tracker. This\n+list contains state per endpoint.
    \n+
    \n+[report issue]
    \n+
    tier
    \n+
    the tier this tracker belongs to
    \n+
    \n+[report issue]
    \n+
    fail_limit
    \n+
    the max number of failures to announce to this tracker in\n+a row, before this tracker is not used anymore. 0 means unlimited
    \n+
    \n+[report issue]
    \n+
    source
    \n+
    a bitmask specifying which sources we got this tracker from.
    \n+
    \n+[report issue]
    \n+
    verified
    \n+
    set to true the first time we receive a valid response\n+from this tracker.
    \n+
    \n

    The disk I/O can be customized in libtorrent. In previous versions, the\n customization was at the level of each torrent. Now, the customization point\n is at the session level. All torrents added to a session will use the same\n disk I/O subsystem, as determined by the disk_io_constructor (in\n session_params).

    \n

    This allows the disk subsystem to also customize threading and disk job\n management.

    \n@@ -10092,33 +9190,16 @@\n \n std::unique_ptr<lt::disk_interface> temp_disk_constructor(\n lt::io_context& ioc, lt::settings_interface const&, lt::counters&)\n {\n return std::make_unique<temp_disk_io>(ioc);\n }\n \n-[report issue]
    \n-
    \n-

    settings_interface

    \n-

    Declared in "libtorrent/settings_pack.hpp"

    \n-

    the common interface to settings_pack and the internal representation of\n-settings.

    \n-
    \n-struct settings_interface\n-{\n-   virtual void set_bool (int name, bool val) = 0;\n-   virtual void set_int (int name, int val) = 0;\n-   virtual bool has_val (int name) const = 0;\n-   virtual void set_str (int name, std::string val) = 0;\n-   virtual std::string const& get_str (int name) const = 0;\n-   virtual bool get_bool (int name) const = 0;\n-   virtual int get_int (int name) const = 0;\n-};\n-
    \n [report issue]
    \n+
    \n
    \n

    disk_observer

    \n

    Declared in "libtorrent/disk_observer.hpp"

    \n
    \n struct disk_observer\n {\n    virtual void on_disk () = 0;\n@@ -10128,16 +9209,34 @@\n 

    on_disk()

    \n
    \n virtual void on_disk () = 0;\n 
    \n

    called when the disk cache size has dropped\n below the low watermark again and we can\n resume downloading from peers

    \n-[report issue]
    \n+[report issue]
    \n
    \n+
    \n+

    settings_interface

    \n+

    Declared in "libtorrent/settings_pack.hpp"

    \n+

    the common interface to settings_pack and the internal representation of\n+settings.

    \n+
    \n+struct settings_interface\n+{\n+   virtual void set_bool (int name, bool val) = 0;\n+   virtual void set_int (int name, int val) = 0;\n+   virtual bool has_val (int name) const = 0;\n+   virtual void set_str (int name, std::string val) = 0;\n+   virtual int get_int (int name) const = 0;\n+   virtual std::string const& get_str (int name) const = 0;\n+   virtual bool get_bool (int name) const = 0;\n+};\n+
    \n+[report issue]
    \n
    \n

    open_file_state

    \n

    Declared in "libtorrent/disk_interface.hpp"

    \n

    this contains information about a file that's currently open by the\n libtorrent disk I/O subsystem. It's associated with a single torrent.

    \n
    \n struct open_file_state\n@@ -10181,21 +9280,21 @@\n the constructor. The callbacks will be run in the network thread.

    \n
    \n struct disk_interface\n {\n    virtual storage_holder new_torrent (storage_params const& p\n       , std::shared_ptr<void> const& torrent) = 0;\n    virtual void remove_torrent (storage_index_t) = 0;\n+   virtual void async_read (storage_index_t storage, peer_request const& r\n+      , std::function<void(disk_buffer_holder, storage_error const&)> handler\n+      , disk_job_flags_t flags = {}) = 0;\n    virtual bool async_write (storage_index_t storage, peer_request const& r\n       , char const* buf, std::shared_ptr<disk_observer> o\n       , std::function<void(storage_error const&)> handler\n       , disk_job_flags_t flags = {}) = 0;\n-   virtual void async_read (storage_index_t storage, peer_request const& r\n-      , std::function<void(disk_buffer_holder, storage_error const&)> handler\n-      , disk_job_flags_t flags = {}) = 0;\n    virtual void async_hash (storage_index_t storage, piece_index_t piece, span<sha256_hash> v2\n       , disk_job_flags_t flags\n       , std::function<void(piece_index_t, sha1_hash const&, storage_error const&)> handler) = 0;\n    virtual void async_hash2 (storage_index_t storage, piece_index_t piece, int offset, disk_job_flags_t flags\n       , std::function<void(piece_index_t, sha256_hash const&, storage_error const&)> handler) = 0;\n    virtual void async_move_storage (storage_index_t storage, std::string p, move_flags_t flags\n       , std::function<void(status_t, std::string const&, storage_error const&)> handler) = 0;\n@@ -10247,449 +9346,1451 @@\n 

    remove_torrent()

    \n
    \n virtual void remove_torrent (storage_index_t) = 0;\n 
    \n

    remove the storage with the specified index. This is not expected to\n delete any files from disk, just to clean up any resources associated\n with the specified storage.

    \n-\n-[report issue]
    \n-
    \n-

    async_read() async_write()

    \n+\n+[report issue]
    \n+
    \n+

    async_write() async_read()

    \n
    \n+virtual void async_read (storage_index_t storage, peer_request const& r\n+      , std::function<void(disk_buffer_holder, storage_error const&)> handler\n+      , disk_job_flags_t flags = {}) = 0;\n virtual bool async_write (storage_index_t storage, peer_request const& r\n       , char const* buf, std::shared_ptr<disk_observer> o\n       , std::function<void(storage_error const&)> handler\n       , disk_job_flags_t flags = {}) = 0;\n-virtual void async_read (storage_index_t storage, peer_request const& r\n-      , std::function<void(disk_buffer_holder, storage_error const&)> handler\n-      , disk_job_flags_t flags = {}) = 0;\n 
    \n-

    perform a read or write operation from/to the specified storage\n-index and the specified request. When the operation completes, call\n-handler possibly with a disk_buffer_holder, holding the buffer with\n-the result. Flags may be set to affect the read operation. See\n-disk_job_flags_t.

    \n-

    The disk_observer is a callback to indicate that\n-the store buffer/disk write queue is below the watermark to let peers\n-start writing buffers to disk again. When async_write() returns\n-true, indicating the write queue is full, the peer will stop\n-further writes and wait for the passed-in disk_observer to be\n-notified before resuming.

    \n-

    Note that for async_read, the peer_request (r) is not\n-necessarily aligned to blocks (but it is most of the time). However,\n-all writes (passed to async_write) are guaranteed to be block\n-aligned.

    \n-[report issue]
    \n-
    \n-

    async_hash()

    \n+

    perform a read or write operation from/to the specified storage\n+index and the specified request. When the operation completes, call\n+handler possibly with a disk_buffer_holder, holding the buffer with\n+the result. Flags may be set to affect the read operation. See\n+disk_job_flags_t.

    \n+

    The disk_observer is a callback to indicate that\n+the store buffer/disk write queue is below the watermark to let peers\n+start writing buffers to disk again. When async_write() returns\n+true, indicating the write queue is full, the peer will stop\n+further writes and wait for the passed-in disk_observer to be\n+notified before resuming.

    \n+

    Note that for async_read, the peer_request (r) is not\n+necessarily aligned to blocks (but it is most of the time). However,\n+all writes (passed to async_write) are guaranteed to be block\n+aligned.

    \n+[report issue]
    \n+
    \n+

    async_hash()

    \n+
    \n+virtual void async_hash (storage_index_t storage, piece_index_t piece, span<sha256_hash> v2\n+      , disk_job_flags_t flags\n+      , std::function<void(piece_index_t, sha1_hash const&, storage_error const&)> handler) = 0;\n+
    \n+

    Compute hash(es) for the specified piece. Unless the v1_hash flag is\n+set (in flags), the SHA-1 hash of the whole piece does not need\n+to be computed.

    \n+

    The v2 span is optional and can be empty, which means v2 hashes\n+should not be computed. If v2 is non-empty it must be at least large\n+enough to hold all v2 blocks in the piece, and this function will\n+fill in the span with the SHA-256 block hashes of the piece.

    \n+[report issue]
    \n+
    \n+

    async_hash2()

    \n+
    \n+virtual void async_hash2 (storage_index_t storage, piece_index_t piece, int offset, disk_job_flags_t flags\n+      , std::function<void(piece_index_t, sha256_hash const&, storage_error const&)> handler) = 0;\n+
    \n+

    computes the v2 hash (SHA-256) of a single block. The block at\n+offset in piece piece.

    \n+[report issue]
    \n+
    \n+

    async_move_storage()

    \n+
    \n+virtual void async_move_storage (storage_index_t storage, std::string p, move_flags_t flags\n+      , std::function<void(status_t, std::string const&, storage_error const&)> handler) = 0;\n+
    \n+

    called to request the files for the specified storage/torrent be\n+moved to a new location. It is the disk I/O object's responsibility\n+to synchronize this with any currently outstanding disk operations to\n+the storage. Whether files are replaced at the destination path or\n+not is controlled by flags (see move_flags_t).

    \n+[report issue]
    \n+
    \n+

    async_release_files()

    \n+
    \n+virtual void async_release_files (storage_index_t storage\n+      , std::function<void()> handler = std::function<void()>()) = 0;\n+
    \n+

    This is called on disk I/O objects to request they close all open\n+files for the specified storage/torrent. If file handles are not\n+pooled/cached, it can be a no-op. For truly asynchronous disk I/O,\n+this should provide at least one point in time when all files are\n+closed. It is possible that later asynchronous operations will\n+re-open some of the files, by the time this completion handler is\n+called, that's fine.

    \n+[report issue]
    \n+
    \n+

    async_check_files()

    \n+
    \n+virtual void async_check_files (storage_index_t storage\n+      , add_torrent_params const* resume_data\n+      , aux::vector<std::string, file_index_t> links\n+      , std::function<void(status_t, storage_error const&)> handler) = 0;\n+
    \n+

    this is called when torrents are added to validate their resume data\n+against the files on disk. This function is expected to do a few things:

    \n+

    if links is non-empty, it contains a string for each file in the\n+torrent. The string being a path to an existing identical file. The\n+default behavior is to create hard links of those files into the\n+storage of the new torrent (specified by storage). An empty\n+string indicates that there is no known identical file. This is part\n+of the "mutable torrent" feature, where files can be reused from\n+other torrents.

    \n+

    The resume_data points the resume data passed in by the client.

    \n+

    If the resume_data->flags field has the seed_mode flag set, all\n+files/pieces are expected to be on disk already. This should be\n+verified. Not just the existence of the file, but also that it has\n+the correct size.

    \n+

    Any file with a piece set in the resume_data->have_pieces bitmask\n+should exist on disk, this should be verified. Pad files and files\n+with zero priority may be skipped.

    \n+[report issue]
    \n+
    \n+

    async_stop_torrent()

    \n+
    \n+virtual void async_stop_torrent (storage_index_t storage\n+      , std::function<void()> handler = std::function<void()>()) = 0;\n+
    \n+

    This is called when a torrent is stopped. It gives the disk I/O\n+object an opportunity to flush any data to disk that's currently kept\n+cached. This function should at least do the same thing as\n+async_release_files().

    \n+[report issue]
    \n+
    \n+

    async_rename_file()

    \n+
    \n+virtual void async_rename_file (storage_index_t storage\n+      , file_index_t index, std::string name\n+      , std::function<void(std::string const&, file_index_t, storage_error const&)> handler) = 0;\n+
    \n+

    This function is called when the name of a file in the specified\n+storage has been requested to be renamed. The disk I/O object is\n+responsible for renaming the file without racing with other\n+potentially outstanding operations against the file (such as read,\n+write, move, etc.).

    \n+[report issue]
    \n+
    \n+

    async_delete_files()

    \n+
    \n+virtual void async_delete_files (storage_index_t storage, remove_flags_t options\n+      , std::function<void(storage_error const&)> handler) = 0;\n+
    \n+

    This function is called when some file(s) on disk have been requested\n+to be removed by the client. storage indicates which torrent is\n+referred to. See session_handle for remove_flags_t flags\n+indicating which files are to be removed.\n+e.g. session_handle::delete_files - delete all files\n+session_handle::delete_partfile - only delete part file.

    \n+[report issue]
    \n+
    \n+

    async_set_file_priority()

    \n+
    \n+virtual void async_set_file_priority (storage_index_t storage\n+      , aux::vector<download_priority_t, file_index_t> prio\n+      , std::function<void(storage_error const&\n+      , aux::vector<download_priority_t, file_index_t>)> handler) = 0;\n+
    \n+

    This is called to set the priority of some or all files. Changing the\n+priority from or to 0 may involve moving data to and from the\n+partfile. The disk I/O object is responsible for correctly\n+synchronizing this work to not race with any potentially outstanding\n+asynchronous operations affecting these files.

    \n+

    prio is a vector of the file priority for all files. If it's\n+shorter than the total number of files in the torrent, they are\n+assumed to be set to the default priority.

    \n+[report issue]
    \n+
    \n+

    async_clear_piece()

    \n+
    \n+virtual void async_clear_piece (storage_index_t storage, piece_index_t index\n+      , std::function<void(piece_index_t)> handler) = 0;\n+
    \n+

    This is called when a piece fails the hash check, to ensure there are\n+no outstanding disk operations to the piece before blocks are\n+re-requested from peers to overwrite the existing blocks. The disk I/O\n+object does not need to perform any action other than synchronize\n+with all outstanding disk operations to the specified piece before\n+posting the result back.

    \n+[report issue]
    \n+
    \n+

    update_stats_counters()

    \n+
    \n+virtual void update_stats_counters (counters& c) const = 0;\n+
    \n+

    update_stats_counters() is called to give the disk storage an\n+opportunity to update gauges in the c stats counters, that aren't\n+updated continuously as operations are performed. This is called\n+before a snapshot of the counters are passed to the client.

    \n+[report issue]
    \n+
    \n+

    get_status()

    \n+
    \n+virtual std::vector<open_file_state> get_status (storage_index_t) const = 0;\n+
    \n+

    Return a list of all the files that are currently open for the\n+specified storage/torrent. This is is just used for the client to\n+query the currently open files, and which modes those files are open\n+in.

    \n+[report issue]
    \n+
    \n+

    abort()

    \n+
    \n+virtual void abort (bool wait) = 0;\n+
    \n+

    this is called when the session is starting to shut down. The disk\n+I/O object is expected to flush any outstanding write jobs, cancel\n+hash jobs and initiate tearing down of any internal threads. If\n+wait is true, this should be asynchronous. i.e. this call should\n+not return until all threads have stopped and all jobs have either\n+been aborted or completed and the disk I/O object is ready to be\n+destructed.

    \n+[report issue]
    \n+
    \n+

    submit_jobs()

    \n+
    \n+virtual void submit_jobs () = 0;\n+
    \n+

    This will be called after a batch of disk jobs has been issues (via\n+the async_* ). It gives the disk I/O object an opportunity to\n+notify any potential condition variables to wake up the disk\n+thread(s). The async_* calls can of course also notify condition\n+variables, but doing it in this call allows for batching jobs, by\n+issuing the notification once for a collection of jobs.

    \n+[report issue]
    \n+
    \n+

    settings_updated()

    \n+
    \n+virtual void settings_updated () = 0;\n+
    \n+

    This is called to notify the disk I/O object that the settings have\n+been updated. In the disk io constructor, a settings_interface\n+reference is passed in. Whenever these settings are updated, this\n+function is called to allow the disk I/O object to react to any\n+changed settings relevant to its operations.

    \n+[report issue]
    \n+
    force_copy
    \n+
    force making a copy of the cached block, rather than getting a\n+reference to a block already in the cache. This is used the block is\n+expected to be overwritten very soon, by async_write()`, and we need\n+access to the previous content.
    \n+
    \n+[report issue]
    \n+
    sequential_access
    \n+
    hint that there may be more disk operations with sequential access to\n+the file
    \n+
    \n+[report issue]
    \n+
    volatile_read
    \n+
    don't keep the read block in cache. This is a hint that this block is\n+unlikely to be read again anytime soon, and caching it would be\n+wasteful.
    \n+
    \n+[report issue]
    \n+
    v1_hash
    \n+
    compute a v1 piece hash. This is only used by the async_hash() call.\n+If this flag is not set in the async_hash() call, the SHA-1 piece\n+hash does not need to be computed.
    \n+
    \n+[report issue]
    \n+
    flush_piece
    \n+
    this flag instructs a hash job that we just completed this piece, and\n+it should be flushed to disk
    \n+
    \n+[report issue]
    \n+
    \n+
    \n+

    storage_holder

    \n+

    Declared in "libtorrent/disk_interface.hpp"

    \n+

    a unique, owning, reference to the storage of a torrent in a disk io\n+subsystem (class that implements disk_interface). This is held by the\n+internal libtorrent torrent object to tie the storage object allocated\n+for a torrent to the lifetime of the internal torrent object. When a\n+torrent is removed from the session, this holder is destructed and will\n+inform the disk object.

    \n+
    \n+struct storage_holder\n+{\n+   ~storage_holder ();\n+   storage_holder () = default;\n+   storage_holder (storage_index_t idx, disk_interface& disk_io);\n+   explicit operator bool () const;\n+   operator storage_index_t () const;\n+   void reset ();\n+   storage_holder (storage_holder const&) = delete;\n+   storage_holder& operator= (storage_holder const&) = delete;\n+   storage_holder (storage_holder&& rhs) noexcept;\n+   storage_holder& operator= (storage_holder&& rhs) noexcept;\n+};\n+
    \n+[report issue]
    \n+
    \n+

    buffer_allocator_interface

    \n+

    Declared in "libtorrent/disk_buffer_holder.hpp"

    \n+

    the interface for freeing disk buffers, used by the disk_buffer_holder.\n+when implementing disk_interface, this must also be implemented in order\n+to return disk buffers back to libtorrent

    \n+
    \n+struct buffer_allocator_interface\n+{\n+   virtual void free_disk_buffer (char* b) = 0;\n+};\n+
    \n+[report issue]
    \n+
    \n+

    disk_buffer_holder

    \n+

    Declared in "libtorrent/disk_buffer_holder.hpp"

    \n+

    The disk buffer holder acts like a unique_ptr that frees a disk buffer\n+when it's destructed

    \n+

    If this buffer holder is moved-from, default constructed or reset,\n+data() will return nullptr.

    \n+
    \n+struct disk_buffer_holder\n+{\n+   disk_buffer_holder (disk_buffer_holder&&) noexcept;\n+   disk_buffer_holder& operator= (disk_buffer_holder&&) & noexcept;\n+   disk_buffer_holder (disk_buffer_holder const&) = delete;\n+   disk_buffer_holder& operator= (disk_buffer_holder const&) = delete;\n+   disk_buffer_holder (buffer_allocator_interface& alloc\n+      , char* buf, int sz) noexcept;\n+   disk_buffer_holder () noexcept = default;\n+   ~disk_buffer_holder ();\n+   char* data () const noexcept;\n+   void reset ();\n+   void swap (disk_buffer_holder& h) noexcept;\n+   bool is_mutable () const noexcept;\n+   explicit operator bool () const noexcept;\n+   std::ptrdiff_t size () const;\n+};\n+
    \n+[report issue]
    \n+

    disk_buffer_holder()

    \n+
    \n+disk_buffer_holder (buffer_allocator_interface& alloc\n+      , char* buf, int sz) noexcept;\n+
    \n+

    construct a buffer holder that will free the held buffer\n+using a disk buffer pool directly (there's only one\n+disk_buffer_pool per session)

    \n+[report issue]
    \n+
    \n+

    disk_buffer_holder()

    \n+
    \n+disk_buffer_holder () noexcept = default;\n+
    \n+

    default construct a holder that does not own any buffer

    \n+[report issue]
    \n+
    \n+

    ~disk_buffer_holder()

    \n+
    \n+~disk_buffer_holder ();\n+
    \n+

    frees disk buffer held by this object

    \n+[report issue]
    \n+
    \n+

    data()

    \n+
    \n+char* data () const noexcept;\n+
    \n+

    return a pointer to the held buffer, if any. Otherwise returns nullptr.

    \n+[report issue]
    \n+
    \n+

    reset()

    \n+
    \n+void reset ();\n+
    \n+

    free the held disk buffer, if any, and clear the holder. This sets the\n+holder object to a default-constructed state

    \n+[report issue]
    \n+
    \n+

    swap()

    \n+
    \n+void swap (disk_buffer_holder& h) noexcept;\n+
    \n+

    swap pointers of two disk buffer holders.

    \n+[report issue]
    \n+
    \n+

    is_mutable()

    \n+
    \n+bool is_mutable () const noexcept;\n+
    \n+

    if this returns true, the buffer may not be modified in place

    \n+[report issue]
    \n+
    \n+

    bool()

    \n+
    \n+explicit operator bool () const noexcept;\n+
    \n+

    implicitly convertible to true if the object is currently holding a\n+buffer

    \n+[report issue]
    \n+
    \n+
    \n+

    file_open_mode_t

    \n+

    Declared in "libtorrent/disk_interface.hpp"

    \n+
    \n+
    read_only
    \n+
    open the file for reading only
    \n+
    \n+
    \n+
    write_only
    \n+
    open the file for writing only
    \n+
    \n+
    \n+
    read_write
    \n+
    open the file for reading and writing
    \n+
    \n+
    \n+
    rw_mask
    \n+
    the mask for the bits determining read or write mode
    \n+
    \n+
    \n+
    sparse
    \n+
    open the file in sparse mode (if supported by the\n+filesystem).
    \n+
    \n+
    \n+
    no_atime
    \n+
    don't update the access timestamps on the file (if\n+supported by the operating system and filesystem).\n+this generally improves disk performance.
    \n+
    \n+
    \n+
    random_access
    \n+
    When this is not set, the kernel is hinted that access to this file will\n+be made sequentially.
    \n+
    \n+
    \n+
    mmapped
    \n+
    the file is memory mapped
    \n+
    \n+[report issue]
    \n+
    \n+

    add_torrent_params

    \n+

    Declared in "libtorrent/add_torrent_params.hpp"

    \n+

    The add_torrent_params contains all the information in a .torrent file\n+along with all information necessary to add that torrent to a session.\n+The key fields when adding a torrent are:

    \n+
      \n+
    • ti - the immutable info-dict part of the torrent
    • \n+
    • info_hash - when you don't have the metadata (.torrent file). This\n+uniquely identifies the torrent and can validate the info-dict when\n+received from the swarm.
    • \n+
    \n+

    In order to add a torrent to a session, one of those fields must be set\n+in addition to save_path. The add_torrent_params object can then be\n+passed into one of the session::add_torrent() overloads or\n+session::async_add_torrent().

    \n+

    If you only specify the info-hash, the torrent file will be downloaded\n+from peers, which requires them to support the metadata extension. For\n+the metadata extension to work, libtorrent must be built with extensions\n+enabled (TORRENT_DISABLE_EXTENSIONS must not be defined). It also\n+takes an optional name argument. This may be left empty in case no\n+name should be assigned to the torrent. In case it's not, the name is\n+used for the torrent as long as it doesn't have metadata. See\n+torrent_handle::name.

    \n+

    The add_torrent_params is also used when requesting resume data for a\n+torrent. It can be saved to and restored from a file and added back to a\n+new session. For serialization and de-serialization of\n+add_torrent_params objects, see read_resume_data() and\n+write_resume_data().

    \n+

    The add_torrent_params is also used to represent a parsed .torrent\n+file. It can be loaded via load_torrent_file(), load_torrent_buffer() and\n+load_torrent_parsed(). It can be saved via write_torrent_file().

    \n+
    \n+struct add_torrent_params\n+{\n+   int version  = LIBTORRENT_VERSION_NUM;\n+   std::shared_ptr<torrent_info> ti;\n+   aux::noexcept_movable<std::vector<std::string>> trackers;\n+   aux::noexcept_movable<std::vector<int>> tracker_tiers;\n+   aux::noexcept_movable<std::vector<std::pair<std::string, int>>> dht_nodes;\n+   std::string name;\n+   std::string save_path;\n+   storage_mode_t storage_mode  = storage_mode_sparse;\n+   client_data_t userdata;\n+   aux::noexcept_movable<std::vector<download_priority_t>> file_priorities;\n+   std::string trackerid;\n+   torrent_flags_t flags  = torrent_flags::default_flags;\n+   info_hash_t info_hashes;\n+   int max_uploads  = -1;\n+   int max_connections  = -1;\n+   int upload_limit  = -1;\n+   int download_limit  = -1;\n+   std::int64_t total_uploaded  = 0;\n+   std::int64_t total_downloaded  = 0;\n+   int active_time  = 0;\n+   int finished_time  = 0;\n+   int seeding_time  = 0;\n+   std::time_t added_time  = 0;\n+   std::time_t completed_time  = 0;\n+   std::time_t last_seen_complete  = 0;\n+   int num_complete  = -1;\n+   int num_incomplete  = -1;\n+   int num_downloaded  = -1;\n+   aux::noexcept_movable<std::vector<std::string>> http_seeds;\n+   aux::noexcept_movable<std::vector<std::string>> url_seeds;\n+   aux::noexcept_movable<std::vector<tcp::endpoint>> peers;\n+   aux::noexcept_movable<std::vector<tcp::endpoint>> banned_peers;\n+   aux::noexcept_movable<std::map<piece_index_t, bitfield>> unfinished_pieces;\n+   typed_bitfield<piece_index_t> have_pieces;\n+   typed_bitfield<piece_index_t> verified_pieces;\n+   aux::noexcept_movable<std::vector<download_priority_t>> piece_priorities;\n+   aux::vector<std::vector<sha256_hash>, file_index_t> merkle_trees;\n+   aux::vector<std::vector<bool>, file_index_t> merkle_tree_mask;\n+   aux::vector<std::vector<bool>, file_index_t> verified_leaf_hashes;\n+   aux::noexcept_movable<std::map<file_index_t, std::string>> renamed_files;\n+   std::time_t last_download  = 0;\n+   std::time_t last_upload  = 0;\n+};\n+
    \n+[report issue]
    \n+
    version
    \n+
    filled in by the constructor and should be left untouched. It is used\n+for forward binary compatibility.
    \n+
    \n+[report issue]
    \n+
    ti
    \n+
    torrent_info object with the torrent to add. Unless the\n+info_hash is set, this is required to be initialized.
    \n+
    \n+[report issue]
    \n+
    trackers
    \n+
    If the torrent doesn't have a tracker, but relies on the DHT to find\n+peers, the trackers can specify tracker URLs for the torrent.
    \n+
    \n+[report issue]
    \n+
    tracker_tiers
    \n+
    the tiers the URLs in trackers belong to. Trackers belonging to\n+different tiers may be treated differently, as defined by the multi\n+tracker extension. This is optional, if not specified trackers are\n+assumed to be part of tier 0, or whichever the last tier was as\n+iterating over the trackers.
    \n+
    \n+[report issue]
    \n+
    dht_nodes
    \n+
    a list of hostname and port pairs, representing DHT nodes to be added\n+to the session (if DHT is enabled). The hostname may be an IP address.
    \n+
    \n+[report issue]
    \n+
    name
    \n+
    in case there's no other name in this torrent, this name will be used.\n+The name out of the torrent_info object takes precedence if available.
    \n+
    \n+[report issue]
    \n+
    save_path
    \n+

    the path where the torrent is or will be stored.

    \n+
    \n+

    Note

    \n+

    On windows this path (and other paths) are interpreted as UNC\n+paths. This means they must use backslashes as directory separators\n+and may not contain the special directories "." or "..".

    \n+
    \n+

    Setting this to an absolute path performs slightly better than a\n+relative path.

    \n+
    \n+
    \n+[report issue]
    \n+
    storage_mode
    \n+
    One of the values from storage_mode_t. For more information, see\n+storage allocation.
    \n+
    \n+[report issue]
    \n+
    userdata
    \n+
    The userdata parameter is optional and will be passed on to the\n+extension constructor functions, if any\n+(see torrent_handle::add_extension()). It will also be stored in the\n+torrent object and can be retrieved by calling userdata().
    \n+
    \n+[report issue]
    \n+
    file_priorities
    \n+
    can be set to control the initial file priorities when adding a\n+torrent. The semantics are the same as for\n+torrent_handle::prioritize_files(). The file priorities specified\n+in here take precedence over those specified in the resume data, if\n+any.\n+If this vector of file priorities is shorter than the number of files\n+in the torrent, the remaining files (not covered by this) will still\n+have the default download priority. This default can be changed by\n+setting the default_dont_download torrent_flag.
    \n+
    \n+[report issue]
    \n+
    trackerid
    \n+
    the default tracker id to be used when announcing to trackers. By\n+default this is empty, and no tracker ID is used, since this is an\n+optional argument. If a tracker returns a tracker ID, that ID is used\n+instead of this.
    \n+
    \n+[report issue]
    \n+
    flags
    \n+

    flags controlling aspects of this torrent and how it's added. See\n+torrent_flags_t for details.

    \n+
    \n+

    Note

    \n+

    The flags field is initialized with default flags by the\n+constructor. In order to preserve default behavior when clearing or\n+setting other flags, make sure to bitwise OR or in a flag or bitwise\n+AND the inverse of a flag to clear it.

    \n+
    \n+
    \n+
    \n+[report issue]
    \n+
    info_hashes
    \n+
    set this to the info hash of the torrent to add in case the info-hash\n+is the only known property of the torrent. i.e. you don't have a\n+.torrent file nor a magnet link.\n+To add a magnet link, use parse_magnet_uri() to populate fields in the\n+add_torrent_params object.
    \n+
    \n+\n+[report issue]
    \n+
    max_uploads max_connections
    \n+

    max_uploads, max_connections, upload_limit,\n+download_limit correspond to the set_max_uploads(),\n+set_max_connections(), set_upload_limit() and\n+set_download_limit() functions on torrent_handle. These values let\n+you initialize these settings when the torrent is added, instead of\n+calling these functions immediately following adding it.

    \n+

    -1 means unlimited on these settings just like their counterpart\n+functions on torrent_handle

    \n+

    For fine grained control over rate limits, including making them apply\n+to local peers, see peer classes.

    \n+
    \n+
    \n+\n+[report issue]
    \n+
    upload_limit download_limit
    \n+
    the upload and download rate limits for this torrent, specified in\n+bytes per second. -1 means unlimited.
    \n+
    \n+\n+[report issue]
    \n+
    total_uploaded total_downloaded
    \n+
    the total number of bytes uploaded and downloaded by this torrent so\n+far.
    \n+
    \n+\n+\n+[report issue]
    \n+
    active_time finished_time seeding_time
    \n+
    the number of seconds this torrent has spent in started, finished and\n+seeding state so far, respectively.
    \n+
    \n+\n+[report issue]
    \n+
    added_time completed_time
    \n+
    if set to a non-zero value, this is the posix time of when this torrent\n+was first added, including previous runs/sessions. If set to zero, the\n+internal added_time will be set to the time of when add_torrent() is\n+called.
    \n+
    \n+[report issue]
    \n+
    last_seen_complete
    \n+
    if set to non-zero, initializes the time (expressed in posix time) when\n+we last saw a seed or peers that together formed a complete copy of the\n+torrent. If left set to zero, the internal counterpart to this field\n+will be updated when we see a seed or a distributed copies >= 1.0.
    \n+
    \n+\n+\n+[report issue]
    \n+
    num_complete num_incomplete num_downloaded
    \n+

    these field can be used to initialize the torrent's cached scrape data.\n+The scrape data is high level metadata about the current state of the\n+swarm, as returned by the tracker (either when announcing to it or by\n+sending a specific scrape request). num_complete is the number of\n+peers in the swarm that are seeds, or have every piece in the torrent.\n+num_incomplete is the number of peers in the swarm that do not have\n+every piece. num_downloaded is the number of times the torrent has\n+been downloaded (not initiated, but the number of times a download has\n+completed).

    \n+

    Leaving any of these values set to -1 indicates we don't know, or we\n+have not received any scrape data.

    \n+
    \n+
    \n+\n+[report issue]
    \n+
    http_seeds url_seeds
    \n+

    URLs can be added to these two lists to specify additional web\n+seeds to be used by the torrent. If the flag_override_web_seeds\n+is set, these will be the _only_ ones to be used. i.e. any web seeds\n+found in the .torrent file will be overridden.

    \n+

    http_seeds expects URLs to web servers implementing the original HTTP\n+seed specification BEP 17.

    \n+

    url_seeds expects URLs to regular web servers, aka "get right" style,\n+specified in BEP 19.

    \n+
    \n+
    \n+[report issue]
    \n+
    peers
    \n+
    peers to add to the torrent, to be tried to be connected to as\n+bittorrent peers.
    \n+
    \n+[report issue]
    \n+
    banned_peers
    \n+
    peers banned from this torrent. The will not be connected to
    \n+
    \n+[report issue]
    \n+
    unfinished_pieces
    \n+
    this is a map of partially downloaded piece. The key is the piece index\n+and the value is a bitfield where each bit represents a 16 kiB block.\n+A set bit means we have that block.
    \n+
    \n+[report issue]
    \n+
    have_pieces
    \n+
    this is a bitfield indicating which pieces we already have of this\n+torrent.
    \n+
    \n+[report issue]
    \n+
    verified_pieces
    \n+
    when in seed_mode, pieces with a set bit in this bitfield have been\n+verified to be valid. Other pieces will be verified the first time a\n+peer requests it.
    \n+
    \n+[report issue]
    \n+
    piece_priorities
    \n+
    this sets the priorities for each individual piece in the torrent. Each\n+element in the vector represent the piece with the same index. If you\n+set both file- and piece priorities, file priorities will take\n+precedence.
    \n+
    \n+[report issue]
    \n+
    merkle_trees
    \n+
    v2 hashes, if known
    \n+
    \n+[report issue]
    \n+
    merkle_tree_mask
    \n+
    if set, indicates which hashes are included in the corresponding\n+vector of merkle_trees. These bitmasks always cover the full\n+tree, a cleared bit means the hash is all zeros (i.e. not set) and\n+set bit means the next hash in the corresponding vector in\n+merkle_trees is the hash for that node. This is an optimization\n+to avoid storing a lot of zeros.
    \n+
    \n+[report issue]
    \n+
    verified_leaf_hashes
    \n+
    bit-fields indicating which v2 leaf hashes have been verified\n+against the root hash. If this vector is empty and merkle_trees is\n+non-empty it implies that all hashes in merkle_trees are verified.
    \n+
    \n+[report issue]
    \n+
    renamed_files
    \n+
    this is a map of file indices in the torrent and new filenames to be\n+applied before the torrent is added.
    \n+
    \n+\n+[report issue]
    \n+
    last_download last_upload
    \n+
    the posix time of the last time payload was received or sent for this\n+torrent, respectively. A value of 0 means we don't know when we last\n+uploaded or downloaded, or we have never uploaded or downloaded any\n+payload for this torrent.
    \n+
    \n+[report issue]
    \n+
    \n+

    client_data_t

    \n+

    Declared in "libtorrent/client_data.hpp"

    \n+

    A thin wrapper around a void pointer used as "user data". i.e. an opaque\n+cookie passed in to libtorrent and returned on demand. It adds type-safety by\n+requiring the same type be requested out of it as was assigned to it.

    \n+
    \n+struct client_data_t\n+{\n+   client_data_t () = default;\n+   explicit client_data_t (T* v);\n+   client_data_t& operator= (T* v);\n+   explicit operator T () const;\n+   T* get () const;\n+   client_data_t& operator= (void*) = delete;\n+   client_data_t& operator= (void const*) = delete;\n+   operator void* () const = delete;\n+   operator void const* () const = delete;\n+\n+   template <typename T, typename U  = typename std::enable_if<std::is_pointer<T>::value>::type>\n+};\n+
    \n+[report issue]
    \n+

    client_data_t()

    \n+
    \n+client_data_t () = default;\n+
    \n+

    construct a nullptr client data

    \n+\n+\n+[report issue]
    \n+
    \n+

    operator=() void*() const*()

    \n+
    \n+client_data_t& operator= (void*) = delete;\n+client_data_t& operator= (void const*) = delete;\n+operator void* () const = delete;\n+operator void const* () const = delete;\n+
    \n+

    we don't allow type-unsafe operations

    \n+[report issue]
    \n+
    \n+
    \n+

    web_seed_entry

    \n+

    Declared in "libtorrent/torrent_info.hpp"

    \n+

    the web_seed_entry holds information about a web seed (also known\n+as URL seed or HTTP seed). It is essentially a URL with some state\n+associated with it. For more information, see BEP 17 and BEP 19.

    \n+
    \n+struct web_seed_entry\n+{\n+   bool operator== (web_seed_entry const& e) const;\n+   bool operator< (web_seed_entry const& e) const;\n+\n+   enum type_t\n+   {\n+      url_seed,\n+      http_seed,\n+   };\n+\n+   std::string url;\n+   std::string auth;\n+   headers_t extra_headers;\n+   std::uint8_t type;\n+};\n+
    \n+[report issue]
    \n+

    operator==()

    \n+
    \n+bool operator== (web_seed_entry const& e) const;\n+
    \n+

    URL and type comparison

    \n+[report issue]
    \n+
    \n+

    operator<()

    \n+
    \n+bool operator< (web_seed_entry const& e) const;\n+
    \n+

    URL and type less-than comparison

    \n+[report issue]
    \n+
    \n+

    enum type_t

    \n+

    Declared in "libtorrent/torrent_info.hpp"

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    namevaluedescription
    url_seed0 
    http_seed1 
    \n+[report issue]
    \n+
    url
    \n+
    The URL of the web seed
    \n+
    \n+[report issue]
    \n+
    auth
    \n+
    Optional authentication. If this is set, it's passed\n+in as HTTP basic auth to the web seed. The format is:\n+username:password.
    \n+
    \n+[report issue]
    \n+
    extra_headers
    \n+
    Any extra HTTP headers that need to be passed to the web seed
    \n+
    \n+[report issue]
    \n+
    type
    \n+
    The type of web seed (see type_t)
    \n+
    \n+[report issue]
    \n+
    \n+
    \n+

    load_torrent_limits

    \n+

    Declared in "libtorrent/torrent_info.hpp"

    \n+

    this object holds configuration options for limits to use when loading\n+torrents. They are meant to prevent loading potentially malicious torrents\n+that cause excessive memory allocations.

    \n+
    \n+struct load_torrent_limits\n+{\n+   int max_buffer_size  = 10000000;\n+   int max_pieces  = 0x200000;\n+   int max_decode_depth  = 100;\n+   int max_decode_tokens  = 3000000;\n+};\n+
    \n+[report issue]
    \n+
    max_buffer_size
    \n+
    the max size of a .torrent file to load into RAM
    \n+
    \n+[report issue]
    \n+
    max_pieces
    \n+
    the max number of pieces allowed in the torrent
    \n+
    \n+[report issue]
    \n+
    max_decode_depth
    \n+
    the max recursion depth in the bdecoded structure
    \n+
    \n+[report issue]
    \n+
    max_decode_tokens
    \n+
    the max number of bdecode tokens
    \n+
    \n+[report issue]
    \n+
    \n+

    torrent_info

    \n+

    Declared in "libtorrent/torrent_info.hpp"

    \n+

    the torrent_info class holds the information found in a .torrent file.

    \n+
    \n+class torrent_info\n+{\n+   torrent_info (span<char const> buffer, load_torrent_limits const& cfg, from_span_t);\n+   torrent_info (std::string const& filename, error_code& ec);\n+   explicit torrent_info (span<char const> buffer, from_span_t);\n+   torrent_info (torrent_info const& t);\n+   explicit torrent_info (info_hash_t const& info_hash);\n+   torrent_info (span<char const> buffer, error_code& ec, from_span_t);\n+   torrent_info (std::string const& filename, load_torrent_limits const& cfg);\n+   torrent_info (char const* buffer, int size, error_code& ec);\n+   torrent_info (bdecode_node const& torrent_file, load_torrent_limits const& cfg);\n+   explicit torrent_info (std::string const& filename);\n+   explicit torrent_info (bdecode_node const& torrent_file);\n+   torrent_info (bdecode_node const& torrent_file, error_code& ec);\n+   torrent_info (char const* buffer, int size);\n+   ~torrent_info ();\n+   file_storage const& files () const;\n+   file_storage const& orig_files () const;\n+   void rename_file (file_index_t index, std::string const& new_filename);\n+   void remap_files (file_storage const& f);\n+   std::vector<announce_entry> const& trackers () const;\n+   void add_tracker (std::string const& url, int tier = 0);\n+   void add_tracker (std::string const& url, int tier\n+      , announce_entry::tracker_source source);\n+   void clear_trackers ();\n+   std::vector<std::string> collections () const;\n+   std::vector<sha1_hash> similar_torrents () const;\n+   std::vector<web_seed_entry> const& web_seeds () const;\n+   void add_http_seed (std::string const& url\n+      , std::string const& extern_auth = std::string()\n+      , web_seed_entry::headers_t const& extra_headers = web_seed_entry::headers_t());\n+   void add_url_seed (std::string const& url\n+      , std::string const& ext_auth = std::string()\n+      , web_seed_entry::headers_t const& ext_headers = web_seed_entry::headers_t());\n+   void set_web_seeds (std::vector<web_seed_entry> seeds);\n+   std::int64_t total_size () const;\n+   int num_pieces () const;\n+   int piece_length () const;\n+   int blocks_per_piece () const;\n+   piece_index_t last_piece () const;\n+   piece_index_t end_piece () const;\n+   index_range<piece_index_t> piece_range () const;\n+   sha1_hash info_hash () const noexcept;\n+   info_hash_t const& info_hashes () const;\n+   bool v1 () const;\n+   bool v2 () const;\n+   int num_files () const;\n+   std::vector<file_slice> map_block (piece_index_t const piece\n+      , std::int64_t offset, int size) const;\n+   peer_request map_file (file_index_t const file, std::int64_t offset, int size) const;\n+   string_view ssl_cert () const;\n+   bool is_valid () const;\n+   bool priv () const;\n+   bool is_i2p () const;\n+   int piece_size (piece_index_t index) const;\n+   sha1_hash hash_for_piece (piece_index_t index) const;\n+   char const* hash_for_piece_ptr (piece_index_t const index) const;\n+   bool is_loaded () const;\n+   const std::string& name () const;\n+   std::time_t creation_date () const;\n+   const std::string& creator () const;\n+   const std::string& comment () const;\n+   std::vector<std::pair<std::string, int>> const& nodes () const;\n+   void add_node (std::pair<std::string, int> const& node);\n+   bool parse_info_section (bdecode_node const& info, error_code& ec, int max_pieces);\n+   bdecode_node info (char const* key) const;\n+   span<char const> info_section () const;\n+   span<char const> piece_layer (file_index_t) const;\n+   void free_piece_layers ();\n+};\n+
    \n+[report issue]
    \n+

    torrent_info()

    \n+
    \n+torrent_info (span<char const> buffer, load_torrent_limits const& cfg, from_span_t);\n+torrent_info (std::string const& filename, error_code& ec);\n+explicit torrent_info (span<char const> buffer, from_span_t);\n+torrent_info (torrent_info const& t);\n+explicit torrent_info (info_hash_t const& info_hash);\n+torrent_info (span<char const> buffer, error_code& ec, from_span_t);\n+torrent_info (std::string const& filename, load_torrent_limits const& cfg);\n+torrent_info (char const* buffer, int size, error_code& ec);\n+torrent_info (bdecode_node const& torrent_file, load_torrent_limits const& cfg);\n+explicit torrent_info (std::string const& filename);\n+explicit torrent_info (bdecode_node const& torrent_file);\n+torrent_info (bdecode_node const& torrent_file, error_code& ec);\n+torrent_info (char const* buffer, int size);\n+
    \n+

    The constructor that takes an info-hash will initialize the info-hash\n+to the given value, but leave all other fields empty. This is used\n+internally when downloading torrents without the metadata. The\n+metadata will be created by libtorrent as soon as it has been\n+downloaded from the swarm.

    \n+

    The constructor that takes a bdecode_node will create a torrent_info\n+object from the information found in the given torrent_file. The\n+bdecode_node represents a tree node in an bencoded file. To load an\n+ordinary .torrent file into a bdecode_node, use bdecode().

    \n+

    The version that takes a buffer pointer and a size will decode it as a\n+.torrent file and initialize the torrent_info object for you.

    \n+

    The version that takes a filename will simply load the torrent file\n+and decode it inside the constructor, for convenience. This might not\n+be the most suitable for applications that want to be able to report\n+detailed errors on what might go wrong.

    \n+

    There is an upper limit on the size of the torrent file that will be\n+loaded by the overload taking a filename. If it's important that even\n+very large torrent files are loaded, use one of the other overloads.

    \n+

    The overloads that takes an error_code const& never throws if an\n+error occur, they will simply set the error code to describe what went\n+wrong and not fully initialize the torrent_info object. The overloads\n+that do not take the extra error_code parameter will always throw if\n+an error occurs. These overloads are not available when building\n+without exception support.

    \n+

    The overload that takes a span also needs an extra parameter of\n+type from_span_t to disambiguate the std::string overload for\n+string literals. There is an object in the libtorrent namespace of this\n+type called from_span.

    \n+[report issue]
    \n+
    \n+

    ~torrent_info()

    \n+
    \n+~torrent_info ();\n+
    \n+

    frees all storage associated with this torrent_info object

    \n+\n+[report issue]
    \n+
    \n+

    files() orig_files()

    \n+
    \n+file_storage const& files () const;\n+file_storage const& orig_files () const;\n+
    \n+

    The file_storage object contains the information on how to map the\n+pieces to files. It is separated from the torrent_info object because\n+when creating torrents a storage object needs to be created without\n+having a torrent file. When renaming files in a storage, the storage\n+needs to make its own copy of the file_storage in order to make its\n+mapping differ from the one in the torrent file.

    \n+

    orig_files() returns the original (unmodified) file storage for\n+this torrent. This is used by the web server connection, which needs\n+to request files with the original names. Filename may be changed using\n+torrent_info::rename_file().

    \n+

    For more information on the file_storage object, see the separate\n+document on how to create torrents.

    \n+[report issue]
    \n+
    \n+

    rename_file()

    \n+
    \n+void rename_file (file_index_t index, std::string const& new_filename);\n+
    \n+

    Renames the file with the specified index to the new name. The new\n+filename is reflected by the file_storage returned by files()\n+but not by the one returned by orig_files().

    \n+

    If you want to rename the base name of the torrent (for a multi file\n+torrent), you can copy the file_storage (see files() and\n+orig_files() ), change the name, and then use remap_files().

    \n+

    The new_filename can both be a relative path, in which case the\n+file name is relative to the save_path of the torrent. If the\n+new_filename is an absolute path (i.e. is_complete(new_filename)\n+== true), then the file is detached from the save_path of the\n+torrent. In this case the file is not moved when move_storage() is\n+invoked.

    \n+[report issue]
    \n+
    \n+

    remap_files()

    \n+
    \n+void remap_files (file_storage const& f);\n+
    \n+
    \n+

    Warning

    \n+

    Using remap_files() is discouraged as it's incompatible with v2\n+torrents. This is because the piece boundaries and piece hashes in\n+v2 torrents are intimately tied to the file boundaries. Instead,\n+just rename individual files, or implement a custom disk_interface\n+to customize how to store files.

    \n+
    \n+

    Remaps the file storage to a new file layout. This can be used to, for\n+instance, download all data in a torrent to a single file, or to a\n+number of fixed size sector aligned files, regardless of the number\n+and sizes of the files in the torrent.

    \n+

    The new specified file_storage must have the exact same size as\n+the current one.

    \n+\n+\n+[report issue]
    \n+
    \n+

    clear_trackers() trackers() add_tracker()

    \n+
    \n+std::vector<announce_entry> const& trackers () const;\n+void add_tracker (std::string const& url, int tier = 0);\n+void add_tracker (std::string const& url, int tier\n+      , announce_entry::tracker_source source);\n+void clear_trackers ();\n+
    \n+

    add_tracker() adds a tracker to the announce-list. The tier\n+determines the order in which the trackers are to be tried.\n+The trackers() function will return a sorted vector of\n+announce_entry. Each announce entry contains a string, which is\n+the tracker url, and a tier index. The tier index is the high-level\n+priority. No matter which trackers that works or not, the ones with\n+lower tier will always be tried before the one with higher tier\n+number. For more information, see announce_entry.

    \n+

    trackers() returns all entries from announce-list.

    \n+

    clear_trackers() removes all trackers from announce-list.

    \n+\n+[report issue]
    \n+
    \n+

    similar_torrents() collections()

    \n+
    \n+std::vector<std::string> collections () const;\n+std::vector<sha1_hash> similar_torrents () const;\n+
    \n+

    These two functions are related to BEP 38 (mutable torrents). The\n+vectors returned from these correspond to the "similar" and\n+"collections" keys in the .torrent file. Both info-hashes and\n+collections from within the info-dict and from outside of it are\n+included.

    \n+\n+\n+\n+[report issue]
    \n+
    \n+

    web_seeds() set_web_seeds() add_http_seed() add_url_seed()

    \n+
    \n+std::vector<web_seed_entry> const& web_seeds () const;\n+void add_http_seed (std::string const& url\n+      , std::string const& extern_auth = std::string()\n+      , web_seed_entry::headers_t const& extra_headers = web_seed_entry::headers_t());\n+void add_url_seed (std::string const& url\n+      , std::string const& ext_auth = std::string()\n+      , web_seed_entry::headers_t const& ext_headers = web_seed_entry::headers_t());\n+void set_web_seeds (std::vector<web_seed_entry> seeds);\n+
    \n+

    web_seeds() returns all url seeds and http seeds in the torrent.\n+Each entry is a web_seed_entry and may refer to either a url seed\n+or http seed.

    \n+

    add_url_seed() and add_http_seed() adds one url to the list of\n+url/http seeds.

    \n+

    set_web_seeds() replaces all web seeds with the ones specified in\n+the seeds vector.

    \n+

    The extern_auth argument can be used for other authorization\n+schemes than basic HTTP authorization. If set, it will override any\n+username and password found in the URL itself. The string will be sent\n+as the HTTP authorization header's value (without specifying "Basic").

    \n+

    The extra_headers argument defaults to an empty list, but can be\n+used to insert custom HTTP headers in the requests to a specific web\n+seed.

    \n+

    See http seeding for more information.

    \n+[report issue]
    \n+
    \n+

    total_size()

    \n
    \n-virtual void async_hash (storage_index_t storage, piece_index_t piece, span<sha256_hash> v2\n-      , disk_job_flags_t flags\n-      , std::function<void(piece_index_t, sha1_hash const&, storage_error const&)> handler) = 0;\n+std::int64_t total_size () const;\n 
    \n-

    Compute hash(es) for the specified piece. Unless the v1_hash flag is\n-set (in flags), the SHA-1 hash of the whole piece does not need\n-to be computed.

    \n-

    The v2 span is optional and can be empty, which means v2 hashes\n-should not be computed. If v2 is non-empty it must be at least large\n-enough to hold all v2 blocks in the piece, and this function will\n-fill in the span with the SHA-256 block hashes of the piece.

    \n-[report issue]
    \n-
    \n-

    async_hash2()

    \n+

    total_size() returns the total number of bytes the torrent-file\n+represents. Note that this is the number of pieces times the piece\n+size (modulo the last piece possibly being smaller). With pad files,\n+the total size will be larger than the sum of all (regular) file\n+sizes.

    \n+\n+[report issue]
    \n+
    \n+

    piece_length() num_pieces()

    \n
    \n-virtual void async_hash2 (storage_index_t storage, piece_index_t piece, int offset, disk_job_flags_t flags\n-      , std::function<void(piece_index_t, sha256_hash const&, storage_error const&)> handler) = 0;\n+int num_pieces () const;\n+int piece_length () const;\n 
    \n-

    computes the v2 hash (SHA-256) of a single block. The block at\n-offset in piece piece.

    \n-[report issue]
    \n-
    \n-

    async_move_storage()

    \n+

    piece_length() and num_pieces() returns the number of byte\n+for each piece and the total number of pieces, respectively. The\n+difference between piece_size() and piece_length() is that\n+piece_size() takes the piece index as argument and gives you the\n+exact size of that piece. It will always be the same as\n+piece_length() except in the case of the last piece, which may be\n+smaller.

    \n+[report issue]
    \n+
    \n+

    blocks_per_piece()

    \n
    \n-virtual void async_move_storage (storage_index_t storage, std::string p, move_flags_t flags\n-      , std::function<void(status_t, std::string const&, storage_error const&)> handler) = 0;\n+int blocks_per_piece () const;\n 
    \n-

    called to request the files for the specified storage/torrent be\n-moved to a new location. It is the disk I/O object's responsibility\n-to synchronize this with any currently outstanding disk operations to\n-the storage. Whether files are replaced at the destination path or\n-not is controlled by flags (see move_flags_t).

    \n-[report issue]
    \n-
    \n-

    async_release_files()

    \n+

    returns the number of blocks there are in the typical piece. There\n+may be fewer in the last piece)

    \n+\n+\n+[report issue]
    \n+
    \n+

    piece_range() end_piece() last_piece()

    \n
    \n-virtual void async_release_files (storage_index_t storage\n-      , std::function<void()> handler = std::function<void()>()) = 0;\n+piece_index_t last_piece () const;\n+piece_index_t end_piece () const;\n+index_range<piece_index_t> piece_range () const;\n 
    \n-

    This is called on disk I/O objects to request they close all open\n-files for the specified storage/torrent. If file handles are not\n-pooled/cached, it can be a no-op. For truly asynchronous disk I/O,\n-this should provide at least one point in time when all files are\n-closed. It is possible that later asynchronous operations will\n-re-open some of the files, by the time this completion handler is\n-called, that's fine.

    \n-[report issue]
    \n-
    \n-

    async_check_files()

    \n+

    last_piece() returns the index to the last piece in the torrent and\n+end_piece() returns the index to the one-past-end piece in the\n+torrent\n+piece_range() returns an implementation-defined type that can be\n+used as the container in a range-for loop. Where the values are the\n+indices of all pieces in the file_storage.

    \n+\n+[report issue]
    \n+
    \n+

    info_hashes() info_hash()

    \n
    \n-virtual void async_check_files (storage_index_t storage\n-      , add_torrent_params const* resume_data\n-      , aux::vector<std::string, file_index_t> links\n-      , std::function<void(status_t, storage_error const&)> handler) = 0;\n+sha1_hash info_hash () const noexcept;\n+info_hash_t const& info_hashes () const;\n 
    \n-

    this is called when torrents are added to validate their resume data\n-against the files on disk. This function is expected to do a few things:

    \n-

    if links is non-empty, it contains a string for each file in the\n-torrent. The string being a path to an existing identical file. The\n-default behavior is to create hard links of those files into the\n-storage of the new torrent (specified by storage). An empty\n-string indicates that there is no known identical file. This is part\n-of the "mutable torrent" feature, where files can be reused from\n-other torrents.

    \n-

    The resume_data points the resume data passed in by the client.

    \n-

    If the resume_data->flags field has the seed_mode flag set, all\n-files/pieces are expected to be on disk already. This should be\n-verified. Not just the existence of the file, but also that it has\n-the correct size.

    \n-

    Any file with a piece set in the resume_data->have_pieces bitmask\n-should exist on disk, this should be verified. Pad files and files\n-with zero priority may be skipped.

    \n-[report issue]
    \n-
    \n-

    async_stop_torrent()

    \n+

    returns the info-hash of the torrent. For BitTorrent v2 support, use\n+info_hashes() to get an object that may hold both a v1 and v2\n+info-hash

    \n+\n+[report issue]
    \n+
    \n+

    v2() v1()

    \n
    \n-virtual void async_stop_torrent (storage_index_t storage\n-      , std::function<void()> handler = std::function<void()>()) = 0;\n+bool v1 () const;\n+bool v2 () const;\n 
    \n-

    This is called when a torrent is stopped. It gives the disk I/O\n-object an opportunity to flush any data to disk that's currently kept\n-cached. This function should at least do the same thing as\n-async_release_files().

    \n-[report issue]
    \n-
    \n-

    async_rename_file()

    \n+

    returns whether this torrent has v1 and/or v2 metadata, respectively.\n+Hybrid torrents have both. These are shortcuts for\n+info_hashes().has_v1() and info_hashes().has_v2() calls.

    \n+[report issue]
    \n+
    \n+

    num_files()

    \n
    \n-virtual void async_rename_file (storage_index_t storage\n-      , file_index_t index, std::string name\n-      , std::function<void(std::string const&, file_index_t, storage_error const&)> handler) = 0;\n+int num_files () const;\n 
    \n-

    This function is called when the name of a file in the specified\n-storage has been requested to be renamed. The disk I/O object is\n-responsible for renaming the file without racing with other\n-potentially outstanding operations against the file (such as read,\n-write, move, etc.).

    \n-[report issue]
    \n-
    \n-

    async_delete_files()

    \n+

    If you need index-access to files you can use the num_files() along\n+with the file_path(), file_size()-family of functions to access\n+files using indices.

    \n+[report issue]
    \n+
    \n+

    map_block()

    \n
    \n-virtual void async_delete_files (storage_index_t storage, remove_flags_t options\n-      , std::function<void(storage_error const&)> handler) = 0;\n+std::vector<file_slice> map_block (piece_index_t const piece\n+      , std::int64_t offset, int size) const;\n 
    \n-

    This function is called when some file(s) on disk have been requested\n-to be removed by the client. storage indicates which torrent is\n-referred to. See session_handle for remove_flags_t flags\n-indicating which files are to be removed.\n-e.g. session_handle::delete_files - delete all files\n-session_handle::delete_partfile - only delete part file.

    \n-[report issue]
    \n-
    \n-

    async_set_file_priority()

    \n+

    This function will map a piece index, a byte offset within that piece\n+and a size (in bytes) into the corresponding files with offsets where\n+that data for that piece is supposed to be stored. See file_slice.

    \n+[report issue]
    \n+
    \n+

    map_file()

    \n
    \n-virtual void async_set_file_priority (storage_index_t storage\n-      , aux::vector<download_priority_t, file_index_t> prio\n-      , std::function<void(storage_error const&\n-      , aux::vector<download_priority_t, file_index_t>)> handler) = 0;\n+peer_request map_file (file_index_t const file, std::int64_t offset, int size) const;\n 
    \n-

    This is called to set the priority of some or all files. Changing the\n-priority from or to 0 may involve moving data to and from the\n-partfile. The disk I/O object is responsible for correctly\n-synchronizing this work to not race with any potentially outstanding\n-asynchronous operations affecting these files.

    \n-

    prio is a vector of the file priority for all files. If it's\n-shorter than the total number of files in the torrent, they are\n-assumed to be set to the default priority.

    \n-[report issue]
    \n-
    \n-

    async_clear_piece()

    \n+

    This function will map a range in a specific file into a range in the\n+torrent. The file_offset parameter is the offset in the file,\n+given in bytes, where 0 is the start of the file. See peer_request.

    \n+

    The input range is assumed to be valid within the torrent.\n+file_offset + size is not allowed to be greater than the file\n+size. file_index must refer to a valid file, i.e. it cannot be >=\n+num_files().

    \n+[report issue]
    \n+
    \n+

    ssl_cert()

    \n
    \n-virtual void async_clear_piece (storage_index_t storage, piece_index_t index\n-      , std::function<void(piece_index_t)> handler) = 0;\n+string_view ssl_cert () const;\n 
    \n-

    This is called when a piece fails the hash check, to ensure there are\n-no outstanding disk operations to the piece before blocks are\n-re-requested from peers to overwrite the existing blocks. The disk I/O\n-object does not need to perform any action other than synchronize\n-with all outstanding disk operations to the specified piece before\n-posting the result back.

    \n-[report issue]
    \n-
    \n-

    update_stats_counters()

    \n+

    Returns the SSL root certificate for the torrent, if it is an SSL\n+torrent. Otherwise returns an empty string. The certificate is\n+the public certificate in x509 format.

    \n+[report issue]
    \n+
    \n+

    is_valid()

    \n
    \n-virtual void update_stats_counters (counters& c) const = 0;\n+bool is_valid () const;\n 
    \n-

    update_stats_counters() is called to give the disk storage an\n-opportunity to update gauges in the c stats counters, that aren't\n-updated continuously as operations are performed. This is called\n-before a snapshot of the counters are passed to the client.

    \n-[report issue]
    \n-
    \n-

    get_status()

    \n+

    returns true if this torrent_info object has a torrent loaded.\n+This is primarily used to determine if a magnet link has had its\n+metadata resolved yet or not.

    \n+[report issue]
    \n+
    \n+

    priv()

    \n
    \n-virtual std::vector<open_file_state> get_status (storage_index_t) const = 0;\n+bool priv () const;\n 
    \n-

    Return a list of all the files that are currently open for the\n-specified storage/torrent. This is is just used for the client to\n-query the currently open files, and which modes those files are open\n-in.

    \n-[report issue]
    \n-
    \n-

    abort()

    \n+

    returns true if this torrent is private. i.e., the client should not\n+advertise itself on the trackerless network (the Kademlia DHT) for this torrent.

    \n+[report issue]
    \n+
    \n+

    is_i2p()

    \n
    \n-virtual void abort (bool wait) = 0;\n+bool is_i2p () const;\n 
    \n-

    this is called when the session is starting to shut down. The disk\n-I/O object is expected to flush any outstanding write jobs, cancel\n-hash jobs and initiate tearing down of any internal threads. If\n-wait is true, this should be asynchronous. i.e. this call should\n-not return until all threads have stopped and all jobs have either\n-been aborted or completed and the disk I/O object is ready to be\n-destructed.

    \n-[report issue]
    \n-
    \n-

    submit_jobs()

    \n+

    returns true if this is an i2p torrent. This is determined by whether\n+or not it has a tracker whose URL domain name ends with ".i2p". i2p\n+torrents disable the DHT and local peer discovery as well as talking\n+to peers over anything other than the i2p network.

    \n+[report issue]
    \n+
    \n+

    piece_size()

    \n
    \n-virtual void submit_jobs () = 0;\n+int piece_size (piece_index_t index) const;\n 
    \n-

    This will be called after a batch of disk jobs has been issues (via\n-the async_* ). It gives the disk I/O object an opportunity to\n-notify any potential condition variables to wake up the disk\n-thread(s). The async_* calls can of course also notify condition\n-variables, but doing it in this call allows for batching jobs, by\n-issuing the notification once for a collection of jobs.

    \n-[report issue]
    \n-
    \n-

    settings_updated()

    \n+

    returns the piece size of file with index. This will be the same as piece_length(),\n+except for the last piece, which may be shorter.

    \n+\n+[report issue]
    \n+
    \n+

    hash_for_piece_ptr() hash_for_piece()

    \n
    \n-virtual void settings_updated () = 0;\n+sha1_hash hash_for_piece (piece_index_t index) const;\n+char const* hash_for_piece_ptr (piece_index_t const index) const;\n 
    \n-

    This is called to notify the disk I/O object that the settings have\n-been updated. In the disk io constructor, a settings_interface\n-reference is passed in. Whenever these settings are updated, this\n-function is called to allow the disk I/O object to react to any\n-changed settings relevant to its operations.

    \n-[report issue]
    \n-
    force_copy
    \n-
    force making a copy of the cached block, rather than getting a\n-reference to a block already in the cache. This is used the block is\n-expected to be overwritten very soon, by async_write()`, and we need\n-access to the previous content.
    \n-
    \n-[report issue]
    \n-
    sequential_access
    \n-
    hint that there may be more disk operations with sequential access to\n-the file
    \n-
    \n-[report issue]
    \n-
    volatile_read
    \n-
    don't keep the read block in cache. This is a hint that this block is\n-unlikely to be read again anytime soon, and caching it would be\n-wasteful.
    \n-
    \n-[report issue]
    \n-
    v1_hash
    \n-
    compute a v1 piece hash. This is only used by the async_hash() call.\n-If this flag is not set in the async_hash() call, the SHA-1 piece\n-hash does not need to be computed.
    \n-
    \n-[report issue]
    \n-
    flush_piece
    \n-
    this flag instructs a hash job that we just completed this piece, and\n-it should be flushed to disk
    \n-
    \n-[report issue]
    \n-
    \n-
    \n-

    storage_holder

    \n-

    Declared in "libtorrent/disk_interface.hpp"

    \n-

    a unique, owning, reference to the storage of a torrent in a disk io\n-subsystem (class that implements disk_interface). This is held by the\n-internal libtorrent torrent object to tie the storage object allocated\n-for a torrent to the lifetime of the internal torrent object. When a\n-torrent is removed from the session, this holder is destructed and will\n-inform the disk object.

    \n+

    hash_for_piece() takes a piece-index and returns the 20-bytes\n+sha1-hash for that piece and info_hash() returns the 20-bytes\n+sha1-hash for the info-section of the torrent file.\n+hash_for_piece_ptr() returns a pointer to the 20 byte sha1 digest\n+for the piece. Note that the string is not 0-terminated.

    \n+[report issue]
    \n+
    \n+

    name()

    \n
    \n-struct storage_holder\n-{\n-   storage_holder () = default;\n-   storage_holder (storage_index_t idx, disk_interface& disk_io);\n-   ~storage_holder ();\n-   explicit operator bool () const;\n-   operator storage_index_t () const;\n-   void reset ();\n-   storage_holder (storage_holder const&) = delete;\n-   storage_holder& operator= (storage_holder const&) = delete;\n-   storage_holder (storage_holder&& rhs) noexcept;\n-   storage_holder& operator= (storage_holder&& rhs) noexcept;\n-};\n+const std::string& name () const;\n 
    \n-[report issue]
    \n-
    \n-

    buffer_allocator_interface

    \n-

    Declared in "libtorrent/disk_buffer_holder.hpp"

    \n-

    the interface for freeing disk buffers, used by the disk_buffer_holder.\n-when implementing disk_interface, this must also be implemented in order\n-to return disk buffers back to libtorrent

    \n+

    name() returns the name of the torrent.\n+name contains UTF-8 encoded string.

    \n+[report issue]
    \n+
    \n+

    creation_date()

    \n
    \n-struct buffer_allocator_interface\n-{\n-   virtual void free_disk_buffer (char* b) = 0;\n-};\n+std::time_t creation_date () const;\n 
    \n-[report issue]
    \n-
    \n-

    disk_buffer_holder

    \n-

    Declared in "libtorrent/disk_buffer_holder.hpp"

    \n-

    The disk buffer holder acts like a unique_ptr that frees a disk buffer\n-when it's destructed

    \n-

    If this buffer holder is moved-from, default constructed or reset,\n-data() will return nullptr.

    \n+

    creation_date() returns the creation date of the torrent as time_t\n+(posix time). If there's no time stamp in the torrent file, 0 is\n+returned.\n+.. posix time: http://www.opengroup.org/onlinepubs/009695399/functions/time.html

    \n+[report issue]
    \n+
    \n+

    creator()

    \n
    \n-struct disk_buffer_holder\n-{\n-   disk_buffer_holder (disk_buffer_holder&&) noexcept;\n-   disk_buffer_holder& operator= (disk_buffer_holder&&) & noexcept;\n-   disk_buffer_holder& operator= (disk_buffer_holder const&) = delete;\n-   disk_buffer_holder (disk_buffer_holder const&) = delete;\n-   disk_buffer_holder (buffer_allocator_interface& alloc\n-      , char* buf, int sz) noexcept;\n-   disk_buffer_holder () noexcept = default;\n-   ~disk_buffer_holder ();\n-   char* data () const noexcept;\n-   void reset ();\n-   void swap (disk_buffer_holder& h) noexcept;\n-   bool is_mutable () const noexcept;\n-   explicit operator bool () const noexcept;\n-   std::ptrdiff_t size () const;\n-};\n+const std::string& creator () const;\n 
    \n-[report issue]
    \n-

    disk_buffer_holder()

    \n+

    creator() returns the creator string in the torrent. If there is\n+no creator string it will return an empty string.

    \n+[report issue]
    \n+
    \n+

    comment()

    \n
    \n-disk_buffer_holder (buffer_allocator_interface& alloc\n-      , char* buf, int sz) noexcept;\n+const std::string& comment () const;\n 
    \n-

    construct a buffer holder that will free the held buffer\n-using a disk buffer pool directly (there's only one\n-disk_buffer_pool per session)

    \n-[report issue]
    \n-
    \n-

    disk_buffer_holder()

    \n+

    comment() returns the comment associated with the torrent. If\n+there's no comment, it will return an empty string.\n+comment contains UTF-8 encoded string.

    \n+[report issue]
    \n+
    \n+

    nodes()

    \n
    \n-disk_buffer_holder () noexcept = default;\n+std::vector<std::pair<std::string, int>> const& nodes () const;\n 
    \n-

    default construct a holder that does not own any buffer

    \n-[report issue]
    \n-
    \n-

    ~disk_buffer_holder()

    \n+

    If this torrent contains any DHT nodes, they are put in this vector in\n+their original form (host name and port number).

    \n+[report issue]
    \n+
    \n+

    add_node()

    \n
    \n-~disk_buffer_holder ();\n+void add_node (std::pair<std::string, int> const& node);\n 
    \n-

    frees disk buffer held by this object

    \n-[report issue]
    \n-
    \n-

    data()

    \n+

    This is used when creating torrent. Use this to add a known DHT node.\n+It may be used, by the client, to bootstrap into the DHT network.

    \n+[report issue]
    \n+
    \n+

    parse_info_section()

    \n
    \n-char* data () const noexcept;\n+bool parse_info_section (bdecode_node const& info, error_code& ec, int max_pieces);\n 
    \n-

    return a pointer to the held buffer, if any. Otherwise returns nullptr.

    \n-[report issue]
    \n-
    \n-

    reset()

    \n+

    populates the torrent_info by providing just the info-dict buffer.\n+This is used when loading a torrent from a magnet link for instance,\n+where we only have the info-dict. The bdecode_node e points to a\n+parsed info-dictionary. ec returns an error code if something\n+fails (typically if the info dictionary is malformed).\n+The max_pieces parameter allows limiting the amount of memory\n+dedicated to loading the torrent, and fails for torrents that exceed\n+the limit. To load large torrents, this limit may also need to be\n+raised in settings_pack::max_piece_count and in calls to\n+read_resume_data().

    \n+[report issue]
    \n+
    \n+

    info()

    \n
    \n-void reset ();\n+bdecode_node info (char const* key) const;\n 
    \n-

    free the held disk buffer, if any, and clear the holder. This sets the\n-holder object to a default-constructed state

    \n-[report issue]
    \n-
    \n-

    swap()

    \n+

    This function looks up keys from the info-dictionary of the loaded\n+torrent file. It can be used to access extension values put in the\n+.torrent file. If the specified key cannot be found, it returns nullptr.

    \n+[report issue]
    \n+
    \n+

    info_section()

    \n
    \n-void swap (disk_buffer_holder& h) noexcept;\n+span<char const> info_section () const;\n 
    \n-

    swap pointers of two disk buffer holders.

    \n-[report issue]
    \n-
    \n-

    is_mutable()

    \n+

    returns a the raw info section of the torrent file.\n+The underlying buffer is still owned by the torrent_info object

    \n+[report issue]
    \n+
    \n+

    piece_layer()

    \n
    \n-bool is_mutable () const noexcept;\n+span<char const> piece_layer (file_index_t) const;\n 
    \n-

    if this returns true, the buffer may not be modified in place

    \n-[report issue]
    \n-
    \n-

    bool()

    \n+

    return the bytes of the piece layer hashes for the specified file. If\n+the file doesn't have a piece layer, an empty span is returned.\n+The span size is divisible by 32, the size of a SHA-256 hash.\n+If the size of the file is smaller than or equal to the piece size,\n+the files "root hash" is the hash of the file and is not saved\n+separately in the "piece layers" field, but this function still\n+returns the root hash of the file in that case.

    \n+[report issue]
    \n+
    \n+

    free_piece_layers()

    \n
    \n-explicit operator bool () const noexcept;\n+void free_piece_layers ();\n 
    \n-

    implicitly convertible to true if the object is currently holding a\n-buffer

    \n-[report issue]
    \n-
    \n-
    \n-

    file_open_mode_t

    \n-

    Declared in "libtorrent/disk_interface.hpp"

    \n-
    \n-
    read_only
    \n-
    open the file for reading only
    \n-
    \n-
    \n-
    write_only
    \n-
    open the file for writing only
    \n-
    \n-
    \n-
    read_write
    \n-
    open the file for reading and writing
    \n-
    \n-
    \n-
    rw_mask
    \n-
    the mask for the bits determining read or write mode
    \n-
    \n-
    \n-
    sparse
    \n-
    open the file in sparse mode (if supported by the\n-filesystem).
    \n-
    \n-
    \n-
    no_atime
    \n-
    don't update the access timestamps on the file (if\n-supported by the operating system and filesystem).\n-this generally improves disk performance.
    \n-
    \n-
    \n-
    random_access
    \n-
    When this is not set, the kernel is hinted that access to this file will\n-be made sequentially.
    \n-
    \n-
    \n-
    mmapped
    \n-
    the file is memory mapped
    \n-
    \n+

    clears the piece layers from the torrent_info. This is done by the\n+session when a torrent is added, to avoid storing it twice. The piece\n+layer (or other hashes part of the merkle tree) are stored in the\n+internal torrent object.

    \n

    You have some control over session configuration through the session::apply_settings()\n member function. To change one or more configuration options, create a settings_pack\n object and fill it with the settings to be set and pass it in to session::apply_settings().

    \n

    The settings_pack object is a collection of settings updates that are applied\n to the session when passed to session::apply_settings(). It's empty when\n constructed.

    \n

    You have control over proxy and authorization settings and also the user-agent\n that will be sent to the tracker. The user-agent will also be used to identify the\n client with other peers.

    \n

    Each configuration option is named with an enum value inside the\n settings_pack class. These are the available settings:

    \n [report issue]
    \n+
    \n
    \n

    settings_pack

    \n

    Declared in "libtorrent/settings_pack.hpp"

    \n

    The settings_pack struct, contains the names of all settings as\n enum values. These values are passed in to the set_str(),\n set_int(), set_bool() functions, to specify the setting to\n change.

    \n@@ -15218,23 +15319,23 @@\n
    \n struct settings_pack final : settings_interface\n {\n    friend  void apply_pack_impl (settings_pack const*\n       , aux::session_settings_single_thread&\n       , std::vector<void(aux::session_impl::*)()>*);\n    void set_int (int name, flags::bitfield_flag<Type, Tag> const val);\n-   void set_bool (int name, bool val) override;\n    void set_str (int name, std::string val) override;\n    void set_int (int name, int val) override;\n+   void set_bool (int name, bool val) override;\n    bool has_val (int name) const override;\n    void clear ();\n    void clear (int name);\n-   int get_int (int name) const override;\n    std::string const& get_str (int name) const override;\n    bool get_bool (int name) const override;\n+   int get_int (int name) const override;\n    void for_each (Fun&& f) const;\n \n    enum type_bases\n    {\n       string_type_base,\n       int_type_base,\n       bool_type_base,\n@@ -15304,23 +15405,23 @@\n       socks5,\n       socks5_pw,\n       http,\n       http_pw,\n    };\n };\n 
    \n-\n \n-[report issue]
    \n-

    set_bool() set_str() set_int()

    \n+\n+[report issue]
    \n+

    set_str() set_bool() set_int()

    \n
    \n void set_int (int name, flags::bitfield_flag<Type, Tag> const val);\n-void set_bool (int name, bool val) override;\n void set_str (int name, std::string val) override;\n void set_int (int name, int val) override;\n+void set_bool (int name, bool val) override;\n 
    \n

    set a configuration option in the settings_pack. name is one of\n the enum values from string_types, int_types or bool_types. They must\n match the respective type of the set_* function.

    \n [report issue]
    \n
    \n

    has_val()

    \n@@ -15340,23 +15441,23 @@\n [report issue]
    \n
    \n

    clear()

    \n
    \n void clear (int name);\n 
    \n

    clear a specific setting from the pack

    \n+\n \n-\n-[report issue]
    \n-
    \n-

    get_int() get_str() get_bool()

    \n+[report issue]
    \n+
    \n+

    get_bool() get_int() get_str()

    \n
    \n-int get_int (int name) const override;\n std::string const& get_str (int name) const override;\n bool get_bool (int name) const override;\n+int get_int (int name) const override;\n 
    \n

    queries the current configuration option from the settings_pack.\n name is one of the enumeration values from string_types, int_types\n or bool_types. The enum value must match the type of the get_*\n function. If the specified setting field has not been set, the default\n value is returned.

    \n [report issue]
    \n@@ -15715,64 +15816,16 @@\n http_pw\n 5\n The server is assumed to be an HTTP proxy that requires user\n authorization. The username and password will be sent to the proxy.\n \n \n \n-\n-[report issue]
    \n-
    \n-
    \n-

    high_performance_seed() min_memory_usage()

    \n-

    Declared in "libtorrent/session.hpp"

    \n-
    \n-settings_pack min_memory_usage ();\n-settings_pack high_performance_seed ();\n-
    \n-

    The default values of the session settings are set for a regular\n-bittorrent client running on a desktop system. There are functions that\n-can set the session settings to pre set settings for other environments.\n-These can be used for the basis, and should be tweaked to fit your needs\n-better.

    \n-

    min_memory_usage returns settings that will use the minimal amount of\n-RAM, at the potential expense of upload and download performance. It\n-adjusts the socket buffer sizes, disables the disk cache, lowers the send\n-buffer watermarks so that each connection only has at most one block in\n-use at any one time. It lowers the outstanding blocks send to the disk\n-I/O thread so that connections only have one block waiting to be flushed\n-to disk at any given time. It lowers the max number of peers in the peer\n-list for torrents. It performs multiple smaller reads when it hashes\n-pieces, instead of reading it all into memory before hashing.

    \n-

    This configuration is intended to be the starting point for embedded\n-devices. It will significantly reduce memory usage.

    \n-

    high_performance_seed returns settings optimized for a seed box,\n-serving many peers and that doesn't do any downloading. It has a 128 MB\n-disk cache and has a limit of 400 files in its file pool. It support fast\n-upload rates by allowing large send buffers.

    \n-\n-[report issue]
    \n-
    \n-

    name_for_setting() setting_by_name()

    \n-

    Declared in "libtorrent/settings_pack.hpp"

    \n-
    \n-int setting_by_name (string_view name);\n-char const* name_for_setting (int s);\n-
    \n-

    converts a setting integer (from the enums string_types, int_types or\n-bool_types) to a string, and vice versa.

    \n-[report issue]
    \n-
    \n-

    default_settings()

    \n-

    Declared in "libtorrent/settings_pack.hpp"

    \n-
    \n-settings_pack default_settings ();\n-
    \n-

    returns a settings_pack with every setting set to its default value

    \n [report issue]
    \n+
    \n
    \n

    generate_fingerprint()

    \n

    Declared in "libtorrent/fingerprint.hpp"

    \n
    \n std::string generate_fingerprint (std::string name\n    , int major, int minor = 0, int revision = 0, int tag = 0);\n 
    \n@@ -15821,389 +15874,826 @@\n Tribler\n \n \n \n

    There's an informal directory of client id's here.

    \n

    The major, minor, revision and tag parameters are used to\n identify the version of your client.

    \n-[report issue]
    \n-
    \n-

    client_data_t

    \n-

    Declared in "libtorrent/client_data.hpp"

    \n-

    A thin wrapper around a void pointer used as "user data". i.e. an opaque\n-cookie passed in to libtorrent and returned on demand. It adds type-safety by\n-requiring the same type be requested out of it as was assigned to it.

    \n+\n+[report issue]
    \n+
    \n+

    high_performance_seed() min_memory_usage()

    \n+

    Declared in "libtorrent/session.hpp"

    \n
    \n-struct client_data_t\n-{\n-   client_data_t () = default;\n-   explicit client_data_t (T* v);\n-   client_data_t& operator= (T* v);\n-   explicit operator T () const;\n-   T* get () const;\n-   operator void* () const = delete;\n-   client_data_t& operator= (void const*) = delete;\n-   client_data_t& operator= (void*) = delete;\n-   operator void const* () const = delete;\n-\n-   template <typename T, typename U  = typename std::enable_if<std::is_pointer<T>::value>::type>\n-};\n+settings_pack min_memory_usage ();\n+settings_pack high_performance_seed ();\n 
    \n-[report issue]
    \n-

    client_data_t()

    \n+

    The default values of the session settings are set for a regular\n+bittorrent client running on a desktop system. There are functions that\n+can set the session settings to pre set settings for other environments.\n+These can be used for the basis, and should be tweaked to fit your needs\n+better.

    \n+

    min_memory_usage returns settings that will use the minimal amount of\n+RAM, at the potential expense of upload and download performance. It\n+adjusts the socket buffer sizes, disables the disk cache, lowers the send\n+buffer watermarks so that each connection only has at most one block in\n+use at any one time. It lowers the outstanding blocks send to the disk\n+I/O thread so that connections only have one block waiting to be flushed\n+to disk at any given time. It lowers the max number of peers in the peer\n+list for torrents. It performs multiple smaller reads when it hashes\n+pieces, instead of reading it all into memory before hashing.

    \n+

    This configuration is intended to be the starting point for embedded\n+devices. It will significantly reduce memory usage.

    \n+

    high_performance_seed returns settings optimized for a seed box,\n+serving many peers and that doesn't do any downloading. It has a 128 MB\n+disk cache and has a limit of 400 files in its file pool. It support fast\n+upload rates by allowing large send buffers.

    \n+\n+[report issue]
    \n+
    \n+

    name_for_setting() setting_by_name()

    \n+

    Declared in "libtorrent/settings_pack.hpp"

    \n
    \n-client_data_t () = default;\n+char const* name_for_setting (int s);\n+int setting_by_name (string_view name);\n 
    \n-

    construct a nullptr client data

    \n-\n-\n-[report issue]
    \n-
    \n-

    operator=() const*() void*()

    \n+

    converts a setting integer (from the enums string_types, int_types or\n+bool_types) to a string, and vice versa.

    \n+[report issue]
    \n+
    \n+

    default_settings()

    \n+

    Declared in "libtorrent/settings_pack.hpp"

    \n
    \n-operator void* () const = delete;\n-client_data_t& operator= (void const*) = delete;\n-client_data_t& operator= (void*) = delete;\n-operator void const* () const = delete;\n+settings_pack default_settings ();\n 
    \n-

    we don't allow type-unsafe operations

    \n-[report issue]
    \n-
    \n-
    \n-

    add_torrent_params

    \n-

    Declared in "libtorrent/add_torrent_params.hpp"

    \n-

    The add_torrent_params contains all the information in a .torrent file\n-along with all information necessary to add that torrent to a session.\n-The key fields when adding a torrent are:

    \n+

    returns a settings_pack with every setting set to its default value

    \n+

    libtorrent has a plugin interface for implementing extensions to the protocol.\n+These can be general extensions for transferring metadata or peer exchange\n+extensions, or it could be used to provide a way to customize the protocol\n+to fit a particular (closed) network.

    \n+

    In short, the plugin interface makes it possible to:

    \n
      \n-
    • ti - the immutable info-dict part of the torrent
    • \n-
    • info_hash - when you don't have the metadata (.torrent file). This\n-uniquely identifies the torrent and can validate the info-dict when\n-received from the swarm.
    • \n+
    • register extension messages (sent in the extension handshake), see\n+extensions.
    • \n+
    • add data and parse data from the extension handshake.
    • \n+
    • send extension messages and standard bittorrent messages.
    • \n+
    • override or block the handling of standard bittorrent messages.
    • \n+
    • save and restore state via the session state
    • \n+
    • see all alerts that are posted
    • \n
    \n-

    In order to add a torrent to a session, one of those fields must be set\n-in addition to save_path. The add_torrent_params object can then be\n-passed into one of the session::add_torrent() overloads or\n-session::async_add_torrent().

    \n-

    If you only specify the info-hash, the torrent file will be downloaded\n-from peers, which requires them to support the metadata extension. For\n-the metadata extension to work, libtorrent must be built with extensions\n-enabled (TORRENT_DISABLE_EXTENSIONS must not be defined). It also\n-takes an optional name argument. This may be left empty in case no\n-name should be assigned to the torrent. In case it's not, the name is\n-used for the torrent as long as it doesn't have metadata. See\n-torrent_handle::name.

    \n-

    The add_torrent_params is also used when requesting resume data for a\n-torrent. It can be saved to and restored from a file and added back to a\n-new session. For serialization and de-serialization of\n-add_torrent_params objects, see read_resume_data() and\n-write_resume_data().

    \n-

    The add_torrent_params is also used to represent a parsed .torrent\n-file. It can be loaded via load_torrent_file(), load_torrent_buffer() and\n-load_torrent_parsed(). It can be saved via write_torrent_file().

    \n+
    \n+
    \n+

    a word of caution

    \n+

    Writing your own plugin is a very easy way to introduce serious bugs such as\n+dead locks and race conditions. Since a plugin has access to internal\n+structures it is also quite easy to sabotage libtorrent's operation.

    \n+

    All the callbacks are always called from the libtorrent network thread. In\n+case portions of your plugin are called from other threads, typically the main\n+thread, you cannot use any of the member functions on the internal structures\n+in libtorrent, since those require being called from the libtorrent network\n+thread . Furthermore, you also need to synchronize your own shared data\n+within the plugin, to make sure it is not accessed at the same time from the\n+libtorrent thread (through a callback). If you need to send out a message\n+from another thread, it is advised to use an internal queue, and do the\n+actual sending in tick().

    \n+

    Since the plugin interface gives you easy access to internal structures, it\n+is not supported as a stable API. Plugins should be considered specific to a\n+specific version of libtorrent. Although, in practice the internals mostly\n+don't change that dramatically.

    \n+
    \n+
    \n+

    plugin-interface

    \n+

    The plugin interface consists of three base classes that the plugin may\n+implement. These are called plugin, torrent_plugin and peer_plugin.\n+They are found in the <libtorrent/extensions.hpp> header.

    \n+

    These plugins are instantiated for each session, torrent and possibly each peer,\n+respectively.

    \n+

    For plugins that only need per torrent state, it is enough to only implement\n+torrent_plugin and pass a constructor function or function object to\n+session::add_extension() or torrent_handle::add_extension() (if the\n+torrent has already been started and you want to hook in the extension at\n+run-time).

    \n+

    The signature of the function is:

    \n+
    \n+std::shared_ptr<torrent_plugin> (*)(torrent_handle const&, client_data_t);\n+
    \n+

    The second argument is the userdata passed to session::add_torrent() or\n+torrent_handle::add_extension().

    \n+

    The function should return a std::shared_ptr<torrent_plugin> which\n+may or may not be 0. If it is a nullptr, the extension is simply ignored\n+for this torrent. If it is a valid pointer (to a class inheriting\n+torrent_plugin), it will be associated with this torrent and callbacks\n+will be made on torrent events.

    \n+

    For more elaborate plugins which require session wide state, you would\n+implement plugin, construct an object (in a std::shared_ptr) and pass\n+it in to session::add_extension().

    \n+
    \n+
    \n+

    custom alerts

    \n+

    Since plugins are running within internal libtorrent threads, one convenient\n+way to communicate with the client is to post custom alerts.

    \n+

    The expected interface of any alert, apart from deriving from the alert\n+base class, looks like this:

    \n
    \n-struct add_torrent_params\n+static const int alert_type = <unique alert ID>;\n+virtual int type() const { return alert_type; }\n+\n+virtual std::string message() const;\n+\n+static const alert_category_t static_category = <bitmask of alert::category_t flags>;\n+virtual alert_category_t category() const { return static_category; }\n+\n+virtual char const* what() const { return <string literal of the name of this alert>; }\n+
    \n+

    The alert_type is used for the type-checking in alert_cast. It must\n+not collide with any other alert. The built-in alerts in libtorrent will\n+not use alert type IDs greater than user_alert_id. When defining your\n+own alert, make sure it's greater than this constant.

    \n+

    type() is the run-time equivalence of the alert_type.

    \n+

    The message() virtual function is expected to construct a useful\n+string representation of the alert and the event or data it represents.\n+Something convenient to put in a log file for instance.

    \n+

    clone() is used internally to copy alerts. The suggested implementation\n+of simply allocating a new instance as a copy of *this is all that's\n+expected.

    \n+

    The static category is required for checking whether or not the category\n+for a specific alert is enabled or not, without instantiating the alert.\n+The category virtual function is the run-time equivalence.

    \n+

    The what() virtual function may simply be a string literal of the class\n+name of your alert.

    \n+

    For more information, see the alert section.

    \n+[report issue]
    \n+
    \n+

    plugin

    \n+

    Declared in "libtorrent/extensions.hpp"

    \n+

    this is the base class for a session plugin. One primary feature\n+is that it is notified of all torrents that are added to the session,\n+and can add its own torrent_plugins.

    \n+
    \n+struct plugin\n {\n-   int version  = LIBTORRENT_VERSION_NUM;\n-   std::shared_ptr<torrent_info> ti;\n-   aux::noexcept_movable<std::vector<std::string>> trackers;\n-   aux::noexcept_movable<std::vector<int>> tracker_tiers;\n-   aux::noexcept_movable<std::vector<std::pair<std::string, int>>> dht_nodes;\n-   std::string name;\n-   std::string save_path;\n-   storage_mode_t storage_mode  = storage_mode_sparse;\n-   client_data_t userdata;\n-   aux::noexcept_movable<std::vector<download_priority_t>> file_priorities;\n-   std::string trackerid;\n-   torrent_flags_t flags  = torrent_flags::default_flags;\n-   info_hash_t info_hashes;\n-   int max_uploads  = -1;\n-   int max_connections  = -1;\n-   int upload_limit  = -1;\n-   int download_limit  = -1;\n-   std::int64_t total_uploaded  = 0;\n-   std::int64_t total_downloaded  = 0;\n-   int active_time  = 0;\n-   int finished_time  = 0;\n-   int seeding_time  = 0;\n-   std::time_t added_time  = 0;\n-   std::time_t completed_time  = 0;\n-   std::time_t last_seen_complete  = 0;\n-   int num_complete  = -1;\n-   int num_incomplete  = -1;\n-   int num_downloaded  = -1;\n-   aux::noexcept_movable<std::vector<std::string>> http_seeds;\n-   aux::noexcept_movable<std::vector<std::string>> url_seeds;\n-   aux::noexcept_movable<std::vector<tcp::endpoint>> peers;\n-   aux::noexcept_movable<std::vector<tcp::endpoint>> banned_peers;\n-   aux::noexcept_movable<std::map<piece_index_t, bitfield>> unfinished_pieces;\n-   typed_bitfield<piece_index_t> have_pieces;\n-   typed_bitfield<piece_index_t> verified_pieces;\n-   aux::noexcept_movable<std::vector<download_priority_t>> piece_priorities;\n-   aux::vector<std::vector<sha256_hash>, file_index_t> merkle_trees;\n-   aux::vector<std::vector<bool>, file_index_t> merkle_tree_mask;\n-   aux::vector<std::vector<bool>, file_index_t> verified_leaf_hashes;\n-   aux::noexcept_movable<std::map<file_index_t, std::string>> renamed_files;\n-   std::time_t last_download  = 0;\n-   std::time_t last_upload  = 0;\n+   virtual feature_flags_t implemented_features ();\n+   virtual std::shared_ptr<torrent_plugin> new_torrent (torrent_handle const&, client_data_t);\n+   virtual void added (session_handle const&);\n+   virtual void abort ();\n+   virtual bool on_dht_request (string_view /* query */\n+      , udp::endpoint const& /* source */, bdecode_node const& /* message */\n+      , entry& /* response */);\n+   virtual void on_alert (alert const*);\n+   virtual bool on_unknown_torrent (info_hash_t const& /* info_hash */\n+      , peer_connection_handle const& /* pc */, add_torrent_params& /* p */);\n+   virtual void on_tick ();\n+   virtual uint64_t get_unchoke_priority (peer_connection_handle const& /* peer */);\n+   virtual std::map<std::string, std::string> save_state () const;\n+   virtual void load_state (std::map<std::string, std::string> const&);\n+\n+   static constexpr feature_flags_t optimistic_unchoke_feature  = 1_bit;\n+   static constexpr feature_flags_t tick_feature  = 2_bit;\n+   static constexpr feature_flags_t dht_request_feature  = 3_bit;\n+   static constexpr feature_flags_t alert_feature  = 4_bit;\n+   static constexpr feature_flags_t unknown_torrent_feature  = 5_bit;\n };\n 
    \n-[report issue]
    \n-
    version
    \n-
    filled in by the constructor and should be left untouched. It is used\n-for forward binary compatibility.
    \n-
    \n-[report issue]
    \n-
    ti
    \n-
    torrent_info object with the torrent to add. Unless the\n-info_hash is set, this is required to be initialized.
    \n+[report issue]
    \n+

    implemented_features()

    \n+
    \n+virtual feature_flags_t implemented_features ();\n+
    \n+

    This function is expected to return a bitmask indicating which features\n+this plugin implements. Some callbacks on this object may not be called\n+unless the corresponding feature flag is returned here. Note that\n+callbacks may still be called even if the corresponding feature is not\n+specified in the return value here. See feature_flags_t for possible\n+flags to return.

    \n+[report issue]
    \n+
    \n+

    new_torrent()

    \n+
    \n+virtual std::shared_ptr<torrent_plugin> new_torrent (torrent_handle const&, client_data_t);\n+
    \n+

    this is called by the session every time a new torrent is added.\n+The torrent* points to the internal torrent object created\n+for the new torrent. The client_data_t is the userdata pointer as\n+passed in via add_torrent_params.

    \n+

    If the plugin returns a torrent_plugin instance, it will be added\n+to the new torrent. Otherwise, return an empty shared_ptr to a\n+torrent_plugin (the default).

    \n+[report issue]
    \n+
    \n+

    added()

    \n+
    \n+virtual void added (session_handle const&);\n+
    \n+

    called when plugin is added to a session

    \n+[report issue]
    \n+
    \n+

    abort()

    \n+
    \n+virtual void abort ();\n+
    \n+

    called when the session is aborted\n+the plugin should perform any cleanup necessary to allow the session's\n+destruction (e.g. cancel outstanding async operations)

    \n+[report issue]
    \n+
    \n+

    on_dht_request()

    \n+
    \n+virtual bool on_dht_request (string_view /* query */\n+      , udp::endpoint const& /* source */, bdecode_node const& /* message */\n+      , entry& /* response */);\n+
    \n+

    called when a dht request is received.\n+If your plugin expects this to be called, make sure to include the flag\n+dht_request_feature in the return value from implemented_features().

    \n+[report issue]
    \n+
    \n+

    on_alert()

    \n+
    \n+virtual void on_alert (alert const*);\n+
    \n+

    called when an alert is posted alerts that are filtered are not posted.\n+If your plugin expects this to be called, make sure to include the flag\n+alert_feature in the return value from implemented_features().

    \n+[report issue]
    \n+
    \n+

    on_unknown_torrent()

    \n+
    \n+virtual bool on_unknown_torrent (info_hash_t const& /* info_hash */\n+      , peer_connection_handle const& /* pc */, add_torrent_params& /* p */);\n+
    \n+

    return true if the add_torrent_params should be added

    \n+[report issue]
    \n+
    \n+

    on_tick()

    \n+
    \n+virtual void on_tick ();\n+
    \n+

    called once per second.\n+If your plugin expects this to be called, make sure to include the flag\n+tick_feature in the return value from implemented_features().

    \n+[report issue]
    \n+
    \n+

    get_unchoke_priority()

    \n+
    \n+virtual uint64_t get_unchoke_priority (peer_connection_handle const& /* peer */);\n+
    \n+

    called when choosing peers to optimistically unchoke. The return value\n+indicates the peer's priority for unchoking. Lower return values\n+correspond to higher priority. Priorities above 2^63-1 are reserved.\n+If your plugin has no priority to assign a peer it should return 2^64-1.\n+If your plugin expects this to be called, make sure to include the flag\n+optimistic_unchoke_feature in the return value from implemented_features().\n+If multiple plugins implement this function the lowest return value\n+(i.e. the highest priority) is used.

    \n+[report issue]
    \n+
    \n+

    load_state()

    \n+
    \n+virtual void load_state (std::map<std::string, std::string> const&);\n+
    \n+

    called on startup while loading settings state from the session_params

    \n+[report issue]
    \n+
    optimistic_unchoke_feature
    \n+
    include this bit if your plugin needs to alter the order of the\n+optimistic unchoke of peers. i.e. have the on_optimistic_unchoke()\n+callback be called.
    \n
    \n-[report issue]
    \n-
    trackers
    \n-
    If the torrent doesn't have a tracker, but relies on the DHT to find\n-peers, the trackers can specify tracker URLs for the torrent.
    \n+[report issue]
    \n+
    tick_feature
    \n+
    include this bit if your plugin needs to have on_tick() called
    \n
    \n-[report issue]
    \n-
    tracker_tiers
    \n-
    the tiers the URLs in trackers belong to. Trackers belonging to\n-different tiers may be treated differently, as defined by the multi\n-tracker extension. This is optional, if not specified trackers are\n-assumed to be part of tier 0, or whichever the last tier was as\n-iterating over the trackers.
    \n+[report issue]
    \n+
    dht_request_feature
    \n+
    include this bit if your plugin needs to have on_dht_request()\n+called
    \n
    \n-[report issue]
    \n-
    dht_nodes
    \n-
    a list of hostname and port pairs, representing DHT nodes to be added\n-to the session (if DHT is enabled). The hostname may be an IP address.
    \n+[report issue]
    \n+
    alert_feature
    \n+
    include this bit if your plugin needs to have on_alert()\n+called
    \n
    \n-[report issue]
    \n-
    name
    \n-
    in case there's no other name in this torrent, this name will be used.\n-The name out of the torrent_info object takes precedence if available.
    \n+[report issue]
    \n+
    unknown_torrent_feature
    \n+
    include this bit if your plugin needs to have on_unknown_torrent()\n+called even if there is no active torrent in the session
    \n
    \n-[report issue]
    \n-
    save_path
    \n-

    the path where the torrent is or will be stored.

    \n-
    \n-

    Note

    \n-

    On windows this path (and other paths) are interpreted as UNC\n-paths. This means they must use backslashes as directory separators\n-and may not contain the special directories "." or "..".

    \n+[report issue]
    \n
    \n-

    Setting this to an absolute path performs slightly better than a\n-relative path.

    \n-\n-
    \n-[report issue]
    \n-
    storage_mode
    \n-
    One of the values from storage_mode_t. For more information, see\n-storage allocation.
    \n-
    \n-[report issue]
    \n-
    userdata
    \n-
    The userdata parameter is optional and will be passed on to the\n-extension constructor functions, if any\n-(see torrent_handle::add_extension()). It will also be stored in the\n-torrent object and can be retrieved by calling userdata().
    \n-
    \n-[report issue]
    \n-
    file_priorities
    \n-
    can be set to control the initial file priorities when adding a\n-torrent. The semantics are the same as for\n-torrent_handle::prioritize_files(). The file priorities specified\n-in here take precedence over those specified in the resume data, if\n-any.\n-If this vector of file priorities is shorter than the number of files\n-in the torrent, the remaining files (not covered by this) will still\n-have the default download priority. This default can be changed by\n-setting the default_dont_download torrent_flag.
    \n+
    \n+

    torrent_plugin

    \n+

    Declared in "libtorrent/extensions.hpp"

    \n+

    Torrent plugins are associated with a single torrent and have a number\n+of functions called at certain events. Many of its functions have the\n+ability to change or override the default libtorrent behavior.

    \n+
    \n+struct torrent_plugin\n+{\n+   virtual std::shared_ptr<peer_plugin> new_connection (peer_connection_handle const&);\n+   virtual void on_piece_failed (piece_index_t);\n+   virtual void on_piece_pass (piece_index_t);\n+   virtual void tick ();\n+   virtual bool on_resume ();\n+   virtual bool on_pause ();\n+   virtual void on_files_checked ();\n+   virtual void on_state (torrent_status::state_t);\n+   virtual void on_add_peer (tcp::endpoint const&,\n+      peer_source_flags_t, add_peer_flags_t);\n+\n+   static constexpr add_peer_flags_t first_time  = 1_bit;\n+   static constexpr add_peer_flags_t filtered  = 2_bit;\n+};\n+
    \n+[report issue]
    \n+

    new_connection()

    \n+
    \n+virtual std::shared_ptr<peer_plugin> new_connection (peer_connection_handle const&);\n+
    \n+

    This function is called each time a new peer is connected to the torrent. You\n+may choose to ignore this by just returning a default constructed\n+shared_ptr (in which case you don't need to override this member\n+function).

    \n+

    If you need an extension to the peer connection (which most plugins do) you\n+are supposed to return an instance of your peer_plugin class. Which in\n+turn will have its hook functions called on event specific to that peer.

    \n+

    The peer_connection_handle will be valid as long as the shared_ptr\n+is being held by the torrent object. So, it is generally a good idea to not\n+keep a shared_ptr to your own peer_plugin. If you want to keep references\n+to it, use weak_ptr.

    \n+

    If this function throws an exception, the connection will be closed.

    \n+\n+[report issue]
    \n+
    \n+

    on_piece_failed() on_piece_pass()

    \n+
    \n+virtual void on_piece_failed (piece_index_t);\n+virtual void on_piece_pass (piece_index_t);\n+
    \n+

    These hooks are called when a piece passes the hash check or fails the hash\n+check, respectively. The index is the piece index that was downloaded.\n+It is possible to access the list of peers that participated in sending the\n+piece through the torrent and the piece_picker.

    \n+[report issue]
    \n+
    \n+

    tick()

    \n+
    \n+virtual void tick ();\n+
    \n+

    This hook is called approximately once per second. It is a way of making it\n+easy for plugins to do timed events, for sending messages or whatever.

    \n+\n+[report issue]
    \n+
    \n+

    on_resume() on_pause()

    \n+
    \n+virtual bool on_resume ();\n+virtual bool on_pause ();\n+
    \n+

    These hooks are called when the torrent is paused and resumed respectively.\n+The return value indicates if the event was handled. A return value of\n+true indicates that it was handled, and no other plugin after this one\n+will have this hook function called, and the standard handler will also not be\n+invoked. So, returning true effectively overrides the standard behavior of\n+pause or resume.

    \n+

    Note that if you call pause() or resume() on the torrent from your\n+handler it will recurse back into your handler, so in order to invoke the\n+standard handler, you have to keep your own state on whether you want standard\n+behavior or overridden behavior.

    \n+[report issue]
    \n+
    \n+

    on_files_checked()

    \n+
    \n+virtual void on_files_checked ();\n+
    \n+

    This function is called when the initial files of the torrent have been\n+checked. If there are no files to check, this function is called immediately.

    \n+

    i.e. This function is always called when the torrent is in a state where it\n+can start downloading.

    \n+[report issue]
    \n+
    \n+

    on_state()

    \n+
    \n+virtual void on_state (torrent_status::state_t);\n+
    \n+

    called when the torrent changes state\n+the state is one of torrent_status::state_t\n+enum members

    \n+[report issue]
    \n+
    \n+

    on_add_peer()

    \n+
    \n+virtual void on_add_peer (tcp::endpoint const&,\n+      peer_source_flags_t, add_peer_flags_t);\n+
    \n+

    called every time a new peer is added to the peer list.\n+This is before the peer is connected to. For flags, see\n+torrent_plugin::flags_t. The source argument refers to\n+the source where we learned about this peer from. It's a\n+bitmask, because many sources may have told us about the same\n+peer. For peer source flags, see peer_info::peer_source_flags.

    \n+[report issue]
    \n+
    first_time
    \n+
    this is the first time we see this peer
    \n
    \n-[report issue]
    \n-
    trackerid
    \n-
    the default tracker id to be used when announcing to trackers. By\n-default this is empty, and no tracker ID is used, since this is an\n-optional argument. If a tracker returns a tracker ID, that ID is used\n-instead of this.
    \n+[report issue]
    \n+
    filtered
    \n+
    this peer was not added because it was\n+filtered by the IP filter
    \n
    \n-[report issue]
    \n-
    flags
    \n-

    flags controlling aspects of this torrent and how it's added. See\n-torrent_flags_t for details.

    \n-
    \n-

    Note

    \n-

    The flags field is initialized with default flags by the\n-constructor. In order to preserve default behavior when clearing or\n-setting other flags, make sure to bitwise OR or in a flag or bitwise\n-AND the inverse of a flag to clear it.

    \n+[report issue]
    \n
    \n-\n-
    \n-[report issue]
    \n-
    info_hashes
    \n-
    set this to the info hash of the torrent to add in case the info-hash\n-is the only known property of the torrent. i.e. you don't have a\n-.torrent file nor a magnet link.\n-To add a magnet link, use parse_magnet_uri() to populate fields in the\n-add_torrent_params object.
    \n-
    \n-\n-[report issue]
    \n-
    max_uploads max_connections
    \n-

    max_uploads, max_connections, upload_limit,\n-download_limit correspond to the set_max_uploads(),\n-set_max_connections(), set_upload_limit() and\n-set_download_limit() functions on torrent_handle. These values let\n-you initialize these settings when the torrent is added, instead of\n-calling these functions immediately following adding it.

    \n-

    -1 means unlimited on these settings just like their counterpart\n-functions on torrent_handle

    \n-

    For fine grained control over rate limits, including making them apply\n-to local peers, see peer classes.

    \n-
    \n-
    \n-\n-[report issue]
    \n-
    upload_limit download_limit
    \n-
    the upload and download rate limits for this torrent, specified in\n-bytes per second. -1 means unlimited.
    \n-
    \n-\n-[report issue]
    \n-
    total_uploaded total_downloaded
    \n-
    the total number of bytes uploaded and downloaded by this torrent so\n-far.
    \n-
    \n-\n-\n-[report issue]
    \n-
    active_time finished_time seeding_time
    \n-
    the number of seconds this torrent has spent in started, finished and\n-seeding state so far, respectively.
    \n-
    \n-\n-[report issue]
    \n-
    added_time completed_time
    \n-
    if set to a non-zero value, this is the posix time of when this torrent\n-was first added, including previous runs/sessions. If set to zero, the\n-internal added_time will be set to the time of when add_torrent() is\n-called.
    \n-
    \n-[report issue]
    \n-
    last_seen_complete
    \n-
    if set to non-zero, initializes the time (expressed in posix time) when\n-we last saw a seed or peers that together formed a complete copy of the\n-torrent. If left set to zero, the internal counterpart to this field\n-will be updated when we see a seed or a distributed copies >= 1.0.
    \n-
    \n-\n-\n-[report issue]
    \n-
    num_complete num_incomplete num_downloaded
    \n-

    these field can be used to initialize the torrent's cached scrape data.\n-The scrape data is high level metadata about the current state of the\n-swarm, as returned by the tracker (either when announcing to it or by\n-sending a specific scrape request). num_complete is the number of\n-peers in the swarm that are seeds, or have every piece in the torrent.\n-num_incomplete is the number of peers in the swarm that do not have\n-every piece. num_downloaded is the number of times the torrent has\n-been downloaded (not initiated, but the number of times a download has\n-completed).

    \n-

    Leaving any of these values set to -1 indicates we don't know, or we\n-have not received any scrape data.

    \n-
    \n-
    \n-\n-[report issue]
    \n-
    http_seeds url_seeds
    \n-

    URLs can be added to these two lists to specify additional web\n-seeds to be used by the torrent. If the flag_override_web_seeds\n-is set, these will be the _only_ ones to be used. i.e. any web seeds\n-found in the .torrent file will be overridden.

    \n-

    http_seeds expects URLs to web servers implementing the original HTTP\n-seed specification BEP 17.

    \n-

    url_seeds expects URLs to regular web servers, aka "get right" style,\n-specified in BEP 19.

    \n-
    \n-
    \n-[report issue]
    \n-
    peers
    \n-
    peers to add to the torrent, to be tried to be connected to as\n-bittorrent peers.
    \n-
    \n-[report issue]
    \n-
    banned_peers
    \n-
    peers banned from this torrent. The will not be connected to
    \n-
    \n-[report issue]
    \n-
    unfinished_pieces
    \n-
    this is a map of partially downloaded piece. The key is the piece index\n-and the value is a bitfield where each bit represents a 16 kiB block.\n-A set bit means we have that block.
    \n-
    \n-[report issue]
    \n-
    have_pieces
    \n-
    this is a bitfield indicating which pieces we already have of this\n-torrent.
    \n-
    \n-[report issue]
    \n-
    verified_pieces
    \n-
    when in seed_mode, pieces with a set bit in this bitfield have been\n-verified to be valid. Other pieces will be verified the first time a\n-peer requests it.
    \n-
    \n-[report issue]
    \n-
    piece_priorities
    \n-
    this sets the priorities for each individual piece in the torrent. Each\n-element in the vector represent the piece with the same index. If you\n-set both file- and piece priorities, file priorities will take\n-precedence.
    \n-
    \n-[report issue]
    \n-
    merkle_trees
    \n-
    v2 hashes, if known
    \n-
    \n-[report issue]
    \n-
    merkle_tree_mask
    \n-
    if set, indicates which hashes are included in the corresponding\n-vector of merkle_trees. These bitmasks always cover the full\n-tree, a cleared bit means the hash is all zeros (i.e. not set) and\n-set bit means the next hash in the corresponding vector in\n-merkle_trees is the hash for that node. This is an optimization\n-to avoid storing a lot of zeros.
    \n-
    \n-[report issue]
    \n-
    verified_leaf_hashes
    \n-
    bit-fields indicating which v2 leaf hashes have been verified\n-against the root hash. If this vector is empty and merkle_trees is\n-non-empty it implies that all hashes in merkle_trees are verified.
    \n-
    \n-[report issue]
    \n-
    renamed_files
    \n-
    this is a map of file indices in the torrent and new filenames to be\n-applied before the torrent is added.
    \n-
    \n-\n-[report issue]
    \n-
    last_download last_upload
    \n-
    the posix time of the last time payload was received or sent for this\n-torrent, respectively. A value of 0 means we don't know when we last\n-uploaded or downloaded, or we have never uploaded or downloaded any\n-payload for this torrent.
    \n-
    \n+
    \n+

    peer_plugin

    \n+

    Declared in "libtorrent/extensions.hpp"

    \n+

    peer plugins are associated with a specific peer. A peer could be\n+both a regular bittorrent peer (bt_peer_connection) or one of the\n+web seed connections (web_peer_connection or http_seed_connection).\n+In order to only attach to certain peers, make your\n+torrent_plugin::new_connection only return a plugin for certain peer\n+connection types

    \n+
    \n+struct peer_plugin\n+{\n+   virtual string_view type () const;\n+   virtual void add_handshake (entry&);\n+   virtual void on_disconnect (error_code const&);\n+   virtual void on_connected ();\n+   virtual bool on_handshake (span<char const>);\n+   virtual bool on_extension_handshake (bdecode_node const&);\n+   virtual bool on_interested ();\n+   virtual bool on_not_interested ();\n+   virtual bool on_dont_have (piece_index_t);\n+   virtual bool on_choke ();\n+   virtual bool on_unchoke ();\n+   virtual bool on_have (piece_index_t);\n+   virtual bool on_allowed_fast (piece_index_t);\n+   virtual bool on_request (peer_request const&);\n+   virtual bool on_bitfield (bitfield const& /*bitfield*/);\n+   virtual bool on_have_none ();\n+   virtual bool on_have_all ();\n+   virtual bool on_piece (peer_request const& /*piece*/\n+      , span<char const> /*buf*/);\n+   virtual bool on_suggest (piece_index_t);\n+   virtual bool on_cancel (peer_request const&);\n+   virtual bool on_reject (peer_request const&);\n+   virtual void sent_reject_request (peer_request const&);\n+   virtual void sent_request (peer_request const&);\n+   virtual void sent_allow_fast (piece_index_t);\n+   virtual void sent_suggest (piece_index_t);\n+   virtual void sent_have_all ();\n+   virtual void sent_choke ();\n+   virtual void sent_have_none ();\n+   virtual void sent_cancel (peer_request const&);\n+   virtual void sent_have (piece_index_t);\n+   virtual void sent_unchoke ();\n+   virtual void sent_interested ();\n+   virtual void sent_piece (peer_request const&);\n+   virtual void sent_not_interested ();\n+   virtual void sent_payload (int /* bytes */);\n+   virtual bool can_disconnect (error_code const& /*ec*/);\n+   virtual bool on_extended (int /*length*/, int /*msg*/,\n+      span<char const> /*body*/);\n+   virtual bool on_unknown_message (int /*length*/, int /*msg*/,\n+      span<char const> /*body*/);\n+   virtual void on_piece_failed (piece_index_t);\n+   virtual void on_piece_pass (piece_index_t);\n+   virtual void tick ();\n+   virtual bool write_request (peer_request const&);\n+};\n+
    \n+[report issue]
    \n+

    type()

    \n+
    \n+virtual string_view type () const;\n+
    \n+

    This function is expected to return the name of\n+the plugin.

    \n+[report issue]
    \n+
    \n+

    add_handshake()

    \n+
    \n+virtual void add_handshake (entry&);\n+
    \n+

    can add entries to the extension handshake\n+this is not called for web seeds

    \n+[report issue]
    \n+
    \n+

    on_disconnect()

    \n+
    \n+virtual void on_disconnect (error_code const&);\n+
    \n+

    called when the peer is being disconnected.

    \n+[report issue]
    \n+
    \n+

    on_connected()

    \n+
    \n+virtual void on_connected ();\n+
    \n+

    called when the peer is successfully connected. Note that\n+incoming connections will have been connected by the time\n+the peer plugin is attached to it, and won't have this hook\n+called.

    \n+[report issue]
    \n+
    \n+

    on_handshake()

    \n+
    \n+virtual bool on_handshake (span<char const>);\n+
    \n+

    this is called when the initial bittorrent handshake is received.\n+Returning false means that the other end doesn't support this extension\n+and will remove it from the list of plugins. this is not called for web\n+seeds

    \n+[report issue]
    \n+
    \n+

    on_extension_handshake()

    \n+
    \n+virtual bool on_extension_handshake (bdecode_node const&);\n+
    \n+

    called when the extension handshake from the other end is received\n+if this returns false, it means that this extension isn't\n+supported by this peer. It will result in this peer_plugin\n+being removed from the peer_connection and destructed.\n+this is not called for web seeds

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+[report issue]
    \n+
    \n+

    on_bitfield() on_interested() on_not_interested() on_choke() on_have_none() on_unchoke() on_dont_have() on_have_all() on_allowed_fast() on_have() on_request()

    \n+
    \n+virtual bool on_interested ();\n+virtual bool on_not_interested ();\n+virtual bool on_dont_have (piece_index_t);\n+virtual bool on_choke ();\n+virtual bool on_unchoke ();\n+virtual bool on_have (piece_index_t);\n+virtual bool on_allowed_fast (piece_index_t);\n+virtual bool on_request (peer_request const&);\n+virtual bool on_bitfield (bitfield const& /*bitfield*/);\n+virtual bool on_have_none ();\n+virtual bool on_have_all ();\n+
    \n+

    returning true from any of the message handlers\n+indicates that the plugin has handled the message.\n+it will break the plugin chain traversing and not let\n+anyone else handle the message, including the default\n+handler.

    \n+[report issue]
    \n+
    \n+

    on_piece()

    \n+
    \n+virtual bool on_piece (peer_request const& /*piece*/\n+      , span<char const> /*buf*/);\n+
    \n+

    This function is called when the peer connection is receiving\n+a piece. buf points (non-owning pointer) to the data in an\n+internal immutable disk buffer. The length of the data is specified\n+in the length member of the piece parameter.\n+returns true to indicate that the piece is handled and the\n+rest of the logic should be ignored.

    \n+\n+\n+\n+\n+[report issue]
    \n+
    \n+

    sent_have() sent_interested() sent_piece() sent_unchoke() sent_not_interested()

    \n+
    \n+virtual void sent_have (piece_index_t);\n+virtual void sent_unchoke ();\n+virtual void sent_interested ();\n+virtual void sent_piece (peer_request const&);\n+virtual void sent_not_interested ();\n+
    \n+

    called after a choke message has been sent to the peer

    \n+[report issue]
    \n+
    \n+

    sent_payload()

    \n+
    \n+virtual void sent_payload (int /* bytes */);\n+
    \n+

    called after piece data has been sent to the peer\n+this can be used for stats book keeping

    \n+[report issue]
    \n+
    \n+

    can_disconnect()

    \n+
    \n+virtual bool can_disconnect (error_code const& /*ec*/);\n+
    \n+

    called when libtorrent think this peer should be disconnected.\n+if the plugin returns false, the peer will not be disconnected.

    \n+[report issue]
    \n+
    \n+

    on_extended()

    \n+
    \n+virtual bool on_extended (int /*length*/, int /*msg*/,\n+      span<char const> /*body*/);\n+
    \n+

    called when an extended message is received. If returning true,\n+the message is not processed by any other plugin and if false\n+is returned the next plugin in the chain will receive it to\n+be able to handle it. This is not called for web seeds.\n+thus function may be called more than once per incoming message, but\n+only the last of the calls will the body size equal the length.\n+i.e. Every time another fragment of the message is received, this\n+function will be called, until finally the whole message has been\n+received. The purpose of this is to allow early disconnects for invalid\n+messages and for reporting progress of receiving large messages.

    \n+[report issue]
    \n+
    \n+

    on_unknown_message()

    \n+
    \n+virtual bool on_unknown_message (int /*length*/, int /*msg*/,\n+      span<char const> /*body*/);\n+
    \n+

    this is not called for web seeds

    \n+\n+[report issue]
    \n+
    \n+

    on_piece_failed() on_piece_pass()

    \n+
    \n+virtual void on_piece_failed (piece_index_t);\n+virtual void on_piece_pass (piece_index_t);\n+
    \n+

    called when a piece that this peer participated in either\n+fails or passes the hash_check

    \n+[report issue]
    \n+
    \n+

    tick()

    \n+
    \n+virtual void tick ();\n+
    \n+

    called approximately once every second

    \n+[report issue]
    \n+
    \n+

    write_request()

    \n+
    \n+virtual bool write_request (peer_request const&);\n+
    \n+

    called each time a request message is to be sent. If true\n+is returned, the original request message won't be sent and\n+no other plugin will have this function called.

    \n+[report issue]
    \n+
    \n+
    \n+

    crypto_plugin

    \n+

    Declared in "libtorrent/extensions.hpp"

    \n+
    \n+struct crypto_plugin\n+{\n+   virtual void set_outgoing_key (span<char const> key) = 0;\n+   virtual void set_incoming_key (span<char const> key) = 0;\n+   encrypt (span<span<char>> /*send_vec*/) = 0;\n+   virtual std::tuple<int, int, int> decrypt (span<span<char>> /*receive_vec*/) = 0;\n+};\n+
    \n+[report issue]
    \n+

    decrypt()

    \n+
    \n+virtual std::tuple<int, int, int> decrypt (span<span<char>> /*receive_vec*/) = 0;\n+
    \n+

    decrypt the provided buffers.\n+returns is a tuple representing the values\n+(consume, produce, packet_size)

    \n+

    consume is set to the number of bytes which should be trimmed from the\n+head of the buffers, default is 0

    \n+

    produce is set to the number of bytes of payload which are now ready to\n+be sent to the upper layer. default is the number of bytes passed in receive_vec

    \n+

    packet_size is set to the minimum number of bytes which must be read to\n+advance the next step of decryption. default is 0

    \n+[report issue]
    \n+
    \n+
    \n+

    peer_connection_handle

    \n+

    Declared in "libtorrent/peer_connection_handle.hpp"

    \n+

    the peer_connection_handle class provides a handle to the internal peer\n+connection object, to be used by plugins. This is a low level interface that\n+may not be stable across libtorrent versions

    \n+
    \n+struct peer_connection_handle\n+{\n+   explicit peer_connection_handle (std::weak_ptr<peer_connection> impl);\n+   connection_type type () const;\n+   peer_plugin const* find_plugin (string_view type) const;\n+   void add_extension (std::shared_ptr<peer_plugin>);\n+   bool is_seed () const;\n+   bool upload_only () const;\n+   bool has_piece (piece_index_t i) const;\n+   peer_id const& pid () const;\n+   bool is_choked () const;\n+   bool is_interesting () const;\n+   bool is_peer_interested () const;\n+   bool has_peer_choked () const;\n+   void choke_this_peer ();\n+   void maybe_unchoke_this_peer ();\n+   void get_peer_info (peer_info& p) const;\n+   torrent_handle associated_torrent () const;\n+   tcp::endpoint local_endpoint () const;\n+   tcp::endpoint const& remote () const;\n+   bool is_outgoing () const;\n+   bool is_disconnecting () const;\n+   bool is_connecting () const;\n+   void disconnect (error_code const& ec, operation_t op\n+      , disconnect_severity_t = peer_connection_interface::normal);\n+   bool ignore_unchoke_slots () const;\n+   bool on_local_network () const;\n+   bool failed () const;\n+   void peer_log (peer_log_alert::direction_t direction\n+      , char const* event, char const* fmt = "", ...) const TORRENT_FORMAT(4,5);\n+   bool should_log (peer_log_alert::direction_t direction) const;\n+   bool can_disconnect (error_code const& ec) const;\n+   bool has_metadata () const;\n+   bool in_handshake () const;\n+   void send_buffer (char const* begin, int size);\n+   time_point time_of_last_unchoke () const;\n+   std::time_t last_seen_complete () const;\n+   bool operator< (peer_connection_handle const& o) const;\n+   bool operator!= (peer_connection_handle const& o) const;\n+   bool operator== (peer_connection_handle const& o) const;\n+   std::shared_ptr<peer_connection> native_handle () const;\n+};\n+
    \n+[report issue]
    \n+
    \n+

    bt_peer_connection_handle

    \n+

    Declared in "libtorrent/peer_connection_handle.hpp"

    \n+

    The bt_peer_connection_handle provides a handle to the internal bittorrent\n+peer connection object to plugins. It's low level and may not be a stable API\n+across libtorrent versions.

    \n+
    \n+struct bt_peer_connection_handle : peer_connection_handle\n+{\n+   explicit bt_peer_connection_handle (peer_connection_handle pc);\n+   bool support_extensions () const;\n+   bool packet_finished () const;\n+   bool supports_encryption () const;\n+   void switch_send_crypto (std::shared_ptr<crypto_plugin> crypto);\n+   void switch_recv_crypto (std::shared_ptr<crypto_plugin> crypto);\n+   std::shared_ptr<bt_peer_connection> native_handle () const;\n+};\n+
    \n+[report issue]
    \n+
    \n+

    create_ut_metadata_plugin()

    \n+

    Declared in "libtorrent/extensions/ut_metadata.hpp"

    \n+
    \n+std::shared_ptr<torrent_plugin> create_ut_metadata_plugin (torrent_handle const&, client_data_t);\n+
    \n+

    constructor function for the ut_metadata extension. The ut_metadata\n+extension allows peers to request the .torrent file (or more\n+specifically the info-dictionary of the .torrent file) from each\n+other. This is the main building block in making magnet links work.\n+This extension is enabled by default unless explicitly disabled in\n+the session constructor.

    \n+

    This can either be passed in the add_torrent_params::extensions field, or\n+via torrent_handle::add_extension().

    \n+[report issue]
    \n+
    \n+

    create_ut_pex_plugin()

    \n+

    Declared in "libtorrent/extensions/ut_pex.hpp"

    \n+
    \n+std::shared_ptr<torrent_plugin> create_ut_pex_plugin (torrent_handle const&, client_data_t);\n+
    \n+

    constructor function for the ut_pex extension. The ut_pex\n+extension allows peers to gossip about their connections, allowing\n+the swarm stay well connected and peers aware of more peers in the\n+swarm. This extension is enabled by default unless explicitly disabled in\n+the session constructor.

    \n+

    This can either be passed in the add_torrent_params::extensions field, or\n+via torrent_handle::add_extension().

    \n+[report issue]
    \n+
    \n+

    create_smart_ban_plugin()

    \n+

    Declared in "libtorrent/extensions/smart_ban.hpp"

    \n+
    \n+std::shared_ptr<torrent_plugin> create_smart_ban_plugin (torrent_handle const&, client_data_t);\n+
    \n+

    constructor function for the smart ban extension. The extension keeps\n+track of the data peers have sent us for failing pieces and once the\n+piece completes and passes the hash check bans the peers that turned\n+out to have sent corrupt data.\n+This function can either be passed in the add_torrent_params::extensions\n+field, or via torrent_handle::add_extension().

    \n [report issue]
    \n
    \n

    block_info

    \n

    Declared in "libtorrent/torrent_handle.hpp"

    \n

    holds the state of a block in a piece. Who we requested\n it from and how far along we are at downloading it.

    \n
    \n struct block_info\n {\n-   void set_peer (tcp::endpoint const& ep);\n    tcp::endpoint peer () const;\n+   void set_peer (tcp::endpoint const& ep);\n \n    enum block_state_t\n    {\n       none,\n       requested,\n       writing,\n       finished,\n@@ -16211,20 +16701,20 @@\n \n    unsigned bytes_progress:15;\n    unsigned block_size:15;\n    unsigned state:2;\n    unsigned num_peers:14;\n };\n 
    \n-\n-[report issue]
    \n-

    set_peer() peer()

    \n+\n+[report issue]
    \n+

    peer() set_peer()

    \n
    \n-void set_peer (tcp::endpoint const& ep);\n tcp::endpoint peer () const;\n+void set_peer (tcp::endpoint const& ep);\n 
    \n

    The peer is the ip address of the peer this block was downloaded from.

    \n [report issue]
    \n
    \n

    enum block_state_t

    \n

    Declared in "libtorrent/torrent_handle.hpp"

    \n \n@@ -16354,116 +16844,116 @@\n Which means you cannot perform any operation on it, unless you first\n assign it a valid handle. If you try to perform any operation on an\n uninitialized handle, it will throw invalid_handle.

    \n
    \n

    Warning

    \n

    All operations on a torrent_handle may throw system_error\n exception, in case the handle is no longer referring to a torrent.\n-There is one exception is_valid() will never throw. Since the torrents\n+There is one exception is_valid() will never throw. Since the torrents\n are processed by a background thread, there is no guarantee that a\n handle will remain valid between two calls.

    \n
    \n
    \n struct torrent_handle\n {\n    friend std::size_t hash_value (torrent_handle const& th);\n    torrent_handle () noexcept = default;\n-   void add_piece (piece_index_t piece, char const* data, add_piece_flags_t flags = {}) const;\n    void add_piece (piece_index_t piece, std::vector<char> data, add_piece_flags_t flags = {}) const;\n+   void add_piece (piece_index_t piece, char const* data, add_piece_flags_t flags = {}) const;\n    void read_piece (piece_index_t piece) const;\n    bool have_piece (piece_index_t piece) const;\n    void post_peer_info () const;\n    void get_peer_info (std::vector<peer_info>& v) const;\n-   void post_status (status_flags_t flags = status_flags_t::all()) const;\n    torrent_status status (status_flags_t flags = status_flags_t::all()) const;\n-   void post_download_queue () const;\n-   void get_download_queue (std::vector<partial_piece_info>& queue) const;\n+   void post_status (status_flags_t flags = status_flags_t::all()) const;\n    std::vector<partial_piece_info> get_download_queue () const;\n-   void reset_piece_deadline (piece_index_t index) const;\n+   void get_download_queue (std::vector<partial_piece_info>& queue) const;\n+   void post_download_queue () const;\n    void set_piece_deadline (piece_index_t index, int deadline, deadline_flags_t flags = {}) const;\n    void clear_piece_deadlines () const;\n-   void post_file_progress (file_progress_flags_t flags) const;\n+   void reset_piece_deadline (piece_index_t index) const;\n    std::vector<std::int64_t> file_progress (file_progress_flags_t flags = {}) const;\n+   void post_file_progress (file_progress_flags_t flags) const;\n    void file_progress (std::vector<std::int64_t>& progress, file_progress_flags_t flags = {}) const;\n    std::vector<open_file_state> file_status () const;\n    void clear_error () const;\n    void post_trackers () const;\n+   std::vector<announce_entry> trackers () const;\n    void add_tracker (announce_entry const&) const;\n    void replace_trackers (std::vector<announce_entry> const&) const;\n-   std::vector<announce_entry> trackers () const;\n    std::set<std::string> url_seeds () const;\n    void remove_url_seed (std::string const& url) const;\n    void add_url_seed (std::string const& url) const;\n-   std::set<std::string> http_seeds () const;\n    void add_http_seed (std::string const& url) const;\n    void remove_http_seed (std::string const& url) const;\n+   std::set<std::string> http_seeds () const;\n    void add_extension (\n       std::function<std::shared_ptr<torrent_plugin>(torrent_handle const&, client_data_t)> const& ext\n       , client_data_t userdata = client_data_t{});\n    bool set_metadata (span<char const> metadata) const;\n    bool is_valid () const;\n    void resume () const;\n    void pause (pause_flags_t flags = {}) const;\n-   void set_flags (torrent_flags_t flags, torrent_flags_t mask) const;\n    torrent_flags_t flags () const;\n-   void set_flags (torrent_flags_t flags) const;\n    void unset_flags (torrent_flags_t flags) const;\n+   void set_flags (torrent_flags_t flags) const;\n+   void set_flags (torrent_flags_t flags, torrent_flags_t mask) const;\n    void flush_cache () const;\n    void force_recheck () const;\n    void save_resume_data (resume_data_flags_t flags = {}) const;\n    bool need_save_resume_data (resume_data_flags_t flags) const;\n    bool need_save_resume_data () const;\n    void queue_position_up () const;\n+   queue_position_t queue_position () const;\n    void queue_position_down () const;\n    void queue_position_bottom () const;\n-   queue_position_t queue_position () const;\n    void queue_position_top () const;\n    void queue_position_set (queue_position_t p) const;\n    void set_ssl_certificate (std::string const& certificate\n       , std::string const& private_key\n       , std::string const& dh_params\n       , std::string const& passphrase = "");\n    void set_ssl_certificate_buffer (std::string const& certificate\n       , std::string const& private_key\n       , std::string const& dh_params);\n-   std::shared_ptr<const torrent_info> torrent_file () const;\n    std::shared_ptr<torrent_info> torrent_file_with_hashes () const;\n+   std::shared_ptr<const torrent_info> torrent_file () const;\n    std::vector<std::vector<sha256_hash>> piece_layers () const;\n-   void piece_availability (std::vector<int>& avail) const;\n    void post_piece_availability () const;\n+   void piece_availability (std::vector<int>& avail) const;\n+   std::vector<download_priority_t> get_piece_priorities () const;\n    void prioritize_pieces (std::vector<download_priority_t> const& pieces) const;\n+   void prioritize_pieces (std::vector<std::pair<piece_index_t, download_priority_t>> const& pieces) const;\n    download_priority_t piece_priority (piece_index_t index) const;\n-   std::vector<download_priority_t> get_piece_priorities () const;\n    void piece_priority (piece_index_t index, download_priority_t priority) const;\n-   void prioritize_pieces (std::vector<std::pair<piece_index_t, download_priority_t>> const& pieces) const;\n    std::vector<download_priority_t> get_file_priorities () const;\n-   void prioritize_files (std::vector<download_priority_t> const& files) const;\n    void file_priority (file_index_t index, download_priority_t priority) const;\n+   void prioritize_files (std::vector<download_priority_t> const& files) const;\n    download_priority_t file_priority (file_index_t index) const;\n    void force_lsd_announce () const;\n    void force_dht_announce () const;\n    void force_reannounce (int seconds = 0, int idx = -1, reannounce_flags_t = {}) const;\n    void scrape_tracker (int idx = -1) const;\n-   void set_upload_limit (int limit) const;\n    int upload_limit () const;\n    int download_limit () const;\n    void set_download_limit (int limit) const;\n+   void set_upload_limit (int limit) const;\n    void connect_peer (tcp::endpoint const& adr, peer_source_flags_t source = {}\n       , pex_flags_t flags = pex_encryption | pex_utp | pex_holepunch) const;\n    void clear_peers ();\n-   int max_uploads () const;\n    void set_max_uploads (int max_uploads) const;\n-   void set_max_connections (int max_connections) const;\n+   int max_uploads () const;\n    int max_connections () const;\n+   void set_max_connections (int max_connections) const;\n    void move_storage (std::string const& save_path\n       , move_flags_t flags = move_flags_t::always_replace_files\n       ) const;\n    void rename_file (file_index_t index, std::string const& new_name) const;\n-   sha1_hash info_hash () const;\n    info_hash_t info_hashes () const;\n+   sha1_hash info_hash () const;\n    bool operator!= (const torrent_handle& h) const;\n    bool operator< (const torrent_handle& h) const;\n    bool operator== (const torrent_handle& h) const;\n    std::uint32_t id () const;\n    std::shared_ptr<torrent> native_handle () const;\n    client_data_t userdata () const;\n    bool in_session () const;\n@@ -16493,21 +16983,21 @@\n 
    \n [report issue]
    \n

    torrent_handle()

    \n
    \n torrent_handle () noexcept = default;\n 
    \n

    constructs a torrent handle that does not refer to a torrent.\n-i.e. is_valid() will return false.

    \n+i.e. is_valid() will return false.

    \n [report issue]
    \n
    \n

    add_piece()

    \n
    \n-void add_piece (piece_index_t piece, char const* data, add_piece_flags_t flags = {}) const;\n void add_piece (piece_index_t piece, std::vector<char> data, add_piece_flags_t flags = {}) const;\n+void add_piece (piece_index_t piece, char const* data, add_piece_flags_t flags = {}) const;\n 
    \n

    This function will write data to the storage as piece piece,\n as if it had been downloaded from a peer.

    \n

    By default, data that's already been downloaded is not overwritten by\n this buffer. If you trust this data to be correct (and pass the piece\n hash check) you may pass the overwrite_existing flag. This will\n instruct libtorrent to overwrite any data that may already have been\n@@ -16544,39 +17034,39 @@\n

    \n

    have_piece()

    \n
    \n bool have_piece (piece_index_t piece) const;\n 
    \n

    Returns true if this piece has been completely downloaded and written\n to disk, and false otherwise.

    \n-\n-[report issue]
    \n-
    \n-

    get_peer_info() post_peer_info()

    \n+\n+[report issue]
    \n+
    \n+

    post_peer_info() get_peer_info()

    \n
    \n void post_peer_info () const;\n void get_peer_info (std::vector<peer_info>& v) const;\n 
    \n

    Query information about connected peers for this torrent. If the\n torrent_handle is invalid, it will throw a system_error exception.

    \n

    post_peer_info() is asynchronous and will trigger the posting of\n a peer_info_alert. The alert contain a list of peer_info objects, one\n for each connected peer.

    \n

    get_peer_info() is synchronous and takes a reference to a vector\n that will be cleared and filled with one entry for each peer\n connected to this torrent, given the handle is valid. Each entry in\n the vector contains information about that particular peer. See\n peer_info.

    \n-\n-[report issue]
    \n-
    \n-

    post_status() status()

    \n+\n+[report issue]
    \n+
    \n+

    status() post_status()

    \n
    \n-void post_status (status_flags_t flags = status_flags_t::all()) const;\n torrent_status status (status_flags_t flags = status_flags_t::all()) const;\n+void post_status (status_flags_t flags = status_flags_t::all()) const;\n 
    \n

    status() will return a structure with information about the status\n of this torrent. If the torrent_handle is invalid, it will throw\n system_error exception. See torrent_status. The flags\n argument filters what information is returned in the torrent_status.\n Some information in there is relatively expensive to calculate, and if\n you're not interested in it (and see performance issues), you can\n@@ -16586,38 +17076,38 @@\n instead call post_status(). It will trigger posting of a\n state_update_alert with a single torrent_status object for this\n torrent.

    \n

    In order to get regular updates for torrents whose status changes,\n consider calling session::post_torrent_updates()`` instead.

    \n

    By default everything is included. The flags you can use to decide\n what to include are defined in this class.

    \n-\n-[report issue]
    \n-
    \n-

    get_download_queue() post_download_queue()

    \n+\n+[report issue]
    \n+
    \n+

    post_download_queue() get_download_queue()

    \n
    \n-void post_download_queue () const;\n-void get_download_queue (std::vector<partial_piece_info>& queue) const;\n std::vector<partial_piece_info> get_download_queue () const;\n+void get_download_queue (std::vector<partial_piece_info>& queue) const;\n+void post_download_queue () const;\n 
    \n

    post_download_queue() triggers a download_queue_alert to be\n posted.\n get_download_queue() is a synchronous call and returns a vector\n with information about pieces that are partially downloaded or not\n downloaded but partially requested. See partial_piece_info for the\n fields in the returned vector.

    \n \n-\n-[report issue]
    \n-
    \n-

    set_piece_deadline() clear_piece_deadlines() reset_piece_deadline()

    \n+\n+[report issue]
    \n+
    \n+

    set_piece_deadline() reset_piece_deadline() clear_piece_deadlines()

    \n
    \n-void reset_piece_deadline (piece_index_t index) const;\n void set_piece_deadline (piece_index_t index, int deadline, deadline_flags_t flags = {}) const;\n void clear_piece_deadlines () const;\n+void reset_piece_deadline (piece_index_t index) const;\n 
    \n

    This function sets or resets the deadline associated with a specific\n piece index (index). libtorrent will attempt to download this\n entire piece before the deadline expires. This is not necessarily\n possible, but pieces with a more recent deadline will always be\n prioritized over pieces with a deadline further ahead in time. The\n deadline (and flags) of a piece can be changed by calling this\n@@ -16628,21 +17118,21 @@\n

    deadline is the number of milliseconds until this piece should be\n completed.

    \n

    reset_piece_deadline removes the deadline from the piece. If it\n hasn't already been downloaded, it will no longer be considered a\n priority.

    \n

    clear_piece_deadlines() removes deadlines on all pieces in\n the torrent. As if reset_piece_deadline() was called on all pieces.

    \n-\n-[report issue]
    \n-
    \n-

    post_file_progress() file_progress()

    \n+\n+[report issue]
    \n+
    \n+

    file_progress() post_file_progress()

    \n
    \n-void post_file_progress (file_progress_flags_t flags) const;\n std::vector<std::int64_t> file_progress (file_progress_flags_t flags = {}) const;\n+void post_file_progress (file_progress_flags_t flags) const;\n void file_progress (std::vector<std::int64_t>& progress, file_progress_flags_t flags = {}) const;\n 
    \n

    This function fills in the supplied vector, or returns a vector, with\n the number of bytes downloaded of each file in this torrent. The\n progress values are ordered the same as the files in the\n torrent_info.

    \n

    This operation is not very cheap. Its complexity is O(n + mj).\n@@ -16673,28 +17163,28 @@\n

    clear_error()

    \n
    \n void clear_error () const;\n 
    \n

    If the torrent is in an error state (i.e. torrent_status::error is\n non-empty), this will clear the error and start the torrent again.

    \n \n-\n \n-[report issue]
    \n-
    \n-

    post_trackers() add_tracker() replace_trackers() trackers()

    \n+\n+[report issue]
    \n+
    \n+

    post_trackers() replace_trackers() trackers() add_tracker()

    \n
    \n void post_trackers () const;\n+std::vector<announce_entry> trackers () const;\n void add_tracker (announce_entry const&) const;\n void replace_trackers (std::vector<announce_entry> const&) const;\n-std::vector<announce_entry> trackers () const;\n 
    \n

    trackers() returns the list of trackers for this torrent. The\n announce entry contains both a string url which specify the\n-announce url for the tracker as well as an int tier, which is\n+announce url for the tracker as well as an int tier, which is\n specifies the order in which this tracker is tried. If you want\n libtorrent to use another list of trackers for this torrent, you can\n use replace_trackers() which takes a list of the same form as the\n one returned from trackers() and will replace it. If you want an\n immediate effect, you have to call force_reannounce(). See\n announce_entry.

    \n

    post_trackers() is the asynchronous version of trackers(). It\n@@ -16702,42 +17192,42 @@\n

    add_tracker() will look if the specified tracker is already in the\n set. If it is, it doesn't do anything. If it's not in the current set\n of trackers, it will insert it in the tier specified in the\n announce_entry.

    \n

    The updated set of trackers will be saved in the resume data, and when\n a torrent is started with resume data, the trackers from the resume\n data will replace the original ones.

    \n-\n \n-[report issue]
    \n-
    \n-

    add_url_seed() url_seeds() remove_url_seed()

    \n+\n+[report issue]
    \n+
    \n+

    url_seeds() remove_url_seed() add_url_seed()

    \n
    \n std::set<std::string> url_seeds () const;\n void remove_url_seed (std::string const& url) const;\n void add_url_seed (std::string const& url) const;\n 
    \n

    add_url_seed() adds another url to the torrent's list of url\n seeds. If the given url already exists in that list, the call has no\n effect. The torrent will connect to the server and try to download\n pieces from it, unless it's paused, queued, checking or seeding.\n remove_url_seed() removes the given url if it exists already.\n url_seeds() return a set of the url seeds currently in this\n torrent. Note that URLs that fails may be removed automatically from\n the list.

    \n

    See http seeding for more information.

    \n-\n \n-[report issue]
    \n-
    \n-

    http_seeds() add_http_seed() remove_http_seed()

    \n+\n+[report issue]
    \n+
    \n+

    add_http_seed() http_seeds() remove_http_seed()

    \n
    \n-std::set<std::string> http_seeds () const;\n void add_http_seed (std::string const& url) const;\n void remove_http_seed (std::string const& url) const;\n+std::set<std::string> http_seeds () const;\n 
    \n

    These functions are identical as the *_url_seed() variants, but\n they operate on BEP 17 web seeds instead of BEP 19.

    \n

    See http seeding for more information.

    \n [report issue]
    \n
    \n

    add_extension()

    \n@@ -16761,36 +17251,36 @@\n buffer passed in will be hashed and verified against the info-hash. If\n it fails, a metadata_failed_alert will be generated. If it passes,\n a metadata_received_alert is generated. The function returns true\n if the metadata is successfully set on the torrent, and false\n otherwise. If the torrent already has metadata, this function will not\n affect the torrent, and false will be returned.

    \n [report issue]
    \n-
    \n+
    \n

    is_valid()

    \n
    \n bool is_valid () const;\n 
    \n

    Returns true if this handle refers to a valid torrent and false if it\n hasn't been initialized or if the torrent it refers to has been\n removed from the session AND destructed.

    \n

    To tell if the torrent_handle is in the session, use\n torrent_handle::in_session(). This will return true before\n session_handle::remove_torrent() is called, and false\n afterward.

    \n-

    Clients should only use is_valid() to determine if the result of\n+

    Clients should only use is_valid() to determine if the result of\n session::find_torrent() was successful.

    \n-

    Unlike other member functions which return a value, is_valid()\n+

    Unlike other member functions which return a value, is_valid()\n completes immediately, without blocking on a result from the\n network thread. Also unlike other functions, it never throws\n the system_error exception.

    \n-\n-[report issue]
    \n-
    \n-

    resume() pause()

    \n+\n+[report issue]
    \n+
    \n+

    pause() resume()

    \n
    \n void resume () const;\n void pause (pause_flags_t flags = {}) const;\n 
    \n

    pause(), and resume() will disconnect all peers and reconnect\n all peers respectively. When a torrent is paused, it will however\n remember all share ratios to all peers and remember all potential (not\n@@ -16804,24 +17294,24 @@\n

    \n

    Note

    \n

    Torrents that are auto-managed may be automatically resumed again. It\n does not make sense to pause an auto-managed torrent without making it\n not auto-managed first. Torrents are auto-managed by default when added\n to the session. For more information, see queuing.

    \n
    \n-\n \n-[report issue]
    \n-
    \n-

    flags() unset_flags() set_flags()

    \n+\n+[report issue]
    \n+
    \n+

    unset_flags() set_flags() flags()

    \n
    \n-void set_flags (torrent_flags_t flags, torrent_flags_t mask) const;\n torrent_flags_t flags () const;\n-void set_flags (torrent_flags_t flags) const;\n void unset_flags (torrent_flags_t flags) const;\n+void set_flags (torrent_flags_t flags) const;\n+void set_flags (torrent_flags_t flags, torrent_flags_t mask) const;\n 
    \n

    sets and gets the torrent state flags. See torrent_flags_t.\n The set_flags overload that take a mask will affect all\n flags part of the mask, and set their values to what the\n flags argument is set to. This allows clearing and\n setting flags in a single function call.\n The set_flags overload that just takes flags, sets all\n@@ -16977,26 +17467,26 @@\n

    \n

    Note

    \n

    A torrent's resume data is considered saved as soon as the\n save_resume_data_alert is posted. It is important to make sure this\n alert is received and handled in order for this function to be\n meaningful.

    \n
    \n+\n \n \n \n-\n-[report issue]
    \n-
    \n-

    queue_position_bottom() queue_position_top() queue_position_down() queue_position() queue_position_up()

    \n+[report issue]
    \n+
    \n+

    queue_position() queue_position_bottom() queue_position_top() queue_position_down() queue_position_up()

    \n
    \n void queue_position_up () const;\n+queue_position_t queue_position () const;\n void queue_position_down () const;\n void queue_position_bottom () const;\n-queue_position_t queue_position () const;\n void queue_position_top () const;\n 
    \n

    Every torrent that is added is assigned a queue position exactly one\n greater than the greatest queue position of all existing torrents.\n Torrents that are being seeded have -1 as their queue position, since\n they're no longer in line to be downloaded.

    \n

    When a torrent is removed or turns into a seed, all torrents with\n@@ -17056,16 +17546,16 @@\n provide a valid cert. If you don't have a cert you won't be allowed to\n connect to any peers.

    \n \n [report issue]
    \n
    \n

    torrent_file_with_hashes() torrent_file()

    \n
    \n-std::shared_ptr<const torrent_info> torrent_file () const;\n std::shared_ptr<torrent_info> torrent_file_with_hashes () const;\n+std::shared_ptr<const torrent_info> torrent_file () const;\n 
    \n

    torrent_file() returns a pointer to the torrent_info object\n associated with this torrent. The torrent_info object may be a copy\n of the internal object. If the torrent doesn't have metadata, the\n pointer will not be initialized (i.e. a nullptr). The torrent may be\n in a state without metadata only if it was started without a .torrent\n file, e.g. by being added by magnet link.

    \n@@ -17102,37 +17592,37 @@\n vector. This is a blocking call that will synchronize with the\n libtorrent network thread.

    \n \n [report issue]
    \n
    \n

    post_piece_availability() piece_availability()

    \n
    \n-void piece_availability (std::vector<int>& avail) const;\n void post_piece_availability () const;\n+void piece_availability (std::vector<int>& avail) const;\n 
    \n

    The piece availability is the number of peers that we are connected\n that has advertised having a particular piece. This is the information\n that libtorrent uses in order to prefer picking rare pieces.

    \n

    post_piece_availability() will trigger a piece_availability_alert\n to be posted.

    \n

    piece_availability() fills the specified std::vector<int>\n with the availability for each piece in this torrent. libtorrent does\n not keep track of availability for seeds, so if the torrent is\n seeding the availability for all pieces is reported as 0.

    \n-\n+\n \n-[report issue]
    \n-
    \n-

    prioritize_pieces() piece_priority() get_piece_priorities()

    \n+[report issue]
    \n+
    \n+

    get_piece_priorities() piece_priority() prioritize_pieces()

    \n
    \n+std::vector<download_priority_t> get_piece_priorities () const;\n void prioritize_pieces (std::vector<download_priority_t> const& pieces) const;\n+void prioritize_pieces (std::vector<std::pair<piece_index_t, download_priority_t>> const& pieces) const;\n download_priority_t piece_priority (piece_index_t index) const;\n-std::vector<download_priority_t> get_piece_priorities () const;\n void piece_priority (piece_index_t index, download_priority_t priority) const;\n-void prioritize_pieces (std::vector<std::pair<piece_index_t, download_priority_t>> const& pieces) const;\n 
    \n

    These functions are used to set and get the priority of individual\n pieces. By default all pieces have priority 4. That means that the\n random rarest first algorithm is effectively active for all pieces.\n You may however change the priority of individual pieces. There are 8\n priority levels. 0 means not to download the piece at all. Otherwise,\n lower priority values means less likely to be picked. Piece priority\n@@ -17154,23 +17644,23 @@\n Invalid entries, where the piece index or priority is out of range, are\n not allowed.

    \n

    get_piece_priorities returns a vector with one element for each piece\n in the torrent. Each element is the current priority of that piece.

    \n

    It's possible to cancel the effect of file priorities by setting the\n priorities for the affected pieces. Care has to be taken when mixing\n usage of file- and piece priorities.

    \n-\n \n-[report issue]
    \n-
    \n-

    get_file_priorities() file_priority() prioritize_files()

    \n+\n+[report issue]
    \n+
    \n+

    file_priority() prioritize_files() get_file_priorities()

    \n
    \n std::vector<download_priority_t> get_file_priorities () const;\n-void prioritize_files (std::vector<download_priority_t> const& files) const;\n void file_priority (file_index_t index, download_priority_t priority) const;\n+void prioritize_files (std::vector<download_priority_t> const& files) const;\n download_priority_t file_priority (file_index_t index) const;\n 
    \n

    index must be in the range [0, number_of_files).

    \n

    file_priority() queries or sets the priority of file index.

    \n

    prioritize_files() takes a vector that has at as many elements as\n there are files in the torrent. Each entry is the priority of that\n file. The function sets the priorities of all the pieces in the\n@@ -17194,19 +17684,19 @@\n file_prio_alert.

    \n

    When combining file- and piece priorities, the resume file will record\n both. When loading the resume data, the file priorities will be applied\n first, then the piece priorities.

    \n

    Moving data from a file into the part file is currently not\n supported. If a file has its priority set to 0 after it has already\n been created, it will not be moved into the partfile.

    \n-\n \n-[report issue]
    \n-
    \n-

    force_reannounce() force_lsd_announce() force_dht_announce()

    \n+\n+[report issue]
    \n+
    \n+

    force_lsd_announce() force_dht_announce() force_reannounce()

    \n
    \n void force_lsd_announce () const;\n void force_dht_announce () const;\n void force_reannounce (int seconds = 0, int idx = -1, reannounce_flags_t = {}) const;\n 
    \n

    force_reannounce() will force this torrent to do another tracker\n request, to receive new peers. The seconds argument specifies how\n@@ -17234,25 +17724,25 @@\n idx is >= 0, the tracker with the specified index will scraped.

    \n

    A scrape request queries the tracker for statistics such as total\n number of incomplete peers, complete peers, number of downloads etc.

    \n

    This request will specifically update the num_complete and\n num_incomplete fields in the torrent_status struct once it\n completes. When it completes, it will generate a scrape_reply_alert.\n If it fails, it will generate a scrape_failed_alert.

    \n+\n \n \n-\n-[report issue]
    \n-
    \n-

    upload_limit() set_download_limit() set_upload_limit() download_limit()

    \n+[report issue]
    \n+
    \n+

    set_upload_limit() upload_limit() set_download_limit() download_limit()

    \n
    \n-void set_upload_limit (int limit) const;\n int upload_limit () const;\n int download_limit () const;\n void set_download_limit (int limit) const;\n+void set_upload_limit (int limit) const;\n 
    \n

    set_upload_limit will limit the upload bandwidth used by this\n particular torrent to the limit you set. It is given as the number of\n bytes per second the torrent is allowed to upload.\n set_download_limit works the same way but for download bandwidth\n instead of upload bandwidth. Note that setting a higher limit on a\n torrent then the global limit\n@@ -17289,30 +17779,30 @@\n torrent. New peers will have to be acquired before resuming, from\n trackers, DHT or local service discovery, for example.

    \n \n [report issue]
    \n
    \n

    set_max_uploads() max_uploads()

    \n
    \n-int max_uploads () const;\n void set_max_uploads (int max_uploads) const;\n+int max_uploads () const;\n 
    \n

    set_max_uploads() sets the maximum number of peers that's unchoked\n at the same time on this torrent. If you set this to -1, there will be\n no limit. This defaults to infinite. The primary setting controlling\n this is the global unchoke slots limit, set by unchoke_slots_limit in\n settings_pack.

    \n

    max_uploads() returns the current settings.

    \n-\n-[report issue]
    \n-
    \n-

    set_max_connections() max_connections()

    \n+\n+[report issue]
    \n+
    \n+

    max_connections() set_max_connections()

    \n
    \n-void set_max_connections (int max_connections) const;\n int max_connections () const;\n+void set_max_connections (int max_connections) const;\n 
    \n

    set_max_connections() sets the maximum number of connection this\n torrent will open. If all connections are used up, incoming\n connections may be refused or poor connections may be closed. This\n must be at least 2. The default is unlimited number of connections. If\n -1 is given to the function, it means unlimited. There is also a\n global limit of the number of connections, set by\n@@ -17367,41 +17857,41 @@\n well. This goes for files that have been renamed to absolute paths\n that still end up inside the save path.

    \n

    When copying files, sparse regions are not likely to be preserved.\n This makes it proportionally more expensive to move a large torrent\n when only few pieces have been downloaded, since the files are then\n allocated with zeros in the destination directory.

    \n [report issue]
    \n-
    \n+
    \n

    rename_file()

    \n
    \n void rename_file (file_index_t index, std::string const& new_name) const;\n 
    \n

    Renames the file with the given index asynchronously. The rename\n operation is complete when either a file_renamed_alert or\n file_rename_failed_alert is posted.

    \n \n [report issue]
    \n-
    \n+
    \n

    info_hashes() info_hash()

    \n
    \n-sha1_hash info_hash () const;\n info_hash_t info_hashes () const;\n+sha1_hash info_hash () const;\n 
    \n

    returns the info-hash(es) of the torrent. If this handle is to a\n torrent that hasn't loaded yet (for instance by being added) by a\n URL, the returned value is undefined.\n The info_hash() returns the SHA-1 info-hash for v1 torrents and a\n truncated hash for v2 torrents. For the full v2 info-hash, use\n info_hashes() instead.

    \n \n-\n-[report issue]
    \n+\n+[report issue]
    \n
    \n-

    operator!=() operator==() operator<()

    \n+

    operator!=() operator<() operator==()

    \n
    \n bool operator!= (const torrent_handle& h) const;\n bool operator< (const torrent_handle& h) const;\n bool operator== (const torrent_handle& h) const;\n 
    \n

    comparison operators. The order of the torrents is unspecified\n but stable.

    \n@@ -17594,1418 +18084,928 @@\n
    \n

    hash_value()

    \n

    Declared in "libtorrent/torrent_handle.hpp"

    \n
    \n std::size_t hash_value (torrent_handle const& h);\n 
    \n

    for std::hash (and to support using this type in unordered_map etc.)

    \n-[report issue]
    \n-
    \n-

    web_seed_entry

    \n-

    Declared in "libtorrent/torrent_info.hpp"

    \n-

    the web_seed_entry holds information about a web seed (also known\n-as URL seed or HTTP seed). It is essentially a URL with some state\n-associated with it. For more information, see BEP 17 and BEP 19.

    \n+

    Bencoding is a common representation in bittorrent used for dictionary,\n+list, int and string hierarchies. It's used to encode .torrent files and\n+some messages in the network protocol. libtorrent also uses it to store\n+settings, resume data and other session state.

    \n+

    Strings in bencoded structures do not necessarily represent text.\n+Strings are raw byte buffers of a certain length. If a string is meant to be\n+interpreted as text, it is required to be UTF-8 encoded. See BEP 3.

    \n+

    The function for decoding bencoded data bdecode(), returning a bdecode_node.\n+This function builds a tree that points back into the original buffer. The\n+returned bdecode_node will not be valid once the buffer it was parsed out of\n+is discarded.

    \n+

    It's possible to construct an entry from a bdecode_node, if a structure needs\n+to be altered and re-encoded.

    \n+[report issue]
    \n+
    \n+

    entry

    \n+

    Declared in "libtorrent/entry.hpp"

    \n+

    The entry class represents one node in a bencoded hierarchy. It works as a\n+variant type, it can be either a list, a dictionary (std::map), an integer\n+or a string.

    \n
    \n-struct web_seed_entry\n+class entry\n {\n-   bool operator== (web_seed_entry const& e) const;\n-   bool operator< (web_seed_entry const& e) const;\n+   data_type type () const;\n+   entry (dictionary_type);\n+   entry (list_type);\n+   entry (preformatted_type);\n+   entry (span<char const>);\n+   entry (integer_type);\n+   entry (U v);\n+   entry (data_type t);\n+   entry (bdecode_node const& n);\n+   entry& operator= (entry&&) & noexcept;\n+   entry& operator= (entry const&) &;\n+   entry& operator= (dictionary_type) &;\n+   entry& operator= (span<char const>) &;\n+   entry& operator= (integer_type) &;\n+   entry& operator= (preformatted_type) &;\n+   entry& operator= (bdecode_node const&) &;\n+   entry& operator= (list_type) &;\n+   entry& operator= (U v) &;\n+   preformatted_type const& preformatted () const;\n+   string_type const& string () const;\n+   dictionary_type const& dict () const;\n+   dictionary_type& dict ();\n+   string_type& string ();\n+   preformatted_type& preformatted ();\n+   integer_type& integer ();\n+   list_type const& list () const;\n+   list_type& list ();\n+   integer_type const& integer () const;\n+   void swap (entry& e);\n+   entry& operator[] (string_view key);\n+   entry const& operator[] (string_view key) const;\n+   entry* find_key (string_view key);\n+   entry const* find_key (string_view key) const;\n+   std::string to_string (bool single_line = false) const;\n \n-   enum type_t\n+   enum data_type\n    {\n-      url_seed,\n-      http_seed,\n+      int_t,\n+      string_t,\n+      list_t,\n+      dictionary_t,\n+      undefined_t,\n+      preformatted_t,\n    };\n-\n-   std::string url;\n-   std::string auth;\n-   headers_t extra_headers;\n-   std::uint8_t type;\n };\n 
    \n-[report issue]
    \n-

    operator==()

    \n+[report issue]
    \n+

    type()

    \n
    \n-bool operator== (web_seed_entry const& e) const;\n+data_type type () const;\n 
    \n-

    URL and type comparison

    \n-[report issue]
    \n-
    \n-

    operator<()

    \n+

    returns the concrete type of the entry

    \n+[report issue]
    \n+
    \n+

    entry()

    \n
    \n-bool operator< (web_seed_entry const& e) const;\n+entry (dictionary_type);\n+entry (list_type);\n+entry (preformatted_type);\n+entry (span<char const>);\n+entry (integer_type);\n 
    \n-

    URL and type less-than comparison

    \n-[report issue]
    \n-
    \n-

    enum type_t

    \n-

    Declared in "libtorrent/torrent_info.hpp"

    \n+

    constructors directly from a specific type.\n+The content of the argument is copied into the\n+newly constructed entry

    \n+[report issue]
    \n+
    \n+

    entry()

    \n+
    \n+entry (data_type t);\n+
    \n+

    construct an empty entry of the specified type.\n+see data_type enum.

    \n+[report issue]
    \n+
    \n+

    entry()

    \n+
    \n+entry (bdecode_node const& n);\n+
    \n+

    construct from bdecode_node parsed form (see bdecode())

    \n+[report issue]
    \n+
    \n+

    operator=()

    \n+
    \n+entry& operator= (entry&&) & noexcept;\n+entry& operator= (entry const&) &;\n+entry& operator= (dictionary_type) &;\n+entry& operator= (span<char const>) &;\n+entry& operator= (integer_type) &;\n+entry& operator= (preformatted_type) &;\n+entry& operator= (bdecode_node const&) &;\n+entry& operator= (list_type) &;\n+
    \n+

    copies the structure of the right hand side into this\n+entry.

    \n+\n+\n+\n+\n+[report issue]
    \n+
    \n+

    dict() string() integer() list() preformatted()

    \n+
    \n+preformatted_type const& preformatted () const;\n+string_type const& string () const;\n+dictionary_type const& dict () const;\n+dictionary_type& dict ();\n+string_type& string ();\n+preformatted_type& preformatted ();\n+integer_type& integer ();\n+list_type const& list () const;\n+list_type& list ();\n+integer_type const& integer () const;\n+
    \n+

    The integer(), string(), list() and dict() functions\n+are accessors that return the respective type. If the entry object\n+isn't of the type you request, the accessor will throw\n+system_error. You can ask an entry for its type through the\n+type() function.

    \n+

    If you want to create an entry you give it the type you want it to\n+have in its constructor, and then use one of the non-const accessors\n+to get a reference which you then can assign the value you want it to\n+have.

    \n+

    The typical code to get info from a torrent file will then look like\n+this:

    \n+
    \n+entry torrent_file;\n+// ...\n+\n+// throws if this is not a dictionary\n+entry::dictionary_type const& dict = torrent_file.dict();\n+entry::dictionary_type::const_iterator i;\n+i = dict.find("announce");\n+if (i != dict.end())\n+{\n+        std::string tracker_url = i->second.string();\n+        std::cout << tracker_url << "\\n";\n+}\n+
    \n+

    The following code is equivalent, but a little bit shorter:

    \n+
    \n+entry torrent_file;\n+// ...\n+\n+// throws if this is not a dictionary\n+if (entry* i = torrent_file.find_key("announce"))\n+{\n+        std::string tracker_url = i->string();\n+        std::cout << tracker_url << "\\n";\n+}\n+
    \n+

    To make it easier to extract information from a torrent file, the\n+class torrent_info exists.

    \n+[report issue]
    \n+
    \n+

    swap()

    \n+
    \n+void swap (entry& e);\n+
    \n+

    swaps the content of this with e.

    \n+[report issue]
    \n+
    \n+

    operator[]()

    \n+
    \n+entry& operator[] (string_view key);\n+entry const& operator[] (string_view key) const;\n+
    \n+

    All of these functions requires the entry to be a dictionary, if it\n+isn't they will throw system_error.

    \n+

    The non-const versions of the operator[] will return a reference\n+to either the existing element at the given key or, if there is no\n+element with the given key, a reference to a newly inserted element at\n+that key.

    \n+

    The const version of operator[] will only return a reference to an\n+existing element at the given key. If the key is not found, it will\n+throw system_error.

    \n+[report issue]
    \n+
    \n+

    find_key()

    \n+
    \n+entry* find_key (string_view key);\n+entry const* find_key (string_view key) const;\n+
    \n+

    These functions requires the entry to be a dictionary, if it isn't\n+they will throw system_error.

    \n+

    They will look for an element at the given key in the dictionary, if\n+the element cannot be found, they will return nullptr. If an element\n+with the given key is found, the return a pointer to it.

    \n+[report issue]
    \n+
    \n+

    to_string()

    \n+
    \n+std::string to_string (bool single_line = false) const;\n+
    \n+

    returns a pretty-printed string representation\n+of the bencoded structure, with JSON-style syntax

    \n+[report issue]
    \n+
    \n+

    enum data_type

    \n+

    Declared in "libtorrent/entry.hpp"

    \n
    \n \n-\n-\n-\n+\n+\n+\n \n \n \n \n \n \n \n \n-\n+\n \n \n \n-\n+\n \n \n \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n \n
    namevaluedescription
    url_seed
    int_t0 
    http_seed
    string_t1 
    list_t2 
    dictionary_t3 
    undefined_t4 
    preformatted_t5 
    \n-[report issue]
    \n-
    url
    \n-
    The URL of the web seed
    \n-
    \n-[report issue]
    \n-
    auth
    \n-
    Optional authentication. If this is set, it's passed\n-in as HTTP basic auth to the web seed. The format is:\n-username:password.
    \n-
    \n-[report issue]
    \n-
    extra_headers
    \n-
    Any extra HTTP headers that need to be passed to the web seed
    \n-
    \n-[report issue]
    \n-
    type
    \n-
    The type of web seed (see type_t)
    \n-
    \n-[report issue]
    \n-
    \n-
    \n-

    load_torrent_limits

    \n-

    Declared in "libtorrent/torrent_info.hpp"

    \n-

    this object holds configuration options for limits to use when loading\n-torrents. They are meant to prevent loading potentially malicious torrents\n-that cause excessive memory allocations.

    \n-
    \n-struct load_torrent_limits\n-{\n-   int max_buffer_size  = 10000000;\n-   int max_pieces  = 0x200000;\n-   int max_decode_depth  = 100;\n-   int max_decode_tokens  = 3000000;\n-};\n-
    \n-[report issue]
    \n-
    max_buffer_size
    \n-
    the max size of a .torrent file to load into RAM
    \n-
    \n-[report issue]
    \n-
    max_pieces
    \n-
    the max number of pieces allowed in the torrent
    \n-
    \n-[report issue]
    \n-
    max_decode_depth
    \n-
    the max recursion depth in the bdecoded structure
    \n-
    \n-[report issue]
    \n-
    max_decode_tokens
    \n-
    the max number of bdecode tokens
    \n-
    \n-[report issue]
    \n-
    \n-

    torrent_info

    \n-

    Declared in "libtorrent/torrent_info.hpp"

    \n-

    the torrent_info class holds the information found in a .torrent file.

    \n-
    \n-class torrent_info\n-{\n-   torrent_info (char const* buffer, int size);\n-   torrent_info (std::string const& filename, error_code& ec);\n-   explicit torrent_info (span<char const> buffer, from_span_t);\n-   torrent_info (span<char const> buffer, load_torrent_limits const& cfg, from_span_t);\n-   torrent_info (std::string const& filename, load_torrent_limits const& cfg);\n-   torrent_info (torrent_info const& t);\n-   explicit torrent_info (bdecode_node const& torrent_file);\n-   explicit torrent_info (std::string const& filename);\n-   torrent_info (bdecode_node const& torrent_file, error_code& ec);\n-   explicit torrent_info (info_hash_t const& info_hash);\n-   torrent_info (span<char const> buffer, error_code& ec, from_span_t);\n-   torrent_info (bdecode_node const& torrent_file, load_torrent_limits const& cfg);\n-   torrent_info (char const* buffer, int size, error_code& ec);\n-   ~torrent_info ();\n-   file_storage const& orig_files () const;\n-   file_storage const& files () const;\n-   void rename_file (file_index_t index, std::string const& new_filename);\n-   void remap_files (file_storage const& f);\n-   void add_tracker (std::string const& url, int tier\n-      , announce_entry::tracker_source source);\n-   std::vector<announce_entry> const& trackers () const;\n-   void add_tracker (std::string const& url, int tier = 0);\n-   void clear_trackers ();\n-   std::vector<sha1_hash> similar_torrents () const;\n-   std::vector<std::string> collections () const;\n-   void add_url_seed (std::string const& url\n-      , std::string const& ext_auth = std::string()\n-      , web_seed_entry::headers_t const& ext_headers = web_seed_entry::headers_t());\n-   std::vector<web_seed_entry> const& web_seeds () const;\n-   void add_http_seed (std::string const& url\n-      , std::string const& extern_auth = std::string()\n-      , web_seed_entry::headers_t const& extra_headers = web_seed_entry::headers_t());\n-   void set_web_seeds (std::vector<web_seed_entry> seeds);\n-   std::int64_t total_size () const;\n-   int num_pieces () const;\n-   int piece_length () const;\n-   int blocks_per_piece () const;\n-   piece_index_t last_piece () const;\n-   index_range<piece_index_t> piece_range () const;\n-   piece_index_t end_piece () const;\n-   info_hash_t const& info_hashes () const;\n-   sha1_hash info_hash () const noexcept;\n-   bool v1 () const;\n-   bool v2 () const;\n-   int num_files () const;\n-   std::vector<file_slice> map_block (piece_index_t const piece\n-      , std::int64_t offset, int size) const;\n-   peer_request map_file (file_index_t const file, std::int64_t offset, int size) const;\n-   string_view ssl_cert () const;\n-   bool is_valid () const;\n-   bool priv () const;\n-   bool is_i2p () const;\n-   int piece_size (piece_index_t index) const;\n-   char const* hash_for_piece_ptr (piece_index_t const index) const;\n-   sha1_hash hash_for_piece (piece_index_t index) const;\n-   bool is_loaded () const;\n-   const std::string& name () const;\n-   std::time_t creation_date () const;\n-   const std::string& creator () const;\n-   const std::string& comment () const;\n-   std::vector<std::pair<std::string, int>> const& nodes () const;\n-   void add_node (std::pair<std::string, int> const& node);\n-   bool parse_info_section (bdecode_node const& info, error_code& ec, int max_pieces);\n-   bdecode_node info (char const* key) const;\n-   span<char const> info_section () const;\n-   span<char const> piece_layer (file_index_t) const;\n-   void free_piece_layers ();\n-};\n-
    \n-[report issue]
    \n-

    torrent_info()

    \n-
    \n-torrent_info (char const* buffer, int size);\n-torrent_info (std::string const& filename, error_code& ec);\n-explicit torrent_info (span<char const> buffer, from_span_t);\n-torrent_info (span<char const> buffer, load_torrent_limits const& cfg, from_span_t);\n-torrent_info (std::string const& filename, load_torrent_limits const& cfg);\n-torrent_info (torrent_info const& t);\n-explicit torrent_info (bdecode_node const& torrent_file);\n-explicit torrent_info (std::string const& filename);\n-torrent_info (bdecode_node const& torrent_file, error_code& ec);\n-explicit torrent_info (info_hash_t const& info_hash);\n-torrent_info (span<char const> buffer, error_code& ec, from_span_t);\n-torrent_info (bdecode_node const& torrent_file, load_torrent_limits const& cfg);\n-torrent_info (char const* buffer, int size, error_code& ec);\n-
    \n-

    The constructor that takes an info-hash will initialize the info-hash\n-to the given value, but leave all other fields empty. This is used\n-internally when downloading torrents without the metadata. The\n-metadata will be created by libtorrent as soon as it has been\n-downloaded from the swarm.

    \n-

    The constructor that takes a bdecode_node will create a torrent_info\n-object from the information found in the given torrent_file. The\n-bdecode_node represents a tree node in an bencoded file. To load an\n-ordinary .torrent file into a bdecode_node, use bdecode().

    \n-

    The version that takes a buffer pointer and a size will decode it as a\n-.torrent file and initialize the torrent_info object for you.

    \n-

    The version that takes a filename will simply load the torrent file\n-and decode it inside the constructor, for convenience. This might not\n-be the most suitable for applications that want to be able to report\n-detailed errors on what might go wrong.

    \n-

    There is an upper limit on the size of the torrent file that will be\n-loaded by the overload taking a filename. If it's important that even\n-very large torrent files are loaded, use one of the other overloads.

    \n-

    The overloads that takes an error_code const& never throws if an\n-error occur, they will simply set the error code to describe what went\n-wrong and not fully initialize the torrent_info object. The overloads\n-that do not take the extra error_code parameter will always throw if\n-an error occurs. These overloads are not available when building\n-without exception support.

    \n-

    The overload that takes a span also needs an extra parameter of\n-type from_span_t to disambiguate the std::string overload for\n-string literals. There is an object in the libtorrent namespace of this\n-type called from_span.

    \n-[report issue]
    \n-
    \n-

    ~torrent_info()

    \n-
    \n-~torrent_info ();\n-
    \n-

    frees all storage associated with this torrent_info object

    \n-\n-[report issue]
    \n-
    \n-

    orig_files() files()

    \n-
    \n-file_storage const& orig_files () const;\n-file_storage const& files () const;\n-
    \n-

    The file_storage object contains the information on how to map the\n-pieces to files. It is separated from the torrent_info object because\n-when creating torrents a storage object needs to be created without\n-having a torrent file. When renaming files in a storage, the storage\n-needs to make its own copy of the file_storage in order to make its\n-mapping differ from the one in the torrent file.

    \n-

    orig_files() returns the original (unmodified) file storage for\n-this torrent. This is used by the web server connection, which needs\n-to request files with the original names. Filename may be changed using\n-torrent_info::rename_file().

    \n-

    For more information on the file_storage object, see the separate\n-document on how to create torrents.

    \n-[report issue]
    \n-
    \n-

    rename_file()

    \n-
    \n-void rename_file (file_index_t index, std::string const& new_filename);\n-
    \n-

    Renames the file with the specified index to the new name. The new\n-filename is reflected by the file_storage returned by files()\n-but not by the one returned by orig_files().

    \n-

    If you want to rename the base name of the torrent (for a multi file\n-torrent), you can copy the file_storage (see files() and\n-orig_files() ), change the name, and then use remap_files().

    \n-

    The new_filename can both be a relative path, in which case the\n-file name is relative to the save_path of the torrent. If the\n-new_filename is an absolute path (i.e. is_complete(new_filename)\n-== true), then the file is detached from the save_path of the\n-torrent. In this case the file is not moved when move_storage() is\n-invoked.

    \n-[report issue]
    \n-
    \n-

    remap_files()

    \n-
    \n-void remap_files (file_storage const& f);\n-
    \n-
    \n-

    Warning

    \n-

    Using remap_files() is discouraged as it's incompatible with v2\n-torrents. This is because the piece boundaries and piece hashes in\n-v2 torrents are intimately tied to the file boundaries. Instead,\n-just rename individual files, or implement a custom disk_interface\n-to customize how to store files.

    \n+[report issue]
    \n
    \n-

    Remaps the file storage to a new file layout. This can be used to, for\n-instance, download all data in a torrent to a single file, or to a\n-number of fixed size sector aligned files, regardless of the number\n-and sizes of the files in the torrent.

    \n-

    The new specified file_storage must have the exact same size as\n-the current one.

    \n-\n-\n-[report issue]
    \n-
    \n-

    clear_trackers() add_tracker() trackers()

    \n-
    \n-void add_tracker (std::string const& url, int tier\n-      , announce_entry::tracker_source source);\n-std::vector<announce_entry> const& trackers () const;\n-void add_tracker (std::string const& url, int tier = 0);\n-void clear_trackers ();\n-
    \n-

    add_tracker() adds a tracker to the announce-list. The tier\n-determines the order in which the trackers are to be tried.\n-The trackers() function will return a sorted vector of\n-announce_entry. Each announce entry contains a string, which is\n-the tracker url, and a tier index. The tier index is the high-level\n-priority. No matter which trackers that works or not, the ones with\n-lower tier will always be tried before the one with higher tier\n-number. For more information, see announce_entry.

    \n-

    trackers() returns all entries from announce-list.

    \n-

    clear_trackers() removes all trackers from announce-list.

    \n-\n-[report issue]
    \n-
    \n-

    collections() similar_torrents()

    \n-
    \n-std::vector<sha1_hash> similar_torrents () const;\n-std::vector<std::string> collections () const;\n-
    \n-

    These two functions are related to BEP 38 (mutable torrents). The\n-vectors returned from these correspond to the "similar" and\n-"collections" keys in the .torrent file. Both info-hashes and\n-collections from within the info-dict and from outside of it are\n-included.

    \n-\n-\n-\n-[report issue]
    \n-
    \n-

    add_url_seed() set_web_seeds() web_seeds() add_http_seed()

    \n+
    \n+

    bencode()

    \n+

    Declared in "libtorrent/bencode.hpp"

    \n
    \n-void add_url_seed (std::string const& url\n-      , std::string const& ext_auth = std::string()\n-      , web_seed_entry::headers_t const& ext_headers = web_seed_entry::headers_t());\n-std::vector<web_seed_entry> const& web_seeds () const;\n-void add_http_seed (std::string const& url\n-      , std::string const& extern_auth = std::string()\n-      , web_seed_entry::headers_t const& extra_headers = web_seed_entry::headers_t());\n-void set_web_seeds (std::vector<web_seed_entry> seeds);\n+template<class OutIt> int bencode (OutIt out, const entry& e);\n 
    \n-

    web_seeds() returns all url seeds and http seeds in the torrent.\n-Each entry is a web_seed_entry and may refer to either a url seed\n-or http seed.

    \n-

    add_url_seed() and add_http_seed() adds one url to the list of\n-url/http seeds.

    \n-

    set_web_seeds() replaces all web seeds with the ones specified in\n-the seeds vector.

    \n-

    The extern_auth argument can be used for other authorization\n-schemes than basic HTTP authorization. If set, it will override any\n-username and password found in the URL itself. The string will be sent\n-as the HTTP authorization header's value (without specifying "Basic").

    \n-

    The extra_headers argument defaults to an empty list, but can be\n-used to insert custom HTTP headers in the requests to a specific web\n-seed.

    \n-

    See http seeding for more information.

    \n-[report issue]
    \n-
    \n-

    total_size()

    \n+

    This function will encode data to bencoded form.

    \n+

    The entry class is the internal representation of the bencoded data\n+and it can be used to retrieve information, an entry can also be build by\n+the program and given to bencode() to encode it into the OutIt\n+iterator.

    \n+

    OutIt is an OutputIterator. It's a template and usually\n+instantiated as ostream_iterator or back_insert_iterator. This\n+function assumes the value_type of the iterator is a char.\n+In order to encode entry e into a buffer, do:

    \n
    \n-std::int64_t total_size () const;\n+std::vector<char> buf;\n+bencode(std::back_inserter(buf), e);\n 
    \n-

    total_size() returns the total number of bytes the torrent-file\n-represents. Note that this is the number of pieces times the piece\n-size (modulo the last piece possibly being smaller). With pad files,\n-the total size will be larger than the sum of all (regular) file\n-sizes.

    \n-\n-[report issue]
    \n-
    \n-

    num_pieces() piece_length()

    \n+[report issue]
    \n+
    \n+

    operator<<()

    \n+

    Declared in "libtorrent/entry.hpp"

    \n
    \n-int num_pieces () const;\n-int piece_length () const;\n+inline std::ostream& operator<< (std::ostream& os, const entry& e);\n 
    \n-

    piece_length() and num_pieces() returns the number of byte\n-for each piece and the total number of pieces, respectively. The\n-difference between piece_size() and piece_length() is that\n-piece_size() takes the piece index as argument and gives you the\n-exact size of that piece. It will always be the same as\n-piece_length() except in the case of the last piece, which may be\n-smaller.

    \n-[report issue]
    \n-
    \n-

    blocks_per_piece()

    \n+

    prints the bencoded structure to the ostream as a JSON-style structure.

    \n+[report issue]
    \n+
    \n+

    ip_filter

    \n+

    Declared in "libtorrent/ip_filter.hpp"

    \n+

    The ip_filter class is a set of rules that uniquely categorizes all\n+ip addresses as allowed or disallowed. The default constructor creates\n+a single rule that allows all addresses (0.0.0.0 - 255.255.255.255 for\n+the IPv4 range, and the equivalent range covering all addresses for the\n+IPv6 range).

    \n+

    A default constructed ip_filter does not filter any address.

    \n
    \n-int blocks_per_piece () const;\n+struct ip_filter\n+{\n+   ip_filter (ip_filter&&);\n+   ip_filter& operator= (ip_filter const&);\n+   ip_filter (ip_filter const&);\n+   ip_filter& operator= (ip_filter&&);\n+   ip_filter ();\n+   ~ip_filter ();\n+   bool empty () const;\n+   void add_rule (address const& first, address const& last, std::uint32_t flags);\n+   std::uint32_t access (address const& addr) const;\n+   filter_tuple_t export_filter () const;\n+\n+   enum access_flags\n+   {\n+      blocked,\n+   };\n+};\n 
    \n-

    returns the number of blocks there are in the typical piece. There\n-may be fewer in the last piece)

    \n-\n-\n-[report issue]
    \n-
    \n-

    last_piece() end_piece() piece_range()

    \n+[report issue]
    \n+

    empty()

    \n
    \n-piece_index_t last_piece () const;\n-index_range<piece_index_t> piece_range () const;\n-piece_index_t end_piece () const;\n+bool empty () const;\n 
    \n-

    last_piece() returns the index to the last piece in the torrent and\n-end_piece() returns the index to the one-past-end piece in the\n-torrent\n-piece_range() returns an implementation-defined type that can be\n-used as the container in a range-for loop. Where the values are the\n-indices of all pieces in the file_storage.

    \n-\n-[report issue]
    \n-
    \n-

    info_hashes() info_hash()

    \n+

    returns true if the filter does not contain any rules

    \n+[report issue]
    \n+
    \n+

    add_rule()

    \n
    \n-info_hash_t const& info_hashes () const;\n-sha1_hash info_hash () const noexcept;\n+void add_rule (address const& first, address const& last, std::uint32_t flags);\n 
    \n-

    returns the info-hash of the torrent. For BitTorrent v2 support, use\n-info_hashes() to get an object that may hold both a v1 and v2\n-info-hash

    \n-\n-[report issue]
    \n-
    \n-

    v1() v2()

    \n+

    Adds a rule to the filter. first and last defines a range of\n+ip addresses that will be marked with the given flags. The flags\n+can currently be 0, which means allowed, or ip_filter::blocked, which\n+means disallowed.

    \n+

    precondition:\n+first.is_v4() == last.is_v4() && first.is_v6() == last.is_v6()

    \n+

    postcondition:\n+access(x) == flags for every x in the range [first, last]

    \n+

    This means that in a case of overlapping ranges, the last one applied takes\n+precedence.

    \n+[report issue]
    \n+
    \n+

    access()

    \n
    \n-bool v1 () const;\n-bool v2 () const;\n+std::uint32_t access (address const& addr) const;\n 
    \n-

    returns whether this torrent has v1 and/or v2 metadata, respectively.\n-Hybrid torrents have both. These are shortcuts for\n-info_hashes().has_v1() and info_hashes().has_v2() calls.

    \n-[report issue]
    \n-
    \n-

    num_files()

    \n+

    Returns the access permissions for the given address (addr). The permission\n+can currently be 0 or ip_filter::blocked. The complexity of this operation\n+is O(log n), where n is the minimum number of non-overlapping ranges to describe\n+the current filter.

    \n+[report issue]
    \n+
    \n+

    export_filter()

    \n
    \n-int num_files () const;\n+filter_tuple_t export_filter () const;\n 
    \n-

    If you need index-access to files you can use the num_files() along\n-with the file_path(), file_size()-family of functions to access\n-files using indices.

    \n-[report issue]
    \n-
    \n-

    map_block()

    \n+

    This function will return the current state of the filter in the minimum number of\n+ranges possible. They are sorted from ranges in low addresses to high addresses. Each\n+entry in the returned vector is a range with the access control specified in its\n+flags field.

    \n+

    The return value is a tuple containing two range-lists. One for IPv4 addresses\n+and one for IPv6 addresses.

    \n+[report issue]
    \n+
    \n+

    enum access_flags

    \n+

    Declared in "libtorrent/ip_filter.hpp"

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    namevaluedescription
    blocked1indicates that IPs in this range should not be connected\n+to nor accepted as incoming connections
    \n+[report issue]
    \n+
    \n+
    \n+

    port_filter

    \n+

    Declared in "libtorrent/ip_filter.hpp"

    \n+

    the port filter maps non-overlapping port ranges to flags. This\n+is primarily used to indicate whether a range of ports should\n+be connected to or not. The default is to have the full port\n+range (0-65535) set to flag 0.

    \n
    \n-std::vector<file_slice> map_block (piece_index_t const piece\n-      , std::int64_t offset, int size) const;\n+class port_filter\n+{\n+   port_filter ();\n+   port_filter& operator= (port_filter const&);\n+   port_filter (port_filter const&);\n+   port_filter (port_filter&&);\n+   port_filter& operator= (port_filter&&);\n+   ~port_filter ();\n+   void add_rule (std::uint16_t first, std::uint16_t last, std::uint32_t flags);\n+   std::uint32_t access (std::uint16_t port) const;\n+\n+   enum access_flags\n+   {\n+      blocked,\n+   };\n+};\n 
    \n-

    This function will map a piece index, a byte offset within that piece\n-and a size (in bytes) into the corresponding files with offsets where\n-that data for that piece is supposed to be stored. See file_slice.

    \n-[report issue]
    \n-
    \n-

    map_file()

    \n+[report issue]
    \n+

    add_rule()

    \n
    \n-peer_request map_file (file_index_t const file, std::int64_t offset, int size) const;\n+void add_rule (std::uint16_t first, std::uint16_t last, std::uint32_t flags);\n 
    \n-

    This function will map a range in a specific file into a range in the\n-torrent. The file_offset parameter is the offset in the file,\n-given in bytes, where 0 is the start of the file. See peer_request.

    \n-

    The input range is assumed to be valid within the torrent.\n-file_offset + size is not allowed to be greater than the file\n-size. file_index must refer to a valid file, i.e. it cannot be >=\n-num_files().

    \n-[report issue]
    \n-
    \n-

    ssl_cert()

    \n+

    set the flags for the specified port range (first, last) to\n+flags overwriting any existing rule for those ports. The range\n+is inclusive, i.e. the port last also has the flag set on it.

    \n+[report issue]
    \n+
    \n+

    access()

    \n
    \n-string_view ssl_cert () const;\n+std::uint32_t access (std::uint16_t port) const;\n 
    \n-

    Returns the SSL root certificate for the torrent, if it is an SSL\n-torrent. Otherwise returns an empty string. The certificate is\n-the public certificate in x509 format.

    \n-[report issue]
    \n-
    \n-

    is_valid()

    \n+

    test the specified port (port) for whether it is blocked\n+or not. The returned value is the flags set for this port.\n+see access_flags.

    \n+[report issue]
    \n+
    \n+

    enum access_flags

    \n+

    Declared in "libtorrent/ip_filter.hpp"

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    namevaluedescription
    blocked1this flag indicates that destination ports in the\n+range should not be connected to
    \n+[report issue]
    \n+
    \n+
    \n+

    bitfield

    \n+

    Declared in "libtorrent/bitfield.hpp"

    \n+

    The bitfield type stores any number of bits as a bitfield\n+in a heap allocated array.

    \n
    \n-bool is_valid () const;\n+struct bitfield\n+{\n+   bitfield (bitfield&& rhs) noexcept = default;\n+   explicit bitfield (int bits);\n+   bitfield (int bits, bool val);\n+   bitfield (char const* b, int bits);\n+   bitfield () noexcept = default;\n+   bitfield (bitfield const& rhs);\n+   void assign (char const* b, int const bits);\n+   bool get_bit (int index) const noexcept;\n+   bool operator[] (int index) const noexcept;\n+   void set_bit (int index) noexcept;\n+   void clear_bit (int index) noexcept;\n+   bool all_set () const noexcept;\n+   bool none_set () const noexcept;\n+   int size () const noexcept;\n+   int num_words () const noexcept;\n+   int num_bytes () const noexcept;\n+   bool empty () const noexcept;\n+   char const* data () const noexcept;\n+   char* data () noexcept;\n+   void swap (bitfield& rhs) noexcept;\n+   int count () const noexcept;\n+   int find_first_set () const noexcept;\n+   int find_last_clear () const noexcept;\n+   bool operator== (lt::bitfield const& rhs) const;\n+};\n 
    \n-

    returns true if this torrent_info object has a torrent loaded.\n-This is primarily used to determine if a magnet link has had its\n-metadata resolved yet or not.

    \n-[report issue]
    \n-
    \n-

    priv()

    \n+[report issue]
    \n+

    bitfield()

    \n
    \n-bool priv () const;\n+bitfield (bitfield&& rhs) noexcept = default;\n+explicit bitfield (int bits);\n+bitfield (int bits, bool val);\n+bitfield (char const* b, int bits);\n+bitfield () noexcept = default;\n+bitfield (bitfield const& rhs);\n 
    \n-

    returns true if this torrent is private. i.e., the client should not\n-advertise itself on the trackerless network (the Kademlia DHT) for this torrent.

    \n-[report issue]
    \n-
    \n-

    is_i2p()

    \n+

    constructs a new bitfield. The default constructor creates an empty\n+bitfield. bits is the size of the bitfield (specified in bits).\n+val is the value to initialize the bits to. If not specified\n+all bits are initialized to 0.

    \n+

    The constructor taking a pointer b and bits copies a bitfield\n+from the specified buffer, and bits number of bits (rounded up to\n+the nearest byte boundary).

    \n+[report issue]
    \n+
    \n+

    assign()

    \n
    \n-bool is_i2p () const;\n+void assign (char const* b, int const bits);\n 
    \n-

    returns true if this is an i2p torrent. This is determined by whether\n-or not it has a tracker whose URL domain name ends with ".i2p". i2p\n-torrents disable the DHT and local peer discovery as well as talking\n-to peers over anything other than the i2p network.

    \n-[report issue]
    \n-
    \n-

    piece_size()

    \n+

    copy bitfield from buffer b of bits number of bits, rounded up to\n+the nearest byte boundary.

    \n+\n+[report issue]
    \n+
    \n+

    get_bit() operator[]()

    \n
    \n-int piece_size (piece_index_t index) const;\n+bool get_bit (int index) const noexcept;\n+bool operator[] (int index) const noexcept;\n 
    \n-

    returns the piece size of file with index. This will be the same as piece_length(),\n-except for the last piece, which may be shorter.

    \n-\n-[report issue]
    \n-
    \n-

    hash_for_piece_ptr() hash_for_piece()

    \n+

    query bit at index. Returns true if bit is 1, otherwise false.

    \n+\n+[report issue]
    \n+
    \n+

    set_bit() clear_bit()

    \n
    \n-char const* hash_for_piece_ptr (piece_index_t const index) const;\n-sha1_hash hash_for_piece (piece_index_t index) const;\n+void set_bit (int index) noexcept;\n+void clear_bit (int index) noexcept;\n 
    \n-

    hash_for_piece() takes a piece-index and returns the 20-bytes\n-sha1-hash for that piece and info_hash() returns the 20-bytes\n-sha1-hash for the info-section of the torrent file.\n-hash_for_piece_ptr() returns a pointer to the 20 byte sha1 digest\n-for the piece. Note that the string is not 0-terminated.

    \n-[report issue]
    \n-
    \n-

    name()

    \n+

    set bit at index to 0 (clear_bit) or 1 (set_bit).

    \n+[report issue]
    \n+
    \n+

    all_set()

    \n
    \n-const std::string& name () const;\n+bool all_set () const noexcept;\n 
    \n-

    name() returns the name of the torrent.\n-name contains UTF-8 encoded string.

    \n-[report issue]
    \n-
    \n-

    creation_date()

    \n+

    returns true if all bits in the bitfield are set

    \n+[report issue]
    \n+
    \n+

    none_set()

    \n
    \n-std::time_t creation_date () const;\n+bool none_set () const noexcept;\n 
    \n-

    creation_date() returns the creation date of the torrent as time_t\n-(posix time). If there's no time stamp in the torrent file, 0 is\n-returned.\n-.. posix time: http://www.opengroup.org/onlinepubs/009695399/functions/time.html

    \n-[report issue]
    \n-
    \n-

    creator()

    \n+

    returns true if no bit in the bitfield is set

    \n+[report issue]
    \n+
    \n+

    size()

    \n
    \n-const std::string& creator () const;\n+int size () const noexcept;\n 
    \n-

    creator() returns the creator string in the torrent. If there is\n-no creator string it will return an empty string.

    \n-[report issue]
    \n-
    \n-

    comment()

    \n+

    returns the size of the bitfield in bits.

    \n+[report issue]
    \n+
    \n+

    num_words()

    \n
    \n-const std::string& comment () const;\n+int num_words () const noexcept;\n 
    \n-

    comment() returns the comment associated with the torrent. If\n-there's no comment, it will return an empty string.\n-comment contains UTF-8 encoded string.

    \n-[report issue]
    \n-
    \n-

    nodes()

    \n+

    returns the number of 32 bit words are needed to represent all bits in\n+this bitfield.

    \n+[report issue]
    \n+
    \n+

    num_bytes()

    \n
    \n-std::vector<std::pair<std::string, int>> const& nodes () const;\n+int num_bytes () const noexcept;\n 
    \n-

    If this torrent contains any DHT nodes, they are put in this vector in\n-their original form (host name and port number).

    \n-[report issue]
    \n-
    \n-

    add_node()

    \n+

    returns the number of bytes needed to represent all bits in this\n+bitfield

    \n+[report issue]
    \n+
    \n+

    empty()

    \n
    \n-void add_node (std::pair<std::string, int> const& node);\n+bool empty () const noexcept;\n 
    \n-

    This is used when creating torrent. Use this to add a known DHT node.\n-It may be used, by the client, to bootstrap into the DHT network.

    \n-[report issue]
    \n-
    \n-

    parse_info_section()

    \n+

    returns true if the bitfield has zero size.

    \n+[report issue]
    \n+
    \n+

    data()

    \n
    \n-bool parse_info_section (bdecode_node const& info, error_code& ec, int max_pieces);\n+char const* data () const noexcept;\n+char* data () noexcept;\n 
    \n-

    populates the torrent_info by providing just the info-dict buffer.\n-This is used when loading a torrent from a magnet link for instance,\n-where we only have the info-dict. The bdecode_node e points to a\n-parsed info-dictionary. ec returns an error code if something\n-fails (typically if the info dictionary is malformed).\n-The max_pieces parameter allows limiting the amount of memory\n-dedicated to loading the torrent, and fails for torrents that exceed\n-the limit. To load large torrents, this limit may also need to be\n-raised in settings_pack::max_piece_count and in calls to\n-read_resume_data().

    \n-[report issue]
    \n-
    \n-

    info()

    \n+

    returns a pointer to the internal buffer of the bitfield, or\n+nullptr if it's empty.

    \n+[report issue]
    \n+
    \n+

    swap()

    \n
    \n-bdecode_node info (char const* key) const;\n+void swap (bitfield& rhs) noexcept;\n 
    \n-

    This function looks up keys from the info-dictionary of the loaded\n-torrent file. It can be used to access extension values put in the\n-.torrent file. If the specified key cannot be found, it returns nullptr.

    \n-[report issue]
    \n-
    \n-

    info_section()

    \n+

    swaps the bit-fields two variables refer to

    \n+[report issue]
    \n+
    \n+

    count()

    \n
    \n-span<char const> info_section () const;\n+int count () const noexcept;\n 
    \n-

    returns a the raw info section of the torrent file.\n-The underlying buffer is still owned by the torrent_info object

    \n-[report issue]
    \n-
    \n-

    piece_layer()

    \n+

    count the number of bits in the bitfield that are set to 1.

    \n+[report issue]
    \n+
    \n+

    find_first_set()

    \n
    \n-span<char const> piece_layer (file_index_t) const;\n+int find_first_set () const noexcept;\n 
    \n-

    return the bytes of the piece layer hashes for the specified file. If\n-the file doesn't have a piece layer, an empty span is returned.\n-The span size is divisible by 32, the size of a SHA-256 hash.\n-If the size of the file is smaller than or equal to the piece size,\n-the files "root hash" is the hash of the file and is not saved\n-separately in the "piece layers" field, but this function still\n-returns the root hash of the file in that case.

    \n-[report issue]
    \n-
    \n-

    free_piece_layers()

    \n+

    returns the index of the first set bit in the bitfield, i.e. 1 bit.

    \n+[report issue]
    \n+
    \n+

    find_last_clear()

    \n
    \n-void free_piece_layers ();\n-
    \n-

    clears the piece layers from the torrent_info. This is done by the\n-session when a torrent is added, to avoid storing it twice. The piece\n-layer (or other hashes part of the merkle tree) are stored in the\n-internal torrent object.

    \n-

    libtorrent has a plugin interface for implementing extensions to the protocol.\n-These can be general extensions for transferring metadata or peer exchange\n-extensions, or it could be used to provide a way to customize the protocol\n-to fit a particular (closed) network.

    \n-

    In short, the plugin interface makes it possible to:

    \n-
      \n-
    • register extension messages (sent in the extension handshake), see\n-extensions.
    • \n-
    • add data and parse data from the extension handshake.
    • \n-
    • send extension messages and standard bittorrent messages.
    • \n-
    • override or block the handling of standard bittorrent messages.
    • \n-
    • save and restore state via the session state
    • \n-
    • see all alerts that are posted
    • \n-
    \n-
    \n-
    \n-
    \n-

    a word of caution

    \n-

    Writing your own plugin is a very easy way to introduce serious bugs such as\n-dead locks and race conditions. Since a plugin has access to internal\n-structures it is also quite easy to sabotage libtorrent's operation.

    \n-

    All the callbacks are always called from the libtorrent network thread. In\n-case portions of your plugin are called from other threads, typically the main\n-thread, you cannot use any of the member functions on the internal structures\n-in libtorrent, since those require being called from the libtorrent network\n-thread . Furthermore, you also need to synchronize your own shared data\n-within the plugin, to make sure it is not accessed at the same time from the\n-libtorrent thread (through a callback). If you need to send out a message\n-from another thread, it is advised to use an internal queue, and do the\n-actual sending in tick().

    \n-

    Since the plugin interface gives you easy access to internal structures, it\n-is not supported as a stable API. Plugins should be considered specific to a\n-specific version of libtorrent. Although, in practice the internals mostly\n-don't change that dramatically.

    \n-
    \n-
    \n-

    plugin-interface

    \n-

    The plugin interface consists of three base classes that the plugin may\n-implement. These are called plugin, torrent_plugin and peer_plugin.\n-They are found in the <libtorrent/extensions.hpp> header.

    \n-

    These plugins are instantiated for each session, torrent and possibly each peer,\n-respectively.

    \n-

    For plugins that only need per torrent state, it is enough to only implement\n-torrent_plugin and pass a constructor function or function object to\n-session::add_extension() or torrent_handle::add_extension() (if the\n-torrent has already been started and you want to hook in the extension at\n-run-time).

    \n-

    The signature of the function is:

    \n-
    \n-std::shared_ptr<torrent_plugin> (*)(torrent_handle const&, client_data_t);\n+int find_last_clear () const noexcept;\n 
    \n-

    The second argument is the userdata passed to session::add_torrent() or\n-torrent_handle::add_extension().

    \n-

    The function should return a std::shared_ptr<torrent_plugin> which\n-may or may not be 0. If it is a nullptr, the extension is simply ignored\n-for this torrent. If it is a valid pointer (to a class inheriting\n-torrent_plugin), it will be associated with this torrent and callbacks\n-will be made on torrent events.

    \n-

    For more elaborate plugins which require session wide state, you would\n-implement plugin, construct an object (in a std::shared_ptr) and pass\n-it in to session::add_extension().

    \n+

    returns the index to the last cleared bit in the bitfield, i.e. 0 bit.

    \n+[report issue]
    \n
    \n-
    \n-

    custom alerts

    \n-

    Since plugins are running within internal libtorrent threads, one convenient\n-way to communicate with the client is to post custom alerts.

    \n-

    The expected interface of any alert, apart from deriving from the alert\n-base class, looks like this:

    \n-
    \n-static const int alert_type = <unique alert ID>;\n-virtual int type() const { return alert_type; }\n-\n-virtual std::string message() const;\n-\n-static const alert_category_t static_category = <bitmask of alert::category_t flags>;\n-virtual alert_category_t category() const { return static_category; }\n-\n-virtual char const* what() const { return <string literal of the name of this alert>; }\n-
    \n-

    The alert_type is used for the type-checking in alert_cast. It must\n-not collide with any other alert. The built-in alerts in libtorrent will\n-not use alert type IDs greater than user_alert_id. When defining your\n-own alert, make sure it's greater than this constant.

    \n-

    type() is the run-time equivalence of the alert_type.

    \n-

    The message() virtual function is expected to construct a useful\n-string representation of the alert and the event or data it represents.\n-Something convenient to put in a log file for instance.

    \n-

    clone() is used internally to copy alerts. The suggested implementation\n-of simply allocating a new instance as a copy of *this is all that's\n-expected.

    \n-

    The static category is required for checking whether or not the category\n-for a specific alert is enabled or not, without instantiating the alert.\n-The category virtual function is the run-time equivalence.

    \n-

    The what() virtual function may simply be a string literal of the class\n-name of your alert.

    \n-

    For more information, see the alert section.

    \n-[report issue]
    \n-
    \n-

    plugin

    \n-

    Declared in "libtorrent/extensions.hpp"

    \n-

    this is the base class for a session plugin. One primary feature\n-is that it is notified of all torrents that are added to the session,\n-and can add its own torrent_plugins.

    \n+
    \n+

    hasher

    \n+

    Declared in "libtorrent/hasher.hpp"

    \n+

    this is a SHA-1 hash class.

    \n+

    You use it by first instantiating it, then call update() to feed it\n+with data. i.e. you don't have to keep the entire buffer of which you want to\n+create the hash in memory. You can feed the hasher parts of it at a time. When\n+You have fed the hasher with all the data, you call final() and it\n+will return the sha1-hash of the data.

    \n+

    The constructor that takes a char const* and an integer will construct the\n+sha1 context and feed it the data passed in.

    \n+

    If you want to reuse the hasher object once you have created a hash, you have to\n+call reset() to reinitialize it.

    \n+

    The built-in software version of sha1-algorithm was implemented\n+by Steve Reid and released as public domain.\n+For more info, see src/sha1.cpp.

    \n
    \n-struct plugin\n+class hasher\n {\n-   virtual feature_flags_t implemented_features ();\n-   virtual std::shared_ptr<torrent_plugin> new_torrent (torrent_handle const&, client_data_t);\n-   virtual void added (session_handle const&);\n-   virtual void abort ();\n-   virtual bool on_dht_request (string_view /* query */\n-      , udp::endpoint const& /* source */, bdecode_node const& /* message */\n-      , entry& /* response */);\n-   virtual void on_alert (alert const*);\n-   virtual bool on_unknown_torrent (info_hash_t const& /* info_hash */\n-      , peer_connection_handle const& /* pc */, add_torrent_params& /* p */);\n-   virtual void on_tick ();\n-   virtual uint64_t get_unchoke_priority (peer_connection_handle const& /* peer */);\n-   virtual std::map<std::string, std::string> save_state () const;\n-   virtual void load_state (std::map<std::string, std::string> const&);\n-\n-   static constexpr feature_flags_t optimistic_unchoke_feature  = 1_bit;\n-   static constexpr feature_flags_t tick_feature  = 2_bit;\n-   static constexpr feature_flags_t dht_request_feature  = 3_bit;\n-   static constexpr feature_flags_t alert_feature  = 4_bit;\n-   static constexpr feature_flags_t unknown_torrent_feature  = 5_bit;\n+   hasher ();\n+   hasher (char const* data, int len);\n+   hasher& operator= (hasher const&) &;\n+   hasher (hasher const&);\n+   explicit hasher (span<char const> data);\n+   hasher& update (span<char const> data);\n+   hasher& update (char const* data, int len);\n+   sha1_hash final ();\n+   void reset ();\n };\n 
    \n-[report issue]
    \n-

    implemented_features()

    \n-
    \n-virtual feature_flags_t implemented_features ();\n-
    \n-

    This function is expected to return a bitmask indicating which features\n-this plugin implements. Some callbacks on this object may not be called\n-unless the corresponding feature flag is returned here. Note that\n-callbacks may still be called even if the corresponding feature is not\n-specified in the return value here. See feature_flags_t for possible\n-flags to return.

    \n-[report issue]
    \n-
    \n-

    new_torrent()

    \n-
    \n-virtual std::shared_ptr<torrent_plugin> new_torrent (torrent_handle const&, client_data_t);\n-
    \n-

    this is called by the session every time a new torrent is added.\n-The torrent* points to the internal torrent object created\n-for the new torrent. The client_data_t is the userdata pointer as\n-passed in via add_torrent_params.

    \n-

    If the plugin returns a torrent_plugin instance, it will be added\n-to the new torrent. Otherwise, return an empty shared_ptr to a\n-torrent_plugin (the default).

    \n-[report issue]
    \n-
    \n-

    added()

    \n-
    \n-virtual void added (session_handle const&);\n-
    \n-

    called when plugin is added to a session

    \n-[report issue]
    \n-
    \n-

    abort()

    \n-
    \n-virtual void abort ();\n-
    \n-

    called when the session is aborted\n-the plugin should perform any cleanup necessary to allow the session's\n-destruction (e.g. cancel outstanding async operations)

    \n-[report issue]
    \n-
    \n-

    on_dht_request()

    \n-
    \n-virtual bool on_dht_request (string_view /* query */\n-      , udp::endpoint const& /* source */, bdecode_node const& /* message */\n-      , entry& /* response */);\n-
    \n-

    called when a dht request is received.\n-If your plugin expects this to be called, make sure to include the flag\n-dht_request_feature in the return value from implemented_features().

    \n-[report issue]
    \n-
    \n-

    on_alert()

    \n-
    \n-virtual void on_alert (alert const*);\n-
    \n-

    called when an alert is posted alerts that are filtered are not posted.\n-If your plugin expects this to be called, make sure to include the flag\n-alert_feature in the return value from implemented_features().

    \n-[report issue]
    \n-
    \n-

    on_unknown_torrent()

    \n+\n+[report issue]
    \n+

    hasher() operator=()

    \n
    \n-virtual bool on_unknown_torrent (info_hash_t const& /* info_hash */\n-      , peer_connection_handle const& /* pc */, add_torrent_params& /* p */);\n+hasher (char const* data, int len);\n+hasher& operator= (hasher const&) &;\n+hasher (hasher const&);\n+explicit hasher (span<char const> data);\n 
    \n-

    return true if the add_torrent_params should be added

    \n-[report issue]
    \n-
    \n-

    on_tick()

    \n+

    this is the same as default constructing followed by a call to\n+update(data, len).

    \n+[report issue]
    \n+
    \n+

    update()

    \n
    \n-virtual void on_tick ();\n+hasher& update (span<char const> data);\n+hasher& update (char const* data, int len);\n 
    \n-

    called once per second.\n-If your plugin expects this to be called, make sure to include the flag\n-tick_feature in the return value from implemented_features().

    \n-[report issue]
    \n-
    \n-

    get_unchoke_priority()

    \n+

    append the following bytes to what is being hashed

    \n+[report issue]
    \n+
    \n+

    final()

    \n
    \n-virtual uint64_t get_unchoke_priority (peer_connection_handle const& /* peer */);\n+sha1_hash final ();\n 
    \n-

    called when choosing peers to optimistically unchoke. The return value\n-indicates the peer's priority for unchoking. Lower return values\n-correspond to higher priority. Priorities above 2^63-1 are reserved.\n-If your plugin has no priority to assign a peer it should return 2^64-1.\n-If your plugin expects this to be called, make sure to include the flag\n-optimistic_unchoke_feature in the return value from implemented_features().\n-If multiple plugins implement this function the lowest return value\n-(i.e. the highest priority) is used.

    \n-[report issue]
    \n-
    \n-

    load_state()

    \n+

    returns the SHA-1 digest of the buffers previously passed to\n+update() and the hasher constructor.

    \n+[report issue]
    \n+
    \n+

    reset()

    \n
    \n-virtual void load_state (std::map<std::string, std::string> const&);\n+void reset ();\n 
    \n-

    called on startup while loading settings state from the session_params

    \n-[report issue]
    \n-
    optimistic_unchoke_feature
    \n-
    include this bit if your plugin needs to alter the order of the\n-optimistic unchoke of peers. i.e. have the on_optimistic_unchoke()\n-callback be called.
    \n-
    \n-[report issue]
    \n-
    tick_feature
    \n-
    include this bit if your plugin needs to have on_tick() called
    \n-
    \n-[report issue]
    \n-
    dht_request_feature
    \n-
    include this bit if your plugin needs to have on_dht_request()\n-called
    \n-
    \n-[report issue]
    \n-
    alert_feature
    \n-
    include this bit if your plugin needs to have on_alert()\n-called
    \n-
    \n-[report issue]
    \n-
    unknown_torrent_feature
    \n-
    include this bit if your plugin needs to have on_unknown_torrent()\n-called even if there is no active torrent in the session
    \n-
    \n-[report issue]
    \n+

    restore the hasher state to be as if the hasher has just been\n+default constructed.

    \n+[report issue]
    \n
    \n-
    \n-

    torrent_plugin

    \n-

    Declared in "libtorrent/extensions.hpp"

    \n-

    Torrent plugins are associated with a single torrent and have a number\n-of functions called at certain events. Many of its functions have the\n-ability to change or override the default libtorrent behavior.

    \n+
    \n+

    hasher256

    \n+

    Declared in "libtorrent/hasher.hpp"

    \n
    \n-struct torrent_plugin\n+class hasher256\n {\n-   virtual std::shared_ptr<peer_plugin> new_connection (peer_connection_handle const&);\n-   virtual void on_piece_pass (piece_index_t);\n-   virtual void on_piece_failed (piece_index_t);\n-   virtual void tick ();\n-   virtual bool on_resume ();\n-   virtual bool on_pause ();\n-   virtual void on_files_checked ();\n-   virtual void on_state (torrent_status::state_t);\n-   virtual void on_add_peer (tcp::endpoint const&,\n-      peer_source_flags_t, add_peer_flags_t);\n-\n-   static constexpr add_peer_flags_t first_time  = 1_bit;\n-   static constexpr add_peer_flags_t filtered  = 2_bit;\n+   hasher256 ();\n+   explicit hasher256 (span<char const> data);\n+   hasher256 (char const* data, int len);\n+   hasher256& operator= (hasher256 const&) &;\n+   hasher256 (hasher256 const&);\n+   hasher256& update (char const* data, int len);\n+   hasher256& update (span<char const> data);\n+   sha256_hash final ();\n+   void reset ();\n+   ~hasher256 ();\n };\n 
    \n-[report issue]
    \n-

    new_connection()

    \n-
    \n-virtual std::shared_ptr<peer_plugin> new_connection (peer_connection_handle const&);\n-
    \n-

    This function is called each time a new peer is connected to the torrent. You\n-may choose to ignore this by just returning a default constructed\n-shared_ptr (in which case you don't need to override this member\n-function).

    \n-

    If you need an extension to the peer connection (which most plugins do) you\n-are supposed to return an instance of your peer_plugin class. Which in\n-turn will have its hook functions called on event specific to that peer.

    \n-

    The peer_connection_handle will be valid as long as the shared_ptr\n-is being held by the torrent object. So, it is generally a good idea to not\n-keep a shared_ptr to your own peer_plugin. If you want to keep references\n-to it, use weak_ptr.

    \n-

    If this function throws an exception, the connection will be closed.

    \n-\n-[report issue]
    \n-
    \n-

    on_piece_pass() on_piece_failed()

    \n-
    \n-virtual void on_piece_pass (piece_index_t);\n-virtual void on_piece_failed (piece_index_t);\n-
    \n-

    These hooks are called when a piece passes the hash check or fails the hash\n-check, respectively. The index is the piece index that was downloaded.\n-It is possible to access the list of peers that participated in sending the\n-piece through the torrent and the piece_picker.

    \n-[report issue]
    \n-
    \n-

    tick()

    \n-
    \n-virtual void tick ();\n-
    \n-

    This hook is called approximately once per second. It is a way of making it\n-easy for plugins to do timed events, for sending messages or whatever.

    \n-\n-[report issue]
    \n-
    \n-

    on_pause() on_resume()

    \n+\n+[report issue]
    \n+

    operator=() hasher256()

    \n
    \n-virtual bool on_resume ();\n-virtual bool on_pause ();\n+explicit hasher256 (span<char const> data);\n+hasher256 (char const* data, int len);\n+hasher256& operator= (hasher256 const&) &;\n+hasher256 (hasher256 const&);\n 
    \n-

    These hooks are called when the torrent is paused and resumed respectively.\n-The return value indicates if the event was handled. A return value of\n-true indicates that it was handled, and no other plugin after this one\n-will have this hook function called, and the standard handler will also not be\n-invoked. So, returning true effectively overrides the standard behavior of\n-pause or resume.

    \n-

    Note that if you call pause() or resume() on the torrent from your\n-handler it will recurse back into your handler, so in order to invoke the\n-standard handler, you have to keep your own state on whether you want standard\n-behavior or overridden behavior.

    \n-[report issue]
    \n-
    \n-

    on_files_checked()

    \n+

    this is the same as default constructing followed by a call to\n+update(data, len).

    \n+[report issue]
    \n+
    \n+

    update()

    \n
    \n-virtual void on_files_checked ();\n+hasher256& update (char const* data, int len);\n+hasher256& update (span<char const> data);\n 
    \n-

    This function is called when the initial files of the torrent have been\n-checked. If there are no files to check, this function is called immediately.

    \n-

    i.e. This function is always called when the torrent is in a state where it\n-can start downloading.

    \n-[report issue]
    \n-
    \n-

    on_state()

    \n+

    append the following bytes to what is being hashed

    \n+[report issue]
    \n+
    \n+

    final()

    \n
    \n-virtual void on_state (torrent_status::state_t);\n+sha256_hash final ();\n 
    \n-

    called when the torrent changes state\n-the state is one of torrent_status::state_t\n-enum members

    \n-[report issue]
    \n-
    \n-

    on_add_peer()

    \n+

    returns the SHA-1 digest of the buffers previously passed to\n+update() and the hasher constructor.

    \n+[report issue]
    \n+
    \n+

    reset()

    \n
    \n-virtual void on_add_peer (tcp::endpoint const&,\n-      peer_source_flags_t, add_peer_flags_t);\n+void reset ();\n 
    \n-

    called every time a new peer is added to the peer list.\n-This is before the peer is connected to. For flags, see\n-torrent_plugin::flags_t. The source argument refers to\n-the source where we learned about this peer from. It's a\n-bitmask, because many sources may have told us about the same\n-peer. For peer source flags, see peer_info::peer_source_flags.

    \n-[report issue]
    \n-
    first_time
    \n-
    this is the first time we see this peer
    \n-
    \n-[report issue]
    \n-
    filtered
    \n-
    this peer was not added because it was\n-filtered by the IP filter
    \n-
    \n-[report issue]
    \n+

    restore the hasher state to be as if the hasher has just been\n+default constructed.

    \n+[report issue]
    \n
    \n-
    \n-

    peer_plugin

    \n-

    Declared in "libtorrent/extensions.hpp"

    \n-

    peer plugins are associated with a specific peer. A peer could be\n-both a regular bittorrent peer (bt_peer_connection) or one of the\n-web seed connections (web_peer_connection or http_seed_connection).\n-In order to only attach to certain peers, make your\n-torrent_plugin::new_connection only return a plugin for certain peer\n-connection types

    \n+
    \n+

    peer_class_type_filter

    \n+

    Declared in "libtorrent/peer_class_type_filter.hpp"

    \n+

    peer_class_type_filter is a simple container for rules for adding and subtracting\n+peer-classes from peers. It is applied after the peer class filter is applied (which\n+is based on the peer's IP address).

    \n
    \n-struct peer_plugin\n+struct peer_class_type_filter\n {\n-   virtual string_view type () const;\n-   virtual void add_handshake (entry&);\n-   virtual void on_disconnect (error_code const&);\n-   virtual void on_connected ();\n-   virtual bool on_handshake (span<char const>);\n-   virtual bool on_extension_handshake (bdecode_node const&);\n-   virtual bool on_request (peer_request const&);\n-   virtual bool on_have_none ();\n-   virtual bool on_have_all ();\n-   virtual bool on_interested ();\n-   virtual bool on_choke ();\n-   virtual bool on_unchoke ();\n-   virtual bool on_bitfield (bitfield const& /*bitfield*/);\n-   virtual bool on_not_interested ();\n-   virtual bool on_dont_have (piece_index_t);\n-   virtual bool on_have (piece_index_t);\n-   virtual bool on_allowed_fast (piece_index_t);\n-   virtual bool on_piece (peer_request const& /*piece*/\n-      , span<char const> /*buf*/);\n-   virtual bool on_suggest (piece_index_t);\n-   virtual bool on_cancel (peer_request const&);\n-   virtual bool on_reject (peer_request const&);\n-   virtual void sent_have_all ();\n-   virtual void sent_request (peer_request const&);\n-   virtual void sent_choke ();\n-   virtual void sent_suggest (piece_index_t);\n-   virtual void sent_allow_fast (piece_index_t);\n-   virtual void sent_reject_request (peer_request const&);\n-   virtual void sent_cancel (peer_request const&);\n-   virtual void sent_have_none ();\n-   virtual void sent_have (piece_index_t);\n-   virtual void sent_interested ();\n-   virtual void sent_unchoke ();\n-   virtual void sent_piece (peer_request const&);\n-   virtual void sent_not_interested ();\n-   virtual void sent_payload (int /* bytes */);\n-   virtual bool can_disconnect (error_code const& /*ec*/);\n-   virtual bool on_extended (int /*length*/, int /*msg*/,\n-      span<char const> /*body*/);\n-   virtual bool on_unknown_message (int /*length*/, int /*msg*/,\n-      span<char const> /*body*/);\n-   virtual void on_piece_pass (piece_index_t);\n-   virtual void on_piece_failed (piece_index_t);\n-   virtual void tick ();\n-   virtual bool write_request (peer_request const&);\n+   void add (socket_type_t const st, peer_class_t const peer_class);\n+   void remove (socket_type_t const st, peer_class_t const peer_class);\n+   void disallow (socket_type_t const st, peer_class_t const peer_class);\n+   void allow (socket_type_t const st, peer_class_t const peer_class);\n+   std::uint32_t apply (socket_type_t const st, std::uint32_t peer_class_mask);\n+   friend bool operator== (peer_class_type_filter const& lhs\n+      , peer_class_type_filter const& rhs);\n+\n+   enum socket_type_t\n+   {\n+      tcp_socket,\n+      utp_socket,\n+      ssl_tcp_socket,\n+      ssl_utp_socket,\n+      i2p_socket,\n+      num_socket_types,\n+   };\n };\n 
    \n-[report issue]
    \n-

    type()

    \n-
    \n-virtual string_view type () const;\n-
    \n-

    This function is expected to return the name of\n-the plugin.

    \n-[report issue]
    \n-
    \n-

    add_handshake()

    \n-
    \n-virtual void add_handshake (entry&);\n-
    \n-

    can add entries to the extension handshake\n-this is not called for web seeds

    \n-[report issue]
    \n-
    \n-

    on_disconnect()

    \n-
    \n-virtual void on_disconnect (error_code const&);\n-
    \n-

    called when the peer is being disconnected.

    \n-[report issue]
    \n-
    \n-

    on_connected()

    \n-
    \n-virtual void on_connected ();\n-
    \n-

    called when the peer is successfully connected. Note that\n-incoming connections will have been connected by the time\n-the peer plugin is attached to it, and won't have this hook\n-called.

    \n-[report issue]
    \n-
    \n-

    on_handshake()

    \n-
    \n-virtual bool on_handshake (span<char const>);\n-
    \n-

    this is called when the initial bittorrent handshake is received.\n-Returning false means that the other end doesn't support this extension\n-and will remove it from the list of plugins. this is not called for web\n-seeds

    \n-[report issue]
    \n-
    \n-

    on_extension_handshake()

    \n-
    \n-virtual bool on_extension_handshake (bdecode_node const&);\n-
    \n-

    called when the extension handshake from the other end is received\n-if this returns false, it means that this extension isn't\n-supported by this peer. It will result in this peer_plugin\n-being removed from the peer_connection and destructed.\n-this is not called for web seeds

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-[report issue]
    \n-
    \n-

    on_not_interested() on_choke() on_unchoke() on_dont_have() on_allowed_fast() on_have_all() on_have() on_bitfield() on_request() on_have_none() on_interested()

    \n-
    \n-virtual bool on_request (peer_request const&);\n-virtual bool on_have_none ();\n-virtual bool on_have_all ();\n-virtual bool on_interested ();\n-virtual bool on_choke ();\n-virtual bool on_unchoke ();\n-virtual bool on_bitfield (bitfield const& /*bitfield*/);\n-virtual bool on_not_interested ();\n-virtual bool on_dont_have (piece_index_t);\n-virtual bool on_have (piece_index_t);\n-virtual bool on_allowed_fast (piece_index_t);\n-
    \n-

    returning true from any of the message handlers\n-indicates that the plugin has handled the message.\n-it will break the plugin chain traversing and not let\n-anyone else handle the message, including the default\n-handler.

    \n-[report issue]
    \n-
    \n-

    on_piece()

    \n-
    \n-virtual bool on_piece (peer_request const& /*piece*/\n-      , span<char const> /*buf*/);\n-
    \n-

    This function is called when the peer connection is receiving\n-a piece. buf points (non-owning pointer) to the data in an\n-internal immutable disk buffer. The length of the data is specified\n-in the length member of the piece parameter.\n-returns true to indicate that the piece is handled and the\n-rest of the logic should be ignored.

    \n-\n-\n-\n-\n-[report issue]
    \n-
    \n-

    sent_interested() sent_unchoke() sent_have() sent_piece() sent_not_interested()

    \n-
    \n-virtual void sent_have (piece_index_t);\n-virtual void sent_interested ();\n-virtual void sent_unchoke ();\n-virtual void sent_piece (peer_request const&);\n-virtual void sent_not_interested ();\n-
    \n-

    called after a choke message has been sent to the peer

    \n-[report issue]
    \n-
    \n-

    sent_payload()

    \n-
    \n-virtual void sent_payload (int /* bytes */);\n-
    \n-

    called after piece data has been sent to the peer\n-this can be used for stats book keeping

    \n-[report issue]
    \n-
    \n-

    can_disconnect()

    \n-
    \n-virtual bool can_disconnect (error_code const& /*ec*/);\n-
    \n-

    called when libtorrent think this peer should be disconnected.\n-if the plugin returns false, the peer will not be disconnected.

    \n-[report issue]
    \n-
    \n-

    on_extended()

    \n-
    \n-virtual bool on_extended (int /*length*/, int /*msg*/,\n-      span<char const> /*body*/);\n-
    \n-

    called when an extended message is received. If returning true,\n-the message is not processed by any other plugin and if false\n-is returned the next plugin in the chain will receive it to\n-be able to handle it. This is not called for web seeds.\n-thus function may be called more than once per incoming message, but\n-only the last of the calls will the body size equal the length.\n-i.e. Every time another fragment of the message is received, this\n-function will be called, until finally the whole message has been\n-received. The purpose of this is to allow early disconnects for invalid\n-messages and for reporting progress of receiving large messages.

    \n-[report issue]
    \n-
    \n-

    on_unknown_message()

    \n-
    \n-virtual bool on_unknown_message (int /*length*/, int /*msg*/,\n-      span<char const> /*body*/);\n-
    \n-

    this is not called for web seeds

    \n-\n-[report issue]
    \n-
    \n-

    on_piece_pass() on_piece_failed()

    \n-
    \n-virtual void on_piece_pass (piece_index_t);\n-virtual void on_piece_failed (piece_index_t);\n-
    \n-

    called when a piece that this peer participated in either\n-fails or passes the hash_check

    \n-[report issue]
    \n-
    \n-

    tick()

    \n-
    \n-virtual void tick ();\n-
    \n-

    called approximately once every second

    \n-[report issue]
    \n-
    \n-

    write_request()

    \n+\n+[report issue]
    \n+

    remove() add()

    \n
    \n-virtual bool write_request (peer_request const&);\n+void add (socket_type_t const st, peer_class_t const peer_class);\n+void remove (socket_type_t const st, peer_class_t const peer_class);\n 
    \n-

    called each time a request message is to be sent. If true\n-is returned, the original request message won't be sent and\n-no other plugin will have this function called.

    \n-[report issue]
    \n-
    \n-
    \n-

    crypto_plugin

    \n-

    Declared in "libtorrent/extensions.hpp"

    \n+

    add() and remove() adds and removes a peer class to be added\n+to new peers based on socket type.

    \n+\n+[report issue]
    \n+
    \n+

    allow() disallow()

    \n
    \n-struct crypto_plugin\n-{\n-   virtual void set_outgoing_key (span<char const> key) = 0;\n-   virtual void set_incoming_key (span<char const> key) = 0;\n-   encrypt (span<span<char>> /*send_vec*/) = 0;\n-   virtual std::tuple<int, int, int> decrypt (span<span<char>> /*receive_vec*/) = 0;\n-};\n+void disallow (socket_type_t const st, peer_class_t const peer_class);\n+void allow (socket_type_t const st, peer_class_t const peer_class);\n 
    \n-[report issue]
    \n-

    decrypt()

    \n+

    disallow() and allow() adds and removes a peer class to be\n+removed from new peers based on socket type.

    \n+

    The peer_class argument cannot be greater than 31. The bitmasks representing\n+peer classes in the peer_class_type_filter are 32 bits.

    \n+[report issue]
    \n+
    \n+

    apply()

    \n
    \n-virtual std::tuple<int, int, int> decrypt (span<span<char>> /*receive_vec*/) = 0;\n+std::uint32_t apply (socket_type_t const st, std::uint32_t peer_class_mask);\n 
    \n-

    decrypt the provided buffers.\n-returns is a tuple representing the values\n-(consume, produce, packet_size)

    \n-

    consume is set to the number of bytes which should be trimmed from the\n-head of the buffers, default is 0

    \n-

    produce is set to the number of bytes of payload which are now ready to\n-be sent to the upper layer. default is the number of bytes passed in receive_vec

    \n-

    packet_size is set to the minimum number of bytes which must be read to\n-advance the next step of decryption. default is 0

    \n-[report issue]
    \n+

    takes a bitmask of peer classes and returns a new bitmask of\n+peer classes after the rules have been applied, based on the socket type argument\n+(st).

    \n+[report issue]
    \n+
    \n+

    enum socket_type_t

    \n+

    Declared in "libtorrent/peer_class_type_filter.hpp"

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    namevaluedescription
    tcp_socket0these match the socket types from socket_type.hpp\n+shifted one down
    utp_socket1 
    ssl_tcp_socket2 
    ssl_utp_socket3 
    i2p_socket4 
    num_socket_types5 
    \n+[report issue]
    \n
    \n-
    \n-

    peer_connection_handle

    \n-

    Declared in "libtorrent/peer_connection_handle.hpp"

    \n-

    the peer_connection_handle class provides a handle to the internal peer\n-connection object, to be used by plugins. This is a low level interface that\n-may not be stable across libtorrent versions

    \n-
    \n-struct peer_connection_handle\n-{\n-   explicit peer_connection_handle (std::weak_ptr<peer_connection> impl);\n-   connection_type type () const;\n-   void add_extension (std::shared_ptr<peer_plugin>);\n-   peer_plugin const* find_plugin (string_view type) const;\n-   bool is_seed () const;\n-   bool upload_only () const;\n-   bool has_piece (piece_index_t i) const;\n-   peer_id const& pid () const;\n-   bool is_choked () const;\n-   bool is_interesting () const;\n-   bool is_peer_interested () const;\n-   bool has_peer_choked () const;\n-   void choke_this_peer ();\n-   void maybe_unchoke_this_peer ();\n-   void get_peer_info (peer_info& p) const;\n-   torrent_handle associated_torrent () const;\n-   tcp::endpoint const& remote () const;\n-   tcp::endpoint local_endpoint () const;\n-   bool is_connecting () const;\n-   bool is_disconnecting () const;\n-   void disconnect (error_code const& ec, operation_t op\n-      , disconnect_severity_t = peer_connection_interface::normal);\n-   bool is_outgoing () const;\n-   bool ignore_unchoke_slots () const;\n-   bool on_local_network () const;\n-   bool failed () const;\n-   void peer_log (peer_log_alert::direction_t direction\n-      , char const* event, char const* fmt = "", ...) const TORRENT_FORMAT(4,5);\n-   bool should_log (peer_log_alert::direction_t direction) const;\n-   bool can_disconnect (error_code const& ec) const;\n-   bool has_metadata () const;\n-   bool in_handshake () const;\n-   void send_buffer (char const* begin, int size);\n-   time_point time_of_last_unchoke () const;\n-   std::time_t last_seen_complete () const;\n-   bool operator< (peer_connection_handle const& o) const;\n-   bool operator!= (peer_connection_handle const& o) const;\n-   bool operator== (peer_connection_handle const& o) const;\n-   std::shared_ptr<peer_connection> native_handle () const;\n-};\n-
    \n-[report issue]
    \n-
    \n-

    bt_peer_connection_handle

    \n-

    Declared in "libtorrent/peer_connection_handle.hpp"

    \n-

    The bt_peer_connection_handle provides a handle to the internal bittorrent\n-peer connection object to plugins. It's low level and may not be a stable API\n-across libtorrent versions.

    \n+
    \n+

    peer_class_info

    \n+

    Declared in "libtorrent/peer_class.hpp"

    \n+

    holds settings for a peer class. Used in set_peer_class() and\n+get_peer_class() calls.

    \n
    \n-struct bt_peer_connection_handle : peer_connection_handle\n+struct peer_class_info\n {\n-   explicit bt_peer_connection_handle (peer_connection_handle pc);\n-   bool support_extensions () const;\n-   bool packet_finished () const;\n-   bool supports_encryption () const;\n-   void switch_recv_crypto (std::shared_ptr<crypto_plugin> crypto);\n-   void switch_send_crypto (std::shared_ptr<crypto_plugin> crypto);\n-   std::shared_ptr<bt_peer_connection> native_handle () const;\n+   bool ignore_unchoke_slots;\n+   int connection_limit_factor;\n+   std::string label;\n+   int upload_limit;\n+   int download_limit;\n+   int upload_priority;\n+   int download_priority;\n };\n 
    \n-[report issue]
    \n-
    \n-

    create_ut_pex_plugin()

    \n-

    Declared in "libtorrent/extensions/ut_pex.hpp"

    \n-
    \n-std::shared_ptr<torrent_plugin> create_ut_pex_plugin (torrent_handle const&, client_data_t);\n-
    \n-

    constructor function for the ut_pex extension. The ut_pex\n-extension allows peers to gossip about their connections, allowing\n-the swarm stay well connected and peers aware of more peers in the\n-swarm. This extension is enabled by default unless explicitly disabled in\n-the session constructor.

    \n-

    This can either be passed in the add_torrent_params::extensions field, or\n-via torrent_handle::add_extension().

    \n-[report issue]
    \n-
    \n-

    create_ut_metadata_plugin()

    \n-

    Declared in "libtorrent/extensions/ut_metadata.hpp"

    \n-
    \n-std::shared_ptr<torrent_plugin> create_ut_metadata_plugin (torrent_handle const&, client_data_t);\n-
    \n-

    constructor function for the ut_metadata extension. The ut_metadata\n-extension allows peers to request the .torrent file (or more\n-specifically the info-dictionary of the .torrent file) from each\n-other. This is the main building block in making magnet links work.\n-This extension is enabled by default unless explicitly disabled in\n-the session constructor.

    \n-

    This can either be passed in the add_torrent_params::extensions field, or\n-via torrent_handle::add_extension().

    \n-[report issue]
    \n-
    \n-

    create_smart_ban_plugin()

    \n-

    Declared in "libtorrent/extensions/smart_ban.hpp"

    \n-
    \n-std::shared_ptr<torrent_plugin> create_smart_ban_plugin (torrent_handle const&, client_data_t);\n-
    \n-

    constructor function for the smart ban extension. The extension keeps\n-track of the data peers have sent us for failing pieces and once the\n-piece completes and passes the hash check bans the peers that turned\n-out to have sent corrupt data.\n-This function can either be passed in the add_torrent_params::extensions\n-field, or via torrent_handle::add_extension().

    \n+[report issue]
    \n+
    ignore_unchoke_slots
    \n+
    ignore_unchoke_slots determines whether peers should always\n+unchoke a peer, regardless of the choking algorithm, or if it should\n+honor the unchoke slot limits. It's used for local peers by default.\n+If any of the peer classes a peer belongs to has this set to true,\n+that peer will be unchoked at all times.
    \n+
    \n+[report issue]
    \n+
    connection_limit_factor
    \n+
    adjusts the connection limit (global and per torrent) that applies to\n+this peer class. By default, local peers are allowed to exceed the\n+normal connection limit for instance. This is specified as a percent\n+factor. 100 makes the peer class apply normally to the limit. 200\n+means as long as there are fewer connections than twice the limit, we\n+accept this peer. This factor applies both to the global connection\n+limit and the per-torrent limit. Note that if not used carefully one\n+peer class can potentially completely starve out all other over time.
    \n+
    \n+[report issue]
    \n+
    label
    \n+
    not used by libtorrent. It's intended as a potentially user-facing\n+identifier of this peer class.
    \n+
    \n+\n+[report issue]
    \n+
    upload_limit download_limit
    \n+
    transfer rates limits for the whole peer class. They are specified in\n+bytes per second and apply to the sum of all peers that are members of\n+this class.
    \n+
    \n+\n+[report issue]
    \n+
    upload_priority download_priority
    \n+
    relative priorities used by the bandwidth allocator in the rate\n+limiter. If no rate limits are in use, the priority is not used\n+either. Priorities start at 1 (0 is not a valid priority) and may not\n+exceed 255.
    \n+
    \n [report issue]
    \n
    \n

    storage_error

    \n

    Declared in "libtorrent/error_code.hpp"

    \n

    used by storage to return errors\n also includes which underlying file the\n error happened on

    \n
    \n struct storage_error\n {\n    explicit operator bool () const;\n-   file_index_t file () const;\n    void file (file_index_t f);\n+   file_index_t file () const;\n \n    error_code ec;\n    operation_t operation;\n };\n 
    \n [report issue]
    \n

    bool()

    \n@@ -19014,16 +19014,16 @@\n \n

    explicitly converts to true if this object represents an error, and\n false if it does not.

    \n [report issue]
    \n
    \n

    file()

    \n
    \n-file_index_t file () const;\n void file (file_index_t f);\n+file_index_t file () const;\n 
    \n

    set and query the index (in the torrent) of the file this error\n occurred on. This may also have special values defined in\n torrent_status.

    \n [report issue]
    \n
    ec
    \n
    the error that occurred
    \n@@ -19037,29 +19037,37 @@\n
    \n
    \n

    pcp_category()

    \n

    Declared in "libtorrent/natpmp.hpp"

    \n
    \n boost::system::error_category& pcp_category ();\n 
    \n+[report issue]
    \n+
    \n+

    bdecode_category()

    \n+

    Declared in "libtorrent/bdecode.hpp"

    \n+
    \n+boost::system::error_category& bdecode_category ();\n+
    \n [report issue]
    \n
    \n

    gzip_category()

    \n

    Declared in "libtorrent/gzip.hpp"

    \n
    \n boost::system::error_category& gzip_category ();\n 
    \n

    get the error_category for zip errors

    \n-[report issue]
    \n-
    \n-

    bdecode_category()

    \n-

    Declared in "libtorrent/bdecode.hpp"

    \n+[report issue]
    \n+
    \n+

    socks_category()

    \n+

    Declared in "libtorrent/socks5_stream.hpp"

    \n
    \n-boost::system::error_category& bdecode_category ();\n+boost::system::error_category& socks_category ();\n 
    \n+

    returns the error_category for SOCKS5 errors

    \n [report issue]
    \n
    \n

    upnp_category()

    \n

    Declared in "libtorrent/upnp.hpp"

    \n
    \n boost::system::error_category& upnp_category ();\n 
    \n@@ -19068,22 +19076,14 @@\n
    \n

    i2p_category()

    \n

    Declared in "libtorrent/i2p_stream.hpp"

    \n
    \n boost::system::error_category& i2p_category ();\n 
    \n

    returns the error category for I2P errors

    \n-[report issue]
    \n-
    \n-

    socks_category()

    \n-

    Declared in "libtorrent/socks5_stream.hpp"

    \n-
    \n-boost::system::error_category& socks_category ();\n-
    \n-

    returns the error_category for SOCKS5 errors

    \n [report issue]
    \n
    \n

    libtorrent_category()

    \n

    Declared in "libtorrent/error_code.hpp"

    \n
    \n boost::system::error_category& libtorrent_category ();\n 
    \n@@ -19171,14 +19171,69 @@\n  \n \n \n \n [report issue]
    \n
    \n

    enum error_code_enum

    \n+

    Declared in "libtorrent/bdecode.hpp"

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    namevaluedescription
    no_error0Not an error
    expected_digit1expected digit in bencoded string
    expected_colon2expected colon in bencoded string
    unexpected_eof3unexpected end of file in bencoded string
    expected_value4expected value (list, dict, int or string) in bencoded string
    depth_exceeded5bencoded recursion depth limit exceeded
    limit_exceeded6bencoded item count limit exceeded
    overflow7integer overflow
    error_code_max8the number of error codes
    \n+[report issue]
    \n+
    \n+

    enum error_code_enum

    \n

    Declared in "libtorrent/gzip.hpp"

    \n \n \n \n \n \n \n@@ -19256,66 +19311,74 @@\n \n \n \n \n \n \n
    error_code_max16the number of error codes
    \n-[report issue]
    \n-
    \n-

    enum error_code_enum

    \n-

    Declared in "libtorrent/bdecode.hpp"

    \n+[report issue]
    \n+
    \n+

    enum socks_error_code

    \n+

    Declared in "libtorrent/socks5_stream.hpp"

    \n \n \n-\n-\n-\n+\n+\n+\n \n \n \n \n \n \n \n \n \n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n+\n+\n+\n+\n+\n+\n+\n+\n \n \n
    namevaluedescription
    no_error0Not an error 
    expected_digit
    unsupported_version1expected digit in bencoded string 
    expected_colon
    unsupported_authentication_method2expected colon in bencoded string 
    unexpected_eof
    unsupported_authentication_version3unexpected end of file in bencoded string 
    expected_value
    authentication_error4expected value (list, dict, int or string) in bencoded string 
    depth_exceeded
    username_required5bencoded recursion depth limit exceeded 
    limit_exceeded
    general_failure6bencoded item count limit exceeded 
    overflow
    command_not_supported7integer overflow 
    error_code_max
    no_identd8the number of error codes 
    identd_error9 
    num_errors10 
    \n [report issue]
    \n
    \n

    enum error_code_enum

    \n

    Declared in "libtorrent/upnp.hpp"

    \n@@ -19439,77 +19502,14 @@\n \n num_errors\n 9\n  \n \n \n \n-[report issue]
    \n-
    \n-

    enum socks_error_code

    \n-

    Declared in "libtorrent/socks5_stream.hpp"

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-
    namevaluedescription
    no_error0 
    unsupported_version1 
    unsupported_authentication_method2 
    unsupported_authentication_version3 
    authentication_error4 
    username_required5 
    general_failure6 
    command_not_supported7 
    no_identd8 
    identd_error9 
    num_errors10 
    \n [report issue]
    \n
    \n

    enum error_code_enum

    \n

    Declared in "libtorrent/error_code.hpp"

    \n \n \n \n@@ -20592,27 +20592,16 @@\n [report issue]\n
    \n

    counters()

    \n
    \n virtual dht_storage_counters counters () const = 0;\n 
    \n

    return stats counters for the store

    \n-[report issue]
    \n-\n-
    \n-

    dht_default_storage_constructor()

    \n-

    Declared in "libtorrent/kademlia/dht_storage.hpp"

    \n-
    \n-std::unique_ptr<dht_storage_interface> dht_default_storage_constructor (\n-   settings_interface const& settings);\n-
    \n-

    constructor for the default DHT storage. The DHT storage is responsible\n-for maintaining peers and mutable and immutable items announced and\n-stored/put to the DHT node.

    \n [report issue]
    \n+\n
    \n

    sign_mutable_item()

    \n

    Declared in "libtorrent/kademlia/item.hpp"

    \n
    \n signature sign_mutable_item (\n    span<char const> v\n    , span<char const> salt\n@@ -20622,14 +20611,25 @@\n 
    \n

    given a byte range v and an optional byte range salt, a\n sequence number, public key pk (must be 32 bytes) and a secret key\n sk (must be 64 bytes), this function produces a signature which\n is written into a 64 byte buffer pointed to by sig. The caller\n is responsible for allocating the destination buffer that's passed in\n as the sig argument. Typically it would be allocated on the stack.

    \n+[report issue]
    \n+
    \n+

    dht_default_storage_constructor()

    \n+

    Declared in "libtorrent/kademlia/dht_storage.hpp"

    \n+
    \n+std::unique_ptr<dht_storage_interface> dht_default_storage_constructor (\n+   settings_interface const& settings);\n+
    \n+

    constructor for the default DHT storage. The DHT storage is responsible\n+for maintaining peers and mutable and immutable items announced and\n+stored/put to the DHT node.

    \n [report issue]
    \n
    \n

    announce_flags_t

    \n

    Declared in "libtorrent/kademlia/announce_flags.hpp"

    \n
    \n
    seed
    \n
    announce to DHT as a seed
    \n@@ -20640,74 +20640,74 @@\n your source UDP port as your listen port, rather than the one specified in\n the message. This may improve the chances of traversing NATs when using uTP.\n
    \n
    \n
    ssl_torrent
    \n
    Specify the port number for the SSL listen socket in the DHT announce.
    \n
    \n+[report issue]
    \n+
    \n+

    read_resume_data()

    \n+

    Declared in "libtorrent/read_resume_data.hpp"

    \n+
    \n+add_torrent_params read_resume_data (span<char const> buffer\n+   , load_torrent_limits const& cfg = {});\n+add_torrent_params read_resume_data (bdecode_node const& rd\n+   , int piece_limit = 0x200000);\n+add_torrent_params read_resume_data (span<char const> buffer\n+   , error_code& ec, load_torrent_limits const& cfg = {});\n+add_torrent_params read_resume_data (bdecode_node const& rd\n+   , error_code& ec, int piece_limit = 0x200000);\n+
    \n+

    these functions are used to parse resume data and populate the appropriate\n+fields in an add_torrent_params object. This object can then be used to add\n+the actual torrent_info object to and pass to session::add_torrent() or\n+session::async_add_torrent().

    \n+

    If the client wants to override any field that was loaded from the resume\n+data, e.g. save_path, those fields must be changed after loading resume\n+data but before adding the torrent.

    \n+

    The piece_limit parameter determines the largest number of pieces\n+allowed in the torrent that may be loaded as part of the resume data, if\n+it contains an info field. The overloads that take a flat buffer are\n+instead configured with limits on torrent sizes via load_torrent limits.

    \n+

    In order to support large torrents, it may also be necessary to raise the\n+settings_pack::max_piece_count setting and pass a higher limit to calls\n+to torrent_info::parse_info_section().

    \n \n [report issue]
    \n
    \n

    write_resume_data() write_resume_data_buf()

    \n

    Declared in "libtorrent/write_resume_data.hpp"

    \n
    \n-entry write_resume_data (add_torrent_params const& atp);\n std::vector<char> write_resume_data_buf (add_torrent_params const& atp);\n+entry write_resume_data (add_torrent_params const& atp);\n 
    \n

    this function turns the resume data in an add_torrent_params object\n into a bencoded structure

    \n-\n-[report issue]
    \n-
    \n-

    write_torrent_file() write_torrent_file_buf()

    \n+\n+[report issue]
    \n+
    \n+

    write_torrent_file_buf() write_torrent_file()

    \n

    Declared in "libtorrent/write_resume_data.hpp"

    \n
    \n-entry write_torrent_file (add_torrent_params const& atp, write_torrent_flags_t flags);\n entry write_torrent_file (add_torrent_params const& atp);\n+entry write_torrent_file (add_torrent_params const& atp, write_torrent_flags_t flags);\n std::vector<char> write_torrent_file_buf (add_torrent_params const& atp\n    , write_torrent_flags_t flags);\n 
    \n

    writes only the fields to create a .torrent file. This function may fail\n with a std::system_error exception if:

    \n
      \n
    • The add_torrent_params object passed to this function does not contain the\n info dictionary (the ti field)
    • \n
    • The piece layers are not complete for all files that need them
    • \n
    \n

    The write_torrent_file_buf() overload returns the torrent file in\n bencoded buffer form. This overload may be faster at the expense of lost\n flexibility to add custom fields.

    \n-[report issue]
    \n-
    \n-

    read_resume_data()

    \n-

    Declared in "libtorrent/read_resume_data.hpp"

    \n-
    \n-add_torrent_params read_resume_data (bdecode_node const& rd\n-   , int piece_limit = 0x200000);\n-add_torrent_params read_resume_data (bdecode_node const& rd\n-   , error_code& ec, int piece_limit = 0x200000);\n-add_torrent_params read_resume_data (span<char const> buffer\n-   , error_code& ec, load_torrent_limits const& cfg = {});\n-add_torrent_params read_resume_data (span<char const> buffer\n-   , load_torrent_limits const& cfg = {});\n-
    \n-

    these functions are used to parse resume data and populate the appropriate\n-fields in an add_torrent_params object. This object can then be used to add\n-the actual torrent_info object to and pass to session::add_torrent() or\n-session::async_add_torrent().

    \n-

    If the client wants to override any field that was loaded from the resume\n-data, e.g. save_path, those fields must be changed after loading resume\n-data but before adding the torrent.

    \n-

    The piece_limit parameter determines the largest number of pieces\n-allowed in the torrent that may be loaded as part of the resume data, if\n-it contains an info field. The overloads that take a flat buffer are\n-instead configured with limits on torrent sizes via load_torrent limits.

    \n-

    In order to support large torrents, it may also be necessary to raise the\n-settings_pack::max_piece_count setting and pass a higher limit to calls\n-to torrent_info::parse_info_section().

    \n [report issue]
    \n
    \n

    write_torrent_flags_t

    \n

    Declared in "libtorrent/write_resume_data.hpp"

    \n
    \n
    allow_missing_piece_layer
    \n
    this makes write_torrent_file() not fail when attempting to write a\n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,211 +1,18 @@\n >\n _\b[_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b _\bl_\bo_\bg_\bo_\b]\n V\bVe\ber\brs\bsi\bio\bon\bn:\b: 2.0.11\n _\bh_\bo_\bm_\be\n Table of contents\n- * _\bc_\bo_\bu_\bn_\bt_\be_\br_\bs\n- o _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b[_\b]_\b(_\b)_\b _\bi_\bn_\bc_\b__\bs_\bt_\ba_\bt_\bs_\b__\bc_\bo_\bu_\bn_\bt_\be_\br_\b(_\b)\n- * _\bs_\bt_\ba_\bt_\bs_\b__\bm_\be_\bt_\br_\bi_\bc\n- * _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bs_\bt_\ba_\bt_\bs_\b__\bm_\be_\bt_\br_\bi_\bc_\bs_\b(_\b)\n- * _\bf_\bi_\bn_\bd_\b__\bm_\be_\bt_\br_\bi_\bc_\b__\bi_\bd_\bx_\b(_\b)\n- * _\be_\bn_\bu_\bm_\b _\bm_\be_\bt_\br_\bi_\bc_\b__\bt_\by_\bp_\be_\b__\bt\n- * _\bp_\be_\be_\br_\b__\br_\be_\bq_\bu_\be_\bs_\bt\n- o _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b=_\b=_\b(_\b)\n- * _\bp_\bi_\be_\bc_\be_\b__\bb_\bl_\bo_\bc_\bk\n- * _\bi_\bn_\bf_\bo_\b__\bh_\ba_\bs_\bh_\b__\bt\n- o _\bi_\bn_\bf_\bo_\b__\bh_\ba_\bs_\bh_\b__\bt_\b(_\b)\n- o _\bh_\ba_\bs_\b__\bv_\b2_\b(_\b)_\b _\bh_\ba_\bs_\b__\bv_\b1_\b(_\b)_\b _\bh_\ba_\bs_\b(_\b)\n- o _\bg_\be_\bt_\b(_\b)\n- o _\bg_\be_\bt_\b__\bb_\be_\bs_\bt_\b(_\b)\n- o _\bf_\bo_\br_\b__\be_\ba_\bc_\bh_\b(_\b)\n- * _\bp_\be_\be_\br_\b__\bi_\bn_\bf_\bo\n- o _\bi_\b2_\bp_\b__\bd_\be_\bs_\bt_\bi_\bn_\ba_\bt_\bi_\bo_\bn_\b(_\b)\n- * _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\be_\be_\br_\b__\be_\bq_\bu_\ba_\bl_\b(_\b)\n- * _\bm_\ba_\bk_\be_\b__\bm_\ba_\bg_\bn_\be_\bt_\b__\bu_\br_\bi_\b(_\b)\n- * _\bp_\ba_\br_\bs_\be_\b__\bm_\ba_\bg_\bn_\be_\bt_\b__\bu_\br_\bi_\b(_\b)\n- * _\bt_\br_\bu_\bn_\bc_\ba_\bt_\be_\b__\bf_\bi_\bl_\be_\bs_\b(_\b)\n- * _\bv_\be_\br_\bs_\bi_\bo_\bn_\b(_\b)\n- * _\bl_\bo_\ba_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bi_\bl_\be_\b(_\b)_\b _\bl_\bo_\ba_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\bs_\be_\bd_\b(_\b)_\b _\bl_\bo_\ba_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bb_\bu_\bf_\bf_\be_\br_\b(_\b)\n- * _\be_\bn_\bu_\bm_\b _\be_\bv_\be_\bn_\bt_\b__\bt\n- * _\be_\bn_\bu_\bm_\b _\bp_\bo_\br_\bt_\bm_\ba_\bp_\b__\bt_\br_\ba_\bn_\bs_\bp_\bo_\br_\bt\n- * _\be_\bn_\bu_\bm_\b _\bp_\bo_\br_\bt_\bm_\ba_\bp_\b__\bp_\br_\bo_\bt_\bo_\bc_\bo_\bl\n- * _\be_\bn_\bu_\bm_\b _\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b__\bt_\by_\bp_\be\n- * _\be_\bn_\bu_\bm_\b _\bp_\br_\bo_\bt_\bo_\bc_\bo_\bl_\b__\bv_\be_\br_\bs_\bi_\bo_\bn\n- * _\be_\bn_\bu_\bm_\b _\bs_\bo_\bc_\bk_\be_\bt_\b__\bt_\by_\bp_\be_\b__\bt\n- * _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bl_\ba_\bg_\bs_\b__\bt\n- * _\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\b__\bp_\br_\bi_\bo_\br_\bi_\bt_\by_\b__\bt\n- * _\bp_\be_\bx_\b__\bf_\bl_\ba_\bg_\bs_\b__\bt\n- * _\bi_\bn_\bt\n- * _\bc_\bh_\ba_\br_\b _\bc_\bo_\bn_\bs_\bt_\b*\n- * _\bs_\bt_\bd_\b:_\b:_\bu_\bi_\bn_\bt_\b6_\b4_\b__\bt\n- * _\bf_\bi_\bl_\be_\b__\bs_\bl_\bi_\bc_\be\n- * _\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be\n- o _\bi_\bs_\b__\bv_\ba_\bl_\bi_\bd_\b(_\b)\n- o _\br_\be_\bs_\be_\br_\bv_\be_\b(_\b)\n- o _\ba_\bd_\bd_\b__\bf_\bi_\bl_\be_\b(_\b)_\b _\ba_\bd_\bd_\b__\bf_\bi_\bl_\be_\b__\bb_\bo_\br_\br_\bo_\bw_\b(_\b)\n- o _\br_\be_\bn_\ba_\bm_\be_\b__\bf_\bi_\bl_\be_\b(_\b)\n- o _\bm_\ba_\bp_\b__\bb_\bl_\bo_\bc_\bk_\b(_\b)\n- o _\bm_\ba_\bp_\b__\bf_\bi_\bl_\be_\b(_\b)\n- o _\bn_\bu_\bm_\b__\bf_\bi_\bl_\be_\bs_\b(_\b)\n- o _\be_\bn_\bd_\b__\bf_\bi_\bl_\be_\b(_\b)\n- o _\bf_\bi_\bl_\be_\b__\br_\ba_\bn_\bg_\be_\b(_\b)\n- o _\bt_\bo_\bt_\ba_\bl_\b__\bs_\bi_\bz_\be_\b(_\b)\n- o _\bs_\be_\bt_\b__\bn_\bu_\bm_\b__\bp_\bi_\be_\bc_\be_\bs_\b(_\b)_\b _\bn_\bu_\bm_\b__\bp_\bi_\be_\bc_\be_\bs_\b(_\b)\n- o _\be_\bn_\bd_\b__\bp_\bi_\be_\bc_\be_\b(_\b)\n- o _\bl_\ba_\bs_\bt_\b__\bp_\bi_\be_\bc_\be_\b(_\b)\n- o _\bp_\bi_\be_\bc_\be_\b__\br_\ba_\bn_\bg_\be_\b(_\b)\n- o _\bp_\bi_\be_\bc_\be_\b__\bl_\be_\bn_\bg_\bt_\bh_\b(_\b)_\b _\bs_\be_\bt_\b__\bp_\bi_\be_\bc_\be_\b__\bl_\be_\bn_\bg_\bt_\bh_\b(_\b)\n- o _\bp_\bi_\be_\bc_\be_\b__\bs_\bi_\bz_\be_\b(_\b)\n- o _\bp_\bi_\be_\bc_\be_\b__\bs_\bi_\bz_\be_\b2_\b(_\b)\n- o _\bb_\bl_\bo_\bc_\bk_\bs_\b__\bi_\bn_\b__\bp_\bi_\be_\bc_\be_\b2_\b(_\b)\n- o _\bb_\bl_\bo_\bc_\bk_\bs_\b__\bp_\be_\br_\b__\bp_\bi_\be_\bc_\be_\b(_\b)\n- o _\bn_\ba_\bm_\be_\b(_\b)_\b _\bs_\be_\bt_\b__\bn_\ba_\bm_\be_\b(_\b)\n- o _\bs_\bw_\ba_\bp_\b(_\b)\n- o _\bc_\ba_\bn_\bo_\bn_\bi_\bc_\ba_\bl_\bi_\bz_\be_\b(_\b)\n- o _\bf_\bi_\bl_\be_\b__\bo_\bf_\bf_\bs_\be_\bt_\b(_\b)_\b _\bs_\by_\bm_\bl_\bi_\bn_\bk_\b(_\b)_\b _\bh_\ba_\bs_\bh_\b(_\b)_\b _\bf_\bi_\bl_\be_\b__\bs_\bi_\bz_\be_\b(_\b)_\b _\br_\bo_\bo_\bt_\b__\bp_\bt_\br_\b(_\b)_\b _\bf_\bi_\bl_\be_\b__\bn_\ba_\bm_\be_\b(_\b)\n- _\bm_\bt_\bi_\bm_\be_\b(_\b)_\b _\bp_\ba_\bd_\b__\bf_\bi_\bl_\be_\b__\ba_\bt_\b(_\b)_\b _\br_\bo_\bo_\bt_\b(_\b)_\b _\bf_\bi_\bl_\be_\b__\bp_\ba_\bt_\bh_\b(_\b)\n- o _\bf_\bi_\bl_\be_\b__\bn_\bu_\bm_\b__\bb_\bl_\bo_\bc_\bk_\bs_\b(_\b)_\b _\bf_\bi_\bl_\be_\b__\bp_\bi_\be_\bc_\be_\b__\br_\ba_\bn_\bg_\be_\b(_\b)_\b _\bf_\bi_\bl_\be_\b__\bn_\bu_\bm_\b__\bp_\bi_\be_\bc_\be_\bs_\b(_\b)\n- o _\bf_\bi_\bl_\be_\b__\bf_\bi_\br_\bs_\bt_\b__\bb_\bl_\bo_\bc_\bk_\b__\bn_\bo_\bd_\be_\b(_\b)_\b _\bf_\bi_\bl_\be_\b__\bf_\bi_\br_\bs_\bt_\b__\bp_\bi_\be_\bc_\be_\b__\bn_\bo_\bd_\be_\b(_\b)\n- o _\bf_\bi_\bl_\be_\b__\bp_\ba_\bt_\bh_\b__\bh_\ba_\bs_\bh_\b(_\b)\n- o _\ba_\bl_\bl_\b__\bp_\ba_\bt_\bh_\b__\bh_\ba_\bs_\bh_\be_\bs_\b(_\b)\n- o _\bf_\bi_\bl_\be_\b__\bf_\bl_\ba_\bg_\bs_\b(_\b)\n- o _\bf_\bi_\bl_\be_\b__\ba_\bb_\bs_\bo_\bl_\bu_\bt_\be_\b__\bp_\ba_\bt_\bh_\b(_\b)\n- o _\bf_\bi_\bl_\be_\b__\bi_\bn_\bd_\be_\bx_\b__\ba_\bt_\b__\bp_\bi_\be_\bc_\be_\b(_\b)_\b _\bf_\bi_\bl_\be_\b__\bi_\bn_\bd_\be_\bx_\b__\ba_\bt_\b__\bo_\bf_\bf_\bs_\be_\bt_\b(_\b)\n- o _\bf_\bi_\bl_\be_\b__\bi_\bn_\bd_\be_\bx_\b__\bf_\bo_\br_\b__\br_\bo_\bo_\bt_\b(_\b)\n- o _\bp_\bi_\be_\bc_\be_\b__\bi_\bn_\bd_\be_\bx_\b__\ba_\bt_\b__\bf_\bi_\bl_\be_\b(_\b)\n- o _\bs_\ba_\bn_\bi_\bt_\bi_\bz_\be_\b__\bs_\by_\bm_\bl_\bi_\bn_\bk_\bs_\b(_\b)\n- o _\bv_\b2_\b(_\b)\n- * _\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bp_\ba_\br_\ba_\bm_\bs\n- * _\bm_\bm_\ba_\bp_\b__\bd_\bi_\bs_\bk_\b__\bi_\bo_\b__\bc_\bo_\bn_\bs_\bt_\br_\bu_\bc_\bt_\bo_\br_\b(_\b)\n- * _\bd_\bi_\bs_\ba_\bb_\bl_\be_\bd_\b__\bd_\bi_\bs_\bk_\b__\bi_\bo_\b__\bc_\bo_\bn_\bs_\bt_\br_\bu_\bc_\bt_\bo_\br_\b(_\b)\n- * _\bd_\be_\bf_\ba_\bu_\bl_\bt_\b__\bd_\bi_\bs_\bk_\b__\bi_\bo_\b__\bc_\bo_\bn_\bs_\bt_\br_\bu_\bc_\bt_\bo_\br_\b(_\b)\n- * _\bp_\bo_\bs_\bi_\bx_\b__\bd_\bi_\bs_\bk_\b__\bi_\bo_\b__\bc_\bo_\bn_\bs_\bt_\br_\bu_\bc_\bt_\bo_\br_\b(_\b)\n- * _\be_\bn_\bu_\bm_\b _\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bm_\bo_\bd_\be_\b__\bt\n- * _\be_\bn_\bu_\bm_\b _\bs_\bt_\ba_\bt_\bu_\bs_\b__\bt\n- * _\be_\bn_\bu_\bm_\b _\bm_\bo_\bv_\be_\b__\bf_\bl_\ba_\bg_\bs_\b__\bt\n- * _\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b__\bi_\bn_\bf_\bo\n- * _\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b__\bt_\by_\bp_\be_\b__\bf_\bi_\bl_\bt_\be_\br\n- o _\ba_\bd_\bd_\b(_\b)_\b _\br_\be_\bm_\bo_\bv_\be_\b(_\b)\n- o _\ba_\bl_\bl_\bo_\bw_\b(_\b)_\b _\bd_\bi_\bs_\ba_\bl_\bl_\bo_\bw_\b(_\b)\n- o _\ba_\bp_\bp_\bl_\by_\b(_\b)\n- o _\be_\bn_\bu_\bm_\b _\bs_\bo_\bc_\bk_\be_\bt_\b__\bt_\by_\bp_\be_\b__\bt\n- * _\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\bi_\bn_\bf_\bo_\bh_\ba_\bs_\bh\n- * _\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\be_\bn_\bd_\bp_\bo_\bi_\bn_\bt\n- * _\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\be_\bn_\bt_\br_\by\n- o _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b=_\b(_\b)_\b _\b~_\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\be_\bn_\bt_\br_\by_\b(_\b)_\b _\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\be_\bn_\bt_\br_\by_\b(_\b)\n- o _\be_\bn_\bu_\bm_\b _\bt_\br_\ba_\bc_\bk_\be_\br_\b__\bs_\bo_\bu_\br_\bc_\be\n- * _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bs_\bt_\ba_\bt_\bu_\bs\n- o _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b=_\b=_\b(_\b)\n- o _\be_\bn_\bu_\bm_\b _\bs_\bt_\ba_\bt_\be_\b__\bt\n- * _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bh_\ba_\bn_\bd_\bl_\be\n- o _\bi_\bs_\b__\bv_\ba_\bl_\bi_\bd_\b(_\b)\n- o _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bs_\bt_\ba_\bt_\be_\b(_\b)\n- o _\br_\be_\bf_\br_\be_\bs_\bh_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bs_\bt_\ba_\bt_\bu_\bs_\b(_\b)_\b _\bg_\be_\bt_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bs_\bt_\ba_\bt_\bu_\bs_\b(_\b)\n- o _\bp_\bo_\bs_\bt_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bu_\bp_\bd_\ba_\bt_\be_\bs_\b(_\b)\n- o _\bp_\bo_\bs_\bt_\b__\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bs_\bt_\ba_\bt_\bs_\b(_\b)\n- o _\bp_\bo_\bs_\bt_\b__\bd_\bh_\bt_\b__\bs_\bt_\ba_\bt_\bs_\b(_\b)\n- o _\bs_\be_\bt_\b__\bd_\bh_\bt_\b__\bs_\bt_\ba_\bt_\be_\b(_\b)\n- o _\bg_\be_\bt_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\bs_\b(_\b)_\b _\bf_\bi_\bn_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b)\n- o _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b)_\b _\ba_\bs_\by_\bn_\bc_\b__\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b)\n- o _\bi_\bs_\b__\bp_\ba_\bu_\bs_\be_\bd_\b(_\b)_\b _\br_\be_\bs_\bu_\bm_\be_\b(_\b)_\b _\bp_\ba_\bu_\bs_\be_\b(_\b)\n- o _\bi_\bs_\b__\bd_\bh_\bt_\b__\br_\bu_\bn_\bn_\bi_\bn_\bg_\b(_\b)\n- o _\bs_\be_\bt_\b__\bd_\bh_\bt_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b(_\b)\n- o _\ba_\bd_\bd_\b__\bd_\bh_\bt_\b__\bn_\bo_\bd_\be_\b(_\b)\n- o _\bd_\bh_\bt_\b__\bg_\be_\bt_\b__\bi_\bt_\be_\bm_\b(_\b)\n- o _\bd_\bh_\bt_\b__\bg_\be_\bt_\b__\bi_\bt_\be_\bm_\b(_\b)\n- o _\bd_\bh_\bt_\b__\bp_\bu_\bt_\b__\bi_\bt_\be_\bm_\b(_\b)\n- o _\bd_\bh_\bt_\b__\bp_\bu_\bt_\b__\bi_\bt_\be_\bm_\b(_\b)\n- o _\bd_\bh_\bt_\b__\bg_\be_\bt_\b__\bp_\be_\be_\br_\bs_\b(_\b)_\b _\bd_\bh_\bt_\b__\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b(_\b)\n- o _\bd_\bh_\bt_\b__\bl_\bi_\bv_\be_\b__\bn_\bo_\bd_\be_\bs_\b(_\b)\n- o _\bd_\bh_\bt_\b__\bs_\ba_\bm_\bp_\bl_\be_\b__\bi_\bn_\bf_\bo_\bh_\ba_\bs_\bh_\be_\bs_\b(_\b)\n- o _\bd_\bh_\bt_\b__\bd_\bi_\br_\be_\bc_\bt_\b__\br_\be_\bq_\bu_\be_\bs_\bt_\b(_\b)\n- o _\ba_\bd_\bd_\b__\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\b(_\b)\n- o _\bg_\be_\bt_\b__\bi_\bp_\b__\bf_\bi_\bl_\bt_\be_\br_\b(_\b)_\b _\bs_\be_\bt_\b__\bi_\bp_\b__\bf_\bi_\bl_\bt_\be_\br_\b(_\b)\n- o _\bs_\be_\bt_\b__\bp_\bo_\br_\bt_\b__\bf_\bi_\bl_\bt_\be_\br_\b(_\b)\n- o _\bi_\bs_\b__\bl_\bi_\bs_\bt_\be_\bn_\bi_\bn_\bg_\b(_\b)_\b _\bs_\bs_\bl_\b__\bl_\bi_\bs_\bt_\be_\bn_\b__\bp_\bo_\br_\bt_\b(_\b)_\b _\bl_\bi_\bs_\bt_\be_\bn_\b__\bp_\bo_\br_\bt_\b(_\b)\n- o _\bs_\be_\bt_\b__\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b__\bf_\bi_\bl_\bt_\be_\br_\b(_\b)_\b _\bg_\be_\bt_\b__\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b__\bf_\bi_\bl_\bt_\be_\br_\b(_\b)\n- o _\bg_\be_\bt_\b__\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b__\bt_\by_\bp_\be_\b__\bf_\bi_\bl_\bt_\be_\br_\b(_\b)_\b _\bs_\be_\bt_\b__\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b__\bt_\by_\bp_\be_\b__\bf_\bi_\bl_\bt_\be_\br_\b(_\b)\n- o _\bc_\br_\be_\ba_\bt_\be_\b__\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b(_\b)\n- o _\bd_\be_\bl_\be_\bt_\be_\b__\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b(_\b)\n- o _\bs_\be_\bt_\b__\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b(_\b)_\b _\bg_\be_\bt_\b__\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b(_\b)\n- o _\br_\be_\bm_\bo_\bv_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b)\n- o _\bg_\be_\bt_\b__\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b(_\b)_\b _\ba_\bp_\bp_\bl_\by_\b__\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b(_\b)\n- o _\bw_\ba_\bi_\bt_\b__\bf_\bo_\br_\b__\ba_\bl_\be_\br_\bt_\b(_\b)_\b _\bs_\be_\bt_\b__\ba_\bl_\be_\br_\bt_\b__\bn_\bo_\bt_\bi_\bf_\by_\b(_\b)_\b _\bp_\bo_\bp_\b__\ba_\bl_\be_\br_\bt_\bs_\b(_\b)\n- o _\ba_\bd_\bd_\b__\bp_\bo_\br_\bt_\b__\bm_\ba_\bp_\bp_\bi_\bn_\bg_\b(_\b)_\b _\bd_\be_\bl_\be_\bt_\be_\b__\bp_\bo_\br_\bt_\b__\bm_\ba_\bp_\bp_\bi_\bn_\bg_\b(_\b)\n- o _\br_\be_\bo_\bp_\be_\bn_\b__\bn_\be_\bt_\bw_\bo_\br_\bk_\b__\bs_\bo_\bc_\bk_\be_\bt_\bs_\b(_\b)\n- o _\bn_\ba_\bt_\bi_\bv_\be_\b__\bh_\ba_\bn_\bd_\bl_\be_\b(_\b)\n- * _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\br_\bo_\bx_\by\n- o _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\br_\bo_\bx_\by_\b(_\b)_\b _\b~_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\br_\bo_\bx_\by_\b(_\b)_\b _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b=_\b(_\b)\n- * _\bs_\be_\bs_\bs_\bi_\bo_\bn\n- o _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b(_\b)\n- o _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b(_\b)\n- o _\b~_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b(_\b)\n- o _\ba_\bb_\bo_\br_\bt_\b(_\b)\n- * _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs\n- o _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs_\b(_\b)\n- o _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs_\b(_\b)\n- * _\bw_\br_\bi_\bt_\be_\b__\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs_\b__\bb_\bu_\bf_\b(_\b)_\b _\br_\be_\ba_\bd_\b__\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs_\b(_\b)_\b _\bw_\br_\bi_\bt_\be_\b__\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs_\b(_\b)\n- * _\bi_\bp_\b__\bf_\bi_\bl_\bt_\be_\br\n- o _\be_\bm_\bp_\bt_\by_\b(_\b)\n- o _\ba_\bd_\bd_\b__\br_\bu_\bl_\be_\b(_\b)\n- o _\ba_\bc_\bc_\be_\bs_\bs_\b(_\b)\n- o _\be_\bx_\bp_\bo_\br_\bt_\b__\bf_\bi_\bl_\bt_\be_\br_\b(_\b)\n- o _\be_\bn_\bu_\bm_\b _\ba_\bc_\bc_\be_\bs_\bs_\b__\bf_\bl_\ba_\bg_\bs\n- * _\bp_\bo_\br_\bt_\b__\bf_\bi_\bl_\bt_\be_\br\n- o _\ba_\bd_\bd_\b__\br_\bu_\bl_\be_\b(_\b)\n- o _\ba_\bc_\bc_\be_\bs_\bs_\b(_\b)\n- o _\be_\bn_\bu_\bm_\b _\ba_\bc_\bc_\be_\bs_\bs_\b__\bf_\bl_\ba_\bg_\bs\n- * _\bb_\bd_\be_\bc_\bo_\bd_\be_\b__\bn_\bo_\bd_\be\n- o _\bb_\bd_\be_\bc_\bo_\bd_\be_\b__\bn_\bo_\bd_\be_\b(_\b)\n- o _\bb_\bd_\be_\bc_\bo_\bd_\be_\b__\bn_\bo_\bd_\be_\b(_\b)_\b _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b=_\b(_\b)\n+ * _\ba_\bl_\be_\br_\bt\n+ o _\bt_\bi_\bm_\be_\bs_\bt_\ba_\bm_\bp_\b(_\b)\n o _\bt_\by_\bp_\be_\b(_\b)\n- o _\bb_\bo_\bo_\bl_\b(_\b)\n- o _\bn_\bo_\bn_\b__\bo_\bw_\bn_\bi_\bn_\bg_\b(_\b)\n- o _\bd_\ba_\bt_\ba_\b__\bs_\be_\bc_\bt_\bi_\bo_\bn_\b(_\b)_\b _\bd_\ba_\bt_\ba_\b__\bo_\bf_\bf_\bs_\be_\bt_\b(_\b)\n- o _\bl_\bi_\bs_\bt_\b__\ba_\bt_\b(_\b)_\b _\bl_\bi_\bs_\bt_\b__\bi_\bn_\bt_\b__\bv_\ba_\bl_\bu_\be_\b__\ba_\bt_\b(_\b)_\b _\bl_\bi_\bs_\bt_\b__\bs_\bt_\br_\bi_\bn_\bg_\b__\bv_\ba_\bl_\bu_\be_\b__\ba_\bt_\b(_\b)_\b _\bl_\bi_\bs_\bt_\b__\bs_\bi_\bz_\be_\b(_\b)\n- o _\bd_\bi_\bc_\bt_\b__\bf_\bi_\bn_\bd_\b__\bs_\bt_\br_\bi_\bn_\bg_\b__\bv_\ba_\bl_\bu_\be_\b(_\b)_\b _\bd_\bi_\bc_\bt_\b__\ba_\bt_\b(_\b)_\b _\bd_\bi_\bc_\bt_\b__\ba_\bt_\b__\bn_\bo_\bd_\be_\b(_\b)_\b _\bd_\bi_\bc_\bt_\b__\bf_\bi_\bn_\bd_\b(_\b)\n- _\bd_\bi_\bc_\bt_\b__\bf_\bi_\bn_\bd_\b__\bl_\bi_\bs_\bt_\b(_\b)_\b _\bd_\bi_\bc_\bt_\b__\bf_\bi_\bn_\bd_\b__\bi_\bn_\bt_\b__\bv_\ba_\bl_\bu_\be_\b(_\b)_\b _\bd_\bi_\bc_\bt_\b__\bs_\bi_\bz_\be_\b(_\b)_\b _\bd_\bi_\bc_\bt_\b__\bf_\bi_\bn_\bd_\b__\bi_\bn_\bt_\b(_\b)\n- _\bd_\bi_\bc_\bt_\b__\bf_\bi_\bn_\bd_\b__\bs_\bt_\br_\bi_\bn_\bg_\b(_\b)_\b _\bd_\bi_\bc_\bt_\b__\bf_\bi_\bn_\bd_\b__\bd_\bi_\bc_\bt_\b(_\b)\n- o _\bi_\bn_\bt_\b__\bv_\ba_\bl_\bu_\be_\b(_\b)\n- o _\bs_\bt_\br_\bi_\bn_\bg_\b__\bo_\bf_\bf_\bs_\be_\bt_\b(_\b)_\b _\bs_\bt_\br_\bi_\bn_\bg_\b__\bl_\be_\bn_\bg_\bt_\bh_\b(_\b)_\b _\bs_\bt_\br_\bi_\bn_\bg_\b__\bp_\bt_\br_\b(_\b)_\b _\bs_\bt_\br_\bi_\bn_\bg_\b__\bv_\ba_\bl_\bu_\be_\b(_\b)\n- o _\bc_\bl_\be_\ba_\br_\b(_\b)\n- o _\bs_\bw_\ba_\bp_\b(_\b)\n- o _\br_\be_\bs_\be_\br_\bv_\be_\b(_\b)\n- o _\bs_\bw_\bi_\bt_\bc_\bh_\b__\bu_\bn_\bd_\be_\br_\bl_\by_\bi_\bn_\bg_\b__\bb_\bu_\bf_\bf_\be_\br_\b(_\b)\n- o _\bh_\ba_\bs_\b__\bs_\bo_\bf_\bt_\b__\be_\br_\br_\bo_\br_\b(_\b)\n- o _\be_\bn_\bu_\bm_\b _\bt_\by_\bp_\be_\b__\bt\n- * _\bp_\br_\bi_\bn_\bt_\b__\be_\bn_\bt_\br_\by_\b(_\b)\n- * _\bb_\bd_\be_\bc_\bo_\bd_\be_\b(_\b)\n- * _\bh_\ba_\bs_\bh_\be_\br\n- o _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b=_\b(_\b)_\b _\bh_\ba_\bs_\bh_\be_\br_\b(_\b)\n- o _\bu_\bp_\bd_\ba_\bt_\be_\b(_\b)\n- o _\bf_\bi_\bn_\ba_\bl_\b(_\b)\n- o _\br_\be_\bs_\be_\bt_\b(_\b)\n- * _\bh_\ba_\bs_\bh_\be_\br_\b2_\b5_\b6\n- o _\bh_\ba_\bs_\bh_\be_\br_\b2_\b5_\b6_\b(_\b)_\b _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b=_\b(_\b)\n- o _\bu_\bp_\bd_\ba_\bt_\be_\b(_\b)\n- o _\bf_\bi_\bn_\ba_\bl_\b(_\b)\n- o _\br_\be_\bs_\be_\bt_\b(_\b)\n- * _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd\n- o _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd_\b(_\b)\n- o _\ba_\bs_\bs_\bi_\bg_\bn_\b(_\b)\n- o _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b[_\b]_\b(_\b)_\b _\bg_\be_\bt_\b__\bb_\bi_\bt_\b(_\b)\n- o _\bc_\bl_\be_\ba_\br_\b__\bb_\bi_\bt_\b(_\b)_\b _\bs_\be_\bt_\b__\bb_\bi_\bt_\b(_\b)\n- o _\ba_\bl_\bl_\b__\bs_\be_\bt_\b(_\b)\n- o _\bn_\bo_\bn_\be_\b__\bs_\be_\bt_\b(_\b)\n- o _\bs_\bi_\bz_\be_\b(_\b)\n- o _\bn_\bu_\bm_\b__\bw_\bo_\br_\bd_\bs_\b(_\b)\n- o _\bn_\bu_\bm_\b__\bb_\by_\bt_\be_\bs_\b(_\b)\n- o _\be_\bm_\bp_\bt_\by_\b(_\b)\n- o _\bd_\ba_\bt_\ba_\b(_\b)\n- o _\bs_\bw_\ba_\bp_\b(_\b)\n- o _\bc_\bo_\bu_\bn_\bt_\b(_\b)\n- o _\bf_\bi_\bn_\bd_\b__\bf_\bi_\br_\bs_\bt_\b__\bs_\be_\bt_\b(_\b)\n- o _\bf_\bi_\bn_\bd_\b__\bl_\ba_\bs_\bt_\b__\bc_\bl_\be_\ba_\br_\b(_\b)\n+ o _\bw_\bh_\ba_\bt_\b(_\b)\n+ o _\bm_\be_\bs_\bs_\ba_\bg_\be_\b(_\b)\n+ o _\bc_\ba_\bt_\be_\bg_\bo_\br_\by_\b(_\b)\n * _\bd_\bh_\bt_\b__\br_\bo_\bu_\bt_\bi_\bn_\bg_\b__\bb_\bu_\bc_\bk_\be_\bt\n * _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\ba_\bl_\be_\br_\bt\n o _\bm_\be_\bs_\bs_\ba_\bg_\be_\b(_\b)\n * _\bp_\be_\be_\br_\b__\ba_\bl_\be_\br_\bt\n * _\bt_\br_\ba_\bc_\bk_\be_\br_\b__\ba_\bl_\be_\br_\bt\n o _\bt_\br_\ba_\bc_\bk_\be_\br_\b__\bu_\br_\bl_\b(_\b)\n * _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\br_\be_\bm_\bo_\bv_\be_\bd_\b__\ba_\bl_\be_\br_\bt\n@@ -330,70 +137,207 @@\n * _\bo_\bv_\be_\br_\bs_\bi_\bz_\be_\bd_\b__\bf_\bi_\bl_\be_\b__\ba_\bl_\be_\br_\bt\n * _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bc_\bo_\bn_\bf_\bl_\bi_\bc_\bt_\b__\ba_\bl_\be_\br_\bt\n * _\bp_\be_\be_\br_\b__\bi_\bn_\bf_\bo_\b__\ba_\bl_\be_\br_\bt\n * _\bf_\bi_\bl_\be_\b__\bp_\br_\bo_\bg_\br_\be_\bs_\bs_\b__\ba_\bl_\be_\br_\bt\n * _\bp_\bi_\be_\bc_\be_\b__\bi_\bn_\bf_\bo_\b__\ba_\bl_\be_\br_\bt\n * _\bp_\bi_\be_\bc_\be_\b__\ba_\bv_\ba_\bi_\bl_\ba_\bb_\bi_\bl_\bi_\bt_\by_\b__\ba_\bl_\be_\br_\bt\n * _\bt_\br_\ba_\bc_\bk_\be_\br_\b__\bl_\bi_\bs_\bt_\b__\ba_\bl_\be_\br_\bt\n- * _\ba_\bl_\be_\br_\bt\n- o _\bt_\bi_\bm_\be_\bs_\bt_\ba_\bm_\bp_\b(_\b)\n- o _\bt_\by_\bp_\be_\b(_\b)\n- o _\bw_\bh_\ba_\bt_\b(_\b)\n- o _\bm_\be_\bs_\bs_\ba_\bg_\be_\b(_\b)\n- o _\bc_\ba_\bt_\be_\bg_\bo_\br_\by_\b(_\b)\n- * _\ba_\bl_\be_\br_\bt_\b__\bc_\ba_\bs_\bt_\b(_\b)\n * _\bo_\bp_\be_\br_\ba_\bt_\bi_\bo_\bn_\b__\bn_\ba_\bm_\be_\b(_\b)\n+ * _\ba_\bl_\be_\br_\bt_\b__\bc_\ba_\bs_\bt_\b(_\b)\n * _\be_\bn_\bu_\bm_\b _\bo_\bp_\be_\br_\ba_\bt_\bi_\bo_\bn_\b__\bt\n- * _\bi_\bn_\bt\n * _\ba_\bl_\be_\br_\bt_\b__\bc_\ba_\bt_\be_\bg_\bo_\br_\by_\b__\bt\n+ * _\bi_\bn_\bt\n+ * _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs\n+ o _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs_\b(_\b)\n+ o _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs_\b(_\b)\n+ * _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bh_\ba_\bn_\bd_\bl_\be\n+ o _\bi_\bs_\b__\bv_\ba_\bl_\bi_\bd_\b(_\b)\n+ o _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bs_\bt_\ba_\bt_\be_\b(_\b)\n+ o _\br_\be_\bf_\br_\be_\bs_\bh_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bs_\bt_\ba_\bt_\bu_\bs_\b(_\b)_\b _\bg_\be_\bt_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bs_\bt_\ba_\bt_\bu_\bs_\b(_\b)\n+ o _\bp_\bo_\bs_\bt_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bu_\bp_\bd_\ba_\bt_\be_\bs_\b(_\b)\n+ o _\bp_\bo_\bs_\bt_\b__\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bs_\bt_\ba_\bt_\bs_\b(_\b)\n+ o _\bp_\bo_\bs_\bt_\b__\bd_\bh_\bt_\b__\bs_\bt_\ba_\bt_\bs_\b(_\b)\n+ o _\bs_\be_\bt_\b__\bd_\bh_\bt_\b__\bs_\bt_\ba_\bt_\be_\b(_\b)\n+ o _\bf_\bi_\bn_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b)_\b _\bg_\be_\bt_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\bs_\b(_\b)\n+ o _\ba_\bs_\by_\bn_\bc_\b__\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b)_\b _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b)\n+ o _\bp_\ba_\bu_\bs_\be_\b(_\b)_\b _\br_\be_\bs_\bu_\bm_\be_\b(_\b)_\b _\bi_\bs_\b__\bp_\ba_\bu_\bs_\be_\bd_\b(_\b)\n+ o _\bi_\bs_\b__\bd_\bh_\bt_\b__\br_\bu_\bn_\bn_\bi_\bn_\bg_\b(_\b)\n+ o _\bs_\be_\bt_\b__\bd_\bh_\bt_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b(_\b)\n+ o _\ba_\bd_\bd_\b__\bd_\bh_\bt_\b__\bn_\bo_\bd_\be_\b(_\b)\n+ o _\bd_\bh_\bt_\b__\bg_\be_\bt_\b__\bi_\bt_\be_\bm_\b(_\b)\n+ o _\bd_\bh_\bt_\b__\bg_\be_\bt_\b__\bi_\bt_\be_\bm_\b(_\b)\n+ o _\bd_\bh_\bt_\b__\bp_\bu_\bt_\b__\bi_\bt_\be_\bm_\b(_\b)\n+ o _\bd_\bh_\bt_\b__\bp_\bu_\bt_\b__\bi_\bt_\be_\bm_\b(_\b)\n+ o _\bd_\bh_\bt_\b__\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b(_\b)_\b _\bd_\bh_\bt_\b__\bg_\be_\bt_\b__\bp_\be_\be_\br_\bs_\b(_\b)\n+ o _\bd_\bh_\bt_\b__\bl_\bi_\bv_\be_\b__\bn_\bo_\bd_\be_\bs_\b(_\b)\n+ o _\bd_\bh_\bt_\b__\bs_\ba_\bm_\bp_\bl_\be_\b__\bi_\bn_\bf_\bo_\bh_\ba_\bs_\bh_\be_\bs_\b(_\b)\n+ o _\bd_\bh_\bt_\b__\bd_\bi_\br_\be_\bc_\bt_\b__\br_\be_\bq_\bu_\be_\bs_\bt_\b(_\b)\n+ o _\ba_\bd_\bd_\b__\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\b(_\b)\n+ o _\bg_\be_\bt_\b__\bi_\bp_\b__\bf_\bi_\bl_\bt_\be_\br_\b(_\b)_\b _\bs_\be_\bt_\b__\bi_\bp_\b__\bf_\bi_\bl_\bt_\be_\br_\b(_\b)\n+ o _\bs_\be_\bt_\b__\bp_\bo_\br_\bt_\b__\bf_\bi_\bl_\bt_\be_\br_\b(_\b)\n+ o _\bi_\bs_\b__\bl_\bi_\bs_\bt_\be_\bn_\bi_\bn_\bg_\b(_\b)_\b _\bl_\bi_\bs_\bt_\be_\bn_\b__\bp_\bo_\br_\bt_\b(_\b)_\b _\bs_\bs_\bl_\b__\bl_\bi_\bs_\bt_\be_\bn_\b__\bp_\bo_\br_\bt_\b(_\b)\n+ o _\bg_\be_\bt_\b__\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b__\bf_\bi_\bl_\bt_\be_\br_\b(_\b)_\b _\bs_\be_\bt_\b__\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b__\bf_\bi_\bl_\bt_\be_\br_\b(_\b)\n+ o _\bs_\be_\bt_\b__\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b__\bt_\by_\bp_\be_\b__\bf_\bi_\bl_\bt_\be_\br_\b(_\b)_\b _\bg_\be_\bt_\b__\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b__\bt_\by_\bp_\be_\b__\bf_\bi_\bl_\bt_\be_\br_\b(_\b)\n+ o _\bc_\br_\be_\ba_\bt_\be_\b__\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b(_\b)\n+ o _\bd_\be_\bl_\be_\bt_\be_\b__\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b(_\b)\n+ o _\bs_\be_\bt_\b__\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b(_\b)_\b _\bg_\be_\bt_\b__\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b(_\b)\n+ o _\br_\be_\bm_\bo_\bv_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b)\n+ o _\ba_\bp_\bp_\bl_\by_\b__\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b(_\b)_\b _\bg_\be_\bt_\b__\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b(_\b)\n+ o _\bw_\ba_\bi_\bt_\b__\bf_\bo_\br_\b__\ba_\bl_\be_\br_\bt_\b(_\b)_\b _\bs_\be_\bt_\b__\ba_\bl_\be_\br_\bt_\b__\bn_\bo_\bt_\bi_\bf_\by_\b(_\b)_\b _\bp_\bo_\bp_\b__\ba_\bl_\be_\br_\bt_\bs_\b(_\b)\n+ o _\ba_\bd_\bd_\b__\bp_\bo_\br_\bt_\b__\bm_\ba_\bp_\bp_\bi_\bn_\bg_\b(_\b)_\b _\bd_\be_\bl_\be_\bt_\be_\b__\bp_\bo_\br_\bt_\b__\bm_\ba_\bp_\bp_\bi_\bn_\bg_\b(_\b)\n+ o _\br_\be_\bo_\bp_\be_\bn_\b__\bn_\be_\bt_\bw_\bo_\br_\bk_\b__\bs_\bo_\bc_\bk_\be_\bt_\bs_\b(_\b)\n+ o _\bn_\ba_\bt_\bi_\bv_\be_\b__\bh_\ba_\bn_\bd_\bl_\be_\b(_\b)\n+ * _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\br_\bo_\bx_\by\n+ o _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b=_\b(_\b)_\b _\b~_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\br_\bo_\bx_\by_\b(_\b)_\b _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\br_\bo_\bx_\by_\b(_\b)\n+ * _\bs_\be_\bs_\bs_\bi_\bo_\bn\n+ o _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b(_\b)\n+ o _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b(_\b)\n+ o _\b~_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b(_\b)\n+ o _\ba_\bb_\bo_\br_\bt_\b(_\b)\n+ * _\br_\be_\ba_\bd_\b__\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs_\b(_\b)_\b _\bw_\br_\bi_\bt_\be_\b__\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs_\b__\bb_\bu_\bf_\b(_\b)_\b _\bw_\br_\bi_\bt_\be_\b__\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs_\b(_\b)\n+ * _\bb_\bd_\be_\bc_\bo_\bd_\be_\b__\bn_\bo_\bd_\be\n+ o _\bb_\bd_\be_\bc_\bo_\bd_\be_\b__\bn_\bo_\bd_\be_\b(_\b)\n+ o _\bb_\bd_\be_\bc_\bo_\bd_\be_\b__\bn_\bo_\bd_\be_\b(_\b)_\b _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b=_\b(_\b)\n+ o _\bt_\by_\bp_\be_\b(_\b)\n+ o _\bb_\bo_\bo_\bl_\b(_\b)\n+ o _\bn_\bo_\bn_\b__\bo_\bw_\bn_\bi_\bn_\bg_\b(_\b)\n+ o _\bd_\ba_\bt_\ba_\b__\bs_\be_\bc_\bt_\bi_\bo_\bn_\b(_\b)_\b _\bd_\ba_\bt_\ba_\b__\bo_\bf_\bf_\bs_\be_\bt_\b(_\b)\n+ o _\bl_\bi_\bs_\bt_\b__\ba_\bt_\b(_\b)_\b _\bl_\bi_\bs_\bt_\b__\bs_\bt_\br_\bi_\bn_\bg_\b__\bv_\ba_\bl_\bu_\be_\b__\ba_\bt_\b(_\b)_\b _\bl_\bi_\bs_\bt_\b__\bi_\bn_\bt_\b__\bv_\ba_\bl_\bu_\be_\b__\ba_\bt_\b(_\b)_\b _\bl_\bi_\bs_\bt_\b__\bs_\bi_\bz_\be_\b(_\b)\n+ o _\bd_\bi_\bc_\bt_\b__\bf_\bi_\bn_\bd_\b__\bl_\bi_\bs_\bt_\b(_\b)_\b _\bd_\bi_\bc_\bt_\b__\bf_\bi_\bn_\bd_\b__\bs_\bt_\br_\bi_\bn_\bg_\b__\bv_\ba_\bl_\bu_\be_\b(_\b)_\b _\bd_\bi_\bc_\bt_\b__\bf_\bi_\bn_\bd_\b__\bs_\bt_\br_\bi_\bn_\bg_\b(_\b)\n+ _\bd_\bi_\bc_\bt_\b__\bf_\bi_\bn_\bd_\b__\bi_\bn_\bt_\b__\bv_\ba_\bl_\bu_\be_\b(_\b)_\b _\bd_\bi_\bc_\bt_\b__\bf_\bi_\bn_\bd_\b__\bd_\bi_\bc_\bt_\b(_\b)_\b _\bd_\bi_\bc_\bt_\b__\bs_\bi_\bz_\be_\b(_\b)_\b _\bd_\bi_\bc_\bt_\b__\bf_\bi_\bn_\bd_\b__\bi_\bn_\bt_\b(_\b)\n+ _\bd_\bi_\bc_\bt_\b__\ba_\bt_\b(_\b)_\b _\bd_\bi_\bc_\bt_\b__\bf_\bi_\bn_\bd_\b(_\b)_\b _\bd_\bi_\bc_\bt_\b__\ba_\bt_\b__\bn_\bo_\bd_\be_\b(_\b)\n+ o _\bi_\bn_\bt_\b__\bv_\ba_\bl_\bu_\be_\b(_\b)\n+ o _\bs_\bt_\br_\bi_\bn_\bg_\b__\bv_\ba_\bl_\bu_\be_\b(_\b)_\b _\bs_\bt_\br_\bi_\bn_\bg_\b__\bl_\be_\bn_\bg_\bt_\bh_\b(_\b)_\b _\bs_\bt_\br_\bi_\bn_\bg_\b__\bo_\bf_\bf_\bs_\be_\bt_\b(_\b)_\b _\bs_\bt_\br_\bi_\bn_\bg_\b__\bp_\bt_\br_\b(_\b)\n+ o _\bc_\bl_\be_\ba_\br_\b(_\b)\n+ o _\bs_\bw_\ba_\bp_\b(_\b)\n+ o _\br_\be_\bs_\be_\br_\bv_\be_\b(_\b)\n+ o _\bs_\bw_\bi_\bt_\bc_\bh_\b__\bu_\bn_\bd_\be_\br_\bl_\by_\bi_\bn_\bg_\b__\bb_\bu_\bf_\bf_\be_\br_\b(_\b)\n+ o _\bh_\ba_\bs_\b__\bs_\bo_\bf_\bt_\b__\be_\br_\br_\bo_\br_\b(_\b)\n+ o _\be_\bn_\bu_\bm_\b _\bt_\by_\bp_\be_\b__\bt\n+ * _\bp_\br_\bi_\bn_\bt_\b__\be_\bn_\bt_\br_\by_\b(_\b)\n+ * _\bb_\bd_\be_\bc_\bo_\bd_\be_\b(_\b)\n+ * _\bi_\bn_\bf_\bo_\b__\bh_\ba_\bs_\bh_\b__\bt\n+ o _\bi_\bn_\bf_\bo_\b__\bh_\ba_\bs_\bh_\b__\bt_\b(_\b)\n+ o _\bh_\ba_\bs_\b__\bv_\b2_\b(_\b)_\b _\bh_\ba_\bs_\b__\bv_\b1_\b(_\b)_\b _\bh_\ba_\bs_\b(_\b)\n+ o _\bg_\be_\bt_\b(_\b)\n+ o _\bg_\be_\bt_\b__\bb_\be_\bs_\bt_\b(_\b)\n+ o _\bf_\bo_\br_\b__\be_\ba_\bc_\bh_\b(_\b)\n+ * _\bp_\bi_\be_\bc_\be_\b__\bb_\bl_\bo_\bc_\bk\n+ * _\bp_\be_\be_\br_\b__\br_\be_\bq_\bu_\be_\bs_\bt\n+ o _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b=_\b=_\b(_\b)\n+ * _\bp_\be_\be_\br_\b__\bi_\bn_\bf_\bo\n+ o _\bi_\b2_\bp_\b__\bd_\be_\bs_\bt_\bi_\bn_\ba_\bt_\bi_\bo_\bn_\b(_\b)\n+ * _\bv_\be_\br_\bs_\bi_\bo_\bn_\b(_\b)\n+ * _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\be_\be_\br_\b__\be_\bq_\bu_\ba_\bl_\b(_\b)\n+ * _\bt_\br_\bu_\bn_\bc_\ba_\bt_\be_\b__\bf_\bi_\bl_\be_\bs_\b(_\b)\n+ * _\bm_\ba_\bk_\be_\b__\bm_\ba_\bg_\bn_\be_\bt_\b__\bu_\br_\bi_\b(_\b)\n+ * _\bp_\ba_\br_\bs_\be_\b__\bm_\ba_\bg_\bn_\be_\bt_\b__\bu_\br_\bi_\b(_\b)\n+ * _\bl_\bo_\ba_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bi_\bl_\be_\b(_\b)_\b _\bl_\bo_\ba_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bb_\bu_\bf_\bf_\be_\br_\b(_\b)_\b _\bl_\bo_\ba_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\bs_\be_\bd_\b(_\b)\n+ * _\be_\bn_\bu_\bm_\b _\bs_\bo_\bc_\bk_\be_\bt_\b__\bt_\by_\bp_\be_\b__\bt\n+ * _\be_\bn_\bu_\bm_\b _\bp_\br_\bo_\bt_\bo_\bc_\bo_\bl_\b__\bv_\be_\br_\bs_\bi_\bo_\bn\n+ * _\be_\bn_\bu_\bm_\b _\be_\bv_\be_\bn_\bt_\b__\bt\n+ * _\be_\bn_\bu_\bm_\b _\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b__\bt_\by_\bp_\be\n+ * _\be_\bn_\bu_\bm_\b _\bp_\bo_\br_\bt_\bm_\ba_\bp_\b__\bt_\br_\ba_\bn_\bs_\bp_\bo_\br_\bt\n+ * _\be_\bn_\bu_\bm_\b _\bp_\bo_\br_\bt_\bm_\ba_\bp_\b__\bp_\br_\bo_\bt_\bo_\bc_\bo_\bl\n+ * _\bp_\be_\bx_\b__\bf_\bl_\ba_\bg_\bs_\b__\bt\n+ * _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bl_\ba_\bg_\bs_\b__\bt\n+ * _\bi_\bn_\bt\n+ * _\bc_\bh_\ba_\br_\b _\bc_\bo_\bn_\bs_\bt_\b*\n+ * _\bs_\bt_\bd_\b:_\b:_\bu_\bi_\bn_\bt_\b6_\b4_\b__\bt\n+ * _\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\b__\bp_\br_\bi_\bo_\br_\bi_\bt_\by_\b__\bt\n+ * _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bs_\bt_\ba_\bt_\bu_\bs\n+ o _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b=_\b=_\b(_\b)\n+ o _\be_\bn_\bu_\bm_\b _\bs_\bt_\ba_\bt_\be_\b__\bt\n * _\bc_\br_\be_\ba_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt\n o _\bc_\br_\be_\ba_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b)\n o _\bg_\be_\bn_\be_\br_\ba_\bt_\be_\b(_\b)_\b _\bg_\be_\bn_\be_\br_\ba_\bt_\be_\b__\bb_\bu_\bf_\b(_\b)\n o _\bf_\bi_\bl_\be_\bs_\b(_\b)\n o _\bs_\be_\bt_\b__\bc_\bo_\bm_\bm_\be_\bn_\bt_\b(_\b)\n o _\bs_\be_\bt_\b__\bc_\br_\be_\ba_\bt_\bo_\br_\b(_\b)\n o _\bs_\be_\bt_\b__\bc_\br_\be_\ba_\bt_\bi_\bo_\bn_\b__\bd_\ba_\bt_\be_\b(_\b)\n o _\bs_\be_\bt_\b__\bh_\ba_\bs_\bh_\b(_\b)\n o _\bs_\be_\bt_\b__\bh_\ba_\bs_\bh_\b2_\b(_\b)\n- o _\ba_\bd_\bd_\b__\bu_\br_\bl_\b__\bs_\be_\be_\bd_\b(_\b)_\b _\ba_\bd_\bd_\b__\bh_\bt_\bt_\bp_\b__\bs_\be_\be_\bd_\b(_\b)\n+ o _\ba_\bd_\bd_\b__\bh_\bt_\bt_\bp_\b__\bs_\be_\be_\bd_\b(_\b)_\b _\ba_\bd_\bd_\b__\bu_\br_\bl_\b__\bs_\be_\be_\bd_\b(_\b)\n o _\ba_\bd_\bd_\b__\bn_\bo_\bd_\be_\b(_\b)\n o _\ba_\bd_\bd_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\b(_\b)\n o _\bs_\be_\bt_\b__\br_\bo_\bo_\bt_\b__\bc_\be_\br_\bt_\b(_\b)\n- o _\bp_\br_\bi_\bv_\b(_\b)_\b _\bs_\be_\bt_\b__\bp_\br_\bi_\bv_\b(_\b)\n+ o _\bs_\be_\bt_\b__\bp_\br_\bi_\bv_\b(_\b)_\b _\bp_\br_\bi_\bv_\b(_\b)\n o _\bn_\bu_\bm_\b__\bp_\bi_\be_\bc_\be_\bs_\b(_\b)\n o _\bp_\bi_\be_\bc_\be_\b__\br_\ba_\bn_\bg_\be_\b(_\b)\n o _\bf_\bi_\bl_\be_\b__\br_\ba_\bn_\bg_\be_\b(_\b)\n o _\bf_\bi_\bl_\be_\b__\bp_\bi_\be_\bc_\be_\b__\br_\ba_\bn_\bg_\be_\b(_\b)\n o _\bt_\bo_\bt_\ba_\bl_\b__\bs_\bi_\bz_\be_\b(_\b)\n- o _\bp_\bi_\be_\bc_\be_\b__\bs_\bi_\bz_\be_\b(_\b)_\b _\bp_\bi_\be_\bc_\be_\b__\bl_\be_\bn_\bg_\bt_\bh_\b(_\b)\n- o _\ba_\bd_\bd_\b__\bc_\bo_\bl_\bl_\be_\bc_\bt_\bi_\bo_\bn_\b(_\b)_\b _\ba_\bd_\bd_\b__\bs_\bi_\bm_\bi_\bl_\ba_\br_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b)\n+ o _\bp_\bi_\be_\bc_\be_\b__\bl_\be_\bn_\bg_\bt_\bh_\b(_\b)_\b _\bp_\bi_\be_\bc_\be_\b__\bs_\bi_\bz_\be_\b(_\b)\n+ o _\ba_\bd_\bd_\b__\bs_\bi_\bm_\bi_\bl_\ba_\br_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b)_\b _\ba_\bd_\bd_\b__\bc_\bo_\bl_\bl_\be_\bc_\bt_\bi_\bo_\bn_\b(_\b)\n * _\ba_\bd_\bd_\b__\bf_\bi_\bl_\be_\bs_\b(_\b)\n * _\bs_\be_\bt_\b__\bp_\bi_\be_\bc_\be_\b__\bh_\ba_\bs_\bh_\be_\bs_\b(_\b)\n- * _\be_\bn_\bt_\br_\by\n- o _\bt_\by_\bp_\be_\b(_\b)\n- o _\be_\bn_\bt_\br_\by_\b(_\b)\n- o _\be_\bn_\bt_\br_\by_\b(_\b)\n- o _\be_\bn_\bt_\br_\by_\b(_\b)\n- o _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b=_\b(_\b)\n- o _\bs_\bt_\br_\bi_\bn_\bg_\b(_\b)_\b _\bd_\bi_\bc_\bt_\b(_\b)_\b _\bl_\bi_\bs_\bt_\b(_\b)_\b _\bi_\bn_\bt_\be_\bg_\be_\br_\b(_\b)_\b _\bp_\br_\be_\bf_\bo_\br_\bm_\ba_\bt_\bt_\be_\bd_\b(_\b)\n+ * _\bs_\bt_\ba_\bt_\bs_\b__\bm_\be_\bt_\br_\bi_\bc\n+ * _\bc_\bo_\bu_\bn_\bt_\be_\br_\bs\n+ o _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b[_\b]_\b(_\b)_\b _\bi_\bn_\bc_\b__\bs_\bt_\ba_\bt_\bs_\b__\bc_\bo_\bu_\bn_\bt_\be_\br_\b(_\b)\n+ * _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bs_\bt_\ba_\bt_\bs_\b__\bm_\be_\bt_\br_\bi_\bc_\bs_\b(_\b)\n+ * _\bf_\bi_\bn_\bd_\b__\bm_\be_\bt_\br_\bi_\bc_\b__\bi_\bd_\bx_\b(_\b)\n+ * _\be_\bn_\bu_\bm_\b _\bm_\be_\bt_\br_\bi_\bc_\b__\bt_\by_\bp_\be_\b__\bt\n+ * _\bf_\bi_\bl_\be_\b__\bs_\bl_\bi_\bc_\be\n+ * _\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be\n+ o _\bi_\bs_\b__\bv_\ba_\bl_\bi_\bd_\b(_\b)\n+ o _\br_\be_\bs_\be_\br_\bv_\be_\b(_\b)\n+ o _\ba_\bd_\bd_\b__\bf_\bi_\bl_\be_\b(_\b)_\b _\ba_\bd_\bd_\b__\bf_\bi_\bl_\be_\b__\bb_\bo_\br_\br_\bo_\bw_\b(_\b)\n+ o _\br_\be_\bn_\ba_\bm_\be_\b__\bf_\bi_\bl_\be_\b(_\b)\n+ o _\bm_\ba_\bp_\b__\bb_\bl_\bo_\bc_\bk_\b(_\b)\n+ o _\bm_\ba_\bp_\b__\bf_\bi_\bl_\be_\b(_\b)\n+ o _\bn_\bu_\bm_\b__\bf_\bi_\bl_\be_\bs_\b(_\b)\n+ o _\be_\bn_\bd_\b__\bf_\bi_\bl_\be_\b(_\b)\n+ o _\bf_\bi_\bl_\be_\b__\br_\ba_\bn_\bg_\be_\b(_\b)\n+ o _\bt_\bo_\bt_\ba_\bl_\b__\bs_\bi_\bz_\be_\b(_\b)\n+ o _\bs_\be_\bt_\b__\bn_\bu_\bm_\b__\bp_\bi_\be_\bc_\be_\bs_\b(_\b)_\b _\bn_\bu_\bm_\b__\bp_\bi_\be_\bc_\be_\bs_\b(_\b)\n+ o _\be_\bn_\bd_\b__\bp_\bi_\be_\bc_\be_\b(_\b)\n+ o _\bl_\ba_\bs_\bt_\b__\bp_\bi_\be_\bc_\be_\b(_\b)\n+ o _\bp_\bi_\be_\bc_\be_\b__\br_\ba_\bn_\bg_\be_\b(_\b)\n+ o _\bs_\be_\bt_\b__\bp_\bi_\be_\bc_\be_\b__\bl_\be_\bn_\bg_\bt_\bh_\b(_\b)_\b _\bp_\bi_\be_\bc_\be_\b__\bl_\be_\bn_\bg_\bt_\bh_\b(_\b)\n+ o _\bp_\bi_\be_\bc_\be_\b__\bs_\bi_\bz_\be_\b(_\b)\n+ o _\bp_\bi_\be_\bc_\be_\b__\bs_\bi_\bz_\be_\b2_\b(_\b)\n+ o _\bb_\bl_\bo_\bc_\bk_\bs_\b__\bi_\bn_\b__\bp_\bi_\be_\bc_\be_\b2_\b(_\b)\n+ o _\bb_\bl_\bo_\bc_\bk_\bs_\b__\bp_\be_\br_\b__\bp_\bi_\be_\bc_\be_\b(_\b)\n+ o _\bs_\be_\bt_\b__\bn_\ba_\bm_\be_\b(_\b)_\b _\bn_\ba_\bm_\be_\b(_\b)\n o _\bs_\bw_\ba_\bp_\b(_\b)\n- o _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b[_\b]_\b(_\b)\n- o _\bf_\bi_\bn_\bd_\b__\bk_\be_\by_\b(_\b)\n- o _\bt_\bo_\b__\bs_\bt_\br_\bi_\bn_\bg_\b(_\b)\n- o _\be_\bn_\bu_\bm_\b _\bd_\ba_\bt_\ba_\b__\bt_\by_\bp_\be\n- * _\bb_\be_\bn_\bc_\bo_\bd_\be_\b(_\b)\n- * _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b<_\b<_\b(_\b)\n- * _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be\n+ o _\bc_\ba_\bn_\bo_\bn_\bi_\bc_\ba_\bl_\bi_\bz_\be_\b(_\b)\n+ o _\bp_\ba_\bd_\b__\bf_\bi_\bl_\be_\b__\ba_\bt_\b(_\b)_\b _\bh_\ba_\bs_\bh_\b(_\b)_\b _\bs_\by_\bm_\bl_\bi_\bn_\bk_\b(_\b)_\b _\br_\bo_\bo_\bt_\b__\bp_\bt_\br_\b(_\b)_\b _\bf_\bi_\bl_\be_\b__\bp_\ba_\bt_\bh_\b(_\b)_\b _\bf_\bi_\bl_\be_\b__\bs_\bi_\bz_\be_\b(_\b)\n+ _\bm_\bt_\bi_\bm_\be_\b(_\b)_\b _\br_\bo_\bo_\bt_\b(_\b)_\b _\bf_\bi_\bl_\be_\b__\bo_\bf_\bf_\bs_\be_\bt_\b(_\b)_\b _\bf_\bi_\bl_\be_\b__\bn_\ba_\bm_\be_\b(_\b)\n+ o _\bf_\bi_\bl_\be_\b__\bp_\bi_\be_\bc_\be_\b__\br_\ba_\bn_\bg_\be_\b(_\b)_\b _\bf_\bi_\bl_\be_\b__\bn_\bu_\bm_\b__\bp_\bi_\be_\bc_\be_\bs_\b(_\b)_\b _\bf_\bi_\bl_\be_\b__\bn_\bu_\bm_\b__\bb_\bl_\bo_\bc_\bk_\bs_\b(_\b)\n+ o _\bf_\bi_\bl_\be_\b__\bf_\bi_\br_\bs_\bt_\b__\bp_\bi_\be_\bc_\be_\b__\bn_\bo_\bd_\be_\b(_\b)_\b _\bf_\bi_\bl_\be_\b__\bf_\bi_\br_\bs_\bt_\b__\bb_\bl_\bo_\bc_\bk_\b__\bn_\bo_\bd_\be_\b(_\b)\n+ o _\bf_\bi_\bl_\be_\b__\bp_\ba_\bt_\bh_\b__\bh_\ba_\bs_\bh_\b(_\b)\n+ o _\ba_\bl_\bl_\b__\bp_\ba_\bt_\bh_\b__\bh_\ba_\bs_\bh_\be_\bs_\b(_\b)\n+ o _\bf_\bi_\bl_\be_\b__\bf_\bl_\ba_\bg_\bs_\b(_\b)\n+ o _\bf_\bi_\bl_\be_\b__\ba_\bb_\bs_\bo_\bl_\bu_\bt_\be_\b__\bp_\ba_\bt_\bh_\b(_\b)\n+ o _\bf_\bi_\bl_\be_\b__\bi_\bn_\bd_\be_\bx_\b__\ba_\bt_\b__\bp_\bi_\be_\bc_\be_\b(_\b)_\b _\bf_\bi_\bl_\be_\b__\bi_\bn_\bd_\be_\bx_\b__\ba_\bt_\b__\bo_\bf_\bf_\bs_\be_\bt_\b(_\b)\n+ o _\bf_\bi_\bl_\be_\b__\bi_\bn_\bd_\be_\bx_\b__\bf_\bo_\br_\b__\br_\bo_\bo_\bt_\b(_\b)\n+ o _\bp_\bi_\be_\bc_\be_\b__\bi_\bn_\bd_\be_\bx_\b__\ba_\bt_\b__\bf_\bi_\bl_\be_\b(_\b)\n+ o _\bs_\ba_\bn_\bi_\bt_\bi_\bz_\be_\b__\bs_\by_\bm_\bl_\bi_\bn_\bk_\bs_\b(_\b)\n+ o _\bv_\b2_\b(_\b)\n+ * _\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bp_\ba_\br_\ba_\bm_\bs\n+ * _\bd_\be_\bf_\ba_\bu_\bl_\bt_\b__\bd_\bi_\bs_\bk_\b__\bi_\bo_\b__\bc_\bo_\bn_\bs_\bt_\br_\bu_\bc_\bt_\bo_\br_\b(_\b)\n+ * _\bd_\bi_\bs_\ba_\bb_\bl_\be_\bd_\b__\bd_\bi_\bs_\bk_\b__\bi_\bo_\b__\bc_\bo_\bn_\bs_\bt_\br_\bu_\bc_\bt_\bo_\br_\b(_\b)\n+ * _\bp_\bo_\bs_\bi_\bx_\b__\bd_\bi_\bs_\bk_\b__\bi_\bo_\b__\bc_\bo_\bn_\bs_\bt_\br_\bu_\bc_\bt_\bo_\br_\b(_\b)\n+ * _\bm_\bm_\ba_\bp_\b__\bd_\bi_\bs_\bk_\b__\bi_\bo_\b__\bc_\bo_\bn_\bs_\bt_\br_\bu_\bc_\bt_\bo_\br_\b(_\b)\n+ * _\be_\bn_\bu_\bm_\b _\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bm_\bo_\bd_\be_\b__\bt\n+ * _\be_\bn_\bu_\bm_\b _\bs_\bt_\ba_\bt_\bu_\bs_\b__\bt\n+ * _\be_\bn_\bu_\bm_\b _\bm_\bo_\bv_\be_\b__\bf_\bl_\ba_\bg_\bs_\b__\bt\n+ * _\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\bi_\bn_\bf_\bo_\bh_\ba_\bs_\bh\n+ * _\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\be_\bn_\bd_\bp_\bo_\bi_\bn_\bt\n+ * _\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\be_\bn_\bt_\br_\by\n+ o _\b~_\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\be_\bn_\bt_\br_\by_\b(_\b)_\b _\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\be_\bn_\bt_\br_\by_\b(_\b)_\b _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b=_\b(_\b)\n+ o _\be_\bn_\bu_\bm_\b _\bt_\br_\ba_\bc_\bk_\be_\br_\b__\bs_\bo_\bu_\br_\bc_\be\n * _\bd_\bi_\bs_\bk_\b__\bo_\bb_\bs_\be_\br_\bv_\be_\br\n o _\bo_\bn_\b__\bd_\bi_\bs_\bk_\b(_\b)\n+ * _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be\n * _\bo_\bp_\be_\bn_\b__\bf_\bi_\bl_\be_\b__\bs_\bt_\ba_\bt_\be\n * _\bd_\bi_\bs_\bk_\b__\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be\n o _\bn_\be_\bw_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b)\n o _\br_\be_\bm_\bo_\bv_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b)\n- o _\ba_\bs_\by_\bn_\bc_\b__\br_\be_\ba_\bd_\b(_\b)_\b _\ba_\bs_\by_\bn_\bc_\b__\bw_\br_\bi_\bt_\be_\b(_\b)\n+ o _\ba_\bs_\by_\bn_\bc_\b__\bw_\br_\bi_\bt_\be_\b(_\b)_\b _\ba_\bs_\by_\bn_\bc_\b__\br_\be_\ba_\bd_\b(_\b)\n o _\ba_\bs_\by_\bn_\bc_\b__\bh_\ba_\bs_\bh_\b(_\b)\n o _\ba_\bs_\by_\bn_\bc_\b__\bh_\ba_\bs_\bh_\b2_\b(_\b)\n o _\ba_\bs_\by_\bn_\bc_\b__\bm_\bo_\bv_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b(_\b)\n o _\ba_\bs_\by_\bn_\bc_\b__\br_\be_\bl_\be_\ba_\bs_\be_\b__\bf_\bi_\bl_\be_\bs_\b(_\b)\n o _\ba_\bs_\by_\bn_\bc_\b__\bc_\bh_\be_\bc_\bk_\b__\bf_\bi_\bl_\be_\bs_\b(_\b)\n o _\ba_\bs_\by_\bn_\bc_\b__\bs_\bt_\bo_\bp_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b)\n o _\ba_\bs_\by_\bn_\bc_\b__\br_\be_\bn_\ba_\bm_\be_\b__\bf_\bi_\bl_\be_\b(_\b)\n@@ -413,112 +357,38 @@\n o _\b~_\bd_\bi_\bs_\bk_\b__\bb_\bu_\bf_\bf_\be_\br_\b__\bh_\bo_\bl_\bd_\be_\br_\b(_\b)\n o _\bd_\ba_\bt_\ba_\b(_\b)\n o _\br_\be_\bs_\be_\bt_\b(_\b)\n o _\bs_\bw_\ba_\bp_\b(_\b)\n o _\bi_\bs_\b__\bm_\bu_\bt_\ba_\bb_\bl_\be_\b(_\b)\n o _\bb_\bo_\bo_\bl_\b(_\b)\n * _\bf_\bi_\bl_\be_\b__\bo_\bp_\be_\bn_\b__\bm_\bo_\bd_\be_\b__\bt\n- * _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk\n- o _\bs_\be_\bt_\b__\bb_\bo_\bo_\bl_\b(_\b)_\b _\bs_\be_\bt_\b__\bs_\bt_\br_\b(_\b)_\b _\bs_\be_\bt_\b__\bi_\bn_\bt_\b(_\b)\n- o _\bh_\ba_\bs_\b__\bv_\ba_\bl_\b(_\b)\n- o _\bc_\bl_\be_\ba_\br_\b(_\b)\n- o _\bc_\bl_\be_\ba_\br_\b(_\b)\n- o _\bg_\be_\bt_\b__\bi_\bn_\bt_\b(_\b)_\b _\bg_\be_\bt_\b__\bs_\bt_\br_\b(_\b)_\b _\bg_\be_\bt_\b__\bb_\bo_\bo_\bl_\b(_\b)\n- o _\be_\bn_\bu_\bm_\b _\bt_\by_\bp_\be_\b__\bb_\ba_\bs_\be_\bs\n- o _\be_\bn_\bu_\bm_\b _\bm_\bm_\ba_\bp_\b__\bw_\br_\bi_\bt_\be_\b__\bm_\bo_\bd_\be_\b__\bt\n- o _\be_\bn_\bu_\bm_\b _\bs_\bu_\bg_\bg_\be_\bs_\bt_\b__\bm_\bo_\bd_\be_\b__\bt\n- o _\be_\bn_\bu_\bm_\b _\bc_\bh_\bo_\bk_\bi_\bn_\bg_\b__\ba_\bl_\bg_\bo_\br_\bi_\bt_\bh_\bm_\b__\bt\n- o _\be_\bn_\bu_\bm_\b _\bs_\be_\be_\bd_\b__\bc_\bh_\bo_\bk_\bi_\bn_\bg_\b__\ba_\bl_\bg_\bo_\br_\bi_\bt_\bh_\bm_\b__\bt\n- o _\be_\bn_\bu_\bm_\b _\bi_\bo_\b__\bb_\bu_\bf_\bf_\be_\br_\b__\bm_\bo_\bd_\be_\b__\bt\n- o _\be_\bn_\bu_\bm_\b _\bb_\ba_\bn_\bd_\bw_\bi_\bd_\bt_\bh_\b__\bm_\bi_\bx_\be_\bd_\b__\ba_\bl_\bg_\bo_\b__\bt\n- o _\be_\bn_\bu_\bm_\b _\be_\bn_\bc_\b__\bp_\bo_\bl_\bi_\bc_\by\n- o _\be_\bn_\bu_\bm_\b _\be_\bn_\bc_\b__\bl_\be_\bv_\be_\bl\n- o _\be_\bn_\bu_\bm_\b _\bp_\br_\bo_\bx_\by_\b__\bt_\by_\bp_\be_\b__\bt\n- * _\bh_\bi_\bg_\bh_\b__\bp_\be_\br_\bf_\bo_\br_\bm_\ba_\bn_\bc_\be_\b__\bs_\be_\be_\bd_\b(_\b)_\b _\bm_\bi_\bn_\b__\bm_\be_\bm_\bo_\br_\by_\b__\bu_\bs_\ba_\bg_\be_\b(_\b)\n- * _\bn_\ba_\bm_\be_\b__\bf_\bo_\br_\b__\bs_\be_\bt_\bt_\bi_\bn_\bg_\b(_\b)_\b _\bs_\be_\bt_\bt_\bi_\bn_\bg_\b__\bb_\by_\b__\bn_\ba_\bm_\be_\b(_\b)\n- * _\bd_\be_\bf_\ba_\bu_\bl_\bt_\b__\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b(_\b)\n- * _\bg_\be_\bn_\be_\br_\ba_\bt_\be_\b__\bf_\bi_\bn_\bg_\be_\br_\bp_\br_\bi_\bn_\bt_\b(_\b)\n+ * _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs\n * _\bc_\bl_\bi_\be_\bn_\bt_\b__\bd_\ba_\bt_\ba_\b__\bt\n o _\bc_\bl_\bi_\be_\bn_\bt_\b__\bd_\ba_\bt_\ba_\b__\bt_\b(_\b)\n- o _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b=_\b(_\b)_\b _\bc_\bo_\bn_\bs_\bt_\b*_\b(_\b)_\b _\bv_\bo_\bi_\bd_\b*_\b(_\b)\n- * _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs\n- * _\bb_\bl_\bo_\bc_\bk_\b__\bi_\bn_\bf_\bo\n- o _\bs_\be_\bt_\b__\bp_\be_\be_\br_\b(_\b)_\b _\bp_\be_\be_\br_\b(_\b)\n- o _\be_\bn_\bu_\bm_\b _\bb_\bl_\bo_\bc_\bk_\b__\bs_\bt_\ba_\bt_\be_\b__\bt\n- * _\bp_\ba_\br_\bt_\bi_\ba_\bl_\b__\bp_\bi_\be_\bc_\be_\b__\bi_\bn_\bf_\bo\n- * _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be\n- o _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be_\b(_\b)\n- o _\ba_\bd_\bd_\b__\bp_\bi_\be_\bc_\be_\b(_\b)\n- o _\br_\be_\ba_\bd_\b__\bp_\bi_\be_\bc_\be_\b(_\b)\n- o _\bh_\ba_\bv_\be_\b__\bp_\bi_\be_\bc_\be_\b(_\b)\n- o _\bg_\be_\bt_\b__\bp_\be_\be_\br_\b__\bi_\bn_\bf_\bo_\b(_\b)_\b _\bp_\bo_\bs_\bt_\b__\bp_\be_\be_\br_\b__\bi_\bn_\bf_\bo_\b(_\b)\n- o _\bp_\bo_\bs_\bt_\b__\bs_\bt_\ba_\bt_\bu_\bs_\b(_\b)_\b _\bs_\bt_\ba_\bt_\bu_\bs_\b(_\b)\n- o _\bg_\be_\bt_\b__\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\b__\bq_\bu_\be_\bu_\be_\b(_\b)_\b _\bp_\bo_\bs_\bt_\b__\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\b__\bq_\bu_\be_\bu_\be_\b(_\b)\n- o _\bs_\be_\bt_\b__\bp_\bi_\be_\bc_\be_\b__\bd_\be_\ba_\bd_\bl_\bi_\bn_\be_\b(_\b)_\b _\bc_\bl_\be_\ba_\br_\b__\bp_\bi_\be_\bc_\be_\b__\bd_\be_\ba_\bd_\bl_\bi_\bn_\be_\bs_\b(_\b)_\b _\br_\be_\bs_\be_\bt_\b__\bp_\bi_\be_\bc_\be_\b__\bd_\be_\ba_\bd_\bl_\bi_\bn_\be_\b(_\b)\n- o _\bp_\bo_\bs_\bt_\b__\bf_\bi_\bl_\be_\b__\bp_\br_\bo_\bg_\br_\be_\bs_\bs_\b(_\b)_\b _\bf_\bi_\bl_\be_\b__\bp_\br_\bo_\bg_\br_\be_\bs_\bs_\b(_\b)\n- o _\bf_\bi_\bl_\be_\b__\bs_\bt_\ba_\bt_\bu_\bs_\b(_\b)\n- o _\bc_\bl_\be_\ba_\br_\b__\be_\br_\br_\bo_\br_\b(_\b)\n- o _\bp_\bo_\bs_\bt_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\bs_\b(_\b)_\b _\ba_\bd_\bd_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\b(_\b)_\b _\br_\be_\bp_\bl_\ba_\bc_\be_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\bs_\b(_\b)_\b _\bt_\br_\ba_\bc_\bk_\be_\br_\bs_\b(_\b)\n- o _\ba_\bd_\bd_\b__\bu_\br_\bl_\b__\bs_\be_\be_\bd_\b(_\b)_\b _\bu_\br_\bl_\b__\bs_\be_\be_\bd_\bs_\b(_\b)_\b _\br_\be_\bm_\bo_\bv_\be_\b__\bu_\br_\bl_\b__\bs_\be_\be_\bd_\b(_\b)\n- o _\bh_\bt_\bt_\bp_\b__\bs_\be_\be_\bd_\bs_\b(_\b)_\b _\ba_\bd_\bd_\b__\bh_\bt_\bt_\bp_\b__\bs_\be_\be_\bd_\b(_\b)_\b _\br_\be_\bm_\bo_\bv_\be_\b__\bh_\bt_\bt_\bp_\b__\bs_\be_\be_\bd_\b(_\b)\n- o _\ba_\bd_\bd_\b__\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\b(_\b)\n- o _\bs_\be_\bt_\b__\bm_\be_\bt_\ba_\bd_\ba_\bt_\ba_\b(_\b)\n- o _\bi_\bs_\b__\bv_\ba_\bl_\bi_\bd_\b(_\b)\n- o _\br_\be_\bs_\bu_\bm_\be_\b(_\b)_\b _\bp_\ba_\bu_\bs_\be_\b(_\b)\n- o _\bf_\bl_\ba_\bg_\bs_\b(_\b)_\b _\bu_\bn_\bs_\be_\bt_\b__\bf_\bl_\ba_\bg_\bs_\b(_\b)_\b _\bs_\be_\bt_\b__\bf_\bl_\ba_\bg_\bs_\b(_\b)\n- o _\bf_\bl_\bu_\bs_\bh_\b__\bc_\ba_\bc_\bh_\be_\b(_\b)\n- o _\bf_\bo_\br_\bc_\be_\b__\br_\be_\bc_\bh_\be_\bc_\bk_\b(_\b)\n- o _\bs_\ba_\bv_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b)\n- o _\bn_\be_\be_\bd_\b__\bs_\ba_\bv_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b)\n- o _\bq_\bu_\be_\bu_\be_\b__\bp_\bo_\bs_\bi_\bt_\bi_\bo_\bn_\b__\bb_\bo_\bt_\bt_\bo_\bm_\b(_\b)_\b _\bq_\bu_\be_\bu_\be_\b__\bp_\bo_\bs_\bi_\bt_\bi_\bo_\bn_\b__\bt_\bo_\bp_\b(_\b)_\b _\bq_\bu_\be_\bu_\be_\b__\bp_\bo_\bs_\bi_\bt_\bi_\bo_\bn_\b__\bd_\bo_\bw_\bn_\b(_\b)\n- _\bq_\bu_\be_\bu_\be_\b__\bp_\bo_\bs_\bi_\bt_\bi_\bo_\bn_\b(_\b)_\b _\bq_\bu_\be_\bu_\be_\b__\bp_\bo_\bs_\bi_\bt_\bi_\bo_\bn_\b__\bu_\bp_\b(_\b)\n- o _\bq_\bu_\be_\bu_\be_\b__\bp_\bo_\bs_\bi_\bt_\bi_\bo_\bn_\b__\bs_\be_\bt_\b(_\b)\n- o _\bs_\be_\bt_\b__\bs_\bs_\bl_\b__\bc_\be_\br_\bt_\bi_\bf_\bi_\bc_\ba_\bt_\be_\b__\bb_\bu_\bf_\bf_\be_\br_\b(_\b)_\b _\bs_\be_\bt_\b__\bs_\bs_\bl_\b__\bc_\be_\br_\bt_\bi_\bf_\bi_\bc_\ba_\bt_\be_\b(_\b)\n- o _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bi_\bl_\be_\b__\bw_\bi_\bt_\bh_\b__\bh_\ba_\bs_\bh_\be_\bs_\b(_\b)_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bi_\bl_\be_\b(_\b)\n- o _\bp_\bi_\be_\bc_\be_\b__\bl_\ba_\by_\be_\br_\bs_\b(_\b)\n- o _\bp_\bo_\bs_\bt_\b__\bp_\bi_\be_\bc_\be_\b__\ba_\bv_\ba_\bi_\bl_\ba_\bb_\bi_\bl_\bi_\bt_\by_\b(_\b)_\b _\bp_\bi_\be_\bc_\be_\b__\ba_\bv_\ba_\bi_\bl_\ba_\bb_\bi_\bl_\bi_\bt_\by_\b(_\b)\n- o _\bp_\br_\bi_\bo_\br_\bi_\bt_\bi_\bz_\be_\b__\bp_\bi_\be_\bc_\be_\bs_\b(_\b)_\b _\bp_\bi_\be_\bc_\be_\b__\bp_\br_\bi_\bo_\br_\bi_\bt_\by_\b(_\b)_\b _\bg_\be_\bt_\b__\bp_\bi_\be_\bc_\be_\b__\bp_\br_\bi_\bo_\br_\bi_\bt_\bi_\be_\bs_\b(_\b)\n- o _\bg_\be_\bt_\b__\bf_\bi_\bl_\be_\b__\bp_\br_\bi_\bo_\br_\bi_\bt_\bi_\be_\bs_\b(_\b)_\b _\bf_\bi_\bl_\be_\b__\bp_\br_\bi_\bo_\br_\bi_\bt_\by_\b(_\b)_\b _\bp_\br_\bi_\bo_\br_\bi_\bt_\bi_\bz_\be_\b__\bf_\bi_\bl_\be_\bs_\b(_\b)\n- o _\bf_\bo_\br_\bc_\be_\b__\br_\be_\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b(_\b)_\b _\bf_\bo_\br_\bc_\be_\b__\bl_\bs_\bd_\b__\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b(_\b)_\b _\bf_\bo_\br_\bc_\be_\b__\bd_\bh_\bt_\b__\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b(_\b)\n- o _\bs_\bc_\br_\ba_\bp_\be_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\b(_\b)\n- o _\bu_\bp_\bl_\bo_\ba_\bd_\b__\bl_\bi_\bm_\bi_\bt_\b(_\b)_\b _\bs_\be_\bt_\b__\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\b__\bl_\bi_\bm_\bi_\bt_\b(_\b)_\b _\bs_\be_\bt_\b__\bu_\bp_\bl_\bo_\ba_\bd_\b__\bl_\bi_\bm_\bi_\bt_\b(_\b)\n- _\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\b__\bl_\bi_\bm_\bi_\bt_\b(_\b)\n- o _\bc_\bo_\bn_\bn_\be_\bc_\bt_\b__\bp_\be_\be_\br_\b(_\b)\n- o _\bc_\bl_\be_\ba_\br_\b__\bp_\be_\be_\br_\bs_\b(_\b)\n- o _\bs_\be_\bt_\b__\bm_\ba_\bx_\b__\bu_\bp_\bl_\bo_\ba_\bd_\bs_\b(_\b)_\b _\bm_\ba_\bx_\b__\bu_\bp_\bl_\bo_\ba_\bd_\bs_\b(_\b)\n- o _\bs_\be_\bt_\b__\bm_\ba_\bx_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\bs_\b(_\b)_\b _\bm_\ba_\bx_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\bs_\b(_\b)\n- o _\bm_\bo_\bv_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b(_\b)\n- o _\br_\be_\bn_\ba_\bm_\be_\b__\bf_\bi_\bl_\be_\b(_\b)\n- o _\bi_\bn_\bf_\bo_\b__\bh_\ba_\bs_\bh_\be_\bs_\b(_\b)_\b _\bi_\bn_\bf_\bo_\b__\bh_\ba_\bs_\bh_\b(_\b)\n- o _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b!_\b=_\b(_\b)_\b _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b=_\b=_\b(_\b)_\b _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b<_\b(_\b)\n- o _\bi_\bd_\b(_\b)\n- o _\bn_\ba_\bt_\bi_\bv_\be_\b__\bh_\ba_\bn_\bd_\bl_\be_\b(_\b)\n- o _\bu_\bs_\be_\br_\bd_\ba_\bt_\ba_\b(_\b)\n- o _\bi_\bn_\b__\bs_\be_\bs_\bs_\bi_\bo_\bn_\b(_\b)\n- * _\bh_\ba_\bs_\bh_\b__\bv_\ba_\bl_\bu_\be_\b(_\b)\n+ o _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b=_\b(_\b)_\b _\bv_\bo_\bi_\bd_\b*_\b(_\b)_\b _\bc_\bo_\bn_\bs_\bt_\b*_\b(_\b)\n * _\bw_\be_\bb_\b__\bs_\be_\be_\bd_\b__\be_\bn_\bt_\br_\by\n o _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b=_\b=_\b(_\b)\n o _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b<_\b(_\b)\n o _\be_\bn_\bu_\bm_\b _\bt_\by_\bp_\be_\b__\bt\n * _\bl_\bo_\ba_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bl_\bi_\bm_\bi_\bt_\bs\n * _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo\n o _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b(_\b)\n o _\b~_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b(_\b)\n- o _\bo_\br_\bi_\bg_\b__\bf_\bi_\bl_\be_\bs_\b(_\b)_\b _\bf_\bi_\bl_\be_\bs_\b(_\b)\n+ o _\bf_\bi_\bl_\be_\bs_\b(_\b)_\b _\bo_\br_\bi_\bg_\b__\bf_\bi_\bl_\be_\bs_\b(_\b)\n o _\br_\be_\bn_\ba_\bm_\be_\b__\bf_\bi_\bl_\be_\b(_\b)\n o _\br_\be_\bm_\ba_\bp_\b__\bf_\bi_\bl_\be_\bs_\b(_\b)\n- o _\bc_\bl_\be_\ba_\br_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\bs_\b(_\b)_\b _\ba_\bd_\bd_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\b(_\b)_\b _\bt_\br_\ba_\bc_\bk_\be_\br_\bs_\b(_\b)\n- o _\bc_\bo_\bl_\bl_\be_\bc_\bt_\bi_\bo_\bn_\bs_\b(_\b)_\b _\bs_\bi_\bm_\bi_\bl_\ba_\br_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\bs_\b(_\b)\n- o _\ba_\bd_\bd_\b__\bu_\br_\bl_\b__\bs_\be_\be_\bd_\b(_\b)_\b _\bs_\be_\bt_\b__\bw_\be_\bb_\b__\bs_\be_\be_\bd_\bs_\b(_\b)_\b _\bw_\be_\bb_\b__\bs_\be_\be_\bd_\bs_\b(_\b)_\b _\ba_\bd_\bd_\b__\bh_\bt_\bt_\bp_\b__\bs_\be_\be_\bd_\b(_\b)\n+ o _\bc_\bl_\be_\ba_\br_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\bs_\b(_\b)_\b _\bt_\br_\ba_\bc_\bk_\be_\br_\bs_\b(_\b)_\b _\ba_\bd_\bd_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\b(_\b)\n+ o _\bs_\bi_\bm_\bi_\bl_\ba_\br_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\bs_\b(_\b)_\b _\bc_\bo_\bl_\bl_\be_\bc_\bt_\bi_\bo_\bn_\bs_\b(_\b)\n+ o _\bw_\be_\bb_\b__\bs_\be_\be_\bd_\bs_\b(_\b)_\b _\bs_\be_\bt_\b__\bw_\be_\bb_\b__\bs_\be_\be_\bd_\bs_\b(_\b)_\b _\ba_\bd_\bd_\b__\bh_\bt_\bt_\bp_\b__\bs_\be_\be_\bd_\b(_\b)_\b _\ba_\bd_\bd_\b__\bu_\br_\bl_\b__\bs_\be_\be_\bd_\b(_\b)\n o _\bt_\bo_\bt_\ba_\bl_\b__\bs_\bi_\bz_\be_\b(_\b)\n- o _\bn_\bu_\bm_\b__\bp_\bi_\be_\bc_\be_\bs_\b(_\b)_\b _\bp_\bi_\be_\bc_\be_\b__\bl_\be_\bn_\bg_\bt_\bh_\b(_\b)\n+ o _\bp_\bi_\be_\bc_\be_\b__\bl_\be_\bn_\bg_\bt_\bh_\b(_\b)_\b _\bn_\bu_\bm_\b__\bp_\bi_\be_\bc_\be_\bs_\b(_\b)\n o _\bb_\bl_\bo_\bc_\bk_\bs_\b__\bp_\be_\br_\b__\bp_\bi_\be_\bc_\be_\b(_\b)\n- o _\bl_\ba_\bs_\bt_\b__\bp_\bi_\be_\bc_\be_\b(_\b)_\b _\be_\bn_\bd_\b__\bp_\bi_\be_\bc_\be_\b(_\b)_\b _\bp_\bi_\be_\bc_\be_\b__\br_\ba_\bn_\bg_\be_\b(_\b)\n+ o _\bp_\bi_\be_\bc_\be_\b__\br_\ba_\bn_\bg_\be_\b(_\b)_\b _\be_\bn_\bd_\b__\bp_\bi_\be_\bc_\be_\b(_\b)_\b _\bl_\ba_\bs_\bt_\b__\bp_\bi_\be_\bc_\be_\b(_\b)\n o _\bi_\bn_\bf_\bo_\b__\bh_\ba_\bs_\bh_\be_\bs_\b(_\b)_\b _\bi_\bn_\bf_\bo_\b__\bh_\ba_\bs_\bh_\b(_\b)\n- o _\bv_\b1_\b(_\b)_\b _\bv_\b2_\b(_\b)\n+ o _\bv_\b2_\b(_\b)_\b _\bv_\b1_\b(_\b)\n o _\bn_\bu_\bm_\b__\bf_\bi_\bl_\be_\bs_\b(_\b)\n o _\bm_\ba_\bp_\b__\bb_\bl_\bo_\bc_\bk_\b(_\b)\n o _\bm_\ba_\bp_\b__\bf_\bi_\bl_\be_\b(_\b)\n o _\bs_\bs_\bl_\b__\bc_\be_\br_\bt_\b(_\b)\n o _\bi_\bs_\b__\bv_\ba_\bl_\bi_\bd_\b(_\b)\n o _\bp_\br_\bi_\bv_\b(_\b)\n o _\bi_\bs_\b__\bi_\b2_\bp_\b(_\b)\n@@ -531,14 +401,34 @@\n o _\bn_\bo_\bd_\be_\bs_\b(_\b)\n o _\ba_\bd_\bd_\b__\bn_\bo_\bd_\be_\b(_\b)\n o _\bp_\ba_\br_\bs_\be_\b__\bi_\bn_\bf_\bo_\b__\bs_\be_\bc_\bt_\bi_\bo_\bn_\b(_\b)\n o _\bi_\bn_\bf_\bo_\b(_\b)\n o _\bi_\bn_\bf_\bo_\b__\bs_\be_\bc_\bt_\bi_\bo_\bn_\b(_\b)\n o _\bp_\bi_\be_\bc_\be_\b__\bl_\ba_\by_\be_\br_\b(_\b)\n o _\bf_\br_\be_\be_\b__\bp_\bi_\be_\bc_\be_\b__\bl_\ba_\by_\be_\br_\bs_\b(_\b)\n+ * _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk\n+ o _\bs_\be_\bt_\b__\bs_\bt_\br_\b(_\b)_\b _\bs_\be_\bt_\b__\bb_\bo_\bo_\bl_\b(_\b)_\b _\bs_\be_\bt_\b__\bi_\bn_\bt_\b(_\b)\n+ o _\bh_\ba_\bs_\b__\bv_\ba_\bl_\b(_\b)\n+ o _\bc_\bl_\be_\ba_\br_\b(_\b)\n+ o _\bc_\bl_\be_\ba_\br_\b(_\b)\n+ o _\bg_\be_\bt_\b__\bb_\bo_\bo_\bl_\b(_\b)_\b _\bg_\be_\bt_\b__\bi_\bn_\bt_\b(_\b)_\b _\bg_\be_\bt_\b__\bs_\bt_\br_\b(_\b)\n+ o _\be_\bn_\bu_\bm_\b _\bt_\by_\bp_\be_\b__\bb_\ba_\bs_\be_\bs\n+ o _\be_\bn_\bu_\bm_\b _\bm_\bm_\ba_\bp_\b__\bw_\br_\bi_\bt_\be_\b__\bm_\bo_\bd_\be_\b__\bt\n+ o _\be_\bn_\bu_\bm_\b _\bs_\bu_\bg_\bg_\be_\bs_\bt_\b__\bm_\bo_\bd_\be_\b__\bt\n+ o _\be_\bn_\bu_\bm_\b _\bc_\bh_\bo_\bk_\bi_\bn_\bg_\b__\ba_\bl_\bg_\bo_\br_\bi_\bt_\bh_\bm_\b__\bt\n+ o _\be_\bn_\bu_\bm_\b _\bs_\be_\be_\bd_\b__\bc_\bh_\bo_\bk_\bi_\bn_\bg_\b__\ba_\bl_\bg_\bo_\br_\bi_\bt_\bh_\bm_\b__\bt\n+ o _\be_\bn_\bu_\bm_\b _\bi_\bo_\b__\bb_\bu_\bf_\bf_\be_\br_\b__\bm_\bo_\bd_\be_\b__\bt\n+ o _\be_\bn_\bu_\bm_\b _\bb_\ba_\bn_\bd_\bw_\bi_\bd_\bt_\bh_\b__\bm_\bi_\bx_\be_\bd_\b__\ba_\bl_\bg_\bo_\b__\bt\n+ o _\be_\bn_\bu_\bm_\b _\be_\bn_\bc_\b__\bp_\bo_\bl_\bi_\bc_\by\n+ o _\be_\bn_\bu_\bm_\b _\be_\bn_\bc_\b__\bl_\be_\bv_\be_\bl\n+ o _\be_\bn_\bu_\bm_\b _\bp_\br_\bo_\bx_\by_\b__\bt_\by_\bp_\be_\b__\bt\n+ * _\bg_\be_\bn_\be_\br_\ba_\bt_\be_\b__\bf_\bi_\bn_\bg_\be_\br_\bp_\br_\bi_\bn_\bt_\b(_\b)\n+ * _\bh_\bi_\bg_\bh_\b__\bp_\be_\br_\bf_\bo_\br_\bm_\ba_\bn_\bc_\be_\b__\bs_\be_\be_\bd_\b(_\b)_\b _\bm_\bi_\bn_\b__\bm_\be_\bm_\bo_\br_\by_\b__\bu_\bs_\ba_\bg_\be_\b(_\b)\n+ * _\bn_\ba_\bm_\be_\b__\bf_\bo_\br_\b__\bs_\be_\bt_\bt_\bi_\bn_\bg_\b(_\b)_\b _\bs_\be_\bt_\bt_\bi_\bn_\bg_\b__\bb_\by_\b__\bn_\ba_\bm_\be_\b(_\b)\n+ * _\bd_\be_\bf_\ba_\bu_\bl_\bt_\b__\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b(_\b)\n * _\ba_\b _\bw_\bo_\br_\bd_\b _\bo_\bf_\b _\bc_\ba_\bu_\bt_\bi_\bo_\bn\n * _\bp_\bl_\bu_\bg_\bi_\bn_\b-_\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be\n * _\bc_\bu_\bs_\bt_\bo_\bm_\b _\ba_\bl_\be_\br_\bt_\bs\n * _\bp_\bl_\bu_\bg_\bi_\bn\n o _\bi_\bm_\bp_\bl_\be_\bm_\be_\bn_\bt_\be_\bd_\b__\bf_\be_\ba_\bt_\bu_\br_\be_\bs_\b(_\b)\n o _\bn_\be_\bw_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b)\n o _\ba_\bd_\bd_\be_\bd_\b(_\b)\n@@ -547,64 +437,174 @@\n o _\bo_\bn_\b__\ba_\bl_\be_\br_\bt_\b(_\b)\n o _\bo_\bn_\b__\bu_\bn_\bk_\bn_\bo_\bw_\bn_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b)\n o _\bo_\bn_\b__\bt_\bi_\bc_\bk_\b(_\b)\n o _\bg_\be_\bt_\b__\bu_\bn_\bc_\bh_\bo_\bk_\be_\b__\bp_\br_\bi_\bo_\br_\bi_\bt_\by_\b(_\b)\n o _\bl_\bo_\ba_\bd_\b__\bs_\bt_\ba_\bt_\be_\b(_\b)\n * _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\bl_\bu_\bg_\bi_\bn\n o _\bn_\be_\bw_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b(_\b)\n- o _\bo_\bn_\b__\bp_\bi_\be_\bc_\be_\b__\bp_\ba_\bs_\bs_\b(_\b)_\b _\bo_\bn_\b__\bp_\bi_\be_\bc_\be_\b__\bf_\ba_\bi_\bl_\be_\bd_\b(_\b)\n+ o _\bo_\bn_\b__\bp_\bi_\be_\bc_\be_\b__\bf_\ba_\bi_\bl_\be_\bd_\b(_\b)_\b _\bo_\bn_\b__\bp_\bi_\be_\bc_\be_\b__\bp_\ba_\bs_\bs_\b(_\b)\n o _\bt_\bi_\bc_\bk_\b(_\b)\n- o _\bo_\bn_\b__\bp_\ba_\bu_\bs_\be_\b(_\b)_\b _\bo_\bn_\b__\br_\be_\bs_\bu_\bm_\be_\b(_\b)\n+ o _\bo_\bn_\b__\br_\be_\bs_\bu_\bm_\be_\b(_\b)_\b _\bo_\bn_\b__\bp_\ba_\bu_\bs_\be_\b(_\b)\n o _\bo_\bn_\b__\bf_\bi_\bl_\be_\bs_\b__\bc_\bh_\be_\bc_\bk_\be_\bd_\b(_\b)\n o _\bo_\bn_\b__\bs_\bt_\ba_\bt_\be_\b(_\b)\n o _\bo_\bn_\b__\ba_\bd_\bd_\b__\bp_\be_\be_\br_\b(_\b)\n * _\bp_\be_\be_\br_\b__\bp_\bl_\bu_\bg_\bi_\bn\n o _\bt_\by_\bp_\be_\b(_\b)\n o _\ba_\bd_\bd_\b__\bh_\ba_\bn_\bd_\bs_\bh_\ba_\bk_\be_\b(_\b)\n o _\bo_\bn_\b__\bd_\bi_\bs_\bc_\bo_\bn_\bn_\be_\bc_\bt_\b(_\b)\n o _\bo_\bn_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\be_\bd_\b(_\b)\n o _\bo_\bn_\b__\bh_\ba_\bn_\bd_\bs_\bh_\ba_\bk_\be_\b(_\b)\n o _\bo_\bn_\b__\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\b__\bh_\ba_\bn_\bd_\bs_\bh_\ba_\bk_\be_\b(_\b)\n- o _\bo_\bn_\b__\bn_\bo_\bt_\b__\bi_\bn_\bt_\be_\br_\be_\bs_\bt_\be_\bd_\b(_\b)_\b _\bo_\bn_\b__\bc_\bh_\bo_\bk_\be_\b(_\b)_\b _\bo_\bn_\b__\bu_\bn_\bc_\bh_\bo_\bk_\be_\b(_\b)_\b _\bo_\bn_\b__\bd_\bo_\bn_\bt_\b__\bh_\ba_\bv_\be_\b(_\b)\n- _\bo_\bn_\b__\ba_\bl_\bl_\bo_\bw_\be_\bd_\b__\bf_\ba_\bs_\bt_\b(_\b)_\b _\bo_\bn_\b__\bh_\ba_\bv_\be_\b__\ba_\bl_\bl_\b(_\b)_\b _\bo_\bn_\b__\bh_\ba_\bv_\be_\b(_\b)_\b _\bo_\bn_\b__\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd_\b(_\b)_\b _\bo_\bn_\b__\br_\be_\bq_\bu_\be_\bs_\bt\n- _\b(_\b)_\b _\bo_\bn_\b__\bh_\ba_\bv_\be_\b__\bn_\bo_\bn_\be_\b(_\b)_\b _\bo_\bn_\b__\bi_\bn_\bt_\be_\br_\be_\bs_\bt_\be_\bd_\b(_\b)\n+ o _\bo_\bn_\b__\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd_\b(_\b)_\b _\bo_\bn_\b__\bi_\bn_\bt_\be_\br_\be_\bs_\bt_\be_\bd_\b(_\b)_\b _\bo_\bn_\b__\bn_\bo_\bt_\b__\bi_\bn_\bt_\be_\br_\be_\bs_\bt_\be_\bd_\b(_\b)_\b _\bo_\bn_\b__\bc_\bh_\bo_\bk_\be_\b(_\b)\n+ _\bo_\bn_\b__\bh_\ba_\bv_\be_\b__\bn_\bo_\bn_\be_\b(_\b)_\b _\bo_\bn_\b__\bu_\bn_\bc_\bh_\bo_\bk_\be_\b(_\b)_\b _\bo_\bn_\b__\bd_\bo_\bn_\bt_\b__\bh_\ba_\bv_\be_\b(_\b)_\b _\bo_\bn_\b__\bh_\ba_\bv_\be_\b__\ba_\bl_\bl_\b(_\b)\n+ _\bo_\bn_\b__\ba_\bl_\bl_\bo_\bw_\be_\bd_\b__\bf_\ba_\bs_\bt_\b(_\b)_\b _\bo_\bn_\b__\bh_\ba_\bv_\be_\b(_\b)_\b _\bo_\bn_\b__\br_\be_\bq_\bu_\be_\bs_\bt_\b(_\b)\n o _\bo_\bn_\b__\bp_\bi_\be_\bc_\be_\b(_\b)\n- o _\bs_\be_\bn_\bt_\b__\bi_\bn_\bt_\be_\br_\be_\bs_\bt_\be_\bd_\b(_\b)_\b _\bs_\be_\bn_\bt_\b__\bu_\bn_\bc_\bh_\bo_\bk_\be_\b(_\b)_\b _\bs_\be_\bn_\bt_\b__\bh_\ba_\bv_\be_\b(_\b)_\b _\bs_\be_\bn_\bt_\b__\bp_\bi_\be_\bc_\be_\b(_\b)\n+ o _\bs_\be_\bn_\bt_\b__\bh_\ba_\bv_\be_\b(_\b)_\b _\bs_\be_\bn_\bt_\b__\bi_\bn_\bt_\be_\br_\be_\bs_\bt_\be_\bd_\b(_\b)_\b _\bs_\be_\bn_\bt_\b__\bp_\bi_\be_\bc_\be_\b(_\b)_\b _\bs_\be_\bn_\bt_\b__\bu_\bn_\bc_\bh_\bo_\bk_\be_\b(_\b)\n _\bs_\be_\bn_\bt_\b__\bn_\bo_\bt_\b__\bi_\bn_\bt_\be_\br_\be_\bs_\bt_\be_\bd_\b(_\b)\n o _\bs_\be_\bn_\bt_\b__\bp_\ba_\by_\bl_\bo_\ba_\bd_\b(_\b)\n o _\bc_\ba_\bn_\b__\bd_\bi_\bs_\bc_\bo_\bn_\bn_\be_\bc_\bt_\b(_\b)\n o _\bo_\bn_\b__\be_\bx_\bt_\be_\bn_\bd_\be_\bd_\b(_\b)\n o _\bo_\bn_\b__\bu_\bn_\bk_\bn_\bo_\bw_\bn_\b__\bm_\be_\bs_\bs_\ba_\bg_\be_\b(_\b)\n- o _\bo_\bn_\b__\bp_\bi_\be_\bc_\be_\b__\bp_\ba_\bs_\bs_\b(_\b)_\b _\bo_\bn_\b__\bp_\bi_\be_\bc_\be_\b__\bf_\ba_\bi_\bl_\be_\bd_\b(_\b)\n+ o _\bo_\bn_\b__\bp_\bi_\be_\bc_\be_\b__\bf_\ba_\bi_\bl_\be_\bd_\b(_\b)_\b _\bo_\bn_\b__\bp_\bi_\be_\bc_\be_\b__\bp_\ba_\bs_\bs_\b(_\b)\n o _\bt_\bi_\bc_\bk_\b(_\b)\n o _\bw_\br_\bi_\bt_\be_\b__\br_\be_\bq_\bu_\be_\bs_\bt_\b(_\b)\n * _\bc_\br_\by_\bp_\bt_\bo_\b__\bp_\bl_\bu_\bg_\bi_\bn\n o _\bd_\be_\bc_\br_\by_\bp_\bt_\b(_\b)\n * _\bp_\be_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b__\bh_\ba_\bn_\bd_\bl_\be\n * _\bb_\bt_\b__\bp_\be_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b__\bh_\ba_\bn_\bd_\bl_\be\n- * _\bc_\br_\be_\ba_\bt_\be_\b__\bu_\bt_\b__\bp_\be_\bx_\b__\bp_\bl_\bu_\bg_\bi_\bn_\b(_\b)\n * _\bc_\br_\be_\ba_\bt_\be_\b__\bu_\bt_\b__\bm_\be_\bt_\ba_\bd_\ba_\bt_\ba_\b__\bp_\bl_\bu_\bg_\bi_\bn_\b(_\b)\n+ * _\bc_\br_\be_\ba_\bt_\be_\b__\bu_\bt_\b__\bp_\be_\bx_\b__\bp_\bl_\bu_\bg_\bi_\bn_\b(_\b)\n * _\bc_\br_\be_\ba_\bt_\be_\b__\bs_\bm_\ba_\br_\bt_\b__\bb_\ba_\bn_\b__\bp_\bl_\bu_\bg_\bi_\bn_\b(_\b)\n+ * _\bb_\bl_\bo_\bc_\bk_\b__\bi_\bn_\bf_\bo\n+ o _\bp_\be_\be_\br_\b(_\b)_\b _\bs_\be_\bt_\b__\bp_\be_\be_\br_\b(_\b)\n+ o _\be_\bn_\bu_\bm_\b _\bb_\bl_\bo_\bc_\bk_\b__\bs_\bt_\ba_\bt_\be_\b__\bt\n+ * _\bp_\ba_\br_\bt_\bi_\ba_\bl_\b__\bp_\bi_\be_\bc_\be_\b__\bi_\bn_\bf_\bo\n+ * _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be\n+ o _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be_\b(_\b)\n+ o _\ba_\bd_\bd_\b__\bp_\bi_\be_\bc_\be_\b(_\b)\n+ o _\br_\be_\ba_\bd_\b__\bp_\bi_\be_\bc_\be_\b(_\b)\n+ o _\bh_\ba_\bv_\be_\b__\bp_\bi_\be_\bc_\be_\b(_\b)\n+ o _\bp_\bo_\bs_\bt_\b__\bp_\be_\be_\br_\b__\bi_\bn_\bf_\bo_\b(_\b)_\b _\bg_\be_\bt_\b__\bp_\be_\be_\br_\b__\bi_\bn_\bf_\bo_\b(_\b)\n+ o _\bs_\bt_\ba_\bt_\bu_\bs_\b(_\b)_\b _\bp_\bo_\bs_\bt_\b__\bs_\bt_\ba_\bt_\bu_\bs_\b(_\b)\n+ o _\bp_\bo_\bs_\bt_\b__\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\b__\bq_\bu_\be_\bu_\be_\b(_\b)_\b _\bg_\be_\bt_\b__\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\b__\bq_\bu_\be_\bu_\be_\b(_\b)\n+ o _\bs_\be_\bt_\b__\bp_\bi_\be_\bc_\be_\b__\bd_\be_\ba_\bd_\bl_\bi_\bn_\be_\b(_\b)_\b _\br_\be_\bs_\be_\bt_\b__\bp_\bi_\be_\bc_\be_\b__\bd_\be_\ba_\bd_\bl_\bi_\bn_\be_\b(_\b)_\b _\bc_\bl_\be_\ba_\br_\b__\bp_\bi_\be_\bc_\be_\b__\bd_\be_\ba_\bd_\bl_\bi_\bn_\be_\bs_\b(_\b)\n+ o _\bf_\bi_\bl_\be_\b__\bp_\br_\bo_\bg_\br_\be_\bs_\bs_\b(_\b)_\b _\bp_\bo_\bs_\bt_\b__\bf_\bi_\bl_\be_\b__\bp_\br_\bo_\bg_\br_\be_\bs_\bs_\b(_\b)\n+ o _\bf_\bi_\bl_\be_\b__\bs_\bt_\ba_\bt_\bu_\bs_\b(_\b)\n+ o _\bc_\bl_\be_\ba_\br_\b__\be_\br_\br_\bo_\br_\b(_\b)\n+ o _\bp_\bo_\bs_\bt_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\bs_\b(_\b)_\b _\br_\be_\bp_\bl_\ba_\bc_\be_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\bs_\b(_\b)_\b _\bt_\br_\ba_\bc_\bk_\be_\br_\bs_\b(_\b)_\b _\ba_\bd_\bd_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\b(_\b)\n+ o _\bu_\br_\bl_\b__\bs_\be_\be_\bd_\bs_\b(_\b)_\b _\br_\be_\bm_\bo_\bv_\be_\b__\bu_\br_\bl_\b__\bs_\be_\be_\bd_\b(_\b)_\b _\ba_\bd_\bd_\b__\bu_\br_\bl_\b__\bs_\be_\be_\bd_\b(_\b)\n+ o _\ba_\bd_\bd_\b__\bh_\bt_\bt_\bp_\b__\bs_\be_\be_\bd_\b(_\b)_\b _\bh_\bt_\bt_\bp_\b__\bs_\be_\be_\bd_\bs_\b(_\b)_\b _\br_\be_\bm_\bo_\bv_\be_\b__\bh_\bt_\bt_\bp_\b__\bs_\be_\be_\bd_\b(_\b)\n+ o _\ba_\bd_\bd_\b__\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\b(_\b)\n+ o _\bs_\be_\bt_\b__\bm_\be_\bt_\ba_\bd_\ba_\bt_\ba_\b(_\b)\n+ o _\bi_\bs_\b__\bv_\ba_\bl_\bi_\bd_\b(_\b)\n+ o _\bp_\ba_\bu_\bs_\be_\b(_\b)_\b _\br_\be_\bs_\bu_\bm_\be_\b(_\b)\n+ o _\bu_\bn_\bs_\be_\bt_\b__\bf_\bl_\ba_\bg_\bs_\b(_\b)_\b _\bs_\be_\bt_\b__\bf_\bl_\ba_\bg_\bs_\b(_\b)_\b _\bf_\bl_\ba_\bg_\bs_\b(_\b)\n+ o _\bf_\bl_\bu_\bs_\bh_\b__\bc_\ba_\bc_\bh_\be_\b(_\b)\n+ o _\bf_\bo_\br_\bc_\be_\b__\br_\be_\bc_\bh_\be_\bc_\bk_\b(_\b)\n+ o _\bs_\ba_\bv_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b)\n+ o _\bn_\be_\be_\bd_\b__\bs_\ba_\bv_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b)\n+ o _\bq_\bu_\be_\bu_\be_\b__\bp_\bo_\bs_\bi_\bt_\bi_\bo_\bn_\b(_\b)_\b _\bq_\bu_\be_\bu_\be_\b__\bp_\bo_\bs_\bi_\bt_\bi_\bo_\bn_\b__\bb_\bo_\bt_\bt_\bo_\bm_\b(_\b)_\b _\bq_\bu_\be_\bu_\be_\b__\bp_\bo_\bs_\bi_\bt_\bi_\bo_\bn_\b__\bt_\bo_\bp_\b(_\b)\n+ _\bq_\bu_\be_\bu_\be_\b__\bp_\bo_\bs_\bi_\bt_\bi_\bo_\bn_\b__\bd_\bo_\bw_\bn_\b(_\b)_\b _\bq_\bu_\be_\bu_\be_\b__\bp_\bo_\bs_\bi_\bt_\bi_\bo_\bn_\b__\bu_\bp_\b(_\b)\n+ o _\bq_\bu_\be_\bu_\be_\b__\bp_\bo_\bs_\bi_\bt_\bi_\bo_\bn_\b__\bs_\be_\bt_\b(_\b)\n+ o _\bs_\be_\bt_\b__\bs_\bs_\bl_\b__\bc_\be_\br_\bt_\bi_\bf_\bi_\bc_\ba_\bt_\be_\b__\bb_\bu_\bf_\bf_\be_\br_\b(_\b)_\b _\bs_\be_\bt_\b__\bs_\bs_\bl_\b__\bc_\be_\br_\bt_\bi_\bf_\bi_\bc_\ba_\bt_\be_\b(_\b)\n+ o _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bi_\bl_\be_\b__\bw_\bi_\bt_\bh_\b__\bh_\ba_\bs_\bh_\be_\bs_\b(_\b)_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bi_\bl_\be_\b(_\b)\n+ o _\bp_\bi_\be_\bc_\be_\b__\bl_\ba_\by_\be_\br_\bs_\b(_\b)\n+ o _\bp_\bo_\bs_\bt_\b__\bp_\bi_\be_\bc_\be_\b__\ba_\bv_\ba_\bi_\bl_\ba_\bb_\bi_\bl_\bi_\bt_\by_\b(_\b)_\b _\bp_\bi_\be_\bc_\be_\b__\ba_\bv_\ba_\bi_\bl_\ba_\bb_\bi_\bl_\bi_\bt_\by_\b(_\b)\n+ o _\bg_\be_\bt_\b__\bp_\bi_\be_\bc_\be_\b__\bp_\br_\bi_\bo_\br_\bi_\bt_\bi_\be_\bs_\b(_\b)_\b _\bp_\bi_\be_\bc_\be_\b__\bp_\br_\bi_\bo_\br_\bi_\bt_\by_\b(_\b)_\b _\bp_\br_\bi_\bo_\br_\bi_\bt_\bi_\bz_\be_\b__\bp_\bi_\be_\bc_\be_\bs_\b(_\b)\n+ o _\bf_\bi_\bl_\be_\b__\bp_\br_\bi_\bo_\br_\bi_\bt_\by_\b(_\b)_\b _\bp_\br_\bi_\bo_\br_\bi_\bt_\bi_\bz_\be_\b__\bf_\bi_\bl_\be_\bs_\b(_\b)_\b _\bg_\be_\bt_\b__\bf_\bi_\bl_\be_\b__\bp_\br_\bi_\bo_\br_\bi_\bt_\bi_\be_\bs_\b(_\b)\n+ o _\bf_\bo_\br_\bc_\be_\b__\bl_\bs_\bd_\b__\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b(_\b)_\b _\bf_\bo_\br_\bc_\be_\b__\bd_\bh_\bt_\b__\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b(_\b)_\b _\bf_\bo_\br_\bc_\be_\b__\br_\be_\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b(_\b)\n+ o _\bs_\bc_\br_\ba_\bp_\be_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\b(_\b)\n+ o _\bs_\be_\bt_\b__\bu_\bp_\bl_\bo_\ba_\bd_\b__\bl_\bi_\bm_\bi_\bt_\b(_\b)_\b _\bu_\bp_\bl_\bo_\ba_\bd_\b__\bl_\bi_\bm_\bi_\bt_\b(_\b)_\b _\bs_\be_\bt_\b__\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\b__\bl_\bi_\bm_\bi_\bt_\b(_\b)\n+ _\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\b__\bl_\bi_\bm_\bi_\bt_\b(_\b)\n+ o _\bc_\bo_\bn_\bn_\be_\bc_\bt_\b__\bp_\be_\be_\br_\b(_\b)\n+ o _\bc_\bl_\be_\ba_\br_\b__\bp_\be_\be_\br_\bs_\b(_\b)\n+ o _\bs_\be_\bt_\b__\bm_\ba_\bx_\b__\bu_\bp_\bl_\bo_\ba_\bd_\bs_\b(_\b)_\b _\bm_\ba_\bx_\b__\bu_\bp_\bl_\bo_\ba_\bd_\bs_\b(_\b)\n+ o _\bm_\ba_\bx_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\bs_\b(_\b)_\b _\bs_\be_\bt_\b__\bm_\ba_\bx_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\bs_\b(_\b)\n+ o _\bm_\bo_\bv_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b(_\b)\n+ o _\br_\be_\bn_\ba_\bm_\be_\b__\bf_\bi_\bl_\be_\b(_\b)\n+ o _\bi_\bn_\bf_\bo_\b__\bh_\ba_\bs_\bh_\be_\bs_\b(_\b)_\b _\bi_\bn_\bf_\bo_\b__\bh_\ba_\bs_\bh_\b(_\b)\n+ o _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b!_\b=_\b(_\b)_\b _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b<_\b(_\b)_\b _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b=_\b=_\b(_\b)\n+ o _\bi_\bd_\b(_\b)\n+ o _\bn_\ba_\bt_\bi_\bv_\be_\b__\bh_\ba_\bn_\bd_\bl_\be_\b(_\b)\n+ o _\bu_\bs_\be_\br_\bd_\ba_\bt_\ba_\b(_\b)\n+ o _\bi_\bn_\b__\bs_\be_\bs_\bs_\bi_\bo_\bn_\b(_\b)\n+ * _\bh_\ba_\bs_\bh_\b__\bv_\ba_\bl_\bu_\be_\b(_\b)\n+ * _\be_\bn_\bt_\br_\by\n+ o _\bt_\by_\bp_\be_\b(_\b)\n+ o _\be_\bn_\bt_\br_\by_\b(_\b)\n+ o _\be_\bn_\bt_\br_\by_\b(_\b)\n+ o _\be_\bn_\bt_\br_\by_\b(_\b)\n+ o _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b=_\b(_\b)\n+ o _\bd_\bi_\bc_\bt_\b(_\b)_\b _\bs_\bt_\br_\bi_\bn_\bg_\b(_\b)_\b _\bi_\bn_\bt_\be_\bg_\be_\br_\b(_\b)_\b _\bl_\bi_\bs_\bt_\b(_\b)_\b _\bp_\br_\be_\bf_\bo_\br_\bm_\ba_\bt_\bt_\be_\bd_\b(_\b)\n+ o _\bs_\bw_\ba_\bp_\b(_\b)\n+ o _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b[_\b]_\b(_\b)\n+ o _\bf_\bi_\bn_\bd_\b__\bk_\be_\by_\b(_\b)\n+ o _\bt_\bo_\b__\bs_\bt_\br_\bi_\bn_\bg_\b(_\b)\n+ o _\be_\bn_\bu_\bm_\b _\bd_\ba_\bt_\ba_\b__\bt_\by_\bp_\be\n+ * _\bb_\be_\bn_\bc_\bo_\bd_\be_\b(_\b)\n+ * _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b<_\b<_\b(_\b)\n+ * _\bi_\bp_\b__\bf_\bi_\bl_\bt_\be_\br\n+ o _\be_\bm_\bp_\bt_\by_\b(_\b)\n+ o _\ba_\bd_\bd_\b__\br_\bu_\bl_\be_\b(_\b)\n+ o _\ba_\bc_\bc_\be_\bs_\bs_\b(_\b)\n+ o _\be_\bx_\bp_\bo_\br_\bt_\b__\bf_\bi_\bl_\bt_\be_\br_\b(_\b)\n+ o _\be_\bn_\bu_\bm_\b _\ba_\bc_\bc_\be_\bs_\bs_\b__\bf_\bl_\ba_\bg_\bs\n+ * _\bp_\bo_\br_\bt_\b__\bf_\bi_\bl_\bt_\be_\br\n+ o _\ba_\bd_\bd_\b__\br_\bu_\bl_\be_\b(_\b)\n+ o _\ba_\bc_\bc_\be_\bs_\bs_\b(_\b)\n+ o _\be_\bn_\bu_\bm_\b _\ba_\bc_\bc_\be_\bs_\bs_\b__\bf_\bl_\ba_\bg_\bs\n+ * _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd\n+ o _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd_\b(_\b)\n+ o _\ba_\bs_\bs_\bi_\bg_\bn_\b(_\b)\n+ o _\bg_\be_\bt_\b__\bb_\bi_\bt_\b(_\b)_\b _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b[_\b]_\b(_\b)\n+ o _\bs_\be_\bt_\b__\bb_\bi_\bt_\b(_\b)_\b _\bc_\bl_\be_\ba_\br_\b__\bb_\bi_\bt_\b(_\b)\n+ o _\ba_\bl_\bl_\b__\bs_\be_\bt_\b(_\b)\n+ o _\bn_\bo_\bn_\be_\b__\bs_\be_\bt_\b(_\b)\n+ o _\bs_\bi_\bz_\be_\b(_\b)\n+ o _\bn_\bu_\bm_\b__\bw_\bo_\br_\bd_\bs_\b(_\b)\n+ o _\bn_\bu_\bm_\b__\bb_\by_\bt_\be_\bs_\b(_\b)\n+ o _\be_\bm_\bp_\bt_\by_\b(_\b)\n+ o _\bd_\ba_\bt_\ba_\b(_\b)\n+ o _\bs_\bw_\ba_\bp_\b(_\b)\n+ o _\bc_\bo_\bu_\bn_\bt_\b(_\b)\n+ o _\bf_\bi_\bn_\bd_\b__\bf_\bi_\br_\bs_\bt_\b__\bs_\be_\bt_\b(_\b)\n+ o _\bf_\bi_\bn_\bd_\b__\bl_\ba_\bs_\bt_\b__\bc_\bl_\be_\ba_\br_\b(_\b)\n+ * _\bh_\ba_\bs_\bh_\be_\br\n+ o _\bh_\ba_\bs_\bh_\be_\br_\b(_\b)_\b _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b=_\b(_\b)\n+ o _\bu_\bp_\bd_\ba_\bt_\be_\b(_\b)\n+ o _\bf_\bi_\bn_\ba_\bl_\b(_\b)\n+ o _\br_\be_\bs_\be_\bt_\b(_\b)\n+ * _\bh_\ba_\bs_\bh_\be_\br_\b2_\b5_\b6\n+ o _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b=_\b(_\b)_\b _\bh_\ba_\bs_\bh_\be_\br_\b2_\b5_\b6_\b(_\b)\n+ o _\bu_\bp_\bd_\ba_\bt_\be_\b(_\b)\n+ o _\bf_\bi_\bn_\ba_\bl_\b(_\b)\n+ o _\br_\be_\bs_\be_\bt_\b(_\b)\n+ * _\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b__\bt_\by_\bp_\be_\b__\bf_\bi_\bl_\bt_\be_\br\n+ o _\br_\be_\bm_\bo_\bv_\be_\b(_\b)_\b _\ba_\bd_\bd_\b(_\b)\n+ o _\ba_\bl_\bl_\bo_\bw_\b(_\b)_\b _\bd_\bi_\bs_\ba_\bl_\bl_\bo_\bw_\b(_\b)\n+ o _\ba_\bp_\bp_\bl_\by_\b(_\b)\n+ o _\be_\bn_\bu_\bm_\b _\bs_\bo_\bc_\bk_\be_\bt_\b__\bt_\by_\bp_\be_\b__\bt\n+ * _\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b__\bi_\bn_\bf_\bo\n * _\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\be_\br_\br_\bo_\br\n o _\bb_\bo_\bo_\bl_\b(_\b)\n o _\bf_\bi_\bl_\be_\b(_\b)\n * _\bp_\bc_\bp_\b__\bc_\ba_\bt_\be_\bg_\bo_\br_\by_\b(_\b)\n- * _\bg_\bz_\bi_\bp_\b__\bc_\ba_\bt_\be_\bg_\bo_\br_\by_\b(_\b)\n * _\bb_\bd_\be_\bc_\bo_\bd_\be_\b__\bc_\ba_\bt_\be_\bg_\bo_\br_\by_\b(_\b)\n+ * _\bg_\bz_\bi_\bp_\b__\bc_\ba_\bt_\be_\bg_\bo_\br_\by_\b(_\b)\n+ * _\bs_\bo_\bc_\bk_\bs_\b__\bc_\ba_\bt_\be_\bg_\bo_\br_\by_\b(_\b)\n * _\bu_\bp_\bn_\bp_\b__\bc_\ba_\bt_\be_\bg_\bo_\br_\by_\b(_\b)\n * _\bi_\b2_\bp_\b__\bc_\ba_\bt_\be_\bg_\bo_\br_\by_\b(_\b)\n- * _\bs_\bo_\bc_\bk_\bs_\b__\bc_\ba_\bt_\be_\bg_\bo_\br_\by_\b(_\b)\n * _\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bc_\ba_\bt_\be_\bg_\bo_\br_\by_\b(_\b)\n * _\bh_\bt_\bt_\bp_\b__\bc_\ba_\bt_\be_\bg_\bo_\br_\by_\b(_\b)\n * _\be_\bn_\bu_\bm_\b _\bp_\bc_\bp_\b__\be_\br_\br_\bo_\br_\bs\n * _\be_\bn_\bu_\bm_\b _\be_\br_\br_\bo_\br_\b__\bc_\bo_\bd_\be_\b__\be_\bn_\bu_\bm\n * _\be_\bn_\bu_\bm_\b _\be_\br_\br_\bo_\br_\b__\bc_\bo_\bd_\be_\b__\be_\bn_\bu_\bm\n+ * _\be_\bn_\bu_\bm_\b _\bs_\bo_\bc_\bk_\bs_\b__\be_\br_\br_\bo_\br_\b__\bc_\bo_\bd_\be\n * _\be_\bn_\bu_\bm_\b _\be_\br_\br_\bo_\br_\b__\bc_\bo_\bd_\be_\b__\be_\bn_\bu_\bm\n * _\be_\bn_\bu_\bm_\b _\bi_\b2_\bp_\b__\be_\br_\br_\bo_\br_\b__\bc_\bo_\bd_\be\n- * _\be_\bn_\bu_\bm_\b _\bs_\bo_\bc_\bk_\bs_\b__\be_\br_\br_\bo_\br_\b__\bc_\bo_\bd_\be\n * _\be_\bn_\bu_\bm_\b _\be_\br_\br_\bo_\br_\b__\bc_\bo_\bd_\be_\b__\be_\bn_\bu_\bm\n * _\be_\bn_\bu_\bm_\b _\bh_\bt_\bt_\bp_\b__\be_\br_\br_\bo_\br_\bs\n * _\bd_\bh_\bt_\b__\bs_\bt_\ba_\bt_\be\n * _\bd_\bh_\bt_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bc_\bo_\bu_\bn_\bt_\be_\br_\bs\n o _\br_\be_\bs_\be_\bt_\b(_\b)\n * _\bd_\bh_\bt_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be\n o _\bu_\bp_\bd_\ba_\bt_\be_\b__\bn_\bo_\bd_\be_\b__\bi_\bd_\bs_\b(_\b)\n@@ -614,3465 +614,27 @@\n o _\bp_\bu_\bt_\b__\bi_\bm_\bm_\bu_\bt_\ba_\bb_\bl_\be_\b__\bi_\bt_\be_\bm_\b(_\b)\n o _\bg_\be_\bt_\b__\bm_\bu_\bt_\ba_\bb_\bl_\be_\b__\bi_\bt_\be_\bm_\b__\bs_\be_\bq_\b(_\b)\n o _\bg_\be_\bt_\b__\bm_\bu_\bt_\ba_\bb_\bl_\be_\b__\bi_\bt_\be_\bm_\b(_\b)\n o _\bp_\bu_\bt_\b__\bm_\bu_\bt_\ba_\bb_\bl_\be_\b__\bi_\bt_\be_\bm_\b(_\b)\n o _\bg_\be_\bt_\b__\bi_\bn_\bf_\bo_\bh_\ba_\bs_\bh_\be_\bs_\b__\bs_\ba_\bm_\bp_\bl_\be_\b(_\b)\n o _\bt_\bi_\bc_\bk_\b(_\b)\n o _\bc_\bo_\bu_\bn_\bt_\be_\br_\bs_\b(_\b)\n- * _\bd_\bh_\bt_\b__\bd_\be_\bf_\ba_\bu_\bl_\bt_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bc_\bo_\bn_\bs_\bt_\br_\bu_\bc_\bt_\bo_\br_\b(_\b)\n * _\bs_\bi_\bg_\bn_\b__\bm_\bu_\bt_\ba_\bb_\bl_\be_\b__\bi_\bt_\be_\bm_\b(_\b)\n+ * _\bd_\bh_\bt_\b__\bd_\be_\bf_\ba_\bu_\bl_\bt_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bc_\bo_\bn_\bs_\bt_\br_\bu_\bc_\bt_\bo_\br_\b(_\b)\n * _\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\bf_\bl_\ba_\bg_\bs_\b__\bt\n- * _\bw_\br_\bi_\bt_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b)_\b _\bw_\br_\bi_\bt_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b__\bb_\bu_\bf_\b(_\b)\n- * _\bw_\br_\bi_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bi_\bl_\be_\b(_\b)_\b _\bw_\br_\bi_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bi_\bl_\be_\b__\bb_\bu_\bf_\b(_\b)\n * _\br_\be_\ba_\bd_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b)\n+ * _\bw_\br_\bi_\bt_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b)_\b _\bw_\br_\bi_\bt_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b__\bb_\bu_\bf_\b(_\b)\n+ * _\bw_\br_\bi_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bi_\bl_\be_\b__\bb_\bu_\bf_\b(_\b)_\b _\bw_\br_\bi_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bi_\bl_\be_\b(_\b)\n * _\bw_\br_\bi_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bl_\ba_\bg_\bs_\b__\bt\n * _\be_\bd_\b2_\b5_\b5_\b1_\b9_\b__\bc_\br_\be_\ba_\bt_\be_\b__\bs_\be_\be_\bd_\b(_\b)\n * _\be_\bd_\b2_\b5_\b5_\b1_\b9_\b__\bc_\br_\be_\ba_\bt_\be_\b__\bk_\be_\by_\bp_\ba_\bi_\br_\b(_\b)\n * _\be_\bd_\b2_\b5_\b5_\b1_\b9_\b__\bs_\bi_\bg_\bn_\b(_\b)\n * _\be_\bd_\b2_\b5_\b5_\b1_\b9_\b__\bv_\be_\br_\bi_\bf_\by_\b(_\b)\n * _\be_\bd_\b2_\b5_\b5_\b1_\b9_\b__\ba_\bd_\bd_\b__\bs_\bc_\ba_\bl_\ba_\br_\b(_\b)\n * _\be_\bd_\b2_\b5_\b5_\b1_\b9_\b__\bk_\be_\by_\b__\be_\bx_\bc_\bh_\ba_\bn_\bg_\be_\b(_\b)\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* c\bco\bou\bun\bnt\bte\ber\brs\bs *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bp_\be_\br_\bf_\bo_\br_\bm_\ba_\bn_\bc_\be_\b__\bc_\bo_\bu_\bn_\bt_\be_\br_\bs_\b._\bh_\bp_\bp\"\n-struct counters\n-{\n- c\bco\bou\bun\bnt\bte\ber\brs\bs () ;\n- counters& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (counters const&) & ;\n- c\bco\bou\bun\bnt\bte\ber\brs\bs (counters const&) ;\n- std::int64_t o\bop\bpe\ber\bra\bat\bto\bor\br[\b[]\b] (int i) const ;\n- std::int64_t i\bin\bnc\bc_\b_s\bst\bta\bat\bts\bs_\b_c\bco\bou\bun\bnt\bte\ber\br (int c, std::int64_t value = 1) ;\n- void s\bse\bet\bt_\b_v\bva\bal\blu\bue\be (int c, std::int64_t value) ;\n- void b\bbl\ble\ben\bnd\bd_\b_s\bst\bta\bat\bts\bs_\b_c\bco\bou\bun\bnt\bte\ber\br (int c, std::int64_t value, int ratio) ;\n-};\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* o\bop\bpe\ber\bra\bat\bto\bor\br[\b[]\b](\b()\b) i\bin\bnc\bc_\b_s\bst\bta\bat\bts\bs_\b_c\bco\bou\bun\bnt\bte\ber\br(\b()\b) *\b**\b**\b**\b**\b*\n-std::int64_t o\bop\bpe\ber\bra\bat\bto\bor\br[\b[]\b] (int i) const ;\n-std::int64_t i\bin\bnc\bc_\b_s\bst\bta\bat\bts\bs_\b_c\bco\bou\bun\bnt\bte\ber\br (int c, std::int64_t value = 1) ;\n-returns the new value\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* s\bst\bta\bat\bts\bs_\b_m\bme\bet\btr\bri\bic\bc *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bs_\bt_\ba_\bt_\bs_\b._\bh_\bp_\bp\"\n-describes one statistics metric from the _\bs_\be_\bs_\bs_\bi_\bo_\bn. For more information, see the\n-_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b _\bs_\bt_\ba_\bt_\bi_\bs_\bt_\bi_\bc_\bs section.\n-struct stats_metric\n-{\n- char const* name;\n- int value_index;\n- metric_type_t type;\n-};\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- name\n- the name of the counter or gauge\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- value_index type\n- the index into the _\bs_\be_\bs_\bs_\bi_\bo_\bn stats array, where the underlying value of\n- this counter or gauge is found. The _\bs_\be_\bs_\bs_\bi_\bo_\bn stats array is part of the\n- _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bs_\bt_\ba_\bt_\bs_\b__\ba_\bl_\be_\br_\bt object.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* s\bse\bes\bss\bsi\bio\bon\bn_\b_s\bst\bta\bat\bts\bs_\b_m\bme\bet\btr\bri\bic\bcs\bs(\b()\b) *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bs_\bt_\ba_\bt_\bs_\b._\bh_\bp_\bp\"\n-std::vector s\bse\bes\bss\bsi\bio\bon\bn_\b_s\bst\bta\bat\bts\bs_\b_m\bme\bet\btr\bri\bic\bcs\bs ();\n-This free function returns the list of available metrics exposed by\n-libtorrent's statistics API. Each metric has a name and a v\bva\bal\blu\bue\be i\bin\bnd\bde\bex\bx. The\n-value index is the index into the array in _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bs_\bt_\ba_\bt_\bs_\b__\ba_\bl_\be_\br_\bt where this\n-metric's value can be found when the _\bs_\be_\bs_\bs_\bi_\bo_\bn stats is sampled (by calling\n-_\bp_\bo_\bs_\bt_\b__\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bs_\bt_\ba_\bt_\bs_\b(_\b)).\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* f\bfi\bin\bnd\bd_\b_m\bme\bet\btr\bri\bic\bc_\b_i\bid\bdx\bx(\b()\b) *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bs_\bt_\ba_\bt_\bs_\b._\bh_\bp_\bp\"\n-int f\bfi\bin\bnd\bd_\b_m\bme\bet\btr\bri\bic\bc_\b_i\bid\bdx\bx (string_view name);\n-given a name of a metric, this function returns the counter index of it, or -\n-1 if it could not be found. The counter index is the index into the values\n-array returned by _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bs_\bt_\ba_\bt_\bs_\b__\ba_\bl_\be_\br_\bt.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* e\ben\bnu\bum\bm m\bme\bet\btr\bri\bic\bc_\b_t\bty\byp\bpe\be_\b_t\bt *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bs_\bt_\ba_\bt_\bs_\b._\bh_\bp_\bp\"\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n-|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn|\n-|_\bc_\bo_\bu_\bn_\bt_\be_\br_\b|_\b0_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bg_\ba_\bu_\bg_\be_\b _\b _\b|_\b1_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* p\bpe\bee\ber\br_\b_r\bre\beq\bqu\bue\bes\bst\bt *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bp_\be_\be_\br_\b__\br_\be_\bq_\bu_\be_\bs_\bt_\b._\bh_\bp_\bp\"\n-represents a byte range within a piece. Internally this is is used for incoming\n-piece requests.\n-struct peer_request\n-{\n- bool o\bop\bpe\ber\bra\bat\bto\bor\br=\b==\b= (peer_request const& r) const;\n-\n- piece_index_t piece;\n- int start;\n- int length;\n-};\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* o\bop\bpe\ber\bra\bat\bto\bor\br=\b==\b=(\b()\b) *\b**\b**\b**\b**\b*\n-bool o\bop\bpe\ber\bra\bat\bto\bor\br=\b==\b= (peer_request const& r) const;\n-returns true if the right hand side _\bp_\be_\be_\br_\b__\br_\be_\bq_\bu_\be_\bs_\bt refers to the same range as\n-this does.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- piece\n- The index of the piece in which the range starts.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- start\n- The byte offset within that piece where the range starts.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- length\n- The size of the range, in bytes.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* p\bpi\bie\bec\bce\be_\b_b\bbl\blo\boc\bck\bk *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bp_\bi_\be_\bc_\be_\b__\bb_\bl_\bo_\bc_\bk_\b._\bh_\bp_\bp\"\n-struct piece_block\n-{\n- p\bpi\bie\bec\bce\be_\b_b\bbl\blo\boc\bck\bk () = default;\n- p\bpi\bie\bec\bce\be_\b_b\bbl\blo\boc\bck\bk (piece_index_t p_index, int b_index);\n- bool o\bop\bpe\ber\bra\bat\bto\bor\br<\b< (piece_block const& b) const;\n- bool o\bop\bpe\ber\bra\bat\bto\bor\br=\b==\b= (piece_block const& b) const;\n- bool o\bop\bpe\ber\bra\bat\bto\bor\br!\b!=\b= (piece_block const& b) const;\n-\n- static const piece_block invalid;\n- piece_index_t piece_index {0};\n- int b\bbl\blo\boc\bck\bk_\b_i\bin\bnd\bde\bex\bx = 0;\n-};\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh_\b_t\bt *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bi_\bn_\bf_\bo_\b__\bh_\ba_\bs_\bh_\b._\bh_\bp_\bp\"\n-class holding the info-hash of a torrent. It can hold a v1 info-hash (SHA-1) or\n-a v2 info-hash (SHA-256) or both.\n-Note\n-If has_v2() is false then the v1 hash might actually be a truncated v2 hash\n-struct info_hash_t\n-{\n- explicit i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh_\b_t\bt (sha1_hash h1) noexcept;\n- explicit i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh_\b_t\bt (sha256_hash h2) noexcept;\n- i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh_\b_t\bt () noexcept = default;\n- i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh_\b_t\bt (sha1_hash h1, sha256_hash h2) noexcept;\n- bool h\bha\bas\bs_\b_v\bv1\b1 () const;\n- bool h\bha\bas\bs (protocol_version v) const;\n- bool h\bha\bas\bs_\b_v\bv2\b2 () const;\n- sha1_hash g\bge\bet\bt (protocol_version v) const;\n- sha1_hash g\bge\bet\bt_\b_b\bbe\bes\bst\bt () const;\n- friend bool o\bop\bpe\ber\bra\bat\bto\bor\br!\b!=\b= (info_hash_t const& lhs, info_hash_t const& rhs);\n- friend bool o\bop\bpe\ber\bra\bat\bto\bor\br=\b==\b= (info_hash_t const& lhs, info_hash_t const& rhs)\n-noexcept;\n- template void f\bfo\bor\br_\b_e\bea\bac\bch\bh (F f) const;\n- bool o\bop\bpe\ber\bra\bat\bto\bor\br<\b< (info_hash_t const& o) const;\n- friend std::ostream& o\bop\bpe\ber\bra\bat\bto\bor\br<\b<<\b< (std::ostream& os, info_hash_t const& ih);\n-\n- sha1_hash v1;\n- sha256_hash v2;\n-};\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh_\b_t\bt(\b()\b) *\b**\b**\b**\b**\b*\n-explicit i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh_\b_t\bt (sha1_hash h1) noexcept;\n-explicit i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh_\b_t\bt (sha256_hash h2) noexcept;\n-i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh_\b_t\bt () noexcept = default;\n-i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh_\b_t\bt (sha1_hash h1, sha256_hash h2) noexcept;\n-The default constructor creates an object that has neither a v1 or v2 hash.\n-For backwards compatibility, make it possible to construct directly from a v1\n-hash. This constructor allows i\bim\bmp\bpl\bli\bic\bci\bit\bt conversion from a v1 hash, but the\n-implicitness is deprecated.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* h\bha\bas\bs_\b_v\bv2\b2(\b()\b) h\bha\bas\bs_\b_v\bv1\b1(\b()\b) h\bha\bas\bs(\b()\b) *\b**\b**\b**\b**\b*\n-bool h\bha\bas\bs_\b_v\bv1\b1 () const;\n-bool h\bha\bas\bs (protocol_version v) const;\n-bool h\bha\bas\bs_\b_v\bv2\b2 () const;\n-returns true if the corresponding info hash is present in this object.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* g\bge\bet\bt(\b()\b) *\b**\b**\b**\b**\b*\n-sha1_hash g\bge\bet\bt (protocol_version v) const;\n-returns the has for the specified protocol version\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* g\bge\bet\bt_\b_b\bbe\bes\bst\bt(\b()\b) *\b**\b**\b**\b**\b*\n-sha1_hash g\bge\bet\bt_\b_b\bbe\bes\bst\bt () const;\n-returns the v2 (truncated) info-hash, if there is one, otherwise returns the v1\n-info-hash\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* f\bfo\bor\br_\b_e\bea\bac\bch\bh(\b()\b) *\b**\b**\b**\b**\b*\n-template void f\bfo\bor\br_\b_e\bea\bac\bch\bh (F f) const;\n-calls the function object f for each hash that is available. starting with v1.\n-The signature of F is:\n-void(sha1_hash const&, protocol_version);\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* p\bpe\bee\ber\br_\b_i\bin\bnf\bfo\bo *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bp_\be_\be_\br_\b__\bi_\bn_\bf_\bo_\b._\bh_\bp_\bp\"\n-holds information and statistics about one peer that libtorrent is connected to\n-struct peer_info\n-{\n- sha256_hash i\bi2\b2p\bp_\b_d\bde\bes\bst\bti\bin\bna\bat\bti\bio\bon\bn () const;\n-\n- std::string client;\n- typed_bitfield pieces;\n- std::int64_t total_download;\n- std::int64_t total_upload;\n- time_duration last_request;\n- time_duration last_active;\n- time_duration download_queue_time;\n- static constexpr peer_flags_t i\bin\bnt\bte\ber\bre\bes\bst\bti\bin\bng\bg = 0_bit;\n- static constexpr peer_flags_t c\bch\bho\bok\bke\bed\bd = 1_bit;\n- static constexpr peer_flags_t r\bre\bem\bmo\bot\bte\be_\b_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd = 2_bit;\n- static constexpr peer_flags_t r\bre\bem\bmo\bot\bte\be_\b_c\bch\bho\bok\bke\bed\bd = 3_bit;\n- static constexpr peer_flags_t s\bsu\bup\bpp\bpo\bor\brt\bts\bs_\b_e\bex\bxt\bte\ben\bns\bsi\bio\bon\bns\bs = 4_bit;\n- static constexpr peer_flags_t o\bou\but\btg\bgo\boi\bin\bng\bg_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn = 5_bit;\n- static constexpr peer_flags_t l\blo\boc\bca\bal\bl_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn = 5_bit;\n- static constexpr peer_flags_t h\bha\ban\bnd\bds\bsh\bha\bak\bke\be = 6_bit;\n- static constexpr peer_flags_t c\bco\bon\bnn\bne\bec\bct\bti\bin\bng\bg = 7_bit;\n- static constexpr peer_flags_t o\bon\bn_\b_p\bpa\bar\bro\bol\ble\be = 9_bit;\n- static constexpr peer_flags_t s\bse\bee\bed\bd = 10_bit;\n- static constexpr peer_flags_t o\bop\bpt\bti\bim\bmi\bis\bst\bti\bic\bc_\b_u\bun\bnc\bch\bho\bok\bke\be = 11_bit;\n- static constexpr peer_flags_t s\bsn\bnu\bub\bbb\bbe\bed\bd = 12_bit;\n- static constexpr peer_flags_t u\bup\bpl\blo\boa\bad\bd_\b_o\bon\bnl\bly\by = 13_bit;\n- static constexpr peer_flags_t e\ben\bnd\bdg\bga\bam\bme\be_\b_m\bmo\bod\bde\be = 14_bit;\n- static constexpr peer_flags_t h\bho\bol\ble\bep\bpu\bun\bnc\bch\bhe\bed\bd = 15_bit;\n- static constexpr peer_flags_t i\bi2\b2p\bp_\b_s\bso\boc\bck\bke\bet\bt = 16_bit;\n- static constexpr peer_flags_t u\but\btp\bp_\b_s\bso\boc\bck\bke\bet\bt = 17_bit;\n- static constexpr peer_flags_t s\bss\bsl\bl_\b_s\bso\boc\bck\bke\bet\bt = 18_bit;\n- static constexpr peer_flags_t r\brc\bc4\b4_\b_e\ben\bnc\bcr\bry\byp\bpt\bte\bed\bd = 19_bit;\n- static constexpr peer_flags_t p\bpl\bla\bai\bin\bnt\bte\bex\bxt\bt_\b_e\ben\bnc\bcr\bry\byp\bpt\bte\bed\bd = 20_bit;\n- peer_flags_t flags;\n- static constexpr peer_source_flags_t t\btr\bra\bac\bck\bke\ber\br = 0_bit;\n- static constexpr peer_source_flags_t d\bdh\bht\bt = 1_bit;\n- static constexpr peer_source_flags_t p\bpe\bex\bx = 2_bit;\n- static constexpr peer_source_flags_t l\bls\bsd\bd = 3_bit;\n- static constexpr peer_source_flags_t r\bre\bes\bsu\bum\bme\be_\b_d\bda\bat\bta\ba = 4_bit;\n- static constexpr peer_source_flags_t i\bin\bnc\bco\bom\bmi\bin\bng\bg = 5_bit;\n- peer_source_flags_t source;\n- int up_speed;\n- int down_speed;\n- int payload_up_speed;\n- int payload_down_speed;\n- peer_id pid;\n- int queue_bytes;\n- int request_timeout;\n- int send_buffer_size;\n- int used_send_buffer;\n- int receive_buffer_size;\n- int used_receive_buffer;\n- int receive_buffer_watermark;\n- int num_hashfails;\n- int download_queue_length;\n- int timed_out_requests;\n- int busy_requests;\n- int requests_in_buffer;\n- int target_dl_queue_length;\n- int upload_queue_length;\n- int failcount;\n- piece_index_t downloading_piece_index;\n- int downloading_block_index;\n- int downloading_progress;\n- int downloading_total;\n- static constexpr connection_type_t s\bst\bta\ban\bnd\bda\bar\brd\bd_\b_b\bbi\bit\btt\bto\bor\brr\bre\ben\bnt\bt = 0_bit;\n- static constexpr connection_type_t w\bwe\beb\bb_\b_s\bse\bee\bed\bd = 1_bit;\n- static constexpr connection_type_t h\bht\btt\btp\bp_\b_s\bse\bee\bed\bd = 2_bit;\n- connection_type_t connection_type;\n- int pending_disk_bytes;\n- int pending_disk_read_bytes;\n- int send_quota;\n- int receive_quota;\n- int rtt;\n- int num_pieces;\n- int download_rate_peak;\n- int upload_rate_peak;\n- float progress;\n- int progress_ppm;\n- _\bt_\bc_\bp_\b:_\b:_\be_\bn_\bd_\bp_\bo_\bi_\bn_\bt ip;\n- _\bt_\bc_\bp_\b:_\b:_\be_\bn_\bd_\bp_\bo_\bi_\bn_\bt local_endpoint;\n- static constexpr bandwidth_state_flags_t b\bbw\bw_\b_i\bid\bdl\ble\be = 0_bit;\n- static constexpr bandwidth_state_flags_t b\bbw\bw_\b_l\bli\bim\bmi\bit\bt = 1_bit;\n- static constexpr bandwidth_state_flags_t b\bbw\bw_\b_n\bne\bet\btw\bwo\bor\brk\bk = 2_bit;\n- static constexpr bandwidth_state_flags_t b\bbw\bw_\b_d\bdi\bis\bsk\bk = 4_bit;\n- bandwidth_state_flags_t read_state;\n- bandwidth_state_flags_t write_state;\n-};\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* i\bi2\b2p\bp_\b_d\bde\bes\bst\bti\bin\bna\bat\bti\bio\bon\bn(\b()\b) *\b**\b**\b**\b**\b*\n-sha256_hash i\bi2\b2p\bp_\b_d\bde\bes\bst\bti\bin\bna\bat\bti\bio\bon\bn () const;\n-If this peer is an i2p peer, this function returns the destination address of\n-the peer\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- client\n- A human readable string describing the software at the other end of the\n- connection. In some cases this information is not available, then it will\n- contain a string that may give away something about which software is\n- running in the other end. In the case of a web seed, the server type and\n- version will be a part of this string. This is UTF-8 encoded.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- pieces\n- a _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd, with one bit per piece in the torrent. Each bit tells you if\n- the peer has that piece (if it's set to 1) or if the peer miss that piece\n- (set to 0).\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- total_download total_upload\n- the total number of bytes downloaded from and uploaded to this peer.\n- These numbers do not include the protocol chatter, but only the payload\n- data.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- last_request last_active\n- the time since we last sent a request to this peer and since any transfer\n- occurred with this peer\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- download_queue_time\n- the time until all blocks in the request queue will be downloaded\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- interesting\n- w\bwe\be are interested in pieces from this peer.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- choked\n- w\bwe\be have choked this peer.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- remote_interested\n- the peer is interested in u\bus\bs\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- remote_choked\n- the peer has choked u\bus\bs.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- supports_extensions\n- means that this peer supports the _\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\b _\bp_\br_\bo_\bt_\bo_\bc_\bo_\bl.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- outgoing_connection\n- The connection was initiated by us, the peer has a listen port open, and\n- that port is the same as in the address of this peer. If this flag is not\n- set, this peer connection was opened by this peer connecting to us.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- local_connection\n- deprecated synonym for outgoing_connection\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- handshake\n- The connection is opened, and waiting for the handshake. Until the\n- handshake is done, the peer cannot be identified.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- connecting\n- The connection is in a half-open state (i.e. it is being connected).\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- on_parole\n- The peer has participated in a piece that failed the hash check, and is\n- now \"on parole\", which means we're only requesting whole pieces from this\n- peer until it either fails that piece or proves that it doesn't send bad\n- data.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- seed\n- This peer is a seed (it has all the pieces).\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- optimistic_unchoke\n- This peer is subject to an optimistic unchoke. It has been unchoked for a\n- while to see if it might unchoke us in return an earn an upload/unchoke\n- slot. If it doesn't within some period of time, it will be choked and\n- another peer will be optimistically unchoked.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- snubbed\n- This peer has recently failed to send a block within the request timeout\n- from when the request was sent. We're currently picking one block at a\n- time from this peer.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- upload_only\n- This peer has either explicitly (with an extension) or implicitly (by\n- becoming a seed) told us that it will not downloading anything more,\n- regardless of which pieces we have.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- endgame_mode\n- This means the last time this peer picket a piece, it could not pick as\n- many as it wanted because there were not enough free ones. i.e. all\n- pieces this peer has were already requested from other peers.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- holepunched\n- This flag is set if the peer was in holepunch mode when the connection\n- succeeded. This typically only happens if both peers are behind a NAT and\n- the peers connect via the NAT holepunch mechanism.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- i2p_socket\n- indicates that this socket is running on top of the I2P transport.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- utp_socket\n- indicates that this socket is a uTP socket\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- ssl_socket\n- indicates that this socket is running on top of an SSL (TLS) channel\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- rc4_encrypted\n- this connection is obfuscated with RC4\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- plaintext_encrypted\n- the handshake of this connection was obfuscated with a Diffie-Hellman\n- exchange\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- flags\n- tells you in which state the peer is in. It is set to any combination of\n- the peer_flags_t flags above.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- tracker\n- The peer was received from the tracker.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- dht\n- The peer was received from the kademlia DHT.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- pex\n- The peer was received from the peer exchange extension.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- lsd\n- The peer was received from the local service discovery (The peer is on\n- the local network).\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- resume_data\n- The peer was added from the fast resume data.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- incoming\n- we received an incoming connection from this peer\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- source\n- a combination of flags describing from which sources this peer was\n- received. A combination of the peer_source_flags_t above.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- up_speed down_speed\n- the current upload and download speed we have to and from this peer\n- (including any protocol messages). updated about once per second\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- payload_up_speed payload_down_speed\n- The transfer rates of payload data only updated about once per second\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- pid\n- the peer's id as used in the bittorrent protocol. This id can be used to\n- extract 'fingerprints' from the peer. Sometimes it can tell you which\n- client the peer is using. See identify_client()_\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- queue_bytes\n- the number of bytes we have requested from this peer, but not yet\n- received.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- request_timeout\n- the number of seconds until the current front piece request will time\n- out. This timeout can be adjusted through settings_pack::request_timeout.\n- -1 means that there is not outstanding request.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- send_buffer_size used_send_buffer\n- the number of bytes allocated and used for the peer's send buffer,\n- respectively.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- receive_buffer_size used_receive_buffer receive_buffer_watermark\n- the number of bytes allocated and used as receive buffer, respectively.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- num_hashfails\n- the number of pieces this peer has participated in sending us that turned\n- out to fail the hash check.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- download_queue_length\n- this is the number of requests we have sent to this peer that we haven't\n- got a response for yet\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- timed_out_requests\n- the number of block requests that have timed out, and are still in the\n- download queue\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- busy_requests\n- the number of busy requests in the download queue. A busy request is a\n- request for a block we've also requested from a different peer\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- requests_in_buffer\n- the number of requests messages that are currently in the send buffer\n- waiting to be sent.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- target_dl_queue_length\n- the number of requests that is tried to be maintained (this is typically\n- a function of download speed)\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- upload_queue_length\n- the number of piece-requests we have received from this peer that we\n- haven't answered with a piece yet.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- failcount\n- the number of times this peer has \"failed\". i.e. failed to connect or\n- disconnected us. The failcount is decremented when we see this peer in a\n- tracker response or peer exchange message.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- downloading_piece_index downloading_block_index downloading_progress\n- downloading_total\n- You can know which piece, and which part of that piece, that is currently\n- being downloaded from a specific peer by looking at these four members.\n- downloading_piece_index is the index of the piece that is currently being\n- downloaded. This may be set to -1 if there's currently no piece\n- downloading from this peer. If it is >= 0, the other three members are\n- valid. downloading_block_index is the index of the block (or sub-piece)\n- that is being downloaded. downloading_progress is the number of bytes of\n- this block we have received from the peer, and downloading_total is the\n- total number of bytes in this block.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- standard_bittorrent\n- Regular bittorrent connection\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- web_seed\n- HTTP connection using the _\bB_\bE_\bP_\b _\b1_\b9 protocol\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- http_seed\n- HTTP connection using the _\bB_\bE_\bP_\b _\b1_\b7 protocol\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- connection_type\n- the kind of connection this peer uses. See connection_type_t.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- pending_disk_bytes\n- the number of bytes this peer has pending in the disk-io thread.\n- Downloaded and waiting to be written to disk. This is what is capped by\n- settings_pack::max_queued_disk_bytes.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- pending_disk_read_bytes\n- number of outstanding bytes to read from disk\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- send_quota receive_quota\n- the number of bytes this peer has been assigned to be allowed to send and\n- receive until it has to request more quota from the bandwidth manager.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- rtt\n- an estimated round trip time to this peer, in milliseconds. It is\n- estimated by timing the TCP connect(). It may be 0 for incoming\n- connections.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- num_pieces\n- the number of pieces this peer has.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- download_rate_peak upload_rate_peak\n- the highest download and upload rates seen on this connection. They are\n- given in bytes per second. This number is reset to 0 on reconnect.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- progress\n- the progress of the peer in the range [0, 1]. This is always 0 when\n- floating point operations are disabled, instead use progress_ppm.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- progress_ppm\n- indicates the download progress of the peer in the range [0, 1000000]\n- (parts per million).\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- ip\n- the IP-address to this peer. The type is an asio endpoint. For more info,\n- see the _\ba_\bs_\bi_\bo documentation. This field is not valid for i2p peers.\n- Instead use the _\bi_\b2_\bp_\b__\bd_\be_\bs_\bt_\bi_\bn_\ba_\bt_\bi_\bo_\bn_\b(_\b) function.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- local_endpoint\n- the IP and port pair the socket is bound to locally. i.e. the IP address\n- of the interface it's going out over. This may be useful for multi-homed\n- clients with multiple interfaces to the internet. This field is not valid\n- for i2p peers.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- bw_idle\n- The peer is not waiting for any external events to send or receive data.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- bw_limit\n- The peer is waiting for the rate limiter.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- bw_network\n- The peer has quota and is currently waiting for a network read or write\n- operation to complete. This is the state all peers are in if there are no\n- bandwidth limits.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- bw_disk\n- The peer is waiting for the disk I/O thread to catch up writing buffers\n- to disk before downloading more.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- read_state write_state\n- bitmasks indicating what state this peer is in with regards to sending\n- and receiving data. The states are defined as independent flags of type\n- bandwidth_state_flags_t, in this class.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* t\bto\bor\brr\bre\ben\bnt\bt_\b_p\bpe\bee\ber\br_\b_e\beq\bqu\bua\bal\bl(\b()\b) *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\be_\be_\br_\b._\bh_\bp_\bp\"\n-inline bool t\bto\bor\brr\bre\ben\bnt\bt_\b_p\bpe\bee\ber\br_\b_e\beq\bqu\bua\bal\bl (torrent_peer const* lhs, torrent_peer const*\n-rhs);\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* m\bma\bak\bke\be_\b_m\bma\bag\bgn\bne\bet\bt_\b_u\bur\bri\bi(\b()\b) *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bm_\ba_\bg_\bn_\be_\bt_\b__\bu_\br_\bi_\b._\bh_\bp_\bp\"\n-std::string m\bma\bak\bke\be_\b_m\bma\bag\bgn\bne\bet\bt_\b_u\bur\bri\bi (add_torrent_params const& atp);\n-std::string m\bma\bak\bke\be_\b_m\bma\bag\bgn\bne\bet\bt_\b_u\bur\bri\bi (torrent_handle const& handle);\n-std::string m\bma\bak\bke\be_\b_m\bma\bag\bgn\bne\bet\bt_\b_u\bur\bri\bi (torrent_info const& info);\n-Generates a magnet URI from the specified torrent.\n-Several fields from the _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs objects are recorded in the magnet\n-link. In order to not include them, they have to be cleared before calling\n-_\bm_\ba_\bk_\be_\b__\bm_\ba_\bg_\bn_\be_\bt_\b__\bu_\br_\bi_\b(_\b). These fields are used:\n- ti, info_hashes, url_seeds, dht_nodes, file_priorities, trackers,\n- name, peers.\n-Depending on what the use case for the resulting magnet link is, clearing peers\n-and dht_nodes is probably a good idea if the _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs came from a\n-running torrent. Those lists may be long and be ephemeral.\n-If none of the info_hashes or ti fields are set, there is not info-hash\n-available, and a magnet link cannot be created. In this case _\bm_\ba_\bk_\be_\b__\bm_\ba_\bg_\bn_\be_\bt_\b__\bu_\br_\bi_\b(_\b)\n-returns an empty string.\n-The recommended way to generate a magnet link from a _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be is to call\n-_\bs_\ba_\bv_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b), which will post a _\bs_\ba_\bv_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b__\ba_\bl_\be_\br_\bt containing an\n-_\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs object. This can then be passed to _\bm_\ba_\bk_\be_\b__\bm_\ba_\bg_\bn_\be_\bt_\b__\bu_\br_\bi_\b(_\b).\n-The overload that takes a _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be will make blocking calls to query\n-information about the torrent. If the torrent handle is invalid, an empty\n-string is returned.\n-For more information about magnet links, see _\bm_\ba_\bg_\bn_\be_\bt_\b _\bl_\bi_\bn_\bk_\bs.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* p\bpa\bar\brs\bse\be_\b_m\bma\bag\bgn\bne\bet\bt_\b_u\bur\bri\bi(\b()\b) *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bm_\ba_\bg_\bn_\be_\bt_\b__\bu_\br_\bi_\b._\bh_\bp_\bp\"\n-void p\bpa\bar\brs\bse\be_\b_m\bma\bag\bgn\bne\bet\bt_\b_u\bur\bri\bi (string_view uri, add_torrent_params& p, error_code& ec);\n-add_torrent_params p\bpa\bar\brs\bse\be_\b_m\bma\bag\bgn\bne\bet\bt_\b_u\bur\bri\bi (string_view uri, error_code& ec);\n-add_torrent_params p\bpa\bar\brs\bse\be_\b_m\bma\bag\bgn\bne\bet\bt_\b_u\bur\bri\bi (string_view uri);\n-This function parses out information from the magnet link and populates the\n-_\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs object. The overload that does not take an error_code\n-reference will throw a system_error on error The overload taking an\n-add_torrent_params reference will fill in the fields specified in the magnet\n-URI.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* t\btr\bru\bun\bnc\bca\bat\bte\be_\b_f\bfi\bil\ble\bes\bs(\b()\b) *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bt_\br_\bu_\bn_\bc_\ba_\bt_\be_\b._\bh_\bp_\bp\"\n-void t\btr\bru\bun\bnc\bca\bat\bte\be_\b_f\bfi\bil\ble\bes\bs (file_storage const& fs, std::string const& save_path,\n-storage_error& ec);\n-Truncates files larger than specified in the _\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be, saved under the\n-specified save_path.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* v\bve\ber\brs\bsi\bio\bon\bn(\b()\b) *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bv_\be_\br_\bs_\bi_\bo_\bn_\b._\bh_\bp_\bp\"\n-char const* v\bve\ber\brs\bsi\bio\bon\bn ();\n-returns the libtorrent version as string form in this format:\n-\"...\"\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* l\blo\boa\bad\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be(\b()\b) l\blo\boa\bad\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_p\bpa\bar\brs\bse\bed\bd(\b()\b) l\blo\boa\bad\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_b\bbu\buf\bff\bfe\ber\br(\b()\b) *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bl_\bo_\ba_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bh_\bp_\bp\"\n-add_torrent_params l\blo\boa\bad\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be (\n- std::string const& filename, load_torrent_limits const& cfg);\n-add_torrent_params l\blo\boa\bad\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_p\bpa\bar\brs\bse\bed\bd (\n- bdecode_node const& torrent_file, load_torrent_limits const& cfg);\n-add_torrent_params l\blo\boa\bad\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_b\bbu\buf\bff\bfe\ber\br (\n- span buffer, load_torrent_limits const& cfg);\n-add_torrent_params l\blo\boa\bad\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be (\n- std::string const& filename);\n-add_torrent_params l\blo\boa\bad\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_p\bpa\bar\brs\bse\bed\bd (\n- bdecode_node const& torrent_file);\n-add_torrent_params l\blo\boa\bad\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_b\bbu\buf\bff\bfe\ber\br (\n- span buffer);\n-These functions load the content of a .torrent file into an _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs\n-object. The immutable part of a torrent file (the info-dictionary) is stored in\n-the ti field in the _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs object (as a _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo object). The\n-returned object is suitable to be:\n- * added to a _\bs_\be_\bs_\bs_\bi_\bo_\bn via _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b) or _\ba_\bs_\by_\bn_\bc_\b__\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b)\n- * saved as a .torrent_file via _\bw_\br_\bi_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bi_\bl_\be_\b(_\b)\n- * turned into a magnet link via _\bm_\ba_\bk_\be_\b__\bm_\ba_\bg_\bn_\be_\bt_\b__\bu_\br_\bi_\b(_\b)\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* e\ben\bnu\bum\bm e\bev\bve\ben\bnt\bt_\b_t\bt *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bt_\br_\ba_\bc_\bk_\be_\br_\b__\bm_\ba_\bn_\ba_\bg_\be_\br_\b._\bh_\bp_\bp\"\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n-|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn|\n-|_\bn_\bo_\bn_\be_\b _\b _\b _\b _\b _\b|_\b0_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bc_\bo_\bm_\bp_\bl_\be_\bt_\be_\bd_\b|_\b1_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bs_\bt_\ba_\br_\bt_\be_\bd_\b _\b _\b|_\b2_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bs_\bt_\bo_\bp_\bp_\be_\bd_\b _\b _\b|_\b3_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bp_\ba_\bu_\bs_\be_\bd_\b _\b _\b _\b|_\b4_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* e\ben\bnu\bum\bm p\bpo\bor\brt\btm\bma\bap\bp_\b_t\btr\bra\ban\bns\bsp\bpo\bor\brt\bt *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bp_\bo_\br_\bt_\bm_\ba_\bp_\b._\bh_\bp_\bp\"\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n-|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bn_\ba_\bt_\bp_\bm_\bp_\b|_\b0_\b _\b _\b _\b _\b|_\bn_\ba_\bt_\bp_\bm_\bp_\b _\bc_\ba_\bn_\b _\bb_\be_\b _\bN_\bA_\bT_\b-_\bP_\bM_\bP_\b _\bo_\br_\b _\bP_\bC_\bP|\n-|_\bu_\bp_\bn_\bp_\b _\b _\b|_\b1_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* e\ben\bnu\bum\bm p\bpo\bor\brt\btm\bma\bap\bp_\b_p\bpr\bro\bot\bto\boc\bco\bol\bl *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bp_\bo_\br_\bt_\bm_\ba_\bp_\b._\bh_\bp_\bp\"\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n-|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn|\n-|_\bn_\bo_\bn_\be_\b|_\b0_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bt_\bc_\bp_\b _\b|_\b1_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bu_\bd_\bp_\b _\b|_\b2_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* e\ben\bnu\bum\bm c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn_\b_t\bty\byp\bpe\be *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bp_\be_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b._\bh_\bp_\bp\"\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n-|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn|\n-|_\bb_\bi_\bt_\bt_\bo_\br_\br_\be_\bn_\bt_\b|_\b0_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bu_\br_\bl_\b__\bs_\be_\be_\bd_\b _\b _\b|_\b1_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bh_\bt_\bt_\bp_\b__\bs_\be_\be_\bd_\b _\b|_\b2_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* e\ben\bnu\bum\bm p\bpr\bro\bot\bto\boc\bco\bol\bl_\b_v\bve\ber\brs\bsi\bio\bon\bn *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bi_\bn_\bf_\bo_\b__\bh_\ba_\bs_\bh_\b._\bh_\bp_\bp\"\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n-|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bV_\b1_\b _\b _\b|_\b0_\b _\b _\b _\b _\b|_\bT_\bh_\be_\b _\bo_\br_\bi_\bg_\bi_\bn_\ba_\bl_\b _\bB_\bi_\bt_\bT_\bo_\br_\br_\be_\bn_\bt_\b _\bv_\be_\br_\bs_\bi_\bo_\bn_\b,_\b _\bu_\bs_\bi_\bn_\bg_\b _\bS_\bH_\bA_\b-_\b1_\b _\bh_\ba_\bs_\bh_\be_\bs_\b _\b _\b _\b _\b _\b _\b |\n-|_\bV_\b2_\b _\b _\b|_\b1_\b _\b _\b _\b _\b|_\bV_\be_\br_\bs_\bi_\bo_\bn_\b _\b2_\b _\bo_\bf_\b _\bt_\bh_\be_\b _\bB_\bi_\bt_\bT_\bo_\br_\br_\be_\bn_\bt_\b _\bp_\br_\bo_\bt_\bo_\bc_\bo_\bl_\b,_\b _\bu_\bs_\bi_\bn_\bg_\b _\bS_\bH_\bA_\b-_\b2_\b5_\b6_\b _\bh_\ba_\bs_\bh_\be_\bs|\n-|_\bN_\bU_\bM_\b _\b|_\b2_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* e\ben\bnu\bum\bm s\bso\boc\bck\bke\bet\bt_\b_t\bty\byp\bpe\be_\b_t\bt *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\bo_\bc_\bk_\be_\bt_\b__\bt_\by_\bp_\be_\b._\bh_\bp_\bp\"\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n-|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn|\n-|_\bt_\bc_\bp_\b _\b _\b _\b _\b _\b _\b _\b|_\b0_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bs_\bo_\bc_\bk_\bs_\b5_\b _\b _\b _\b _\b|_\b1_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bh_\bt_\bt_\bp_\b _\b _\b _\b _\b _\b _\b|_\b2_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bu_\bt_\bp_\b _\b _\b _\b _\b _\b _\b _\b|_\b3_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bi_\b2_\bp_\b _\b _\b _\b _\b _\b _\b _\b|_\b4_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bt_\bc_\bp_\b__\bs_\bs_\bl_\b _\b _\b _\b|_\b5_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bs_\bo_\bc_\bk_\bs_\b5_\b__\bs_\bs_\bl_\b|_\b6_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bh_\bt_\bt_\bp_\b__\bs_\bs_\bl_\b _\b _\b|_\b7_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bu_\bt_\bp_\b__\bs_\bs_\bl_\b _\b _\b _\b|_\b8_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfl\bla\bag\bgs\bs_\b_t\bt *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bl_\ba_\bg_\bs_\b._\bh_\bp_\bp\"\n- seed_mode\n- If seed_mode is set, libtorrent will assume that all files are present\n- for this torrent and that they all match the hashes in the torrent file.\n- Each time a peer requests to download a block, the piece is verified\n- against the hash, unless it has been verified already. If a hash fails,\n- the torrent will automatically leave the seed mode and recheck all the\n- files. The use case for this mode is if a torrent is created and seeded,\n- or if the user already know that the files are complete, this is a way to\n- avoid the initial file checks, and significantly reduce the startup time.\n- Setting seed_mode on a torrent without metadata (a .torrent file) is a\n- no-op and will be ignored.\n- It is not possible to s\bse\bet\bt the seed_mode flag on a torrent after it has\n- been added to a _\bs_\be_\bs_\bs_\bi_\bo_\bn. It is possible to c\bcl\ble\bea\bar\br it though.\n- upload_mode\n- If upload_mode is set, the torrent will be initialized in upload-mode,\n- which means it will not make any piece requests. This state is typically\n- entered on disk I/O errors, and if the torrent is also auto managed, it\n- will be taken out of this state periodically (see settings_pack::\n- optimistic_disk_retry).\n- This mode can be used to avoid race conditions when adjusting priorities\n- of pieces before allowing the torrent to start downloading.\n- If the torrent is auto-managed (auto_managed), the torrent will\n- eventually be taken out of upload-mode, regardless of how it got there.\n- If it's important to manually control when the torrent leaves upload\n- mode, don't make it auto managed.\n- share_mode\n- determines if the torrent should be added in s\bsh\bha\bar\bre\be m\bmo\bod\bde\be or not. Share\n- mode indicates that we are not interested in downloading the torrent, but\n- merely want to improve our share ratio (i.e. increase it). A torrent\n- started in share mode will do its best to never download more than it\n- uploads to the swarm. If the swarm does not have enough demand for upload\n- capacity, the torrent will not download anything. This mode is intended\n- to be safe to add any number of torrents to, without manual screening,\n- without the risk of downloading more than is uploaded.\n- A torrent in share mode sets the priority to all pieces to 0, except for\n- the pieces that are downloaded, when pieces are decided to be downloaded.\n- This affects the progress bar, which might be set to \"100% finished\" most\n- of the time. Do not change file or piece priorities for torrents in share\n- mode, it will make it not work.\n- The share mode has one setting, the share ratio target, see\n- settings_pack::share_mode_target for more info.\n- apply_ip_filter\n- determines if the IP filter should apply to this torrent or not. By\n- default all torrents are subject to filtering by the IP filter (i.e. this\n- flag is set by default). This is useful if certain torrents needs to be\n- exempt for some reason, being an auto-update torrent for instance.\n- paused\n- specifies whether or not the torrent is paused. i.e. it won't connect to\n- the tracker or any of the peers until it's resumed. Note that a paused\n- torrent that also has the auto_managed flag set can be started at any\n- time by libtorrent's queuing logic. See _\bq_\bu_\be_\bu_\bi_\bn_\bg.\n- auto_managed\n- If the torrent is auto-managed (auto_managed), the torrent may be resumed\n- at any point, regardless of how it paused. If it's important to manually\n- control when the torrent is paused and resumed, don't make it auto\n- managed.\n- If auto_managed is set, the torrent will be queued, started and seeded\n- automatically by libtorrent. When this is set, the torrent should also be\n- started as paused. The default queue order is the order the torrents were\n- added. They are all downloaded in that order. For more details, see\n- _\bq_\bu_\be_\bu_\bi_\bn_\bg.\n- duplicate_is_error\n- used in _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs to indicate that it's an error to attempt to\n- add a torrent that's already in the _\bs_\be_\bs_\bs_\bi_\bo_\bn. If it's not considered an\n- error, a handle to the existing torrent is returned. This flag is not\n- saved by _\bw_\br_\bi_\bt_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b), since it is only meant for adding torrents.\n- update_subscribe\n- on by default and means that this torrent will be part of state updates\n- when calling _\bp_\bo_\bs_\bt_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bu_\bp_\bd_\ba_\bt_\be_\bs_\b(_\b). This flag is not saved by\n- _\bw_\br_\bi_\bt_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b).\n- super_seeding\n- sets the torrent into super seeding/initial seeding mode. If the torrent\n- is not a seed, this flag has no effect.\n- sequential_download\n- sets the sequential download state for the torrent. In this mode the\n- piece picker will pick pieces with low index numbers before pieces with\n- high indices. The actual pieces that are picked depend on other factors\n- still, such as which pieces a peer has and whether it is in parole mode\n- or \"prefer whole pieces\"-mode. Sequential mode is not ideal for streaming\n- media. For that, see _\bs_\be_\bt_\b__\bp_\bi_\be_\bc_\be_\b__\bd_\be_\ba_\bd_\bl_\bi_\bn_\be_\b(_\b) instead.\n- stop_when_ready\n- When this flag is set, the torrent will f\bfo\bor\brc\bce\be s\bst\bto\bop\bp whenever it\n- transitions from a non-data-transferring state into a data-transferring\n- state (referred to as being ready to download or seed). This is useful\n- for torrents that should not start downloading or seeding yet, but want\n- to be made ready to do so. A torrent may need to have its files checked\n- for instance, so it needs to be started and possibly queued for checking\n- (auto-managed and started) but as soon as it's done, it should be\n- stopped.\n- F\bFo\bor\brc\bce\be s\bst\bto\bop\bpp\bpe\bed\bd means auto-managed is set to false and it's paused. As if\n- the auto_manages flag is cleared and the paused flag is set on the\n- torrent.\n- Note that the torrent may transition into a downloading state while\n- setting this flag, and since the logic is edge triggered you may miss the\n- edge. To avoid this race, if the torrent already is in a downloading\n- state when this call is made, it will trigger the stop-when-ready\n- immediately.\n- When the stop-when-ready logic fires, the flag is cleared. Any subsequent\n- transitions between downloading and non-downloading states will not be\n- affected, until this flag is set again.\n- The behavior is more robust when setting this flag as part of adding the\n- torrent. See _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs.\n- The stop-when-ready flag fixes the inherent race condition of waiting for\n- the _\bs_\bt_\ba_\bt_\be_\b__\bc_\bh_\ba_\bn_\bg_\be_\bd_\b__\ba_\bl_\be_\br_\bt and then call _\bp_\ba_\bu_\bs_\be_\b(_\b). The download/seeding will\n- most likely start in between posting the _\ba_\bl_\be_\br_\bt and receiving the call to\n- pause.\n- A downloading state is one where peers are being connected. Which means\n- just downloading the metadata via the ut_metadata extension counts as a\n- downloading state. In order to stop a torrent once the metadata has been\n- downloaded, instead set all file priorities to dont_download\n- override_trackers\n- when this flag is set, the tracker list in the _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs object\n- override any trackers from the torrent file. If the flag is not set, the\n- trackers from the _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs object will be added to the list of\n- trackers used by the torrent. This flag is set by _\br_\be_\ba_\bd_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b) if\n- there are trackers present in the resume data file. This effectively\n- makes the trackers saved in the resume data take precedence over the\n- original trackers. This includes if there's an empty list of trackers, to\n- support the case where they were explicitly removed in the previous\n- _\bs_\be_\bs_\bs_\bi_\bo_\bn. This flag is not saved by _\bw_\br_\bi_\bt_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b)\n- override_web_seeds\n- If this flag is set, the web seeds from the _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs object\n- will override any web seeds in the torrent file. If it's not set, web\n- seeds in the _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs object will be added to the list of web\n- seeds used by the torrent. This flag is set by _\br_\be_\ba_\bd_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b) if\n- there are web seeds present in the resume data file. This effectively\n- makes the web seeds saved in the resume data take precedence over the\n- original ones. This includes if there's an empty list of web seeds, to\n- support the case where they were explicitly removed in the previous\n- _\bs_\be_\bs_\bs_\bi_\bo_\bn. This flag is not saved by _\bw_\br_\bi_\bt_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b)\n- need_save_resume\n- if this flag is set (which it is by default) the torrent will be\n- considered needing to save its resume data immediately, in the category\n- if_metadata_changed. See resume_data_flags_t and _\bs_\ba_\bv_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b) for\n- details.\n- This flag is cleared by a successful call to _\bs_\ba_\bv_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b) This flag\n- is not saved by _\bw_\br_\bi_\bt_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b), since it represents an ephemeral\n- state of a running torrent.\n- disable_dht\n- set this flag to disable DHT for this torrent. This lets you have the DHT\n- enabled for the whole client, and still have specific torrents not\n- participating in it. i.e. not announcing to the DHT nor picking up peers\n- from it.\n- disable_lsd\n- set this flag to disable local service discovery for this torrent.\n- disable_pex\n- set this flag to disable peer exchange for this torrent.\n- no_verify_files\n- if this flag is set, the resume data will be assumed to be correct\n- without validating it against any files on disk. This may be used when\n- restoring a _\bs_\be_\bs_\bs_\bi_\bo_\bn by loading resume data from disk. It will save time\n- and also delay any hard disk errors until files are actually needed. If\n- the resume data cannot be trusted, or if a torrent is added for the first\n- time to some save path that may already have some of the files, this flag\n- should not be set.\n- default_dont_download\n- default all file priorities to dont_download. This is useful for adding\n- magnet links where the number of files is unknown, but the\n- file_priorities is still set for some files. Any file not covered by the\n- file_priorities list will be set to normal download priority, unless this\n- flag is set, in which case they will be set to 0 (dont_download).\n- i2p_torrent\n- this flag makes the torrent be considered an \"i2p torrent\" for purposes\n- of the allow_i2p_mixed setting. When mixing regular peers and i2p peers\n- is disabled, i2p torrents won't add normal peers to its peer list. Note\n- that non i2p torrents may still allow i2p peers (on the off-chance that a\n- tracker return them and the _\bs_\be_\bs_\bs_\bi_\bo_\bn is configured with a SAM connection).\n- This flag is set automatically when adding a torrent that has at least\n- one tracker whose hostname ends with .i2p. It's also set by\n- _\bp_\ba_\br_\bs_\be_\b__\bm_\ba_\bg_\bn_\be_\bt_\b__\bu_\br_\bi_\b(_\b) if the tracker list contains such URL.\n- all\n- all torrent flags combined. Can conveniently be used when creating masks\n- for flags\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_p\bpr\bri\bio\bor\bri\bit\bty\by_\b_t\bt *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\b__\bp_\br_\bi_\bo_\br_\bi_\bt_\by_\b._\bh_\bp_\bp\"\n- dont_download\n- Don't download the file or piece. Partial pieces may still be downloaded\n- when setting file priorities.\n- default_priority\n- The default priority for files and pieces.\n- low_priority\n- The lowest priority for files and pieces.\n- top_priority\n- The highest priority for files and pieces.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* p\bpe\bex\bx_\b_f\bfl\bla\bag\bgs\bs_\b_t\bt *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bp_\be_\bx_\b__\bf_\bl_\ba_\bg_\bs_\b._\bh_\bp_\bp\"\n- pex_encryption\n- the peer supports protocol encryption\n- pex_seed\n- the peer is a seed\n- pex_utp\n- the peer supports the uTP, transport protocol over UDP.\n- pex_holepunch\n- the peer supports the holepunch extension If this flag is received from a\n- peer, it can be used as a rendezvous point in case direct connections to\n- the peer fail\n- pex_lt_v2\n- protocol v2 this is not a standard flag, it is only used internally\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* i\bin\bnt\bt *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bv_\be_\br_\bs_\bi_\bo_\bn_\b._\bh_\bp_\bp\"\n- version_major\n- the major, minor and tiny versions of libtorrent\n- version_minor\n- the major, minor and tiny versions of libtorrent\n- version_tiny\n- the major, minor and tiny versions of libtorrent\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* c\bch\bha\bar\br c\bco\bon\bns\bst\bt*\b* *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bv_\be_\br_\bs_\bi_\bo_\bn_\b._\bh_\bp_\bp\"\n- version_str\n- the libtorrent version in string form\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* s\bst\btd\bd:\b::\b:u\bui\bin\bnt\bt6\b64\b4_\b_t\bt *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bv_\be_\br_\bs_\bi_\bo_\bn_\b._\bh_\bp_\bp\"\n- version_revision\n- the git commit of this libtorrent version\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* f\bfi\bil\ble\be_\b_s\bsl\bli\bic\bce\be *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b._\bh_\bp_\bp\"\n-represents a window of a file in a torrent.\n-The file_index refers to the index of the file (in the _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo). To get\n-the path and filename, use file_path() and give the file_index as argument. The\n-offset is the byte offset in the file where the range starts, and size is the\n-number of bytes this range is. The size + offset will never be greater than the\n-file size.\n-struct file_slice\n-{\n- file_index_t file_index;\n- std::int64_t offset;\n- std::int64_t size;\n-};\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- file_index\n- the index of the file\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- offset\n- the offset from the start of the file, in bytes\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- size\n- the size of the window, in bytes\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* f\bfi\bil\ble\be_\b_s\bst\bto\bor\bra\bag\bge\be *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b._\bh_\bp_\bp\"\n-The file_storage class represents a file list and the piece size. Everything\n-necessary to interpret a regular bittorrent storage file structure.\n-class file_storage\n-{\n- bool i\bis\bs_\b_v\bva\bal\bli\bid\bd () const;\n- void r\bre\bes\bse\ber\brv\bve\be (int num_files);\n- void a\bad\bdd\bd_\b_f\bfi\bil\ble\be (std::string const& path, std::int64_t file_size\n- , file_flags_t file_flags = {}\n- , std::time_t mtime = 0, string_view symlink_path = string_view()\n- , char const* root_hash = nullptr);\n- void a\bad\bdd\bd_\b_f\bfi\bil\ble\be_\b_b\bbo\bor\brr\bro\bow\bw (string_view filename\n- , std::string const& path, std::int64_t file_size\n- , file_flags_t file_flags = {}, char const* filehash = nullptr\n- , std::int64_t mtime = 0, string_view symlink_path = string_view()\n- , char const* root_hash = nullptr);\n- void a\bad\bdd\bd_\b_f\bfi\bil\ble\be (error_code& ec, std::string const& path, std::int64_t\n-file_size\n- , file_flags_t file_flags = {}\n- , std::time_t mtime = 0, string_view symlink_path = string_view()\n- , char const* root_hash = nullptr);\n- void a\bad\bdd\bd_\b_f\bfi\bil\ble\be_\b_b\bbo\bor\brr\bro\bow\bw (error_code& ec, string_view filename\n- , std::string const& path, std::int64_t file_size\n- , file_flags_t file_flags = {}, char const* filehash = nullptr\n- , std::int64_t mtime = 0, string_view symlink_path = string_view()\n- , char const* root_hash = nullptr);\n- void r\bre\ben\bna\bam\bme\be_\b_f\bfi\bil\ble\be (file_index_t index, std::string const& new_filename);\n- std::vector m\bma\bap\bp_\b_b\bbl\blo\boc\bck\bk (piece_index_t piece, std::int64_t offset\n- , std::int64_t size) const;\n- peer_request m\bma\bap\bp_\b_f\bfi\bil\ble\be (file_index_t file, std::int64_t offset, int size)\n-const;\n- int n\bnu\bum\bm_\b_f\bfi\bil\ble\bes\bs () const noexcept;\n- file_index_t e\ben\bnd\bd_\b_f\bfi\bil\ble\be () const noexcept;\n- index_range f\bfi\bil\ble\be_\b_r\bra\ban\bng\bge\be () const noexcept;\n- std::int64_t t\bto\bot\bta\bal\bl_\b_s\bsi\biz\bze\be () const;\n- void s\bse\bet\bt_\b_n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs (int n);\n- int n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs () const;\n- piece_index_t e\ben\bnd\bd_\b_p\bpi\bie\bec\bce\be () const;\n- piece_index_t l\bla\bas\bst\bt_\b_p\bpi\bie\bec\bce\be () const;\n- index_range p\bpi\bie\bec\bce\be_\b_r\bra\ban\bng\bge\be () const noexcept;\n- void s\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_l\ble\ben\bng\bgt\bth\bh (int l);\n- int p\bpi\bie\bec\bce\be_\b_l\ble\ben\bng\bgt\bth\bh () const;\n- int p\bpi\bie\bec\bce\be_\b_s\bsi\biz\bze\be (piece_index_t index) const;\n- int p\bpi\bie\bec\bce\be_\b_s\bsi\biz\bze\be2\b2 (piece_index_t index) const;\n- int b\bbl\blo\boc\bck\bks\bs_\b_i\bin\bn_\b_p\bpi\bie\bec\bce\be2\b2 (piece_index_t index) const;\n- int b\bbl\blo\boc\bck\bks\bs_\b_p\bpe\ber\br_\b_p\bpi\bie\bec\bce\be () const;\n- void s\bse\bet\bt_\b_n\bna\bam\bme\be (std::string const& n);\n- std::string const& n\bna\bam\bme\be () const;\n- void s\bsw\bwa\bap\bp (file_storage& ti) noexcept;\n- void c\bca\ban\bno\bon\bni\bic\bca\bal\bli\biz\bze\be ();\n- std::string s\bsy\bym\bml\bli\bin\bnk\bk (file_index_t index) const;\n- std::time_t m\bmt\bti\bim\bme\be (file_index_t index) const;\n- bool p\bpa\bad\bd_\b_f\bfi\bil\ble\be_\b_a\bat\bt (file_index_t index) const;\n- std::string f\bfi\bil\ble\be_\b_p\bpa\bat\bth\bh (file_index_t index, std::string const& save_path =\n-\"\") const;\n- sha256_hash r\bro\boo\bot\bt (file_index_t index) const;\n- std::int64_t f\bfi\bil\ble\be_\b_o\bof\bff\bfs\bse\bet\bt (file_index_t index) const;\n- sha1_hash h\bha\bas\bsh\bh (file_index_t index) const;\n- string_view f\bfi\bil\ble\be_\b_n\bna\bam\bme\be (file_index_t index) const;\n- char const* r\bro\boo\bot\bt_\b_p\bpt\btr\br (file_index_t const index) const;\n- std::int64_t f\bfi\bil\ble\be_\b_s\bsi\biz\bze\be (file_index_t index) const;\n- int f\bfi\bil\ble\be_\b_n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs (file_index_t index) const;\n- index_range f\bfi\bil\ble\be_\b_p\bpi\bie\bec\bce\be_\b_r\bra\ban\bng\bge\be (file_index_t) const;\n- int f\bfi\bil\ble\be_\b_n\bnu\bum\bm_\b_b\bbl\blo\boc\bck\bks\bs (file_index_t index) const;\n- int f\bfi\bil\ble\be_\b_f\bfi\bir\brs\bst\bt_\b_p\bpi\bie\bec\bce\be_\b_n\bno\bod\bde\be (file_index_t index) const;\n- int f\bfi\bil\ble\be_\b_f\bfi\bir\brs\bst\bt_\b_b\bbl\blo\boc\bck\bk_\b_n\bno\bod\bde\be (file_index_t index) const;\n- std::uint32_t f\bfi\bil\ble\be_\b_p\bpa\bat\bth\bh_\b_h\bha\bas\bsh\bh (file_index_t index, std::string const&\n-save_path) const;\n- void a\bal\bll\bl_\b_p\bpa\bat\bth\bh_\b_h\bha\bas\bsh\bhe\bes\bs (std::unordered_set& table) const;\n- file_flags_t f\bfi\bil\ble\be_\b_f\bfl\bla\bag\bgs\bs (file_index_t index) const;\n- bool f\bfi\bil\ble\be_\b_a\bab\bbs\bso\bol\blu\but\bte\be_\b_p\bpa\bat\bth\bh (file_index_t index) const;\n- file_index_t f\bfi\bil\ble\be_\b_i\bin\bnd\bde\bex\bx_\b_a\bat\bt_\b_o\bof\bff\bfs\bse\bet\bt (std::int64_t offset) const;\n- file_index_t f\bfi\bil\ble\be_\b_i\bin\bnd\bde\bex\bx_\b_a\bat\bt_\b_p\bpi\bie\bec\bce\be (piece_index_t piece) const;\n- file_index_t f\bfi\bil\ble\be_\b_i\bin\bnd\bde\bex\bx_\b_f\bfo\bor\br_\b_r\bro\boo\bot\bt (sha256_hash const& root_hash) const;\n- piece_index_t p\bpi\bie\bec\bce\be_\b_i\bin\bnd\bde\bex\bx_\b_a\bat\bt_\b_f\bfi\bil\ble\be (file_index_t f) const;\n- void s\bsa\ban\bni\bit\bti\biz\bze\be_\b_s\bsy\bym\bml\bli\bin\bnk\bks\bs ();\n- bool v\bv2\b2 () const;\n-\n- static constexpr file_flags_t f\bfl\bla\bag\bg_\b_p\bpa\bad\bd_\b_f\bfi\bil\ble\be = 0_bit;\n- static constexpr file_flags_t f\bfl\bla\bag\bg_\b_h\bhi\bid\bdd\bde\ben\bn = 1_bit;\n- static constexpr file_flags_t f\bfl\bla\bag\bg_\b_e\bex\bxe\bec\bcu\but\bta\bab\bbl\ble\be = 2_bit;\n- static constexpr file_flags_t f\bfl\bla\bag\bg_\b_s\bsy\bym\bml\bli\bin\bnk\bk = 3_bit;\n-};\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* i\bis\bs_\b_v\bva\bal\bli\bid\bd(\b()\b) *\b**\b**\b**\b**\b*\n-bool i\bis\bs_\b_v\bva\bal\bli\bid\bd () const;\n-returns true if the piece length has been initialized on the _\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be. This\n-is typically taken as a proxy of whether the _\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be as a whole is\n-initialized or not.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* r\bre\bes\bse\ber\brv\bve\be(\b()\b) *\b**\b**\b**\b**\b*\n-void r\bre\bes\bse\ber\brv\bve\be (int num_files);\n-allocates space for num_files in the internal file list. This can be used to\n-avoid reallocating the internal file list when the number of files to be added\n-is known up-front.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_f\bfi\bil\ble\be(\b()\b) a\bad\bdd\bd_\b_f\bfi\bil\ble\be_\b_b\bbo\bor\brr\bro\bow\bw(\b()\b) *\b**\b**\b**\b**\b*\n-void a\bad\bdd\bd_\b_f\bfi\bil\ble\be (std::string const& path, std::int64_t file_size\n- , file_flags_t file_flags = {}\n- , std::time_t mtime = 0, string_view symlink_path = string_view()\n- , char const* root_hash = nullptr);\n-void a\bad\bdd\bd_\b_f\bfi\bil\ble\be_\b_b\bbo\bor\brr\bro\bow\bw (string_view filename\n- , std::string const& path, std::int64_t file_size\n- , file_flags_t file_flags = {}, char const* filehash = nullptr\n- , std::int64_t mtime = 0, string_view symlink_path = string_view()\n- , char const* root_hash = nullptr);\n-void a\bad\bdd\bd_\b_f\bfi\bil\ble\be (error_code& ec, std::string const& path, std::int64_t file_size\n- , file_flags_t file_flags = {}\n- , std::time_t mtime = 0, string_view symlink_path = string_view()\n- , char const* root_hash = nullptr);\n-void a\bad\bdd\bd_\b_f\bfi\bil\ble\be_\b_b\bbo\bor\brr\bro\bow\bw (error_code& ec, string_view filename\n- , std::string const& path, std::int64_t file_size\n- , file_flags_t file_flags = {}, char const* filehash = nullptr\n- , std::int64_t mtime = 0, string_view symlink_path = string_view()\n- , char const* root_hash = nullptr);\n-Adds a file to the file storage. The add_file_borrow version expects that\n-filename is the file name (without a path) of the file that's being added. This\n-memory is b\bbo\bor\brr\bro\bow\bwe\bed\bd, i.e. it is the caller's responsibility to make sure it\n-stays valid throughout the lifetime of this _\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be object or any copy of\n-it. The same thing applies to filehash, which is an optional pointer to a 20\n-byte binary SHA-1 hash of the file.\n-if filename is empty, the filename from path is used and not borrowed.\n-The path argument is the full path (in the torrent file) to the file to add.\n-Note that this is not supposed to be an absolute path, but it is expected to\n-include the name of the torrent as the first path element.\n-file_size is the size of the file in bytes.\n-The file_flags argument sets attributes on the file. The file attributes is an\n-extension and may not work in all bittorrent clients.\n-For possible file attributes, see file_storage::flags_t.\n-The mtime argument is optional and can be set to 0. If non-zero, it is the\n-posix time of the last modification time of this file.\n-symlink_path is the path the file is a symlink to. To make this a symlink you\n-also need to set the _\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b:_\b:_\bf_\bl_\ba_\bg_\b__\bs_\by_\bm_\bl_\bi_\bn_\bk file flag.\n-root_hash is an optional pointer to a 32 byte SHA-256 hash, being the merkle\n-tree root hash for this file. This is only used for v2 torrents. If the root\n-hash is specified for one file, it has to be specified for all, otherwise this\n-function will fail. Note that the buffer root_hash points to must out-live the\n-_\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be object, it will not be copied. This parameter is only used when\n-l\blo\boa\bad\bdi\bin\bng\bg torrents, that already have their file hashes computed. When creating\n-torrents, the file hashes will be computed by the piece hashes.\n-If more files than one are added, certain restrictions to their paths apply. In\n-a multi-file file storage (torrent), all files must share the same root\n-directory.\n-That is, the first path element of all files must be the same. This shared path\n-element is also set to the name of the torrent. It can be changed by calling\n-set_name.\n-The overloads that take anerror_codereference will report failures via that\n-variable, otherwisesystem_erroris thrown.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* r\bre\ben\bna\bam\bme\be_\b_f\bfi\bil\ble\be(\b()\b) *\b**\b**\b**\b**\b*\n-void r\bre\ben\bna\bam\bme\be_\b_f\bfi\bil\ble\be (file_index_t index, std::string const& new_filename);\n-renames the file at index to new_filename. Keep in mind that filenames are\n-expected to be UTF-8 encoded.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* m\bma\bap\bp_\b_b\bbl\blo\boc\bck\bk(\b()\b) *\b**\b**\b**\b**\b*\n-std::vector m\bma\bap\bp_\b_b\bbl\blo\boc\bck\bk (piece_index_t piece, std::int64_t offset\n- , std::int64_t size) const;\n-returns a list of _\bf_\bi_\bl_\be_\b__\bs_\bl_\bi_\bc_\be objects representing the portions of files the\n-specified piece index, byte offset and size range overlaps. this is the inverse\n-mapping of _\bm_\ba_\bp_\b__\bf_\bi_\bl_\be_\b(_\b).\n-Preconditions of this function is that the input range is within the torrents\n-address space. piece may not be negative and\n- piece * piece_size + offset + size\n-may not exceed the total size of the torrent.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* m\bma\bap\bp_\b_f\bfi\bil\ble\be(\b()\b) *\b**\b**\b**\b**\b*\n-peer_request m\bma\bap\bp_\b_f\bfi\bil\ble\be (file_index_t file, std::int64_t offset, int size) const;\n-returns a _\bp_\be_\be_\br_\b__\br_\be_\bq_\bu_\be_\bs_\bt representing the piece index, byte offset and size the\n-specified file range overlaps. This is the inverse mapping over _\bm_\ba_\bp_\b__\bb_\bl_\bo_\bc_\bk_\b(_\b).\n-Note that the peer_request return type is meant to hold bittorrent block\n-requests, which may not be larger than 16 kiB. Mapping a range larger than that\n-may return an overflown integer.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* n\bnu\bum\bm_\b_f\bfi\bil\ble\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n-int n\bnu\bum\bm_\b_f\bfi\bil\ble\bes\bs () const noexcept;\n-returns the number of files in the _\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* e\ben\bnd\bd_\b_f\bfi\bil\ble\be(\b()\b) *\b**\b**\b**\b**\b*\n-file_index_t e\ben\bnd\bd_\b_f\bfi\bil\ble\be () const noexcept;\n-returns the index of the one-past-end file in the file storage\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* f\bfi\bil\ble\be_\b_r\bra\ban\bng\bge\be(\b()\b) *\b**\b**\b**\b**\b*\n-index_range f\bfi\bil\ble\be_\b_r\bra\ban\bng\bge\be () const noexcept;\n-returns an implementation-defined type that can be used as the container in a\n-range-for loop. Where the values are the indices of all files in the\n-_\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* t\bto\bot\bta\bal\bl_\b_s\bsi\biz\bze\be(\b()\b) *\b**\b**\b**\b**\b*\n-std::int64_t t\bto\bot\bta\bal\bl_\b_s\bsi\biz\bze\be () const;\n-returns the total number of bytes all the files in this torrent spans\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* s\bse\bet\bt_\b_n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs(\b()\b) n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n-void s\bse\bet\bt_\b_n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs (int n);\n-int n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs () const;\n-set and get the number of pieces in the torrent\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* e\ben\bnd\bd_\b_p\bpi\bie\bec\bce\be(\b()\b) *\b**\b**\b**\b**\b*\n-piece_index_t e\ben\bnd\bd_\b_p\bpi\bie\bec\bce\be () const;\n-returns the index of the one-past-end piece in the file storage\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* l\bla\bas\bst\bt_\b_p\bpi\bie\bec\bce\be(\b()\b) *\b**\b**\b**\b**\b*\n-piece_index_t l\bla\bas\bst\bt_\b_p\bpi\bie\bec\bce\be () const;\n-returns the index of the last piece in the torrent. The last piece is special\n-in that it may be smaller than the other pieces (and the other pieces are all\n-the same size).\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* p\bpi\bie\bec\bce\be_\b_r\bra\ban\bng\bge\be(\b()\b) *\b**\b**\b**\b**\b*\n-index_range p\bpi\bie\bec\bce\be_\b_r\bra\ban\bng\bge\be () const noexcept;\n-returns an implementation-defined type that can be used as the container in a\n-range-for loop. Where the values are the indices of all pieces in the\n-_\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* p\bpi\bie\bec\bce\be_\b_l\ble\ben\bng\bgt\bth\bh(\b()\b) s\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_l\ble\ben\bng\bgt\bth\bh(\b()\b) *\b**\b**\b**\b**\b*\n-void s\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_l\ble\ben\bng\bgt\bth\bh (int l);\n-int p\bpi\bie\bec\bce\be_\b_l\ble\ben\bng\bgt\bth\bh () const;\n-set and get the size of each piece in this torrent. It must be a power of two\n-and at least 16 kiB.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* p\bpi\bie\bec\bce\be_\b_s\bsi\biz\bze\be(\b()\b) *\b**\b**\b**\b**\b*\n-int p\bpi\bie\bec\bce\be_\b_s\bsi\biz\bze\be (piece_index_t index) const;\n-returns the piece size of index. This will be the same as _\bp_\bi_\be_\bc_\be_\b__\bl_\be_\bn_\bg_\bt_\bh_\b(_\b),\n-except for the last piece, which may be shorter.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* p\bpi\bie\bec\bce\be_\b_s\bsi\biz\bze\be2\b2(\b()\b) *\b**\b**\b**\b**\b*\n-int p\bpi\bie\bec\bce\be_\b_s\bsi\biz\bze\be2\b2 (piece_index_t index) const;\n-Returns the size of the given piece. If the piece spans multiple files, only\n-the first file is considered part of the piece. This is used for v2 torrents,\n-where all files are piece aligned and padded. i.e. The pad files are not\n-considered part of the piece for this purpose.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* b\bbl\blo\boc\bck\bks\bs_\b_i\bin\bn_\b_p\bpi\bie\bec\bce\be2\b2(\b()\b) *\b**\b**\b**\b**\b*\n-int b\bbl\blo\boc\bck\bks\bs_\b_i\bin\bn_\b_p\bpi\bie\bec\bce\be2\b2 (piece_index_t index) const;\n-returns the number of blocks in the specified piece, for v2 torrents.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* b\bbl\blo\boc\bck\bks\bs_\b_p\bpe\ber\br_\b_p\bpi\bie\bec\bce\be(\b()\b) *\b**\b**\b**\b**\b*\n-int b\bbl\blo\boc\bck\bks\bs_\b_p\bpe\ber\br_\b_p\bpi\bie\bec\bce\be () const;\n-returns the number of blocks there are in the typical piece. There may be fewer\n-in the last piece)\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* n\bna\bam\bme\be(\b()\b) s\bse\bet\bt_\b_n\bna\bam\bme\be(\b()\b) *\b**\b**\b**\b**\b*\n-void s\bse\bet\bt_\b_n\bna\bam\bme\be (std::string const& n);\n-std::string const& n\bna\bam\bme\be () const;\n-set and get the name of this torrent. For multi-file torrents, this is also the\n-name of the root directory all the files are stored in.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* s\bsw\bwa\bap\bp(\b()\b) *\b**\b**\b**\b**\b*\n-void s\bsw\bwa\bap\bp (file_storage& ti) noexcept;\n-swap all content of t\bth\bhi\bis\bs with t\bti\bi.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* c\bca\ban\bno\bon\bni\bic\bca\bal\bli\biz\bze\be(\b()\b) *\b**\b**\b**\b**\b*\n-void c\bca\ban\bno\bon\bni\bic\bca\bal\bli\biz\bze\be ();\n-arrange files and padding to match the canonical form required by BEP 52\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* f\bfi\bil\ble\be_\b_o\bof\bff\bfs\bse\bet\bt(\b()\b) s\bsy\bym\bml\bli\bin\bnk\bk(\b()\b) h\bha\bas\bsh\bh(\b()\b) f\bfi\bil\ble\be_\b_s\bsi\biz\bze\be(\b()\b) r\bro\boo\bot\bt_\b_p\bpt\btr\br(\b()\b) f\bfi\bil\ble\be_\b_n\bna\bam\bme\be(\b()\b) m\bmt\bti\bim\bme\be(\b()\b)\n-p\bpa\bad\bd_\b_f\bfi\bil\ble\be_\b_a\bat\bt(\b()\b) r\bro\boo\bot\bt(\b()\b) f\bfi\bil\ble\be_\b_p\bpa\bat\bth\bh(\b()\b) *\b**\b**\b**\b**\b*\n-std::string s\bsy\bym\bml\bli\bin\bnk\bk (file_index_t index) const;\n-std::time_t m\bmt\bti\bim\bme\be (file_index_t index) const;\n-bool p\bpa\bad\bd_\b_f\bfi\bil\ble\be_\b_a\bat\bt (file_index_t index) const;\n-std::string f\bfi\bil\ble\be_\b_p\bpa\bat\bth\bh (file_index_t index, std::string const& save_path = \"\")\n-const;\n-sha256_hash r\bro\boo\bot\bt (file_index_t index) const;\n-std::int64_t f\bfi\bil\ble\be_\b_o\bof\bff\bfs\bse\bet\bt (file_index_t index) const;\n-sha1_hash h\bha\bas\bsh\bh (file_index_t index) const;\n-string_view f\bfi\bil\ble\be_\b_n\bna\bam\bme\be (file_index_t index) const;\n-char const* r\bro\boo\bot\bt_\b_p\bpt\btr\br (file_index_t const index) const;\n-std::int64_t f\bfi\bil\ble\be_\b_s\bsi\biz\bze\be (file_index_t index) const;\n-These functions are used to query attributes of files at a given index.\n-The hash() is a SHA-1 hash of the file, or 0 if none was provided in the\n-torrent file. This can potentially be used to join a bittorrent network with\n-other file sharing networks.\n-root() returns the SHA-256 merkle tree root of the specified file, in case this\n-is a v2 torrent. Otherwise returns zeros. root_ptr() returns a pointer to the\n-SHA-256 merkle tree root hash for the specified file. The pointer points into\n-storage referred to when the file was added, it is not owned by this object.\n-Torrents that are not v2 torrents return nullptr.\n-The mtime() is the modification time is the posix time when a file was last\n-modified when the torrent was created, or 0 if it was not included in the\n-torrent file.\n-file_path() returns the full path to a file.\n-file_size() returns the size of a file.\n-pad_file_at() returns true if the file at the given index is a pad-file.\n-file_name() returns j\bju\bus\bst\bt the name of the file, whereas file_path() returns the\n-path (inside the torrent file) with the filename appended.\n-file_offset() returns the byte offset within the torrent file where this file\n-starts. It can be used to map the file to a piece index (given the piece size).\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* f\bfi\bil\ble\be_\b_n\bnu\bum\bm_\b_b\bbl\blo\boc\bck\bks\bs(\b()\b) f\bfi\bil\ble\be_\b_p\bpi\bie\bec\bce\be_\b_r\bra\ban\bng\bge\be(\b()\b) f\bfi\bil\ble\be_\b_n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n-int f\bfi\bil\ble\be_\b_n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs (file_index_t index) const;\n-index_range f\bfi\bil\ble\be_\b_p\bpi\bie\bec\bce\be_\b_r\bra\ban\bng\bge\be (file_index_t) const;\n-int f\bfi\bil\ble\be_\b_n\bnu\bum\bm_\b_b\bbl\blo\boc\bck\bks\bs (file_index_t index) const;\n-Returns the number of pieces or blocks the file atindexspans, under the\n-assumption that the file is aligned to the start of a piece. This is only\n-meaningful for v2 torrents, where files are guaranteed such alignment. These\n-numbers are used to size and navigate the merkle hash tree for each file.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* f\bfi\bil\ble\be_\b_f\bfi\bir\brs\bst\bt_\b_b\bbl\blo\boc\bck\bk_\b_n\bno\bod\bde\be(\b()\b) f\bfi\bil\ble\be_\b_f\bfi\bir\brs\bst\bt_\b_p\bpi\bie\bec\bce\be_\b_n\bno\bod\bde\be(\b()\b) *\b**\b**\b**\b**\b*\n-int f\bfi\bil\ble\be_\b_f\bfi\bir\brs\bst\bt_\b_p\bpi\bie\bec\bce\be_\b_n\bno\bod\bde\be (file_index_t index) const;\n-int f\bfi\bil\ble\be_\b_f\bfi\bir\brs\bst\bt_\b_b\bbl\blo\boc\bck\bk_\b_n\bno\bod\bde\be (file_index_t index) const;\n-index of first piece node in the merkle tree\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* f\bfi\bil\ble\be_\b_p\bpa\bat\bth\bh_\b_h\bha\bas\bsh\bh(\b()\b) *\b**\b**\b**\b**\b*\n-std::uint32_t f\bfi\bil\ble\be_\b_p\bpa\bat\bth\bh_\b_h\bha\bas\bsh\bh (file_index_t index, std::string const& save_path)\n-const;\n-returns the crc32 hash of file_path(index)\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* a\bal\bll\bl_\b_p\bpa\bat\bth\bh_\b_h\bha\bas\bsh\bhe\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n-void a\bal\bll\bl_\b_p\bpa\bat\bth\bh_\b_h\bha\bas\bsh\bhe\bes\bs (std::unordered_set& table) const;\n-this will add the CRC32 hash of all directory entries to the table. No filename\n-will be included, just directories. Every depth of directories are added\n-separately to allow test for collisions with files at all levels. i.e. if one\n-path in the torrent is foo/bar/baz, the CRC32 hashes for foo, foo/bar and foo/\n-bar/baz will be added to the set.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* f\bfi\bil\ble\be_\b_f\bfl\bla\bag\bgs\bs(\b()\b) *\b**\b**\b**\b**\b*\n-file_flags_t f\bfi\bil\ble\be_\b_f\bfl\bla\bag\bgs\bs (file_index_t index) const;\n-returns a bitmask of flags from file_flags_t that apply to file at index.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* f\bfi\bil\ble\be_\b_a\bab\bbs\bso\bol\blu\but\bte\be_\b_p\bpa\bat\bth\bh(\b()\b) *\b**\b**\b**\b**\b*\n-bool f\bfi\bil\ble\be_\b_a\bab\bbs\bso\bol\blu\but\bte\be_\b_p\bpa\bat\bth\bh (file_index_t index) const;\n-returns true if the file at the specified index has been renamed to have an\n-absolute path, i.e. is not anchored in the save path of the torrent.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* f\bfi\bil\ble\be_\b_i\bin\bnd\bde\bex\bx_\b_a\bat\bt_\b_p\bpi\bie\bec\bce\be(\b()\b) f\bfi\bil\ble\be_\b_i\bin\bnd\bde\bex\bx_\b_a\bat\bt_\b_o\bof\bff\bfs\bse\bet\bt(\b()\b) *\b**\b**\b**\b**\b*\n-file_index_t f\bfi\bil\ble\be_\b_i\bin\bnd\bde\bex\bx_\b_a\bat\bt_\b_o\bof\bff\bfs\bse\bet\bt (std::int64_t offset) const;\n-file_index_t f\bfi\bil\ble\be_\b_i\bin\bnd\bde\bex\bx_\b_a\bat\bt_\b_p\bpi\bie\bec\bce\be (piece_index_t piece) const;\n-returns the index of the file at the given offset in the torrent\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* f\bfi\bil\ble\be_\b_i\bin\bnd\bde\bex\bx_\b_f\bfo\bor\br_\b_r\bro\boo\bot\bt(\b()\b) *\b**\b**\b**\b**\b*\n-file_index_t f\bfi\bil\ble\be_\b_i\bin\bnd\bde\bex\bx_\b_f\bfo\bor\br_\b_r\bro\boo\bot\bt (sha256_hash const& root_hash) const;\n-finds the file with the given root hash and returns its index if there is no\n-file with the root hash, file_index_t{-1} is returned\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* p\bpi\bie\bec\bce\be_\b_i\bin\bnd\bde\bex\bx_\b_a\bat\bt_\b_f\bfi\bil\ble\be(\b()\b) *\b**\b**\b**\b**\b*\n-piece_index_t p\bpi\bie\bec\bce\be_\b_i\bin\bnd\bde\bex\bx_\b_a\bat\bt_\b_f\bfi\bil\ble\be (file_index_t f) const;\n-returns the piece index the given file starts at\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* s\bsa\ban\bni\bit\bti\biz\bze\be_\b_s\bsy\bym\bml\bli\bin\bnk\bks\bs(\b()\b) *\b**\b**\b**\b**\b*\n-void s\bsa\ban\bni\bit\bti\biz\bze\be_\b_s\bsy\bym\bml\bli\bin\bnk\bks\bs ();\n-validate any symlinks, to ensure they all point to other files or directories\n-inside this storage. Any invalid symlinks are updated to point to themselves.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* v\bv2\b2(\b()\b) *\b**\b**\b**\b**\b*\n-bool v\bv2\b2 () const;\n-returns true if this torrent contains v2 metadata.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- flag_pad_file\n- the file is a pad file. It's required to contain zeros at it will not be\n- saved to disk. Its purpose is to make the following file start on a piece\n- boundary.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- flag_hidden\n- this file has the hidden attribute set. This is primarily a windows\n- attribute\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- flag_executable\n- this file has the executable attribute set.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- flag_symlink\n- this file is a symbolic link. It should have a link target string\n- associated with it.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* s\bst\bto\bor\bra\bag\bge\be_\b_p\bpa\bar\bra\bam\bms\bs *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bd_\be_\bf_\bs_\b._\bh_\bp_\bp\"\n-a parameter pack used to construct the storage for a torrent, used in\n-_\bd_\bi_\bs_\bk_\b__\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be\n-struct storage_params\n-{\n- s\bst\bto\bor\bra\bag\bge\be_\b_p\bpa\bar\bra\bam\bms\bs (file_storage const& f, file_storage const* mf\n- , std::string const& sp, storage_mode_t const sm\n- , aux::vector const& prio\n- , sha1_hash const& ih);\n-\n- file_storage const& files;\n- file_storage const* m\bma\bap\bpp\bpe\bed\bd_\b_f\bfi\bil\ble\bes\bs = nullptr;\n- std::string const& path;\n- storage_mode_t m\bmo\bod\bde\be {storage_mode_sparse};\n- aux::vector const& priorities;\n- sha1_hash info_hash;\n-};\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* m\bmm\bma\bap\bp_\b_d\bdi\bis\bsk\bk_\b_i\bio\bo_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br(\b()\b) *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bm_\bm_\ba_\bp_\b__\bd_\bi_\bs_\bk_\b__\bi_\bo_\b._\bh_\bp_\bp\"\n-std::unique_ptr m\bmm\bma\bap\bp_\b_d\bdi\bis\bsk\bk_\b_i\bio\bo_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br (\n- io_context& ios, settings_interface const&, counters& cnt);\n-constructs a memory mapped file disk I/O object.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* d\bdi\bis\bsa\bab\bbl\ble\bed\bd_\b_d\bdi\bis\bsk\bk_\b_i\bio\bo_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br(\b()\b) *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bd_\bi_\bs_\ba_\bb_\bl_\be_\bd_\b__\bd_\bi_\bs_\bk_\b__\bi_\bo_\b._\bh_\bp_\bp\"\n-std::unique_ptr d\bdi\bis\bsa\bab\bbl\ble\bed\bd_\b_d\bdi\bis\bsk\bk_\b_i\bio\bo_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br (\n- io_context& ios, settings_interface const&, counters& cnt);\n-creates a disk io object that discards all data written to it, and only returns\n-zero-buffers when read from. May be useful for testing and benchmarking.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* d\bde\bef\bfa\bau\bul\blt\bt_\b_d\bdi\bis\bsk\bk_\b_i\bio\bo_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br(\b()\b) *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b._\bh_\bp_\bp\"\n-std::unique_ptr d\bde\bef\bfa\bau\bul\blt\bt_\b_d\bdi\bis\bsk\bk_\b_i\bio\bo_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br (\n- io_context& ios, settings_interface const&, counters& cnt);\n-the constructor function for the default storage. On systems that support\n-memory mapped files (and a 64 bit address space) the memory mapped storage will\n-be constructed, otherwise the portable posix storage.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* p\bpo\bos\bsi\bix\bx_\b_d\bdi\bis\bsk\bk_\b_i\bio\bo_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br(\b()\b) *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bp_\bo_\bs_\bi_\bx_\b__\bd_\bi_\bs_\bk_\b__\bi_\bo_\b._\bh_\bp_\bp\"\n-std::unique_ptr p\bpo\bos\bsi\bix\bx_\b_d\bdi\bis\bsk\bk_\b_i\bio\bo_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br (\n- io_context& ios, settings_interface const&, counters& cnt);\n-this is a simple posix disk I/O back-end, used for systems that don't have a 64\n-bit virtual address space or don't support memory mapped files. It's\n-implemented using portable C file functions and is single-threaded.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* e\ben\bnu\bum\bm s\bst\bto\bor\bra\bag\bge\be_\b_m\bmo\bod\bde\be_\b_t\bt *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bd_\be_\bf_\bs_\b._\bh_\bp_\bp\"\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n-|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-| | |All pieces will be written to their final |\n-| | |position, all files will be allocated in full |\n-|storage_mode_allocate|0 |when the torrent is first started. This mode |\n-| | |minimizes fragmentation but could be a costly |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bo_\bp_\be_\br_\ba_\bt_\bi_\bo_\bn_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-| | |All pieces will be written to the place where |\n-|storage_mode_sparse |1 |they belong and sparse files will be used. This|\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bi_\bs_\b _\bt_\bh_\be_\b _\br_\be_\bc_\bo_\bm_\bm_\be_\bn_\bd_\be_\bd_\b,_\b _\ba_\bn_\bd_\b _\bd_\be_\bf_\ba_\bu_\bl_\bt_\b _\bm_\bo_\bd_\be_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* e\ben\bnu\bum\bm s\bst\bta\bat\btu\bus\bs_\b_t\bt *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bd_\be_\bf_\bs_\b._\bh_\bp_\bp\"\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n-|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bn_\bo_\b__\be_\br_\br_\bo_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b0_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bf_\ba_\bt_\ba_\bl_\b__\bd_\bi_\bs_\bk_\b__\be_\br_\br_\bo_\br_\b|_\b1_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bn_\be_\be_\bd_\b__\bf_\bu_\bl_\bl_\b__\bc_\bh_\be_\bc_\bk_\b _\b|_\b2_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bf_\bi_\bl_\be_\b__\be_\bx_\bi_\bs_\bt_\b _\b _\b _\b _\b _\b _\b|_\b3_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-| | |this is not an enum value, but a flag that can be set|\n-| | |in the return from async_check_files, in case an |\n-|oversized_file |16 |existing file was found larger than specified in the |\n-| | |torrent. i.e. it has garbage at the end the _\bs_\bt_\ba_\bt_\bu_\bs_\b__\bt |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bf_\bi_\be_\bl_\bd_\b _\bi_\bs_\b _\bu_\bs_\be_\bd_\b _\bf_\bo_\br_\b _\bt_\bh_\bi_\bs_\b _\bt_\bo_\b _\bp_\br_\be_\bs_\be_\br_\bv_\be_\b _\bA_\bB_\bI_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* e\ben\bnu\bum\bm m\bmo\bov\bve\be_\b_f\bfl\bla\bag\bgs\bs_\b_t\bt *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bd_\be_\bf_\bs_\b._\bh_\bp_\bp\"\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n-|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|always_replace_files |0 |replace any files in the destination when |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bc_\bo_\bp_\by_\bi_\bn_\bg_\b _\bo_\br_\b _\bm_\bo_\bv_\bi_\bn_\bg_\b _\bt_\bh_\be_\b _\bs_\bt_\bo_\br_\ba_\bg_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-| | |if any files that we want to copy exist in |\n-| | |the destination exist, fail the whole |\n-| | |operation and don't perform any copy or move.|\n-| | |There is an inherent race condition in this |\n-|fail_if_exist |1 |mode. The files are checked for existence |\n-| | |before the operation starts. In between the |\n-| | |check and performing the copy, the |\n-| | |destination files may be created, in which |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bc_\ba_\bs_\be_\b _\bt_\bh_\be_\by_\b _\ba_\br_\be_\b _\br_\be_\bp_\bl_\ba_\bc_\be_\bd_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-| | |if any file exist in the target, take those |\n-|dont_replace |2 |files instead of the ones we may have in the |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bs_\bo_\bu_\br_\bc_\be_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-| | |don't move any source files, just forget |\n-|reset_save_path |3 |about them and begin checking files at new |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bs_\ba_\bv_\be_\b _\bp_\ba_\bt_\bh_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|reset_save_path_unchecked|4 |don't move any source files, just change save|\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bp_\ba_\bt_\bh_\b _\ba_\bn_\bd_\b _\bc_\bo_\bn_\bt_\bi_\bn_\bu_\be_\b _\bw_\bo_\br_\bk_\bi_\bn_\bg_\b _\bw_\bi_\bt_\bh_\bo_\bu_\bt_\b _\ba_\bn_\by_\b _\bc_\bh_\be_\bc_\bk_\bs_\b |\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_i\bin\bnf\bfo\bo *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b._\bh_\bp_\bp\"\n-holds settings for a peer class. Used in _\bs_\be_\bt_\b__\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b(_\b) and _\bg_\be_\bt_\b__\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b(_\b)\n-calls.\n-struct peer_class_info\n-{\n- bool ignore_unchoke_slots;\n- int connection_limit_factor;\n- std::string label;\n- int upload_limit;\n- int download_limit;\n- int upload_priority;\n- int download_priority;\n-};\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- ignore_unchoke_slots\n- ignore_unchoke_slots determines whether peers should always unchoke a\n- peer, regardless of the choking algorithm, or if it should honor the\n- unchoke slot limits. It's used for local peers by default. If a\ban\bny\by of the\n- peer classes a peer belongs to has this set to true, that peer will be\n- unchoked at all times.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- connection_limit_factor\n- adjusts the connection limit (global and per torrent) that applies to\n- this peer class. By default, local peers are allowed to exceed the normal\n- connection limit for instance. This is specified as a percent factor. 100\n- makes the peer class apply normally to the limit. 200 means as long as\n- there are fewer connections than twice the limit, we accept this peer.\n- This factor applies both to the global connection limit and the per-\n- torrent limit. Note that if not used carefully one peer class can\n- potentially completely starve out all other over time.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- label\n- not used by libtorrent. It's intended as a potentially user-facing\n- identifier of this peer class.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- upload_limit download_limit\n- transfer rates limits for the whole peer class. They are specified in\n- bytes per second and apply to the sum of all peers that are members of\n- this class.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- upload_priority download_priority\n- relative priorities used by the bandwidth allocator in the rate limiter.\n- If no rate limits are in use, the priority is not used either. Priorities\n- start at 1 (0 is not a valid priority) and may not exceed 255.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_t\bty\byp\bpe\be_\b_f\bfi\bil\blt\bte\ber\br *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b__\bt_\by_\bp_\be_\b__\bf_\bi_\bl_\bt_\be_\br_\b._\bh_\bp_\bp\"\n-peer_class_type_filter is a simple container for rules for adding and\n-subtracting peer-classes from peers. It is applied a\baf\bft\bte\ber\br the peer class filter\n-is applied (which is based on the peer's IP address).\n-struct peer_class_type_filter\n-{\n- void a\bad\bdd\bd (socket_type_t const st, peer_class_t const peer_class);\n- void r\bre\bem\bmo\bov\bve\be (socket_type_t const st, peer_class_t const peer_class);\n- void a\bal\bll\blo\bow\bw (socket_type_t const st, peer_class_t const peer_class);\n- void d\bdi\bis\bsa\bal\bll\blo\bow\bw (socket_type_t const st, peer_class_t const peer_class);\n- std::uint32_t a\bap\bpp\bpl\bly\by (socket_type_t const st, std::uint32_t peer_class_mask);\n- friend bool o\bop\bpe\ber\bra\bat\bto\bor\br=\b==\b= (peer_class_type_filter const& lhs\n- , peer_class_type_filter const& rhs);\n-\n- enum socket_type_t\n- {\n- tcp_socket,\n- utp_socket,\n- ssl_tcp_socket,\n- ssl_utp_socket,\n- i2p_socket,\n- num_socket_types,\n- };\n-};\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* a\bad\bdd\bd(\b()\b) r\bre\bem\bmo\bov\bve\be(\b()\b) *\b**\b**\b**\b**\b*\n-void a\bad\bdd\bd (socket_type_t const st, peer_class_t const peer_class);\n-void r\bre\bem\bmo\bov\bve\be (socket_type_t const st, peer_class_t const peer_class);\n-add() and remove() adds and removes a peer class to be added to new peers based\n-on socket type.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* a\bal\bll\blo\bow\bw(\b()\b) d\bdi\bis\bsa\bal\bll\blo\bow\bw(\b()\b) *\b**\b**\b**\b**\b*\n-void a\bal\bll\blo\bow\bw (socket_type_t const st, peer_class_t const peer_class);\n-void d\bdi\bis\bsa\bal\bll\blo\bow\bw (socket_type_t const st, peer_class_t const peer_class);\n-disallow() and allow() adds and removes a peer class to be removed from new\n-peers based on socket type.\n-The peer_class argument cannot be greater than 31. The bitmasks representing\n-peer classes in the peer_class_type_filter are 32 bits.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* a\bap\bpp\bpl\bly\by(\b()\b) *\b**\b**\b**\b**\b*\n-std::uint32_t a\bap\bpp\bpl\bly\by (socket_type_t const st, std::uint32_t peer_class_mask);\n-takes a bitmask of peer classes and returns a new bitmask of peer classes after\n-the rules have been applied, based on the socket type argument (st).\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* e\ben\bnu\bum\bm s\bso\boc\bck\bke\bet\bt_\b_t\bty\byp\bpe\be_\b_t\bt *\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b__\bt_\by_\bp_\be_\b__\bf_\bi_\bl_\bt_\be_\br_\b._\bh_\bp_\bp\"\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n-|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|tcp_socket |0 |these match the socket types from socket_type.hpp|\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bs_\bh_\bi_\bf_\bt_\be_\bd_\b _\bo_\bn_\be_\b _\bd_\bo_\bw_\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bu_\bt_\bp_\b__\bs_\bo_\bc_\bk_\be_\bt_\b _\b _\b _\b _\b _\b _\b|_\b1_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bs_\bs_\bl_\b__\bt_\bc_\bp_\b__\bs_\bo_\bc_\bk_\be_\bt_\b _\b _\b|_\b2_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bs_\bs_\bl_\b__\bu_\bt_\bp_\b__\bs_\bo_\bc_\bk_\be_\bt_\b _\b _\b|_\b3_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bi_\b2_\bp_\b__\bs_\bo_\bc_\bk_\be_\bt_\b _\b _\b _\b _\b _\b _\b|_\b4_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bn_\bu_\bm_\b__\bs_\bo_\bc_\bk_\be_\bt_\b__\bt_\by_\bp_\be_\bs_\b|_\b5_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_i\bin\bnf\bfo\boh\bha\bas\bsh\bh *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\be_\bn_\bt_\br_\by_\b._\bh_\bp_\bp\"\n-struct announce_infohash\n-{\n- std::string message;\n- error_code last_error;\n- int s\bsc\bcr\bra\bap\bpe\be_\b_i\bin\bnc\bco\bom\bmp\bpl\ble\bet\bte\be = -1;\n- int s\bsc\bcr\bra\bap\bpe\be_\b_c\bco\bom\bmp\bpl\ble\bet\bte\be = -1;\n- int s\bsc\bcr\bra\bap\bpe\be_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bde\bed\bd = -1;\n- std::uint8_t fails : 7;\n- bool updating : 1;\n- bool start_sent : 1;\n- bool complete_sent : 1;\n-};\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- message\n- if this tracker has returned an error or warning message that message is\n- stored here\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- last_error\n- if this tracker failed the last time it was contacted this error code\n- specifies what error occurred\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- scrape_incomplete scrape_complete scrape_downloaded\n- if this tracker has returned scrape data, these fields are filled in with\n- valid numbers. Otherwise they are set to -1. incomplete counts the number\n- of current downloaders. complete counts the number of current peers\n- completed the download, or \"seeds\". downloaded is the cumulative number\n- of completed downloads.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- fails\n- the number of times in a row we have failed to announce to this tracker.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- updating\n- true while we're waiting for a response from the tracker.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- start_sent\n- set to true when we get a valid response from an announce with\n- event=started. If it is set, we won't send start in the subsequent\n- announces.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- complete_sent\n- set to true when we send a event=completed.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnd\bdp\bpo\boi\bin\bnt\bt *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\be_\bn_\bt_\br_\by_\b._\bh_\bp_\bp\"\n-announces are sent to each tracker using every listen socket this class holds\n-information about one listen socket for one tracker\n-struct announce_endpoint\n-{\n- a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnd\bdp\bpo\boi\bin\bnt\bt ();\n-\n- _\bt_\bc_\bp_\b:_\b:_\be_\bn_\bd_\bp_\bo_\bi_\bn_\bt local_endpoint;\n- aux::array info_hashes;\n- bool e\ben\bna\bab\bbl\ble\bed\bd = true;\n-};\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- local_endpoint\n- the local endpoint of the listen interface associated with this endpoint\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- info_hashes\n- info_hashes[0] is the v1 info hash (SHA1) info_hashes[1] is the v2 info\n- hash (truncated SHA-256)\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- enabled\n- set to false to not announce from this endpoint\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\be_\bn_\bt_\br_\by_\b._\bh_\bp_\bp\"\n-this class holds information about one bittorrent tracker, as it relates to a\n-specific torrent.\n-struct announce_entry\n-{\n- announce_entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (announce_entry const&) &;\n- a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by ();\n- ~\b~a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by ();\n- a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by (announce_entry const&);\n- explicit a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by (string_view u);\n-\n- enum tracker_source\n- {\n- source_torrent,\n- source_client,\n- source_magnet_link,\n- source_tex,\n- };\n-\n- std::string url;\n- std::string trackerid;\n- std::vector endpoints;\n- std::uint8_t t\bti\bie\ber\br = 0;\n- std::uint8_t f\bfa\bai\bil\bl_\b_l\bli\bim\bmi\bit\bt = 0;\n- std::uint8_t source:4;\n- bool verified:1;\n-};\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* o\bop\bpe\ber\bra\bat\bto\bor\br=\b=(\b()\b) ~\b~a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by(\b()\b) a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by(\b()\b) *\b**\b**\b**\b**\b*\n-announce_entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (announce_entry const&) &;\n-a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by ();\n-~\b~a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by ();\n-a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by (announce_entry const&);\n-explicit a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by (string_view u);\n-constructs a tracker announce _\be_\bn_\bt_\br_\by with u as the URL.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* e\ben\bnu\bum\bm t\btr\bra\bac\bck\bke\ber\br_\b_s\bso\bou\bur\brc\bce\be *\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\be_\bn_\bt_\br_\by_\b._\bh_\bp_\bp\"\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n-|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bs_\bo_\bu_\br_\bc_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b _\b _\b _\b _\b|_\b1_\b _\b _\b _\b _\b|_\bt_\bh_\be_\b _\bt_\br_\ba_\bc_\bk_\be_\br_\b _\bw_\ba_\bs_\b _\bp_\ba_\br_\bt_\b _\bo_\bf_\b _\bt_\bh_\be_\b _\b._\bt_\bo_\br_\br_\be_\bn_\bt_\b _\bf_\bi_\bl_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|source_client |2 |the tracker was added programmatically via the |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\ba_\bd_\bd_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\b(_\b)_\b _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bs_\bo_\bu_\br_\bc_\be_\b__\bm_\ba_\bg_\bn_\be_\bt_\b__\bl_\bi_\bn_\bk_\b|_\b4_\b _\b _\b _\b _\b|_\bt_\bh_\be_\b _\bt_\br_\ba_\bc_\bk_\be_\br_\b _\bw_\ba_\bs_\b _\bp_\ba_\br_\bt_\b _\bo_\bf_\b _\ba_\b _\bm_\ba_\bg_\bn_\be_\bt_\b _\bl_\bi_\bn_\bk_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|source_tex |8 |the tracker was received from the swarm via tracker|\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\be_\bx_\bc_\bh_\ba_\bn_\bg_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- url\n- tracker URL as it appeared in the torrent file\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- trackerid\n- the current &trackerid= argument passed to the tracker. this is optional\n- and is normally empty (in which case no trackerid is sent).\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- endpoints\n- each local listen socket (endpoint) will announce to the tracker. This\n- list contains state per endpoint.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- tier\n- the tier this tracker belongs to\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- fail_limit\n- the max number of failures to announce to this tracker in a row, before\n- this tracker is not used anymore. 0 means unlimited\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- source\n- a bitmask specifying which sources we got this tracker from.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- verified\n- set to true the first time we receive a valid response from this tracker.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* t\bto\bor\brr\bre\ben\bnt\bt_\b_s\bst\bta\bat\btu\bus\bs *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bs_\bt_\ba_\bt_\bu_\bs_\b._\bh_\bp_\bp\"\n-holds a snapshot of the status of a torrent, as queried by _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be_\b:_\b:\n-_\bs_\bt_\ba_\bt_\bu_\bs_\b(_\b).\n-struct torrent_status\n-{\n- bool o\bop\bpe\ber\bra\bat\bto\bor\br=\b==\b= (torrent_status const& st) const;\n-\n- enum state_t\n- {\n- checking_files,\n- downloading_metadata,\n- downloading,\n- finished,\n- seeding,\n- unused_enum_for_backwards_compatibility_allocating,\n- checking_resume_data,\n- };\n-\n- torrent_handle handle;\n- error_code errc;\n- file_index_t e\ber\brr\bro\bor\br_\b_f\bfi\bil\ble\be = torrent_status::error_file_none;\n- static constexpr file_index_t e\ber\brr\bro\bor\br_\b_f\bfi\bil\ble\be_\b_n\bno\bon\bne\be {-1};\n- static constexpr file_index_t e\ber\brr\bro\bor\br_\b_f\bfi\bil\ble\be_\b_s\bss\bsl\bl_\b_c\bct\btx\bx {-3};\n- static constexpr file_index_t e\ber\brr\bro\bor\br_\b_f\bfi\bil\ble\be_\b_m\bme\bet\bta\bad\bda\bat\bta\ba {-4};\n- static constexpr file_index_t e\ber\brr\bro\bor\br_\b_f\bfi\bil\ble\be_\b_e\bex\bxc\bce\bep\bpt\bti\bio\bon\bn {-5};\n- static constexpr file_index_t e\ber\brr\bro\bor\br_\b_f\bfi\bil\ble\be_\b_p\bpa\bar\brt\btf\bfi\bil\ble\be {-6};\n- std::string save_path;\n- std::string name;\n- std::weak_ptr torrent_file;\n- time_duration n\bne\bex\bxt\bt_\b_a\ban\bnn\bno\bou\bun\bnc\bce\be = seconds{0};\n- std::string current_tracker;\n- std::int64_t t\bto\bot\bta\bal\bl_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd = 0;\n- std::int64_t t\bto\bot\bta\bal\bl_\b_u\bup\bpl\blo\boa\bad\bd = 0;\n- std::int64_t t\bto\bot\bta\bal\bl_\b_p\bpa\bay\byl\blo\boa\bad\bd_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd = 0;\n- std::int64_t t\bto\bot\bta\bal\bl_\b_p\bpa\bay\byl\blo\boa\bad\bd_\b_u\bup\bpl\blo\boa\bad\bd = 0;\n- std::int64_t t\bto\bot\bta\bal\bl_\b_f\bfa\bai\bil\ble\bed\bd_\b_b\bby\byt\bte\bes\bs = 0;\n- std::int64_t t\bto\bot\bta\bal\bl_\b_r\bre\bed\bdu\bun\bnd\bda\ban\bnt\bt_\b_b\bby\byt\bte\bes\bs = 0;\n- typed_bitfield pieces;\n- typed_bitfield verified_pieces;\n- std::int64_t t\bto\bot\bta\bal\bl_\b_d\bdo\bon\bne\be = 0;\n- std::int64_t t\bto\bot\bta\bal\bl = 0;\n- std::int64_t t\bto\bot\bta\bal\bl_\b_w\bwa\ban\bnt\bte\bed\bd_\b_d\bdo\bon\bne\be = 0;\n- std::int64_t t\bto\bot\bta\bal\bl_\b_w\bwa\ban\bnt\bte\bed\bd = 0;\n- std::int64_t a\bal\bll\bl_\b_t\bti\bim\bme\be_\b_u\bup\bpl\blo\boa\bad\bd = 0;\n- std::int64_t a\bal\bll\bl_\b_t\bti\bim\bme\be_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd = 0;\n- std::time_t a\bad\bdd\bde\bed\bd_\b_t\bti\bim\bme\be = 0;\n- std::time_t c\bco\bom\bmp\bpl\ble\bet\bte\bed\bd_\b_t\bti\bim\bme\be = 0;\n- std::time_t l\bla\bas\bst\bt_\b_s\bse\bee\ben\bn_\b_c\bco\bom\bmp\bpl\ble\bet\bte\be = 0;\n- storage_mode_t s\bst\bto\bor\bra\bag\bge\be_\b_m\bmo\bod\bde\be = storage_mode_sparse;\n- float p\bpr\bro\bog\bgr\bre\bes\bss\bs = 0.f;\n- int p\bpr\bro\bog\bgr\bre\bes\bss\bs_\b_p\bpp\bpm\bm = 0;\n- queue_position_t q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn {};\n- int d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_r\bra\bat\bte\be = 0;\n- int u\bup\bpl\blo\boa\bad\bd_\b_r\bra\bat\bte\be = 0;\n- int d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_p\bpa\bay\byl\blo\boa\bad\bd_\b_r\bra\bat\bte\be = 0;\n- int u\bup\bpl\blo\boa\bad\bd_\b_p\bpa\bay\byl\blo\boa\bad\bd_\b_r\bra\bat\bte\be = 0;\n- int n\bnu\bum\bm_\b_s\bse\bee\bed\bds\bs = 0;\n- int n\bnu\bum\bm_\b_p\bpe\bee\ber\brs\bs = 0;\n- int n\bnu\bum\bm_\b_c\bco\bom\bmp\bpl\ble\bet\bte\be = -1;\n- int n\bnu\bum\bm_\b_i\bin\bnc\bco\bom\bmp\bpl\ble\bet\bte\be = -1;\n- int l\bli\bis\bst\bt_\b_s\bse\bee\bed\bds\bs = 0;\n- int l\bli\bis\bst\bt_\b_p\bpe\bee\ber\brs\bs = 0;\n- int c\bco\bon\bnn\bne\bec\bct\bt_\b_c\bca\ban\bnd\bdi\bid\bda\bat\bte\bes\bs = 0;\n- int n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs = 0;\n- int d\bdi\bis\bst\btr\bri\bib\bbu\but\bte\bed\bd_\b_f\bfu\bul\bll\bl_\b_c\bco\bop\bpi\bie\bes\bs = 0;\n- int d\bdi\bis\bst\btr\bri\bib\bbu\but\bte\bed\bd_\b_f\bfr\bra\bac\bct\bti\bio\bon\bn = 0;\n- float d\bdi\bis\bst\btr\bri\bib\bbu\but\bte\bed\bd_\b_c\bco\bop\bpi\bie\bes\bs = 0.f;\n- int b\bbl\blo\boc\bck\bk_\b_s\bsi\biz\bze\be = 0;\n- int n\bnu\bum\bm_\b_u\bup\bpl\blo\boa\bad\bds\bs = 0;\n- int n\bnu\bum\bm_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bns\bs = 0;\n- int u\bup\bpl\blo\boa\bad\bds\bs_\b_l\bli\bim\bmi\bit\bt = 0;\n- int c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bns\bs_\b_l\bli\bim\bmi\bit\bt = 0;\n- int u\bup\bp_\b_b\bba\ban\bnd\bdw\bwi\bid\bdt\bth\bh_\b_q\bqu\bue\beu\bue\be = 0;\n- int d\bdo\bow\bwn\bn_\b_b\bba\ban\bnd\bdw\bwi\bid\bdt\bth\bh_\b_q\bqu\bue\beu\bue\be = 0;\n- int s\bse\bee\bed\bd_\b_r\bra\ban\bnk\bk = 0;\n- state_t s\bst\bta\bat\bte\be = checking_resume_data;\n- bool n\bne\bee\bed\bd_\b_s\bsa\bav\bve\be_\b_r\bre\bes\bsu\bum\bme\be = false;\n- bool i\bis\bs_\b_s\bse\bee\bed\bdi\bin\bng\bg = false;\n- bool i\bis\bs_\b_f\bfi\bin\bni\bis\bsh\bhe\bed\bd = false;\n- bool h\bha\bas\bs_\b_m\bme\bet\bta\bad\bda\bat\bta\ba = false;\n- bool h\bha\bas\bs_\b_i\bin\bnc\bco\bom\bmi\bin\bng\bg = false;\n- bool m\bmo\bov\bvi\bin\bng\bg_\b_s\bst\bto\bor\bra\bag\bge\be = false;\n- bool a\ban\bnn\bno\bou\bun\bnc\bci\bin\bng\bg_\b_t\bto\bo_\b_t\btr\bra\bac\bck\bke\ber\brs\bs = false;\n- bool a\ban\bnn\bno\bou\bun\bnc\bci\bin\bng\bg_\b_t\bto\bo_\b_l\bls\bsd\bd = false;\n- bool a\ban\bnn\bno\bou\bun\bnc\bci\bin\bng\bg_\b_t\bto\bo_\b_d\bdh\bht\bt = false;\n- info_hash_t info_hashes;\n- time_point last_upload;\n- time_point last_download;\n- seconds active_duration;\n- seconds finished_duration;\n- seconds seeding_duration;\n- torrent_flags_t f\bfl\bla\bag\bgs\bs {};\n-};\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* o\bop\bpe\ber\bra\bat\bto\bor\br=\b==\b=(\b()\b) *\b**\b**\b**\b**\b*\n-bool o\bop\bpe\ber\bra\bat\bto\bor\br=\b==\b= (torrent_status const& st) const;\n-compares if the torrent status objects come from the same torrent. i.e. only\n-the _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be field is compared.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* e\ben\bnu\bum\bm s\bst\bta\bat\bte\be_\b_t\bt *\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bs_\bt_\ba_\bt_\bu_\bs_\b._\bh_\bp_\bp\"\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n-|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-| | |The torrent has not |\n-| | |started its download|\n-|checking_files |1 |yet, and is |\n-| | |currently checking |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\be_\bx_\bi_\bs_\bt_\bi_\bn_\bg_\b _\bf_\bi_\bl_\be_\bs_\b._\b _\b _\b _\b _\b |\n-| | |The torrent is |\n-| | |trying to download |\n-|downloading_metadata |2 |metadata from peers.|\n-| | |This implies the |\n-| | |ut_metadata |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\b _\bi_\bs_\b _\bi_\bn_\b _\bu_\bs_\be_\b.|\n-| | |The torrent is being|\n-| | |downloaded. This is |\n-| | |the state most |\n-| | |torrents will be in |\n-|downloading |3 |most of the time. |\n-| | |The progress meter |\n-| | |will tell how much |\n-| | |of the files that |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bh_\ba_\bs_\b _\bb_\be_\be_\bn_\b _\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\be_\bd_\b.|\n-| | |In this state the |\n-| | |torrent has finished|\n-| | |downloading but |\n-|finished |4 |still doesn't have |\n-| | |the entire torrent. |\n-| | |i.e. some pieces are|\n-| | |filtered and won't |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bg_\be_\bt_\b _\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\be_\bd_\b._\b _\b _\b _\b _\b |\n-| | |In this state the |\n-|seeding |5 |torrent has finished|\n-| | |downloading and is a|\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bp_\bu_\br_\be_\b _\bs_\be_\be_\bd_\be_\br_\b._\b _\b _\b _\b _\b _\b _\b _\b |\n-| | |If the torrent was |\n-| | |started in full |\n-| | |allocation mode, |\n-|unused_enum_for_backwards_compatibility_allocating|6 |this indicates that |\n-| | |the (disk) storage |\n-| | |for the torrent is |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\ba_\bl_\bl_\bo_\bc_\ba_\bt_\be_\bd_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-| | |The torrent is |\n-| | |currently checking |\n-| | |the fast resume data|\n-| | |and comparing it to |\n-| | |the files on disk. |\n-|checking_resume_data |7 |This is typically |\n-| | |completed in a |\n-| | |fraction of a |\n-| | |second, but if you |\n-| | |add a large number |\n-| | |of torrents at once,|\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bt_\bh_\be_\by_\b _\bw_\bi_\bl_\bl_\b _\bq_\bu_\be_\bu_\be_\b _\bu_\bp_\b._\b |\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- handle\n- a handle to the torrent whose status the object represents.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- errc\n- may be set to an error code describing why the torrent was paused, in\n- case it was paused by an error. If the torrent is not paused or if it's\n- paused but not because of an error, this error_code is not set. if the\n- error is attributed specifically to a file, error_file is set to the\n- index of that file in the .torrent file.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- error_file\n- if the torrent is stopped because of an disk I/O error, this field\n- contains the index of the file in the torrent that encountered the error.\n- If the error did not originate in a file in the torrent, there are a few\n- special values this can be set to: error_file_none, error_file_ssl_ctx,\n- error_file_exception, error_file_partfile or error_file_metadata;\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- error_file_none\n- special values for error_file to describe which file or component\n- encountered the error (errc). the error did not occur on a file\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- error_file_ssl_ctx\n- the error occurred setting up the SSL context\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- error_file_metadata\n- the error occurred while loading the metadata for the torrent\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- error_file_exception\n- there was a serious error reported in this torrent. The error code or a\n- torrent log _\ba_\bl_\be_\br_\bt may provide more information.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- error_file_partfile\n- the error occurred with the partfile\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- save_path\n- the path to the directory where this torrent's files are stored. It's\n- typically the path as was given to _\ba_\bs_\by_\bn_\bc_\b__\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b) or _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b)\n- when this torrent was started. This field is only included if the torrent\n- status is queried with torrent_handle::query_save_path.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- name\n- the name of the torrent. Typically this is derived from the .torrent\n- file. In case the torrent was started without metadata, and hasn't\n- completely received it yet, it returns the name given to it when added to\n- the _\bs_\be_\bs_\bs_\bi_\bo_\bn. See session::add_torrent. This field is only included if the\n- torrent status is queried with torrent_handle::query_name.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- torrent_file\n- set to point to the torrent_info object for this torrent. It's only\n- included if the torrent status is queried with torrent_handle::\n- query_torrent_file.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- next_announce\n- the time until the torrent will announce itself to the tracker.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- current_tracker\n- the URL of the last working tracker. If no tracker request has been\n- successful yet, it's set to an empty string.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- total_download total_upload\n- the number of bytes downloaded and uploaded to all peers, accumulated,\n- t\bth\bhi\bis\bs s\bse\bes\bss\bsi\bio\bon\bn only. The _\bs_\be_\bs_\bs_\bi_\bo_\bn is considered to restart when a torrent is\n- paused and restarted again. When a torrent is paused, these _\bc_\bo_\bu_\bn_\bt_\be_\br_\bs are\n- reset to 0. If you want complete, persistent, stats, see all_time_upload\n- and all_time_download.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- total_payload_download total_payload_upload\n- counts the amount of bytes send and received this _\bs_\be_\bs_\bs_\bi_\bo_\bn, but only the\n- actual payload data (i.e the interesting data), these _\bc_\bo_\bu_\bn_\bt_\be_\br_\bs ignore any\n- protocol overhead. The _\bs_\be_\bs_\bs_\bi_\bo_\bn is considered to restart when a torrent is\n- paused and restarted again. When a torrent is paused, these _\bc_\bo_\bu_\bn_\bt_\be_\br_\bs are\n- reset to 0.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- total_failed_bytes\n- the number of bytes that has been downloaded and that has failed the\n- piece hash test. In other words, this is just how much crap that has been\n- downloaded since the torrent was last started. If a torrent is paused and\n- then restarted again, this counter will be reset.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- total_redundant_bytes\n- the number of bytes that has been downloaded even though that data\n- already was downloaded. The reason for this is that in some situations\n- the same data can be downloaded by mistake. When libtorrent sends\n- requests to a peer, and the peer doesn't send a response within a certain\n- timeout, libtorrent will re-request that block. Another situation when\n- libtorrent may re-request blocks is when the requests it sends out are\n- not replied in FIFO-order (it will re-request blocks that are skipped by\n- an out of order block). This is supposed to be as low as possible. This\n- only counts bytes since the torrent was last started. If a torrent is\n- paused and then restarted again, this counter will be reset.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- pieces\n- a bitmask that represents which pieces we have (set to true) and the\n- pieces we don't have. It's a pointer and may be set to 0 if the torrent\n- isn't downloading or seeding.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- verified_pieces\n- a bitmask representing which pieces has had their hash checked. This only\n- applies to torrents in s\bse\bee\bed\bd m\bmo\bod\bde\be. If the torrent is not in seed mode,\n- this bitmask may be empty.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- total_done\n- the total number of bytes of the file(s) that we have. All this does not\n- necessarily has to be downloaded during this _\bs_\be_\bs_\bs_\bi_\bo_\bn (that's\n- total_payload_download).\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- total\n- the total number of bytes to download for this torrent. This may be less\n- than the size of the torrent in case there are pad files. This number\n- only counts bytes that will actually be requested from peers.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- total_wanted_done\n- the number of bytes we have downloaded, only counting the pieces that we\n- actually want to download. i.e. excluding any pieces that we have but\n- have priority 0 (i.e. not wanted). Once a torrent becomes seed, any\n- piece- and file priorities are forgotten and all bytes are considered\n- \"wanted\".\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- total_wanted\n- The total number of bytes we want to download. This may be smaller than\n- the total torrent size in case any pieces are prioritized to 0, i.e. not\n- wanted. Once a torrent becomes seed, any piece- and file priorities are\n- forgotten and all bytes are considered \"wanted\".\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- all_time_upload all_time_download\n- are accumulated upload and download payload byte _\bc_\bo_\bu_\bn_\bt_\be_\br_\bs. They are saved\n- in and restored from resume data to keep totals across sessions.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- added_time\n- the posix-time when this torrent was added. i.e. what time(nullptr)\n- returned at the time.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- completed_time\n- the posix-time when this torrent was finished. If the torrent is not yet\n- finished, this is 0.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- last_seen_complete\n- the time when we, or one of our peers, last saw a complete copy of this\n- torrent.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- storage_mode\n- The allocation mode for the torrent. See _\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bm_\bo_\bd_\be_\b__\bt for the options.\n- For more information, see _\bs_\bt_\bo_\br_\ba_\bg_\be_\b _\ba_\bl_\bl_\bo_\bc_\ba_\bt_\bi_\bo_\bn.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- progress\n- a value in the range [0, 1], that represents the progress of the\n- torrent's current task. It may be checking files or downloading.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- progress_ppm\n- progress parts per million (progress * 1000000) when disabling floating\n- point operations, this is the only option to query progress\n- reflects the same value as progress, but instead in a range [0, 1000000]\n- (ppm = parts per million). When floating point operations are disabled,\n- this is the only alternative to the floating point value in progress.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- queue_position\n- the position this torrent has in the download queue. If the torrent is a\n- seed or finished, this is -1.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- download_rate upload_rate\n- the total rates for all peers for this torrent. These will usually have\n- better precision than summing the rates from all peers. The rates are\n- given as the number of bytes per second.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- download_payload_rate upload_payload_rate\n- the total transfer rate of payload only, not counting protocol chatter.\n- This might be slightly smaller than the other rates, but if projected\n- over a long time (e.g. when calculating ETA:s) the difference may be\n- noticeable.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- num_seeds\n- the number of peers that are seeding that this client is currently\n- connected to.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- num_peers\n- the number of peers this torrent currently is connected to. Peer\n- connections that are in the half-open state (is attempting to connect) or\n- are queued for later connection attempt do not count. Although they are\n- visible in the peer list when you call _\bg_\be_\bt_\b__\bp_\be_\be_\br_\b__\bi_\bn_\bf_\bo_\b(_\b).\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- num_complete num_incomplete\n- if the tracker sends scrape info in its announce reply, these fields will\n- be set to the total number of peers that have the whole file and the\n- total number of peers that are still downloading. set to -1 if the\n- tracker did not send any scrape data in its announce reply.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- list_seeds list_peers\n- the number of seeds in our peer list and the total number of peers\n- (including seeds). We are not necessarily connected to all the peers in\n- our peer list. This is the number of peers we know of in total, including\n- banned peers and peers that we have failed to connect to.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- connect_candidates\n- the number of peers in this torrent's peer list that is a candidate to be\n- connected to. i.e. It has fewer connect attempts than the max fail count,\n- it is not a seed if we are a seed, it is not banned etc. If this is 0, it\n- means we don't know of any more peers that we can try.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- num_pieces\n- the number of pieces that has been downloaded. It is equivalent to: std::\n- accumulate(pieces->begin(), pieces->end()). So you don't have to count\n- yourself. This can be used to see if anything has updated since last time\n- if you want to keep a graph of the pieces up to date. Note that these\n- pieces have not necessarily been written to disk yet, and there is a risk\n- the write to disk will fail.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- distributed_full_copies\n- the number of distributed copies of the torrent. Note that one copy may\n- be spread out among many peers. It tells how many copies there are\n- currently of the rarest piece(s) among the peers this client is connected\n- to.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- distributed_fraction\n- tells the share of pieces that have more copies than the rarest piece(s).\n- Divide this number by 1000 to get the fraction.\n- For example, if distributed_full_copies is 2 and distributed_fraction is\n- 500, it means that the rarest pieces have only 2 copies among the peers\n- this torrent is connected to, and that 50% of all the pieces have more\n- than two copies.\n- If we are a seed, the piece picker is deallocated as an optimization, and\n- piece availability is no longer tracked. In this case the distributed\n- copies members are set to -1.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- distributed_copies\n- the number of distributed copies of the file. note that one copy may be\n- spread out among many peers. This is a floating point representation of\n- the distributed copies.\n- the integer part tells how many copies\n- there are of the rarest piece(s)\n- the fractional part tells the fraction of pieces that\n- have more copies than the rarest piece(s).\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- block_size\n- the size of a block, in bytes. A block is a sub piece, it is the number\n- of bytes that each piece request asks for and the number of bytes that\n- each bit in the partial_piece_info's bitset represents, see\n- _\bg_\be_\bt_\b__\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\b__\bq_\bu_\be_\bu_\be_\b(_\b). This is typically 16 kB, but it may be smaller, if\n- the pieces are smaller.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- num_uploads\n- the number of unchoked peers in this torrent.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- num_connections\n- the number of peer connections this torrent has, including half-open\n- connections that hasn't completed the bittorrent handshake yet. This is\n- always >= num_peers.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- uploads_limit\n- the set limit of upload slots (unchoked peers) for this torrent.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- connections_limit\n- the set limit of number of connections for this torrent.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- up_bandwidth_queue down_bandwidth_queue\n- the number of peers in this torrent that are waiting for more bandwidth\n- quota from the torrent rate limiter. This can determine if the rate you\n- get from this torrent is bound by the torrents limit or not. If there is\n- no limit set on this torrent, the peers might still be waiting for\n- bandwidth quota from the global limiter, but then they are counted in the\n- session_status object.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- seed_rank\n- A rank of how important it is to seed the torrent, it is used to\n- determine which torrents to seed and which to queue. It is based on the\n- peer to seed ratio from the tracker scrape. For more information, see\n- _\bq_\bu_\be_\bu_\bi_\bn_\bg. Higher value means more important to seed\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- state\n- the main state the torrent is in. See _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bs_\bt_\ba_\bt_\bu_\bs_\b:_\b:_\bs_\bt_\ba_\bt_\be_\b__\bt.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- need_save_resume\n- true if this torrent has unsaved changes to its download state and\n- statistics since the last resume data was saved.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- is_seeding\n- true if all pieces have been downloaded.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- is_finished\n- true if all pieces that have a priority > 0 are downloaded. There is only\n- a distinction between finished and seeding if some pieces or files have\n- been set to priority 0, i.e. are not downloaded.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- has_metadata\n- true if this torrent has metadata (either it was started from a .torrent\n- file or the metadata has been downloaded). The only scenario where this\n- can be false is when the torrent was started torrent-less (i.e. with just\n- an info-hash and tracker ip, a magnet link for instance).\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- has_incoming\n- true if there has ever been an incoming connection attempt to this\n- torrent.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- moving_storage\n- this is true if this torrent's storage is currently being moved from one\n- location to another. This may potentially be a long operation if a large\n- file ends up being copied from one drive to another.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- announcing_to_trackers announcing_to_lsd announcing_to_dht\n- these are set to true if this torrent is allowed to announce to the\n- respective peer source. Whether they are true or false is determined by\n- the queue logic/auto manager. Torrents that are not auto managed will\n- always be allowed to announce to all peer sources.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- info_hashes\n- the info-hash for this torrent\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- last_upload last_download\n- the timestamps of the last time this torrent uploaded or downloaded\n- payload to any peer.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- active_duration finished_duration seeding_duration\n- these are cumulative _\bc_\bo_\bu_\bn_\bt_\be_\br_\bs of for how long the torrent has been in\n- different states. active means not paused and added to _\bs_\be_\bs_\bs_\bi_\bo_\bn. Whether\n- it has found any peers or not is not relevant. finished means all\n- selected files/pieces were downloaded and available to other peers (this\n- is always a subset of active time). seeding means all files/pieces were\n- downloaded and available to peers. Being available to peers does not\n- imply there are other peers asking for the payload.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- flags\n- reflects several of the torrent's flags. For more information, see\n- torrent_handle::flags().\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* s\bse\bes\bss\bsi\bio\bon\bn_\b_h\bha\ban\bnd\bdl\ble\be *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bh_\ba_\bn_\bd_\bl_\be_\b._\bh_\bp_\bp\"\n-this class provides a non-owning handle to a _\bs_\be_\bs_\bs_\bi_\bo_\bn and a subset of the\n-interface of the _\bs_\be_\bs_\bs_\bi_\bo_\bn class. If the underlying _\bs_\be_\bs_\bs_\bi_\bo_\bn is destructed any\n-handle to it will no longer be valid. _\bi_\bs_\b__\bv_\ba_\bl_\bi_\bd_\b(_\b) will return false and any\n-operation on it will throw a system_error exception, with error code\n-invalid_session_handle.\n-struct session_handle\n-{\n- bool i\bis\bs_\b_v\bva\bal\bli\bid\bd () const;\n- session_params s\bse\bes\bss\bsi\bio\bon\bn_\b_s\bst\bta\bat\bte\be (save_state_flags_t flags =\n-save_state_flags_t::all()) const;\n- void r\bre\bef\bfr\bre\bes\bsh\bh_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_s\bst\bta\bat\btu\bus\bs (std::vector* ret\n- , status_flags_t flags = {}) const;\n- std::vector g\bge\bet\bt_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_s\bst\bta\bat\btu\bus\bs (\n- std::function const& pred\n- , status_flags_t flags = {}) const;\n- void p\bpo\bos\bst\bt_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_u\bup\bpd\bda\bat\bte\bes\bs (status_flags_t flags = status_flags_t::all());\n- void p\bpo\bos\bst\bt_\b_s\bse\bes\bss\bsi\bio\bon\bn_\b_s\bst\bta\bat\bts\bs ();\n- void p\bpo\bos\bst\bt_\b_d\bdh\bht\bt_\b_s\bst\bta\bat\bts\bs ();\n- void s\bse\bet\bt_\b_d\bdh\bht\bt_\b_s\bst\bta\bat\bte\be (dht::dht_state const& st);\n- void s\bse\bet\bt_\b_d\bdh\bht\bt_\b_s\bst\bta\bat\bte\be (dht::dht_state&& st);\n- std::vector g\bge\bet\bt_\b_t\bto\bor\brr\bre\ben\bnt\bts\bs () const;\n- torrent_handle f\bfi\bin\bnd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt (sha1_hash const& info_hash) const;\n- torrent_handle a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt (add_torrent_params const& params);\n- void a\bas\bsy\byn\bnc\bc_\b_a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt (add_torrent_params const& params);\n- torrent_handle a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt (add_torrent_params&& params);\n- torrent_handle a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt (add_torrent_params const& params, error_code&\n-ec);\n- torrent_handle a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt (add_torrent_params&& params, error_code& ec);\n- void a\bas\bsy\byn\bnc\bc_\b_a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt (add_torrent_params&& params);\n- void p\bpa\bau\bus\bse\be ();\n- void r\bre\bes\bsu\bum\bme\be ();\n- bool i\bis\bs_\b_p\bpa\bau\bus\bse\bed\bd () const;\n- bool i\bis\bs_\b_d\bdh\bht\bt_\b_r\bru\bun\bnn\bni\bin\bng\bg () const;\n- void s\bse\bet\bt_\b_d\bdh\bht\bt_\b_s\bst\bto\bor\bra\bag\bge\be (dht::dht_storage_constructor_type sc);\n- void a\bad\bdd\bd_\b_d\bdh\bht\bt_\b_n\bno\bod\bde\be (std::pair const& node);\n- void d\bdh\bht\bt_\b_g\bge\bet\bt_\b_i\bit\bte\bem\bm (sha1_hash const& target);\n- void d\bdh\bht\bt_\b_g\bge\bet\bt_\b_i\bit\bte\bem\bm (std::array key\n- , std::string salt = std::string());\n- sha1_hash d\bdh\bht\bt_\b_p\bpu\but\bt_\b_i\bit\bte\bem\bm (entry data);\n- void d\bdh\bht\bt_\b_p\bpu\but\bt_\b_i\bit\bte\bem\bm (std::array key\n- , std::function&\n- , std::int64_t&, std::string const&)> cb\n- , std::string salt = std::string());\n- void d\bdh\bht\bt_\b_g\bge\bet\bt_\b_p\bpe\bee\ber\brs\bs (sha1_hash const& info_hash);\n- void d\bdh\bht\bt_\b_a\ban\bnn\bno\bou\bun\bnc\bce\be (sha1_hash const& info_hash, int port = 0, dht::\n-announce_flags_t flags = {});\n- void d\bdh\bht\bt_\b_l\bli\biv\bve\be_\b_n\bno\bod\bde\bes\bs (sha1_hash const& nid);\n- void d\bdh\bht\bt_\b_s\bsa\bam\bmp\bpl\ble\be_\b_i\bin\bnf\bfo\boh\bha\bas\bsh\bhe\bes\bs (udp::endpoint const& ep, sha1_hash const&\n-target);\n- void d\bdh\bht\bt_\b_d\bdi\bir\bre\bec\bct\bt_\b_r\bre\beq\bqu\bue\bes\bst\bt (udp::endpoint const& ep, entry const& e,\n-client_data_t userdata = {});\n- void a\bad\bdd\bd_\b_e\bex\bxt\bte\ben\bns\bsi\bio\bon\bn (std::function(\n- torrent_handle const&, client_data_t)> ext);\n- void a\bad\bdd\bd_\b_e\bex\bxt\bte\ben\bns\bsi\bio\bon\bn (std::shared_ptr ext);\n- ip_filter g\bge\bet\bt_\b_i\bip\bp_\b_f\bfi\bil\blt\bte\ber\br () const;\n- void s\bse\bet\bt_\b_i\bip\bp_\b_f\bfi\bil\blt\bte\ber\br (ip_filter f);\n- void s\bse\bet\bt_\b_p\bpo\bor\brt\bt_\b_f\bfi\bil\blt\bte\ber\br (port_filter const& f);\n- unsigned short l\bli\bis\bst\bte\ben\bn_\b_p\bpo\bor\brt\bt () const;\n- bool i\bis\bs_\b_l\bli\bis\bst\bte\ben\bni\bin\bng\bg () const;\n- unsigned short s\bss\bsl\bl_\b_l\bli\bis\bst\bte\ben\bn_\b_p\bpo\bor\brt\bt () const;\n- void s\bse\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_f\bfi\bil\blt\bte\ber\br (ip_filter const& f);\n- ip_filter g\bge\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_f\bfi\bil\blt\bte\ber\br () const;\n- void s\bse\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_t\bty\byp\bpe\be_\b_f\bfi\bil\blt\bte\ber\br (peer_class_type_filter const& f);\n- peer_class_type_filter g\bge\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_t\bty\byp\bpe\be_\b_f\bfi\bil\blt\bte\ber\br () const;\n- peer_class_t c\bcr\bre\bea\bat\bte\be_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs (char const* name);\n- void d\bde\bel\ble\bet\bte\be_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs (peer_class_t cid);\n- peer_class_info g\bge\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs (peer_class_t cid) const;\n- void s\bse\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs (peer_class_t cid, peer_class_info const& pci);\n- void r\bre\bem\bmo\bov\bve\be_\b_t\bto\bor\brr\bre\ben\bnt\bt (const torrent_handle&, remove_flags_t = {});\n- void a\bap\bpp\bpl\bly\by_\b_s\bse\bet\btt\bti\bin\bng\bgs\bs (settings_pack&&);\n- settings_pack g\bge\bet\bt_\b_s\bse\bet\btt\bti\bin\bng\bgs\bs () const;\n- void a\bap\bpp\bpl\bly\by_\b_s\bse\bet\btt\bti\bin\bng\bgs\bs (settings_pack const&);\n- alert* w\bwa\bai\bit\bt_\b_f\bfo\bor\br_\b_a\bal\ble\ber\brt\bt (time_duration max_wait);\n- void s\bse\bet\bt_\b_a\bal\ble\ber\brt\bt_\b_n\bno\bot\bti\bif\bfy\by (std::function const& fun);\n- void p\bpo\bop\bp_\b_a\bal\ble\ber\brt\bts\bs (std::vector* alerts);\n- std::vector a\bad\bdd\bd_\b_p\bpo\bor\brt\bt_\b_m\bma\bap\bpp\bpi\bin\bng\bg (portmap_protocol t, int\n-external_port, int local_port);\n- void d\bde\bel\ble\bet\bte\be_\b_p\bpo\bor\brt\bt_\b_m\bma\bap\bpp\bpi\bin\bng\bg (port_mapping_t handle);\n- void r\bre\beo\bop\bpe\ben\bn_\b_n\bne\bet\btw\bwo\bor\brk\bk_\b_s\bso\boc\bck\bke\bet\bts\bs (reopen_network_flags_t options =\n-reopen_map_ports);\n- std::shared_ptr n\bna\bat\bti\biv\bve\be_\b_h\bha\ban\bnd\bdl\ble\be () const;\n-\n- static constexpr save_state_flags_t s\bsa\bav\bve\be_\b_s\bse\bet\btt\bti\bin\bng\bgs\bs = 0_bit;\n- static constexpr save_state_flags_t s\bsa\bav\bve\be_\b_d\bdh\bht\bt_\b_s\bst\bta\bat\bte\be = 2_bit;\n- static constexpr save_state_flags_t s\bsa\bav\bve\be_\b_e\bex\bxt\bte\ben\bns\bsi\bio\bon\bn_\b_s\bst\bta\bat\bte\be = 11_bit;\n- static constexpr save_state_flags_t s\bsa\bav\bve\be_\b_i\bip\bp_\b_f\bfi\bil\blt\bte\ber\br = 12_bit;\n- static constexpr peer_class_t g\bgl\blo\bob\bba\bal\bl_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_i\bid\bd {0};\n- static constexpr peer_class_t t\btc\bcp\bp_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_i\bid\bd {1};\n- static constexpr peer_class_t l\blo\boc\bca\bal\bl_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_i\bid\bd {2};\n- static constexpr remove_flags_t d\bde\bel\ble\bet\bte\be_\b_f\bfi\bil\ble\bes\bs = 0_bit;\n- static constexpr remove_flags_t d\bde\bel\ble\bet\bte\be_\b_p\bpa\bar\brt\btf\bfi\bil\ble\be = 1_bit;\n- static constexpr session_flags_t p\bpa\bau\bus\bse\bed\bd = 2_bit;\n- static constexpr portmap_protocol u\bud\bdp\bp = portmap_protocol::udp;\n- static constexpr portmap_protocol t\btc\bcp\bp = portmap_protocol::tcp;\n- static constexpr reopen_network_flags_t r\bre\beo\bop\bpe\ben\bn_\b_m\bma\bap\bp_\b_p\bpo\bor\brt\bts\bs = 0_bit;\n-};\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* i\bis\bs_\b_v\bva\bal\bli\bid\bd(\b()\b) *\b**\b**\b**\b**\b*\n-bool i\bis\bs_\b_v\bva\bal\bli\bid\bd () const;\n-returns true if this handle refers to a valid _\bs_\be_\bs_\bs_\bi_\bo_\bn object. If the _\bs_\be_\bs_\bs_\bi_\bo_\bn\n-has been destroyed, all _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bh_\ba_\bn_\bd_\bl_\be objects will expire and not be valid.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* s\bse\bes\bss\bsi\bio\bon\bn_\b_s\bst\bta\bat\bte\be(\b()\b) *\b**\b**\b**\b**\b*\n-session_params s\bse\bes\bss\bsi\bio\bon\bn_\b_s\bst\bta\bat\bte\be (save_state_flags_t flags = save_state_flags_t::\n-all()) const;\n-returns the current _\bs_\be_\bs_\bs_\bi_\bo_\bn state. This can be passed to _\bw_\br_\bi_\bt_\be_\b__\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs_\b(_\b)\n-to save the state to disk and restored using _\br_\be_\ba_\bd_\b__\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs_\b(_\b) when\n-constructing a new _\bs_\be_\bs_\bs_\bi_\bo_\bn. The kind of state that's included is all settings,\n-the DHT routing table, possibly plugin-specific state. the flags parameter can\n-be used to only save certain parts of the _\bs_\be_\bs_\bs_\bi_\bo_\bn state\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* r\bre\bef\bfr\bre\bes\bsh\bh_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_s\bst\bta\bat\btu\bus\bs(\b()\b) g\bge\bet\bt_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_s\bst\bta\bat\btu\bus\bs(\b()\b) *\b**\b**\b**\b**\b*\n-void r\bre\bef\bfr\bre\bes\bsh\bh_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_s\bst\bta\bat\btu\bus\bs (std::vector* ret\n- , status_flags_t flags = {}) const;\n-std::vector g\bge\bet\bt_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_s\bst\bta\bat\btu\bus\bs (\n- std::function const& pred\n- , status_flags_t flags = {}) const;\n-Note\n-these calls are potentially expensive and won't scale well with lots of\n-torrents. If you're concerned about performance, consider using\n-post_torrent_updates() instead.\n-get_torrent_status returns a vector of the _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bs_\bt_\ba_\bt_\bu_\bs for every torrent\n-which satisfies pred, which is a predicate function which determines if a\n-torrent should be included in the returned set or not. Returning true means it\n-should be included and false means excluded. The flags argument is the same as\n-to _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be_\b:_\b:_\bs_\bt_\ba_\bt_\bu_\bs_\b(_\b). Since pred is guaranteed to be called for every\n-torrent, it may be used to count the number of torrents of different categories\n-as well.\n-refresh_torrent_status takes a vector of _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bs_\bt_\ba_\bt_\bu_\bs structs (for instance\n-the same vector that was returned by _\bg_\be_\bt_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bs_\bt_\ba_\bt_\bu_\bs_\b(_\b) ) and refreshes the\n-status based on the handle member. It is possible to use this function by first\n-setting up a vector of default constructed torrent_status objects, only\n-initializing the handle member, in order to request the torrent status for\n-multiple torrents in a single call. This can save a significant amount of time\n-if you have a lot of torrents.\n-Any _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bs_\bt_\ba_\bt_\bu_\bs object whose handle member is not referring to a valid\n-torrent are ignored.\n-The intended use of these functions is to start off by calling\n-get_torrent_status() to get a list of all torrents that match your criteria.\n-Then call refresh_torrent_status() on that list. This will only refresh the\n-status for the torrents in your list, and thus ignore all other torrents you\n-might be running. This may save a significant amount of time, especially if the\n-number of torrents you're interested in is small. In order to keep your list of\n-interested torrents up to date, you can either call get_torrent_status() from\n-time to time, to include torrents you might have become interested in since the\n-last time. In order to stop refreshing a certain torrent, simply remove it from\n-the list.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* p\bpo\bos\bst\bt_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_u\bup\bpd\bda\bat\bte\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n-void p\bpo\bos\bst\bt_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_u\bup\bpd\bda\bat\bte\bes\bs (status_flags_t flags = status_flags_t::all());\n-This functions instructs the _\bs_\be_\bs_\bs_\bi_\bo_\bn to post the _\bs_\bt_\ba_\bt_\be_\b__\bu_\bp_\bd_\ba_\bt_\be_\b__\ba_\bl_\be_\br_\bt, containing\n-the status of all torrents whose state changed since the last time this\n-function was called.\n-Only torrents who has the state subscription flag set will be included. This\n-flag is on by default. See _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs. the flags argument is the same\n-as for _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be_\b:_\b:_\bs_\bt_\ba_\bt_\bu_\bs_\b(_\b). see status_flags_t in _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* p\bpo\bos\bst\bt_\b_s\bse\bes\bss\bsi\bio\bon\bn_\b_s\bst\bta\bat\bts\bs(\b()\b) *\b**\b**\b**\b**\b*\n-void p\bpo\bos\bst\bt_\b_s\bse\bes\bss\bsi\bio\bon\bn_\b_s\bst\bta\bat\bts\bs ();\n-This function will post a _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bs_\bt_\ba_\bt_\bs_\b__\ba_\bl_\be_\br_\bt object, containing a snapshot of\n-the performance _\bc_\bo_\bu_\bn_\bt_\be_\br_\bs from the internals of libtorrent. To interpret these\n-_\bc_\bo_\bu_\bn_\bt_\be_\br_\bs, query the _\bs_\be_\bs_\bs_\bi_\bo_\bn via _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bs_\bt_\ba_\bt_\bs_\b__\bm_\be_\bt_\br_\bi_\bc_\bs_\b(_\b).\n-For more information, see the _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b _\bs_\bt_\ba_\bt_\bi_\bs_\bt_\bi_\bc_\bs section.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* p\bpo\bos\bst\bt_\b_d\bdh\bht\bt_\b_s\bst\bta\bat\bts\bs(\b()\b) *\b**\b**\b**\b**\b*\n-void p\bpo\bos\bst\bt_\b_d\bdh\bht\bt_\b_s\bst\bta\bat\bts\bs ();\n-This will cause a _\bd_\bh_\bt_\b__\bs_\bt_\ba_\bt_\bs_\b__\ba_\bl_\be_\br_\bt to be posted.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* s\bse\bet\bt_\b_d\bdh\bht\bt_\b_s\bst\bta\bat\bte\be(\b()\b) *\b**\b**\b**\b**\b*\n-void s\bse\bet\bt_\b_d\bdh\bht\bt_\b_s\bst\bta\bat\bte\be (dht::dht_state const& st);\n-void s\bse\bet\bt_\b_d\bdh\bht\bt_\b_s\bst\bta\bat\bte\be (dht::dht_state&& st);\n-set the DHT state for the _\bs_\be_\bs_\bs_\bi_\bo_\bn. This will be taken into account the next\n-time the DHT is started, as if it had been passed in via the _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs on\n-startup.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* g\bge\bet\bt_\b_t\bto\bor\brr\bre\ben\bnt\bts\bs(\b()\b) f\bfi\bin\bnd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt(\b()\b) *\b**\b**\b**\b**\b*\n-std::vector g\bge\bet\bt_\b_t\bto\bor\brr\bre\ben\bnt\bts\bs () const;\n-torrent_handle f\bfi\bin\bnd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt (sha1_hash const& info_hash) const;\n-find_torrent() looks for a torrent with the given info-hash. In case there is\n-such a torrent in the _\bs_\be_\bs_\bs_\bi_\bo_\bn, a _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be to that torrent is returned. In\n-case the torrent cannot be found, an invalid _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be is returned.\n-See torrent_handle::is_valid() to know if the torrent was found or not.\n-get_torrents() returns a vector of torrent_handles to all the torrents\n-currently in the _\bs_\be_\bs_\bs_\bi_\bo_\bn.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt(\b()\b) a\bas\bsy\byn\bnc\bc_\b_a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt(\b()\b) *\b**\b**\b**\b**\b*\n-torrent_handle a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt (add_torrent_params const& params);\n-void a\bas\bsy\byn\bnc\bc_\b_a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt (add_torrent_params const& params);\n-torrent_handle a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt (add_torrent_params&& params);\n-torrent_handle a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt (add_torrent_params const& params, error_code& ec);\n-torrent_handle a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt (add_torrent_params&& params, error_code& ec);\n-void a\bas\bsy\byn\bnc\bc_\b_a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt (add_torrent_params&& params);\n-You add torrents through the _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b) function where you give an object\n-with all the parameters. The _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b) overloads will block until the\n-torrent has been added (or failed to be added) and returns an error code and a\n-_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be. In order to add torrents more efficiently, consider using\n-_\ba_\bs_\by_\bn_\bc_\b__\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b) which returns immediately, without waiting for the torrent\n-to add. Notification of the torrent being added is sent as _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\ba_\bl_\be_\br_\bt.\n-The save_path field in _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs must be set to a valid path where the\n-files for the torrent will be saved. Even when using a custom storage, this\n-needs to be set to something. If the save_path is empty, the call to\n-_\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b) will throw a system_error exception.\n-The overload that does not take an error_code throws an exception on error and\n-is not available when building without exception support. The _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be\n-returned by _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b) can be used to retrieve information about the\n-torrent's progress, its peers etc. It is also used to abort a torrent.\n-If the torrent you are trying to add already exists in the _\bs_\be_\bs_\bs_\bi_\bo_\bn (is either\n-queued for checking, being checked or downloading) add_torrent() will throw\n-system_error which derives from std::exception unless duplicate_is_error is set\n-to false. In that case, _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b) will return the handle to the existing\n-torrent.\n-The _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs class has a flags field. It can be used to control what\n-state the new torrent will be added in. Common flags to want to control are\n-torrent_flags::paused and torrent_flags::auto_managed. In order to add a magnet\n-link that will just download the metadata, but no payload, set the\n-torrent_flags::upload_mode flag.\n-Special consideration has to be taken when adding hybrid torrents (i.e.\n-torrents that are BitTorrent v2 torrents that are backwards compatible with\n-v1). For more details, see _\bB_\bi_\bt_\bT_\bo_\br_\br_\be_\bn_\bt_\b _\bv_\b2_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\bs.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* i\bis\bs_\b_p\bpa\bau\bus\bse\bed\bd(\b()\b) r\bre\bes\bsu\bum\bme\be(\b()\b) p\bpa\bau\bus\bse\be(\b()\b) *\b**\b**\b**\b**\b*\n-void p\bpa\bau\bus\bse\be ();\n-void r\bre\bes\bsu\bum\bme\be ();\n-bool i\bis\bs_\b_p\bpa\bau\bus\bse\bed\bd () const;\n-Pausing the _\bs_\be_\bs_\bs_\bi_\bo_\bn has the same effect as pausing every torrent in it, except\n-that torrents will not be resumed by the auto-manage mechanism. Resuming will\n-restore the torrents to their previous paused state. i.e. the _\bs_\be_\bs_\bs_\bi_\bo_\bn pause\n-state is separate from the torrent pause state. A torrent is inactive if it is\n-paused or if the _\bs_\be_\bs_\bs_\bi_\bo_\bn is paused.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* i\bis\bs_\b_d\bdh\bht\bt_\b_r\bru\bun\bnn\bni\bin\bng\bg(\b()\b) *\b**\b**\b**\b**\b*\n-bool i\bis\bs_\b_d\bdh\bht\bt_\b_r\bru\bun\bnn\bni\bin\bng\bg () const;\n-is_dht_running() returns true if the DHT support has been started and false\n-otherwise.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* s\bse\bet\bt_\b_d\bdh\bht\bt_\b_s\bst\bto\bor\bra\bag\bge\be(\b()\b) *\b**\b**\b**\b**\b*\n-void s\bse\bet\bt_\b_d\bdh\bht\bt_\b_s\bst\bto\bor\bra\bag\bge\be (dht::dht_storage_constructor_type sc);\n-set_dht_storage set a dht custom storage constructor function to be used\n-internally when the dht is created.\n-Since the dht storage is a critical component for the dht behavior, this\n-function will only be effective the next time the dht is started. If you never\n-touch this feature, a default map-memory based storage is used.\n-If you want to make sure the dht is initially created with your custom storage,\n-create a _\bs_\be_\bs_\bs_\bi_\bo_\bn with the setting settings_pack::enable_dht to false, set your\n-constructor function and call apply_settings with settings_pack::enable_dht to\n-true.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_d\bdh\bht\bt_\b_n\bno\bod\bde\be(\b()\b) *\b**\b**\b**\b**\b*\n-void a\bad\bdd\bd_\b_d\bdh\bht\bt_\b_n\bno\bod\bde\be (std::pair const& node);\n-add_dht_node takes a host name and port pair. That endpoint will be pinged, and\n-if a valid DHT reply is received, the node will be added to the routing table.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* d\bdh\bht\bt_\b_g\bge\bet\bt_\b_i\bit\bte\bem\bm(\b()\b) *\b**\b**\b**\b**\b*\n-void d\bdh\bht\bt_\b_g\bge\bet\bt_\b_i\bit\bte\bem\bm (sha1_hash const& target);\n-query the DHT for an immutable item at the target hash. the result is posted as\n-a _\bd_\bh_\bt_\b__\bi_\bm_\bm_\bu_\bt_\ba_\bb_\bl_\be_\b__\bi_\bt_\be_\bm_\b__\ba_\bl_\be_\br_\bt.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* d\bdh\bht\bt_\b_g\bge\bet\bt_\b_i\bit\bte\bem\bm(\b()\b) *\b**\b**\b**\b**\b*\n-void d\bdh\bht\bt_\b_g\bge\bet\bt_\b_i\bit\bte\bem\bm (std::array key\n- , std::string salt = std::string());\n-query the DHT for a mutable item under the public key key. this is an ed25519\n-key. salt is optional and may be left as an empty string if no salt is to be\n-used. if the item is found in the DHT, a _\bd_\bh_\bt_\b__\bm_\bu_\bt_\ba_\bb_\bl_\be_\b__\bi_\bt_\be_\bm_\b__\ba_\bl_\be_\br_\bt is posted.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* d\bdh\bht\bt_\b_p\bpu\but\bt_\b_i\bit\bte\bem\bm(\b()\b) *\b**\b**\b**\b**\b*\n-sha1_hash d\bdh\bht\bt_\b_p\bpu\but\bt_\b_i\bit\bte\bem\bm (entry data);\n-store the given bencoded data as an immutable item in the DHT. the returned\n-hash is the key that is to be used to look the item up again. It's just the\n-SHA-1 hash of the bencoded form of the structure.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* d\bdh\bht\bt_\b_p\bpu\but\bt_\b_i\bit\bte\bem\bm(\b()\b) *\b**\b**\b**\b**\b*\n-void d\bdh\bht\bt_\b_p\bpu\but\bt_\b_i\bit\bte\bem\bm (std::array key\n- , std::function&\n- , std::int64_t&, std::string const&)> cb\n- , std::string salt = std::string());\n-store a mutable item. The key is the public key the blob is to be stored under.\n-The optional salt argument is a string that is to be mixed in with the key when\n-determining where in the DHT the value is to be stored. The callback function\n-is called from within the libtorrent network thread once we've found where to\n-store the blob, possibly with the current value stored under the key. The\n-values passed to the callback functions are:\n- entry& value\n- the current value stored under the key (may be empty). Also expected to\n- be set to the value to be stored by the function.\n- std::array& signature\n- the signature authenticating the current value. This may be zeros if\n- there is currently no value stored. The function is expected to fill in\n- this buffer with the signature of the new value to store. To generate the\n- signature, you may want to use the sign_mutable_item function.\n- std::int64_t& seq\n- current sequence number. May be zero if there is no current value. The\n- function is expected to set this to the new sequence number of the value\n- that is to be stored. Sequence numbers must be monotonically increasing.\n- Attempting to overwrite a value with a lower or equal sequence number\n- will fail, even if the signature is correct.\n- std::string const& salt\n- this is the salt that was used for this put call.\n-Since the callback function cb is called from within libtorrent, it is critical\n-to not perform any blocking operations. Ideally not even locking a mutex. Pass\n-any data required for this function along with the function object's context\n-and make the function entirely self-contained. The only reason data blob's\n-value is computed via a function instead of just passing in the new value is to\n-avoid race conditions. If you want to u\bup\bpd\bda\bat\bte\be the value in the DHT, you must\n-first retrieve it, then modify it, then write it back. The way the DHT works,\n-it is natural to always do a lookup before storing and calling the callback in\n-between is convenient.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* d\bdh\bht\bt_\b_g\bge\bet\bt_\b_p\bpe\bee\ber\brs\bs(\b()\b) d\bdh\bht\bt_\b_a\ban\bnn\bno\bou\bun\bnc\bce\be(\b()\b) *\b**\b**\b**\b**\b*\n-void d\bdh\bht\bt_\b_g\bge\bet\bt_\b_p\bpe\bee\ber\brs\bs (sha1_hash const& info_hash);\n-void d\bdh\bht\bt_\b_a\ban\bnn\bno\bou\bun\bnc\bce\be (sha1_hash const& info_hash, int port = 0, dht::\n-announce_flags_t flags = {});\n-dht_get_peers() will issue a DHT get_peer request to the DHT for the specified\n-info-hash. The response (the peers) will be posted back in a\n-_\bd_\bh_\bt_\b__\bg_\be_\bt_\b__\bp_\be_\be_\br_\bs_\b__\br_\be_\bp_\bl_\by_\b__\ba_\bl_\be_\br_\bt.\n-dht_announce() will issue a DHT announce request to the DHT to the specified\n-info-hash, advertising the specified port. If the port is left at its default,\n-0, the port will be implied by the DHT message's source port (which may improve\n-connectivity through a NAT). dht_announce() is not affected by the\n-announce_port override setting.\n-Both these functions are exposed for advanced custom use of the DHT. All\n-torrents eligible to be announce to the DHT will be automatically, by\n-libtorrent.\n-For possible flags, see _\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\bf_\bl_\ba_\bg_\bs_\b__\bt.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* d\bdh\bht\bt_\b_l\bli\biv\bve\be_\b_n\bno\bod\bde\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n-void d\bdh\bht\bt_\b_l\bli\biv\bve\be_\b_n\bno\bod\bde\bes\bs (sha1_hash const& nid);\n-Retrieve all the live DHT (identified by nid) nodes. All the nodes id and\n-endpoint will be returned in the list of nodes in the _\ba_\bl_\be_\br_\bt\n-dht_live_nodes_alert. Since this _\ba_\bl_\be_\br_\bt is a response to an explicit call, it\n-will always be posted, regardless of the _\ba_\bl_\be_\br_\bt mask.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* d\bdh\bht\bt_\b_s\bsa\bam\bmp\bpl\ble\be_\b_i\bin\bnf\bfo\boh\bha\bas\bsh\bhe\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n-void d\bdh\bht\bt_\b_s\bsa\bam\bmp\bpl\ble\be_\b_i\bin\bnf\bfo\boh\bha\bas\bsh\bhe\bes\bs (udp::endpoint const& ep, sha1_hash const& target);\n-Query the DHT node specified by ep to retrieve a sample of the info-hashes that\n-the node currently have in their storage. The target is included for iterative\n-lookups so that indexing nodes can perform a key space traversal with a single\n-RPC per node by adjusting the target value for each RPC. It has no effect on\n-the returned sample value. The result is posted as a\n-dht_sample_infohashes_alert.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* d\bdh\bht\bt_\b_d\bdi\bir\bre\bec\bct\bt_\b_r\bre\beq\bqu\bue\bes\bst\bt(\b()\b) *\b**\b**\b**\b**\b*\n-void d\bdh\bht\bt_\b_d\bdi\bir\bre\bec\bct\bt_\b_r\bre\beq\bqu\bue\bes\bst\bt (udp::endpoint const& ep, entry const& e, client_data_t\n-userdata = {});\n-Send an arbitrary DHT request directly to the specified endpoint. This function\n-is intended for use by plugins. When a response is received or the request\n-times out, a _\bd_\bh_\bt_\b__\bd_\bi_\br_\be_\bc_\bt_\b__\br_\be_\bs_\bp_\bo_\bn_\bs_\be_\b__\ba_\bl_\be_\br_\bt will be posted with the response (if\n-any) and the userdata pointer passed in here. Since this _\ba_\bl_\be_\br_\bt is a response to\n-an explicit call, it will always be posted, regardless of the _\ba_\bl_\be_\br_\bt mask.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_e\bex\bxt\bte\ben\bns\bsi\bio\bon\bn(\b()\b) *\b**\b**\b**\b**\b*\n-void a\bad\bdd\bd_\b_e\bex\bxt\bte\ben\bns\bsi\bio\bon\bn (std::function(\n- torrent_handle const&, client_data_t)> ext);\n-void a\bad\bdd\bd_\b_e\bex\bxt\bte\ben\bns\bsi\bio\bon\bn (std::shared_ptr ext);\n-This function adds an extension to this _\bs_\be_\bs_\bs_\bi_\bo_\bn. The argument is a function\n-object that is called with a torrent_handle and which should return a std::\n-shared_ptr. To write custom plugins, see _\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b _\bp_\bl_\bu_\bg_\bi_\bn_\bs.\n-For the typical bittorrent client all of these extensions should be added. The\n-main plugins implemented in libtorrent are:\n- uTorrent metadata\n- Allows peers to download the metadata (.torrent files) from the swarm\n- directly. Makes it possible to join a swarm with just a tracker and info-\n- hash.\n-#include \n-ses.add_extension(<::create_ut_metadata_plugin);\n- uTorrent peer exchange\n- Exchanges peers between clients.\n-#include \n-ses.add_extension(<::create_ut_pex_plugin);\n- smart ban _\bp_\bl_\bu_\bg_\bi_\bn\n- A _\bp_\bl_\bu_\bg_\bi_\bn that, with a small overhead, can ban peers that sends bad data\n- with very high accuracy. Should eliminate most problems on poisoned\n- torrents.\n-#include \n-ses.add_extension(<::create_smart_ban_plugin);\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* g\bge\bet\bt_\b_i\bip\bp_\b_f\bfi\bil\blt\bte\ber\br(\b()\b) s\bse\bet\bt_\b_i\bip\bp_\b_f\bfi\bil\blt\bte\ber\br(\b()\b) *\b**\b**\b**\b**\b*\n-ip_filter g\bge\bet\bt_\b_i\bip\bp_\b_f\bfi\bil\blt\bte\ber\br () const;\n-void s\bse\bet\bt_\b_i\bip\bp_\b_f\bfi\bil\blt\bte\ber\br (ip_filter f);\n-Sets a filter that will be used to reject and accept incoming as well as\n-outgoing connections based on their originating ip address. The default filter\n-will allow connections to any ip address. To build a set of rules for which\n-addresses are accepted and not, see _\bi_\bp_\b__\bf_\bi_\bl_\bt_\be_\br.\n-Each time a peer is blocked because of the IP filter, a _\bp_\be_\be_\br_\b__\bb_\bl_\bo_\bc_\bk_\be_\bd_\b__\ba_\bl_\be_\br_\bt is\n-generated. get_ip_filter() Returns the _\bi_\bp_\b__\bf_\bi_\bl_\bt_\be_\br currently in the _\bs_\be_\bs_\bs_\bi_\bo_\bn. See\n-_\bi_\bp_\b__\bf_\bi_\bl_\bt_\be_\br.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* s\bse\bet\bt_\b_p\bpo\bor\brt\bt_\b_f\bfi\bil\blt\bte\ber\br(\b()\b) *\b**\b**\b**\b**\b*\n-void s\bse\bet\bt_\b_p\bpo\bor\brt\bt_\b_f\bfi\bil\blt\bte\ber\br (port_filter const& f);\n-apply _\bp_\bo_\br_\bt_\b__\bf_\bi_\bl_\bt_\be_\br f to incoming and outgoing peers. a port filter will reject\n-making outgoing peer connections to certain remote ports. The main intention is\n-to be able to avoid triggering certain anti-virus software by connecting to\n-SMTP, FTP ports.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* i\bis\bs_\b_l\bli\bis\bst\bte\ben\bni\bin\bng\bg(\b()\b) s\bss\bsl\bl_\b_l\bli\bis\bst\bte\ben\bn_\b_p\bpo\bor\brt\bt(\b()\b) l\bli\bis\bst\bte\ben\bn_\b_p\bpo\bor\brt\bt(\b()\b) *\b**\b**\b**\b**\b*\n-unsigned short l\bli\bis\bst\bte\ben\bn_\b_p\bpo\bor\brt\bt () const;\n-bool i\bis\bs_\b_l\bli\bis\bst\bte\ben\bni\bin\bng\bg () const;\n-unsigned short s\bss\bsl\bl_\b_l\bli\bis\bst\bte\ben\bn_\b_p\bpo\bor\brt\bt () const;\n-is_listening() will tell you whether or not the _\bs_\be_\bs_\bs_\bi_\bo_\bn has successfully opened\n-a listening port. If it hasn't, this function will return false, and then you\n-can set a new _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk_\b:_\b:_\bl_\bi_\bs_\bt_\be_\bn_\b__\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be_\bs to try another interface and\n-port to bind to.\n-listen_port() returns the port we ended up listening on.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* s\bse\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_f\bfi\bil\blt\bte\ber\br(\b()\b) g\bge\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_f\bfi\bil\blt\bte\ber\br(\b()\b) *\b**\b**\b**\b**\b*\n-void s\bse\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_f\bfi\bil\blt\bte\ber\br (ip_filter const& f);\n-ip_filter g\bge\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_f\bfi\bil\blt\bte\ber\br () const;\n-Sets the peer class filter for this _\bs_\be_\bs_\bs_\bi_\bo_\bn. All new peer connections will take\n-this into account and be added to the peer classes specified by this filter,\n-based on the peer's IP address.\n-The ip-filter essentially maps an IP -> uint32. Each bit in that 32 bit integer\n-represents a peer class. The least significant bit represents class 0, the next\n-bit class 1 and so on.\n-For more info, see _\bi_\bp_\b__\bf_\bi_\bl_\bt_\be_\br.\n-For example, to make all peers in the range 200.1.1.0 - 200.1.255.255 belong to\n-their own peer class, apply the following filter:\n-ip_filter f = ses.get_peer_class_filter();\n-peer_class_t my_class = ses.create_peer_class(\"200.1.x.x IP range\");\n-f.add_rule(make_address(\"200.1.1.0\"), make_address(\"200.1.255.255\")\n- , 1 << static_cast(my_class));\n-ses.set_peer_class_filter(f);\n-This setting only applies to new connections, it won't affect existing peer\n-connections.\n-This function is limited to only peer class 0-31, since there are only 32 bits\n-in the IP range mapping. Only the set bits matter; no peer class will be\n-removed from a peer as a result of this call, peer classes are only added.\n-The peer_class argument cannot be greater than 31. The bitmasks representing\n-peer classes in the peer_class_filter are 32 bits.\n-The get_peer_class_filter() function returns the current filter.\n-For more information, see _\bp_\be_\be_\br_\b _\bc_\bl_\ba_\bs_\bs_\be_\bs.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* g\bge\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_t\bty\byp\bpe\be_\b_f\bfi\bil\blt\bte\ber\br(\b()\b) s\bse\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_t\bty\byp\bpe\be_\b_f\bfi\bil\blt\bte\ber\br(\b()\b) *\b**\b**\b**\b**\b*\n-void s\bse\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_t\bty\byp\bpe\be_\b_f\bfi\bil\blt\bte\ber\br (peer_class_type_filter const& f);\n-peer_class_type_filter g\bge\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_t\bty\byp\bpe\be_\b_f\bfi\bil\blt\bte\ber\br () const;\n-Sets and gets the p\bpe\bee\ber\br c\bcl\bla\bas\bss\bs t\bty\byp\bpe\be f\bfi\bil\blt\bte\ber\br. This is controls automatic peer class\n-assignments to peers based on what kind of socket it is.\n-It does not only support assigning peer classes, it also supports removing peer\n-classes based on socket type.\n-The order of these rules being applied are:\n- 1. peer-class IP filter\n- 2. peer-class type filter, removing classes\n- 3. peer-class type filter, adding classes\n-For more information, see _\bp_\be_\be_\br_\b _\bc_\bl_\ba_\bs_\bs_\be_\bs.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* c\bcr\bre\bea\bat\bte\be_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs(\b()\b) *\b**\b**\b**\b**\b*\n-peer_class_t c\bcr\bre\bea\bat\bte\be_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs (char const* name);\n-Creates a new peer class (see _\bp_\be_\be_\br_\b _\bc_\bl_\ba_\bs_\bs_\be_\bs) with the given name. The returned\n-integer is the new peer class identifier. Peer classes may have the same name,\n-so each invocation of this function creates a new class and returns a unique\n-identifier.\n-Identifiers are assigned from low numbers to higher. So if you plan on using\n-certain peer classes in a call to _\bs_\be_\bt_\b__\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b__\bf_\bi_\bl_\bt_\be_\br_\b(_\b), make sure to create\n-those early on, to get low identifiers.\n-For more information on peer classes, see _\bp_\be_\be_\br_\b _\bc_\bl_\ba_\bs_\bs_\be_\bs.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* d\bde\bel\ble\bet\bte\be_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs(\b()\b) *\b**\b**\b**\b**\b*\n-void d\bde\bel\ble\bet\bte\be_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs (peer_class_t cid);\n-This call dereferences the reference count of the specified peer class. When\n-creating a peer class it's automatically referenced by 1. If you want to\n-recycle a peer class, you may call this function. You may only call this\n-function o\bon\bnc\bce\be per peer class you create. Calling it more than once for the same\n-class will lead to memory corruption.\n-Since peer classes are reference counted, this function will not remove the\n-peer class if it's still assigned to torrents or peers. It will however remove\n-it once the last peer and torrent drops their references to it.\n-There is no need to call this function for custom peer classes. All peer\n-classes will be properly destructed when the _\bs_\be_\bs_\bs_\bi_\bo_\bn object destructs.\n-For more information on peer classes, see _\bp_\be_\be_\br_\b _\bc_\bl_\ba_\bs_\bs_\be_\bs.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* s\bse\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs(\b()\b) g\bge\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs(\b()\b) *\b**\b**\b**\b**\b*\n-peer_class_info g\bge\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs (peer_class_t cid) const;\n-void s\bse\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs (peer_class_t cid, peer_class_info const& pci);\n-These functions queries information from a peer class and updates the\n-configuration of a peer class, respectively.\n-cid must refer to an existing peer class. If it does not, the return value of\n-get_peer_class() is undefined.\n-set_peer_class() sets all the information in the _\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b__\bi_\bn_\bf_\bo object in the\n-specified peer class. There is no option to only update a single property.\n-A peer or torrent belonging to more than one class, the highest priority among\n-any of its classes is the one that is taken into account.\n-For more information, see _\bp_\be_\be_\br_\b _\bc_\bl_\ba_\bs_\bs_\be_\bs.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* r\bre\bem\bmo\bov\bve\be_\b_t\bto\bor\brr\bre\ben\bnt\bt(\b()\b) *\b**\b**\b**\b**\b*\n-void r\bre\bem\bmo\bov\bve\be_\b_t\bto\bor\brr\bre\ben\bnt\bt (const torrent_handle&, remove_flags_t = {});\n-remove_torrent() will close all peer connections associated with the torrent\n-and tell the tracker that we've stopped participating in the swarm. This\n-operation cannot fail. When it completes, you will receive a\n-_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\br_\be_\bm_\bo_\bv_\be_\bd_\b__\ba_\bl_\be_\br_\bt.\n-_\br_\be_\bm_\bo_\bv_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b) is non-blocking, but will remove the torrent from the _\bs_\be_\bs_\bs_\bi_\bo_\bn\n-synchronously. Calling _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bh_\ba_\bn_\bd_\bl_\be_\b:_\b:_\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b) immediately afterward with\n-the same torrent will succeed. Note that this creates a new handle which is not\n-equal to the removed one.\n-The optional second argument options can be used to delete all the files\n-downloaded by this torrent. To do so, pass in the value session_handle::\n-delete_files. Once the torrent is deleted, a _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bd_\be_\bl_\be_\bt_\be_\bd_\b__\ba_\bl_\be_\br_\bt is posted.\n-The _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be remains valid for some time after _\br_\be_\bm_\bo_\bv_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b) is\n-called. It will become invalid only after all libtorrent tasks (such as I/\n-O tasks) release their references to the torrent. Until this happens,\n-_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be_\b:_\b:_\bi_\bs_\b__\bv_\ba_\bl_\bi_\bd_\b(_\b) will return true, and other calls such as\n-_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be_\b:_\b:_\bs_\bt_\ba_\bt_\bu_\bs_\b(_\b) will succeed. Because of this, and because\n-_\br_\be_\bm_\bo_\bv_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b) is non-blocking, the following sequence usually succeeds (does\n-not throw system_error): .. code:: c++\n- session.remove_handle(handle); handle.save_resume_data();\n-Note that when a queued or downloading torrent is removed, its position in the\n-download queue is vacated and every subsequent torrent in the queue has their\n-queue positions updated. This can potentially cause a large state_update to be\n-posted. When removing all torrents, it is advised to remove them from the back\n-of the queue, to minimize the shifting.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* g\bge\bet\bt_\b_s\bse\bet\btt\bti\bin\bng\bgs\bs(\b()\b) a\bap\bpp\bpl\bly\by_\b_s\bse\bet\btt\bti\bin\bng\bgs\bs(\b()\b) *\b**\b**\b**\b**\b*\n-void a\bap\bpp\bpl\bly\by_\b_s\bse\bet\btt\bti\bin\bng\bgs\bs (settings_pack&&);\n-settings_pack g\bge\bet\bt_\b_s\bse\bet\btt\bti\bin\bng\bgs\bs () const;\n-void a\bap\bpp\bpl\bly\by_\b_s\bse\bet\btt\bti\bin\bng\bgs\bs (settings_pack const&);\n-Applies the settings specified by the _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk s. This is an asynchronous\n-operation that will return immediately and actually apply the settings to the\n-main thread of libtorrent some time later.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* w\bwa\bai\bit\bt_\b_f\bfo\bor\br_\b_a\bal\ble\ber\brt\bt(\b()\b) s\bse\bet\bt_\b_a\bal\ble\ber\brt\bt_\b_n\bno\bot\bti\bif\bfy\by(\b()\b) p\bpo\bop\bp_\b_a\bal\ble\ber\brt\bts\bs(\b()\b) *\b**\b**\b**\b**\b*\n-alert* w\bwa\bai\bit\bt_\b_f\bfo\bor\br_\b_a\bal\ble\ber\brt\bt (time_duration max_wait);\n-void s\bse\bet\bt_\b_a\bal\ble\ber\brt\bt_\b_n\bno\bot\bti\bif\bfy\by (std::function const& fun);\n-void p\bpo\bop\bp_\b_a\bal\ble\ber\brt\bts\bs (std::vector* alerts);\n-Alerts is the main mechanism for libtorrent to report errors and events.\n-pop_alerts fills in the vector passed to it with pointers to new alerts. The\n-_\bs_\be_\bs_\bs_\bi_\bo_\bn still owns these alerts and they will stay valid until the next time\n-pop_alerts is called. You may not delete the _\ba_\bl_\be_\br_\bt objects.\n-It is safe to call pop_alerts from multiple different threads, as long as the\n-alerts themselves are not accessed once another thread calls pop_alerts. Doing\n-this requires manual synchronization between the popping threads.\n-wait_for_alert will block the current thread for max_wait time duration, or\n-until another _\ba_\bl_\be_\br_\bt is posted. If an _\ba_\bl_\be_\br_\bt is available at the time of the\n-call, it returns immediately. The returned _\ba_\bl_\be_\br_\bt pointer is the head of the\n-_\ba_\bl_\be_\br_\bt queue. wait_for_alert does not pop alerts from the queue, it merely peeks\n-at it. The returned _\ba_\bl_\be_\br_\bt will stay valid until pop_alerts is called twice. The\n-first time will pop it and the second will free it.\n-If there is no _\ba_\bl_\be_\br_\bt in the queue and no _\ba_\bl_\be_\br_\bt arrives within the specified\n-timeout, wait_for_alert returns nullptr.\n-In the python binding, wait_for_alert takes the number of milliseconds to wait\n-as an integer.\n-The _\ba_\bl_\be_\br_\bt queue in the _\bs_\be_\bs_\bs_\bi_\bo_\bn will not grow indefinitely. Make sure to pop\n-periodically to not miss notifications. To control the max number of alerts\n-that's queued by the _\bs_\be_\bs_\bs_\bi_\bo_\bn, see settings_pack::alert_queue_size.\n-Some alerts are considered so important that they are posted even when the\n-_\ba_\bl_\be_\br_\bt queue is full. Some alerts are considered mandatory and cannot be\n-disabled by the alert_mask. For instance, _\bs_\ba_\bv_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b__\ba_\bl_\be_\br_\bt and\n-_\bs_\ba_\bv_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b__\bf_\ba_\bi_\bl_\be_\bd_\b__\ba_\bl_\be_\br_\bt are always posted, regardless of the _\ba_\bl_\be_\br_\bt mask.\n-To control which alerts are posted, set the alert_mask (_\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk_\b:_\b:\n-_\ba_\bl_\be_\br_\bt_\b__\bm_\ba_\bs_\bk).\n-If the _\ba_\bl_\be_\br_\bt queue fills up to the point where alerts are dropped, this will be\n-indicated by a _\ba_\bl_\be_\br_\bt_\bs_\b__\bd_\br_\bo_\bp_\bp_\be_\bd_\b__\ba_\bl_\be_\br_\bt, which contains a bitmask of which types of\n-alerts were dropped. Generally it is a good idea to make sure the _\ba_\bl_\be_\br_\bt queue\n-is large enough, the alert_mask doesn't have unnecessary categories enabled and\n-to call pop_alert() frequently, to avoid alerts being dropped.\n-the set_alert_notify function lets the client set a function object to be\n-invoked every time the _\ba_\bl_\be_\br_\bt queue goes from having 0 alerts to 1 _\ba_\bl_\be_\br_\bt. This\n-function is called from within libtorrent, it may be the main thread, or it may\n-be from within a user call. The intention of of the function is that the client\n-wakes up its main thread, to poll for more alerts using pop_alerts(). If the\n-notify function fails to do so, it won't be called again, until pop_alerts is\n-called for some other reason. For instance, it could signal an eventfd, post a\n-message to an HWND or some other main message pump. The actual retrieval of\n-alerts should not be done in the callback. In fact, the callback should not\n-block. It should not perform any expensive work. It really should just notify\n-the main application thread.\n-The type of an _\ba_\bl_\be_\br_\bt is returned by the polymorphic function alert::type() but\n-can also be queries from a concrete type via T::alert_type, as a static\n-constant.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_p\bpo\bor\brt\bt_\b_m\bma\bap\bpp\bpi\bin\bng\bg(\b()\b) d\bde\bel\ble\bet\bte\be_\b_p\bpo\bor\brt\bt_\b_m\bma\bap\bpp\bpi\bin\bng\bg(\b()\b) *\b**\b**\b**\b**\b*\n-std::vector a\bad\bdd\bd_\b_p\bpo\bor\brt\bt_\b_m\bma\bap\bpp\bpi\bin\bng\bg (portmap_protocol t, int\n-external_port, int local_port);\n-void d\bde\bel\ble\bet\bte\be_\b_p\bpo\bor\brt\bt_\b_m\bma\bap\bpp\bpi\bin\bng\bg (port_mapping_t handle);\n-add_port_mapping adds one or more port forwards on UPnP and/or NAT-PMP,\n-whichever is enabled. A mapping is created for each listen socket in the\n-_\bs_\be_\bs_\bs_\bi_\bo_\bn. The return values are all handles referring to the port mappings that\n-were just created. Pass them to _\bd_\be_\bl_\be_\bt_\be_\b__\bp_\bo_\br_\bt_\b__\bm_\ba_\bp_\bp_\bi_\bn_\bg_\b(_\b) to remove them.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* r\bre\beo\bop\bpe\ben\bn_\b_n\bne\bet\btw\bwo\bor\brk\bk_\b_s\bso\boc\bck\bke\bet\bts\bs(\b()\b) *\b**\b**\b**\b**\b*\n-void r\bre\beo\bop\bpe\ben\bn_\b_n\bne\bet\btw\bwo\bor\brk\bk_\b_s\bso\boc\bck\bke\bet\bts\bs (reopen_network_flags_t options =\n-reopen_map_ports);\n-Instructs the _\bs_\be_\bs_\bs_\bi_\bo_\bn to reopen all listen and outgoing sockets.\n-It's useful in the case your platform doesn't support the built in IP notifier\n-mechanism, or if you have a better more reliable way to detect changes in the\n-IP routing table.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* n\bna\bat\bti\biv\bve\be_\b_h\bha\ban\bnd\bdl\ble\be(\b()\b) *\b**\b**\b**\b**\b*\n-std::shared_ptr n\bna\bat\bti\biv\bve\be_\b_h\bha\ban\bnd\bdl\ble\be () const;\n-This function is intended only for use by plugins. This type does not have a\n-stable API and should be relied on as little as possible.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- save_settings\n- saves settings (i.e. the _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk)\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- save_dht_state\n- saves dht state such as nodes and node-id, possibly accelerating joining\n- the DHT if provided at next _\bs_\be_\bs_\bs_\bi_\bo_\bn startup.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- save_extension_state\n- load or save state from plugins\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- save_ip_filter\n- load or save the IP filter set on the _\bs_\be_\bs_\bs_\bi_\bo_\bn\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- global_peer_class_id tcp_peer_class_id local_peer_class_id\n- built-in peer classes\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- delete_files\n- delete the files belonging to the torrent from disk. including the part-\n- file, if there is one\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- delete_partfile\n- delete just the part-file associated with this torrent\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- paused\n- when set, the _\bs_\be_\bs_\bs_\bi_\bo_\bn will start paused. Call _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bh_\ba_\bn_\bd_\bl_\be_\b:_\b:_\br_\be_\bs_\bu_\bm_\be_\b(_\b) to\n- start\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- udp tcp\n- protocols used by _\ba_\bd_\bd_\b__\bp_\bo_\br_\bt_\b__\bm_\ba_\bp_\bp_\bi_\bn_\bg_\b(_\b)\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- reopen_map_ports\n- This option indicates if the ports are mapped using natpmp and upnp. If\n- mapping was already made, they are deleted and added again. This only\n- works if natpmp and/or upnp are configured to be enable.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b._\bh_\bp_\bp\"\n-this is a holder for the internal _\bs_\be_\bs_\bs_\bi_\bo_\bn implementation object. Once the\n-_\bs_\be_\bs_\bs_\bi_\bo_\bn destruction is explicitly initiated, this holder is used to synchronize\n-the completion of the shutdown. The lifetime of this object may outlive\n-_\bs_\be_\bs_\bs_\bi_\bo_\bn, causing the _\bs_\be_\bs_\bs_\bi_\bo_\bn destructor to not block. The _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\br_\bo_\bx_\by\n-destructor will block however, until the underlying _\bs_\be_\bs_\bs_\bi_\bo_\bn is done shutting\n-down.\n-struct session_proxy\n-{\n- s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by (session_proxy const&);\n- session_proxy& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (session_proxy const&) &;\n- s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by (session_proxy&&) noexcept;\n- session_proxy& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (session_proxy&&) & noexcept;\n- s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by ();\n- ~\b~s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by ();\n-};\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by(\b()\b) ~\b~s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by(\b()\b) o\bop\bpe\ber\bra\bat\bto\bor\br=\b=(\b()\b) *\b**\b**\b**\b**\b*\n-s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by (session_proxy const&);\n-session_proxy& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (session_proxy const&) &;\n-s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by (session_proxy&&) noexcept;\n-session_proxy& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (session_proxy&&) & noexcept;\n-s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by ();\n-~\b~s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by ();\n-default constructor, does not refer to any _\bs_\be_\bs_\bs_\bi_\bo_\bn implementation object.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* s\bse\bes\bss\bsi\bio\bon\bn *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b._\bh_\bp_\bp\"\n-The _\bs_\be_\bs_\bs_\bi_\bo_\bn holds all state that spans multiple torrents. Among other things it\n-runs the network loop and manages all torrents. Once it's created, the _\bs_\be_\bs_\bs_\bi_\bo_\bn\n-object will spawn the main thread that will do all the work. The main thread\n-will be idle as long it doesn't have any torrents to participate in.\n-You have some control over _\bs_\be_\bs_\bs_\bi_\bo_\bn configuration through the session_handle::\n-apply_settings() member function. To change one or more configuration options,\n-create a _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk. object and fill it with the settings to be set and pass\n-it in to session::apply_settings().\n-see _\ba_\bp_\bp_\bl_\by_\b__\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b(_\b).\n-struct session : session_handle\n-{\n- s\bse\bes\bss\bsi\bio\bon\bn (session_params const& params, session_flags_t flags);\n- explicit s\bse\bes\bss\bsi\bio\bon\bn (session_params const& params);\n- s\bse\bes\bss\bsi\bio\bon\bn ();\n- s\bse\bes\bss\bsi\bio\bon\bn (session_params&& params, session_flags_t flags);\n- explicit s\bse\bes\bss\bsi\bio\bon\bn (session_params&& params);\n- s\bse\bes\bss\bsi\bio\bon\bn (session_params&& params, io_context& ios);\n- s\bse\bes\bss\bsi\bio\bon\bn (session_params const& params, io_context& ios);\n- s\bse\bes\bss\bsi\bio\bon\bn (session_params&& params, io_context& ios, session_flags_t);\n- s\bse\bes\bss\bsi\bio\bon\bn (session_params const& params, io_context& ios, session_flags_t);\n- ~\b~s\bse\bes\bss\bsi\bio\bon\bn ();\n- session_proxy a\bab\bbo\bor\brt\bt ();\n-};\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* s\bse\bes\bss\bsi\bio\bon\bn(\b()\b) *\b**\b**\b**\b**\b*\n-s\bse\bes\bss\bsi\bio\bon\bn (session_params const& params, session_flags_t flags);\n-explicit s\bse\bes\bss\bsi\bio\bon\bn (session_params const& params);\n-s\bse\bes\bss\bsi\bio\bon\bn ();\n-s\bse\bes\bss\bsi\bio\bon\bn (session_params&& params, session_flags_t flags);\n-explicit s\bse\bes\bss\bsi\bio\bon\bn (session_params&& params);\n-Constructs the _\bs_\be_\bs_\bs_\bi_\bo_\bn objects which acts as the container of torrents. In\n-order to avoid a race condition between starting the _\bs_\be_\bs_\bs_\bi_\bo_\bn and configuring\n-it, you can pass in a _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs object. Its settings will take effect\n-before the _\bs_\be_\bs_\bs_\bi_\bo_\bn starts up.\n-The overloads taking flags can be used to start a _\bs_\be_\bs_\bs_\bi_\bo_\bn in paused mode (by\n-passing in session::paused). Note that add_default_plugins do not have an\n-affect on constructors that take a _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs object. It already contains\n-the plugins to use.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* s\bse\bes\bss\bsi\bio\bon\bn(\b()\b) *\b**\b**\b**\b**\b*\n-s\bse\bes\bss\bsi\bio\bon\bn (session_params&& params, io_context& ios);\n-s\bse\bes\bss\bsi\bio\bon\bn (session_params const& params, io_context& ios);\n-s\bse\bes\bss\bsi\bio\bon\bn (session_params&& params, io_context& ios, session_flags_t);\n-s\bse\bes\bss\bsi\bio\bon\bn (session_params const& params, io_context& ios, session_flags_t);\n-Overload of the constructor that takes an external io_context to run the\n-_\bs_\be_\bs_\bs_\bi_\bo_\bn object on. This is primarily useful for tests that may want to run\n-multiple sessions on a single io_context, or low resource systems where\n-additional threads are expensive and sharing an io_context with other events is\n-fine.\n-Warning\n-The _\bs_\be_\bs_\bs_\bi_\bo_\bn object does not cleanly terminate with an external io_context. The\n-io_context::run() call m\bmu\bus\bst\bt have returned before it's safe to destruct the\n-_\bs_\be_\bs_\bs_\bi_\bo_\bn. Which means you M\bMU\bUS\bST\bT call _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b:_\b:_\ba_\bb_\bo_\br_\bt_\b(_\b) and save the _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\br_\bo_\bx_\by\n-first, then destruct the _\bs_\be_\bs_\bs_\bi_\bo_\bn object, then sync with the io_context, then\n-destruct the _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\br_\bo_\bx_\by object.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* ~\b~s\bse\bes\bss\bsi\bio\bon\bn(\b()\b) *\b**\b**\b**\b**\b*\n-~\b~s\bse\bes\bss\bsi\bio\bon\bn ();\n-The destructor of _\bs_\be_\bs_\bs_\bi_\bo_\bn will notify all trackers that our torrents have been\n-shut down. If some trackers are down, they will time out. All this before the\n-destructor of _\bs_\be_\bs_\bs_\bi_\bo_\bn returns. So, it's advised that any kind of interface\n-(such as windows) are closed before destructing the _\bs_\be_\bs_\bs_\bi_\bo_\bn object. Because it\n-can take a few second for it to finish. The timeout can be set with\n-_\ba_\bp_\bp_\bl_\by_\b__\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b(_\b).\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* a\bab\bbo\bor\brt\bt(\b()\b) *\b**\b**\b**\b**\b*\n-session_proxy a\bab\bbo\bor\brt\bt ();\n-In case you want to destruct the _\bs_\be_\bs_\bs_\bi_\bo_\bn asynchronously, you can request a\n-_\bs_\be_\bs_\bs_\bi_\bo_\bn destruction proxy. If you don't do this, the destructor of the _\bs_\be_\bs_\bs_\bi_\bo_\bn\n-object will block while the trackers are contacted. If you keep one\n-session_proxy to the _\bs_\be_\bs_\bs_\bi_\bo_\bn when destructing it, the destructor will not\n-block, but start to close down the _\bs_\be_\bs_\bs_\bi_\bo_\bn, the destructor of the proxy will\n-then synchronize the threads. So, the destruction of the _\bs_\be_\bs_\bs_\bi_\bo_\bn is performed\n-from the session destructor call until the session_proxy destructor call. The\n-session_proxy does not have any operations on it (since the _\bs_\be_\bs_\bs_\bi_\bo_\bn is being\n-closed down, no operations are allowed on it). The only valid operation is\n-calling the destructor:\n-struct session_proxy {};\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs_\b._\bh_\bp_\bp\"\n-The _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs is a parameters pack for configuring the _\bs_\be_\bs_\bs_\bi_\bo_\bn before it's\n-started.\n-struct session_params\n-{\n- s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs (settings_pack&& sp);\n- s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs (settings_pack const& sp);\n- s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs ();\n- s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs (settings_pack&& sp\n- , std::vector> exts);\n- s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs (settings_pack const& sp\n- , std::vector> exts);\n-\n- settings_pack settings;\n- std::vector> extensions;\n- dht::dht_state dht_state;\n- dht::dht_storage_constructor_type dht_storage_constructor;\n- disk_io_constructor_type disk_io_constructor;\n- std::map ext_state;\n- libtorrent::ip_filter ip_filter;\n-};\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs(\b()\b) *\b**\b**\b**\b**\b*\n-s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs (settings_pack&& sp);\n-s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs (settings_pack const& sp);\n-s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs ();\n-This constructor can be used to start with the default plugins (ut_metadata,\n-ut_pex and smart_ban). Pass a _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk to set the initial settings when\n-the _\bs_\be_\bs_\bs_\bi_\bo_\bn starts.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs(\b()\b) *\b**\b**\b**\b**\b*\n-s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs (settings_pack&& sp\n- , std::vector> exts);\n-s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs (settings_pack const& sp\n- , std::vector> exts);\n-This constructor helps to configure the set of initial plugins to be added to\n-the _\bs_\be_\bs_\bs_\bi_\bo_\bn before it's started.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- settings\n- The settings to configure the _\bs_\be_\bs_\bs_\bi_\bo_\bn with\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- extensions\n- the plugins to add to the _\bs_\be_\bs_\bs_\bi_\bo_\bn as it is constructed\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- dht_state\n- DHT node ID and node addresses to bootstrap the DHT with.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- dht_storage_constructor\n- function object to construct the storage object for DHT items.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- disk_io_constructor\n- function object to create the disk I/O subsystem. Defaults to\n- default_disk_io_constructor.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- ext_state\n- this container can be used by extensions/plugins to store settings. It's\n- primarily here to make it convenient to save and restore state across\n- sessions, using _\br_\be_\ba_\bd_\b__\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs_\b(_\b) and _\bw_\br_\bi_\bt_\be_\b__\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs_\b(_\b).\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- ip_filter\n- the IP filter to use for the _\bs_\be_\bs_\bs_\bi_\bo_\bn. This restricts which peers are\n- allowed to connect. As if passed to _\bs_\be_\bt_\b__\bi_\bp_\b__\bf_\bi_\bl_\bt_\be_\br_\b(_\b).\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* w\bwr\bri\bit\bte\be_\b_s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs_\b_b\bbu\buf\bf(\b()\b) r\bre\bea\bad\bd_\b_s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs(\b()\b) w\bwr\bri\bit\bte\be_\b_s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs(\b()\b)\n-*\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs_\b._\bh_\bp_\bp\"\n-session_params r\bre\bea\bad\bd_\b_s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs (bdecode_node const& e\n- , save_state_flags_t flags = save_state_flags_t::all());\n-session_params r\bre\bea\bad\bd_\b_s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs (span buf\n- , save_state_flags_t flags = save_state_flags_t::all());\n-entry w\bwr\bri\bit\bte\be_\b_s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs (session_params const& sp\n- , save_state_flags_t flags = save_state_flags_t::all());\n-std::vector w\bwr\bri\bit\bte\be_\b_s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs_\b_b\bbu\buf\bf (session_params const& sp\n- , save_state_flags_t flags = save_state_flags_t::all());\n-These functions serialize and de-serialize a session_params object to and from\n-bencoded form. The _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs object is used to initialize a new _\bs_\be_\bs_\bs_\bi_\bo_\bn\n-using the state from a previous one (or by programmatically configure the\n-_\bs_\be_\bs_\bs_\bi_\bo_\bn up-front). The flags parameter can be used to only save and load\n-certain aspects of the session's state. The _buf suffix indicates the function\n-operates on buffer rather than the bencoded structure. The torrents in a\n-_\bs_\be_\bs_\bs_\bi_\bo_\bn are not part of the _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs state, they have to be restored\n-separately.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* i\bip\bp_\b_f\bfi\bil\blt\bte\ber\br *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bi_\bp_\b__\bf_\bi_\bl_\bt_\be_\br_\b._\bh_\bp_\bp\"\n-The ip_filter class is a set of rules that uniquely categorizes all ip\n-addresses as allowed or disallowed. The default constructor creates a single\n-rule that allows all addresses (0.0.0.0 - 255.255.255.255 for the IPv4 range,\n-and the equivalent range covering all addresses for the IPv6 range).\n-A default constructed _\bi_\bp_\b__\bf_\bi_\bl_\bt_\be_\br does not filter any address.\n-struct ip_filter\n-{\n- ip_filter& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (ip_filter&&);\n- ~\b~i\bip\bp_\b_f\bfi\bil\blt\bte\ber\br ();\n- ip_filter& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (ip_filter const&);\n- i\bip\bp_\b_f\bfi\bil\blt\bte\ber\br (ip_filter&&);\n- i\bip\bp_\b_f\bfi\bil\blt\bte\ber\br ();\n- i\bip\bp_\b_f\bfi\bil\blt\bte\ber\br (ip_filter const&);\n- bool e\bem\bmp\bpt\bty\by () const;\n- void a\bad\bdd\bd_\b_r\bru\bul\ble\be (address const& first, address const& last, std::uint32_t\n-flags);\n- std::uint32_t a\bac\bcc\bce\bes\bss\bs (address const& addr) const;\n- filter_tuple_t e\bex\bxp\bpo\bor\brt\bt_\b_f\bfi\bil\blt\bte\ber\br () const;\n-\n- enum access_flags\n- {\n- blocked,\n- };\n-};\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* e\bem\bmp\bpt\bty\by(\b()\b) *\b**\b**\b**\b**\b*\n-bool e\bem\bmp\bpt\bty\by () const;\n-returns true if the filter does not contain any rules\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_r\bru\bul\ble\be(\b()\b) *\b**\b**\b**\b**\b*\n-void a\bad\bdd\bd_\b_r\bru\bul\ble\be (address const& first, address const& last, std::uint32_t flags);\n-Adds a rule to the filter. first and last defines a range of ip addresses that\n-will be marked with the given flags. The flags can currently be 0, which means\n-allowed, or ip_filter::blocked, which means disallowed.\n-precondition: first.is_v4() == last.is_v4() && first.is_v6() == last.is_v6()\n-postcondition: access(x) == flags for every x in the range [first, last]\n-This means that in a case of overlapping ranges, the last one applied takes\n-precedence.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* a\bac\bcc\bce\bes\bss\bs(\b()\b) *\b**\b**\b**\b**\b*\n-std::uint32_t a\bac\bcc\bce\bes\bss\bs (address const& addr) const;\n-Returns the access permissions for the given address (addr). The permission can\n-currently be 0 or ip_filter::blocked. The complexity of this operation is O(log\n-n), where n is the minimum number of non-overlapping ranges to describe the\n-current filter.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* e\bex\bxp\bpo\bor\brt\bt_\b_f\bfi\bil\blt\bte\ber\br(\b()\b) *\b**\b**\b**\b**\b*\n-filter_tuple_t e\bex\bxp\bpo\bor\brt\bt_\b_f\bfi\bil\blt\bte\ber\br () const;\n-This function will return the current state of the filter in the minimum number\n-of ranges possible. They are sorted from ranges in low addresses to high\n-addresses. Each _\be_\bn_\bt_\br_\by in the returned vector is a range with the access control\n-specified in its flags field.\n-The return value is a tuple containing two range-lists. One for IPv4 addresses\n-and one for IPv6 addresses.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* e\ben\bnu\bum\bm a\bac\bcc\bce\bes\bss\bs_\b_f\bfl\bla\bag\bgs\bs *\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bi_\bp_\b__\bf_\bi_\bl_\bt_\be_\br_\b._\bh_\bp_\bp\"\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n-|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|blocked|1 |indicates that IPs in this range should not be connected to nor|\n-|_\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\ba_\bc_\bc_\be_\bp_\bt_\be_\bd_\b _\ba_\bs_\b _\bi_\bn_\bc_\bo_\bm_\bi_\bn_\bg_\b _\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* p\bpo\bor\brt\bt_\b_f\bfi\bil\blt\bte\ber\br *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bi_\bp_\b__\bf_\bi_\bl_\bt_\be_\br_\b._\bh_\bp_\bp\"\n-the port filter maps non-overlapping port ranges to flags. This is primarily\n-used to indicate whether a range of ports should be connected to or not. The\n-default is to have the full port range (0-65535) set to flag 0.\n-class port_filter\n-{\n- ~\b~p\bpo\bor\brt\bt_\b_f\bfi\bil\blt\bte\ber\br ();\n- p\bpo\bor\brt\bt_\b_f\bfi\bil\blt\bte\ber\br (port_filter const&);\n- port_filter& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (port_filter const&);\n- p\bpo\bor\brt\bt_\b_f\bfi\bil\blt\bte\ber\br (port_filter&&);\n- p\bpo\bor\brt\bt_\b_f\bfi\bil\blt\bte\ber\br ();\n- port_filter& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (port_filter&&);\n- void a\bad\bdd\bd_\b_r\bru\bul\ble\be (std::uint16_t first, std::uint16_t last, std::uint32_t\n-flags);\n- std::uint32_t a\bac\bcc\bce\bes\bss\bs (std::uint16_t port) const;\n-\n- enum access_flags\n- {\n- blocked,\n- };\n-};\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_r\bru\bul\ble\be(\b()\b) *\b**\b**\b**\b**\b*\n-void a\bad\bdd\bd_\b_r\bru\bul\ble\be (std::uint16_t first, std::uint16_t last, std::uint32_t flags);\n-set the flags for the specified port range (first, last) to flags overwriting\n-any existing rule for those ports. The range is inclusive, i.e. the port last\n-also has the flag set on it.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* a\bac\bcc\bce\bes\bss\bs(\b()\b) *\b**\b**\b**\b**\b*\n-std::uint32_t a\bac\bcc\bce\bes\bss\bs (std::uint16_t port) const;\n-test the specified port (port) for whether it is blocked or not. The returned\n-value is the flags set for this port. see _\ba_\bc_\bc_\be_\bs_\bs_\b__\bf_\bl_\ba_\bg_\bs.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* e\ben\bnu\bum\bm a\bac\bcc\bce\bes\bss\bs_\b_f\bfl\bla\bag\bgs\bs *\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bi_\bp_\b__\bf_\bi_\bl_\bt_\be_\br_\b._\bh_\bp_\bp\"\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n-|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|blocked|1 |this flag indicates that destination ports in the range should|\n-|_\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bn_\bo_\bt_\b _\bb_\be_\b _\bc_\bo_\bn_\bn_\be_\bc_\bt_\be_\bd_\b _\bt_\bo_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* b\bbd\bde\bec\bco\bod\bde\be_\b_n\bno\bod\bde\be *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bb_\bd_\be_\bc_\bo_\bd_\be_\b._\bh_\bp_\bp\"\n-Sometimes it's important to get a non-owning reference to the root node ( to be\n-able to copy it as a reference for instance). For that, use the _\bn_\bo_\bn_\b__\bo_\bw_\bn_\bi_\bn_\bg_\b(_\b)\n-member function.\n-There are 5 different types of nodes, see _\bt_\by_\bp_\be_\b__\bt.\n-struct bdecode_node\n-{\n- b\bbd\bde\bec\bco\bod\bde\be_\b_n\bno\bod\bde\be () = default;\n- bdecode_node& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (bdecode_node&&) & = default;\n- b\bbd\bde\bec\bco\bod\bde\be_\b_n\bno\bod\bde\be (bdecode_node const&);\n- b\bbd\bde\bec\bco\bod\bde\be_\b_n\bno\bod\bde\be (bdecode_node&&) noexcept;\n- bdecode_node& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (bdecode_node const&) &;\n- type_t t\bty\byp\bpe\be () const noexcept;\n- explicit operator b\bbo\boo\bol\bl () const noexcept;\n- bdecode_node n\bno\bon\bn_\b_o\bow\bwn\bni\bin\bng\bg () const;\n- std::ptrdiff_t d\bda\bat\bta\ba_\b_o\bof\bff\bfs\bse\bet\bt () const noexcept;\n- span d\bda\bat\bta\ba_\b_s\bse\bec\bct\bti\bio\bon\bn () const noexcept;\n- int l\bli\bis\bst\bt_\b_s\bsi\biz\bze\be () const;\n- string_view l\bli\bis\bst\bt_\b_s\bst\btr\bri\bin\bng\bg_\b_v\bva\bal\blu\bue\be_\b_a\bat\bt (int i\n- , string_view default_val = string_view()) const;\n- std::int64_t l\bli\bis\bst\bt_\b_i\bin\bnt\bt_\b_v\bva\bal\blu\bue\be_\b_a\bat\bt (int i\n- , std::int64_t default_val = 0) const;\n- bdecode_node l\bli\bis\bst\bt_\b_a\bat\bt (int i) const;\n- std::pair d\bdi\bic\bct\bt_\b_a\bat\bt (int i) const;\n- bdecode_node d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_d\bdi\bic\bct\bt (string_view key) const;\n- bdecode_node d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_l\bli\bis\bst\bt (string_view key) const;\n- bdecode_node d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_i\bin\bnt\bt (string_view key) const;\n- string_view d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_s\bst\btr\bri\bin\bng\bg_\b_v\bva\bal\blu\bue\be (string_view key\n- , string_view default_value = string_view()) const;\n- bdecode_node d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_s\bst\btr\bri\bin\bng\bg (string_view key) const;\n- std::int64_t d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_i\bin\bnt\bt_\b_v\bva\bal\blu\bue\be (string_view key\n- , std::int64_t default_val = 0) const;\n- int d\bdi\bic\bct\bt_\b_s\bsi\biz\bze\be () const;\n- bdecode_node d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd (string_view key) const;\n- std::pair d\bdi\bic\bct\bt_\b_a\bat\bt_\b_n\bno\bod\bde\be (int i) const;\n- std::int64_t i\bin\bnt\bt_\b_v\bva\bal\blu\bue\be () const;\n- string_view s\bst\btr\bri\bin\bng\bg_\b_v\bva\bal\blu\bue\be () const;\n- std::ptrdiff_t s\bst\btr\bri\bin\bng\bg_\b_o\bof\bff\bfs\bse\bet\bt () const;\n- char const* s\bst\btr\bri\bin\bng\bg_\b_p\bpt\btr\br () const;\n- int s\bst\btr\bri\bin\bng\bg_\b_l\ble\ben\bng\bgt\bth\bh () const;\n- void c\bcl\ble\bea\bar\br ();\n- void s\bsw\bwa\bap\bp (bdecode_node& n);\n- void r\bre\bes\bse\ber\brv\bve\be (int tokens);\n- void s\bsw\bwi\bit\btc\bch\bh_\b_u\bun\bnd\bde\ber\brl\bly\byi\bin\bng\bg_\b_b\bbu\buf\bff\bfe\ber\br (char const* buf) noexcept;\n- bool h\bha\bas\bs_\b_s\bso\bof\bft\bt_\b_e\ber\brr\bro\bor\br (span error) const;\n-\n- enum type_t\n- {\n- none_t,\n- dict_t,\n- list_t,\n- string_t,\n- int_t,\n- };\n-};\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* b\bbd\bde\bec\bco\bod\bde\be_\b_n\bno\bod\bde\be(\b()\b) *\b**\b**\b**\b**\b*\n-b\bbd\bde\bec\bco\bod\bde\be_\b_n\bno\bod\bde\be () = default;\n-creates a default constructed node, it will have the type none_t.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* b\bbd\bde\bec\bco\bod\bde\be_\b_n\bno\bod\bde\be(\b()\b) o\bop\bpe\ber\bra\bat\bto\bor\br=\b=(\b()\b) *\b**\b**\b**\b**\b*\n-bdecode_node& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (bdecode_node&&) & = default;\n-b\bbd\bde\bec\bco\bod\bde\be_\b_n\bno\bod\bde\be (bdecode_node const&);\n-b\bbd\bde\bec\bco\bod\bde\be_\b_n\bno\bod\bde\be (bdecode_node&&) noexcept;\n-bdecode_node& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (bdecode_node const&) &;\n-For owning nodes, the copy will create a copy of the tree, but the underlying\n-buffer remains the same.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* t\bty\byp\bpe\be(\b()\b) *\b**\b**\b**\b**\b*\n-type_t t\bty\byp\bpe\be () const noexcept;\n-the type of this node. See _\bt_\by_\bp_\be_\b__\bt.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* b\bbo\boo\bol\bl(\b()\b) *\b**\b**\b**\b**\b*\n-explicit operator b\bbo\boo\bol\bl () const noexcept;\n-returns true if _\bt_\by_\bp_\be_\b(_\b) != none_t.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* n\bno\bon\bn_\b_o\bow\bwn\bni\bin\bng\bg(\b()\b) *\b**\b**\b**\b**\b*\n-bdecode_node n\bno\bon\bn_\b_o\bow\bwn\bni\bin\bng\bg () const;\n-return a non-owning reference to this node. This is useful to refer to the root\n-node without copying it in assignments.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* d\bda\bat\bta\ba_\b_s\bse\bec\bct\bti\bio\bon\bn(\b()\b) d\bda\bat\bta\ba_\b_o\bof\bff\bfs\bse\bet\bt(\b()\b) *\b**\b**\b**\b**\b*\n-std::ptrdiff_t d\bda\bat\bta\ba_\b_o\bof\bff\bfs\bse\bet\bt () const noexcept;\n-span d\bda\bat\bta\ba_\b_s\bse\bec\bct\bti\bio\bon\bn () const noexcept;\n-returns the buffer and length of the section in the original bencoded buffer\n-where this node is defined. For a dictionary for instance, this starts with d\n-and ends with e, and has all the content of the dictionary in between. the\n-data_offset() function returns the byte-offset to this node in, starting from\n-the beginning of the buffer that was parsed.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* l\bli\bis\bst\bt_\b_a\bat\bt(\b()\b) l\bli\bis\bst\bt_\b_i\bin\bnt\bt_\b_v\bva\bal\blu\bue\be_\b_a\bat\bt(\b()\b) l\bli\bis\bst\bt_\b_s\bst\btr\bri\bin\bng\bg_\b_v\bva\bal\blu\bue\be_\b_a\bat\bt(\b()\b) l\bli\bis\bst\bt_\b_s\bsi\biz\bze\be(\b()\b) *\b**\b**\b**\b**\b*\n-int l\bli\bis\bst\bt_\b_s\bsi\biz\bze\be () const;\n-string_view l\bli\bis\bst\bt_\b_s\bst\btr\bri\bin\bng\bg_\b_v\bva\bal\blu\bue\be_\b_a\bat\bt (int i\n- , string_view default_val = string_view()) const;\n-std::int64_t l\bli\bis\bst\bt_\b_i\bin\bnt\bt_\b_v\bva\bal\blu\bue\be_\b_a\bat\bt (int i\n- , std::int64_t default_val = 0) const;\n-bdecode_node l\bli\bis\bst\bt_\b_a\bat\bt (int i) const;\n-functions with the list_ prefix operate on lists. These functions are only\n-valid if type() == list_t. list_at() returns the item in the list at index i. i\n-may not be greater than or equal to the size of the list. size() returns the\n-size of the list.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_s\bst\btr\bri\bin\bng\bg_\b_v\bva\bal\blu\bue\be(\b()\b) d\bdi\bic\bct\bt_\b_a\bat\bt(\b()\b) d\bdi\bic\bct\bt_\b_a\bat\bt_\b_n\bno\bod\bde\be(\b()\b) d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd(\b()\b)\n-d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_l\bli\bis\bst\bt(\b()\b) d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_i\bin\bnt\bt_\b_v\bva\bal\blu\bue\be(\b()\b) d\bdi\bic\bct\bt_\b_s\bsi\biz\bze\be(\b()\b) d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_i\bin\bnt\bt(\b()\b)\n-d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_s\bst\btr\bri\bin\bng\bg(\b()\b) d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_d\bdi\bic\bct\bt(\b()\b) *\b**\b**\b**\b**\b*\n-std::pair d\bdi\bic\bct\bt_\b_a\bat\bt (int i) const;\n-bdecode_node d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_d\bdi\bic\bct\bt (string_view key) const;\n-bdecode_node d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_l\bli\bis\bst\bt (string_view key) const;\n-bdecode_node d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_i\bin\bnt\bt (string_view key) const;\n-string_view d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_s\bst\btr\bri\bin\bng\bg_\b_v\bva\bal\blu\bue\be (string_view key\n- , string_view default_value = string_view()) const;\n-bdecode_node d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_s\bst\btr\bri\bin\bng\bg (string_view key) const;\n-std::int64_t d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_i\bin\bnt\bt_\b_v\bva\bal\blu\bue\be (string_view key\n- , std::int64_t default_val = 0) const;\n-int d\bdi\bic\bct\bt_\b_s\bsi\biz\bze\be () const;\n-bdecode_node d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd (string_view key) const;\n-std::pair d\bdi\bic\bct\bt_\b_a\bat\bt_\b_n\bno\bod\bde\be (int i) const;\n-Functions with the dict_ prefix operates on dictionaries. They are only valid\n-if type() == dict_t. In case a key you're looking up contains a 0 byte, you\n-cannot use the 0-terminated string overloads, but have to use string_view\n-instead. dict_find_list will return a valid bdecode_node if the key is found\n-_and_ it is a list. Otherwise it will return a default-constructed\n-_\bb_\bd_\be_\bc_\bo_\bd_\be_\b__\bn_\bo_\bd_\be.\n-Functions with the _value suffix return the value of the node directly, rather\n-than the nodes. In case the node is not found, or it has a different type, a\n-default value is returned (which can be specified).\n-dict_at() returns the (key, value)-pair at the specified index in a dictionary.\n-Keys are only allowed to be strings. dict_at_node() also returns the (key,\n-value)-pair, but the key is returned as a bdecode_node (and it will always be a\n-string).\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* i\bin\bnt\bt_\b_v\bva\bal\blu\bue\be(\b()\b) *\b**\b**\b**\b**\b*\n-std::int64_t i\bin\bnt\bt_\b_v\bva\bal\blu\bue\be () const;\n-this function is only valid if type() == int_t. It returns the value of the\n-integer.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* s\bst\btr\bri\bin\bng\bg_\b_o\bof\bff\bfs\bse\bet\bt(\b()\b) s\bst\btr\bri\bin\bng\bg_\b_l\ble\ben\bng\bgt\bth\bh(\b()\b) s\bst\btr\bri\bin\bng\bg_\b_p\bpt\btr\br(\b()\b) s\bst\btr\bri\bin\bng\bg_\b_v\bva\bal\blu\bue\be(\b()\b) *\b**\b**\b**\b**\b*\n-string_view s\bst\btr\bri\bin\bng\bg_\b_v\bva\bal\blu\bue\be () const;\n-std::ptrdiff_t s\bst\btr\bri\bin\bng\bg_\b_o\bof\bff\bfs\bse\bet\bt () const;\n-char const* s\bst\btr\bri\bin\bng\bg_\b_p\bpt\btr\br () const;\n-int s\bst\btr\bri\bin\bng\bg_\b_l\ble\ben\bng\bgt\bth\bh () const;\n-these functions are only valid if type() == string_t. They return the string\n-values. Note that string_ptr() is n\bno\bot\bt 0-terminated. string_length() returns the\n-number of bytes in the string. string_offset() returns the byte offset from the\n-start of the parsed bencoded buffer this string can be found.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* c\bcl\ble\bea\bar\br(\b()\b) *\b**\b**\b**\b**\b*\n-void c\bcl\ble\bea\bar\br ();\n-resets the bdecoded_node to a default constructed state. If this is an owning\n-node, the tree is freed and all child nodes are invalidated.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* s\bsw\bwa\bap\bp(\b()\b) *\b**\b**\b**\b**\b*\n-void s\bsw\bwa\bap\bp (bdecode_node& n);\n-Swap contents.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* r\bre\bes\bse\ber\brv\bve\be(\b()\b) *\b**\b**\b**\b**\b*\n-void r\bre\bes\bse\ber\brv\bve\be (int tokens);\n-preallocate memory for the specified numbers of tokens. This is useful if you\n-know approximately how many tokens are in the file you are about to parse.\n-Doing so will save realloc operations while parsing. You should only call this\n-on the root node, before passing it in to _\bb_\bd_\be_\bc_\bo_\bd_\be_\b(_\b).\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* s\bsw\bwi\bit\btc\bch\bh_\b_u\bun\bnd\bde\ber\brl\bly\byi\bin\bng\bg_\b_b\bbu\buf\bff\bfe\ber\br(\b()\b) *\b**\b**\b**\b**\b*\n-void s\bsw\bwi\bit\btc\bch\bh_\b_u\bun\bnd\bde\ber\brl\bly\byi\bin\bng\bg_\b_b\bbu\buf\bff\bfe\ber\br (char const* buf) noexcept;\n-this buffer M\bMU\bUS\bST\bT be identical to the one originally parsed. This operation is\n-only defined on owning root nodes, i.e. the one passed in to decode().\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* h\bha\bas\bs_\b_s\bso\bof\bft\bt_\b_e\ber\brr\bro\bor\br(\b()\b) *\b**\b**\b**\b**\b*\n-bool h\bha\bas\bs_\b_s\bso\bof\bft\bt_\b_e\ber\brr\bro\bor\br (span error) const;\n-returns true if there is a non-fatal error in the bencoding of this node or its\n-children\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* e\ben\bnu\bum\bm t\bty\byp\bpe\be_\b_t\bt *\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bb_\bd_\be_\bc_\bo_\bd_\be_\b._\bh_\bp_\bp\"\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n-|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|none_t |0 |uninitialized or default constructed. This is also used to|\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bi_\bn_\bd_\bi_\bc_\ba_\bt_\be_\b _\bt_\bh_\ba_\bt_\b _\ba_\b _\bn_\bo_\bd_\be_\b _\bw_\ba_\bs_\b _\bn_\bo_\bt_\b _\bf_\bo_\bu_\bn_\bd_\b _\bi_\bn_\b _\bs_\bo_\bm_\be_\b _\bc_\ba_\bs_\be_\bs_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bd_\bi_\bc_\bt_\b__\bt_\b _\b _\b|_\b1_\b _\b _\b _\b _\b|_\ba_\b _\bd_\bi_\bc_\bt_\bi_\bo_\bn_\ba_\br_\by_\b _\bn_\bo_\bd_\be_\b._\b _\bT_\bh_\be_\b _\bd_\bi_\bc_\bt_\b__\bf_\bi_\bn_\bd_\b__\b _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn_\bs_\b _\ba_\br_\be_\b _\bv_\ba_\bl_\bi_\bd_\b._\b _\b _\b _\b |\n-|_\bl_\bi_\bs_\bt_\b__\bt_\b _\b _\b|_\b2_\b _\b _\b _\b _\b|_\ba_\b _\bl_\bi_\bs_\bt_\b _\bn_\bo_\bd_\be_\b._\b _\bT_\bh_\be_\b _\bl_\bi_\bs_\bt_\b__\b _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn_\bs_\b _\ba_\br_\be_\b _\bv_\ba_\bl_\bi_\bd_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bs_\bt_\br_\bi_\bn_\bg_\b__\bt_\b|_\b3_\b _\b _\b _\b _\b|_\ba_\b _\bs_\bt_\br_\bi_\bn_\bg_\b _\bn_\bo_\bd_\be_\b,_\b _\bt_\bh_\be_\b _\bs_\bt_\br_\bi_\bn_\bg_\b__\b _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn_\bs_\b _\ba_\br_\be_\b _\bv_\ba_\bl_\bi_\bd_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bi_\bn_\bt_\b__\bt_\b _\b _\b _\b|_\b4_\b _\b _\b _\b _\b|_\ba_\bn_\b _\bi_\bn_\bt_\be_\bg_\be_\br_\b _\bn_\bo_\bd_\be_\b._\b _\bT_\bh_\be_\b _\bi_\bn_\bt_\b__\b _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn_\bs_\b _\ba_\br_\be_\b _\bv_\ba_\bl_\bi_\bd_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* p\bpr\bri\bin\bnt\bt_\b_e\ben\bnt\btr\bry\by(\b()\b) *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bb_\bd_\be_\bc_\bo_\bd_\be_\b._\bh_\bp_\bp\"\n-std::string p\bpr\bri\bin\bnt\bt_\b_e\ben\bnt\btr\bry\by (bdecode_node const& e\n- , bool single_line = false, int indent = 0);\n-print the bencoded structure in a human-readable format to a string that's\n-returned.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* b\bbd\bde\bec\bco\bod\bde\be(\b()\b) *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bb_\bd_\be_\bc_\bo_\bd_\be_\b._\bh_\bp_\bp\"\n-int b\bbd\bde\bec\bco\bod\bde\be (char const* start, char const* end, bdecode_node& ret\n- , error_code& ec, int* error_pos = nullptr, int depth_limit = 100\n- , int token_limit = 2000000);\n-bdecode_node b\bbd\bde\bec\bco\bod\bde\be (span buffer\n- , int depth_limit = 100, int token_limit = 2000000);\n-bdecode_node b\bbd\bde\bec\bco\bod\bde\be (span buffer\n- , error_code& ec, int* error_pos = nullptr, int depth_limit = 100\n- , int token_limit = 2000000);\n-This function decodes/parses bdecoded data (for example a .torrent file). The\n-data structure is returned in the ret argument. the buffer to parse is\n-specified by the start of the buffer as well as the end, i.e. one byte past the\n-end. If the buffer fails to parse, the function returns a non-zero value and\n-fills in ec with the error code. The optional argument error_pos, if set to\n-non-nullptr, will be set to the byte offset into the buffer where the parse\n-failure occurred.\n-depth_limit specifies the max number of nested lists or dictionaries are\n-allowed in the data structure. (This affects the stack usage of the function,\n-be careful not to set it too high).\n-token_limit is the max number of tokens allowed to be parsed from the buffer.\n-This is simply a sanity check to not have unbounded memory usage.\n-The resulting bdecode_node is an o\bow\bwn\bni\bin\bng\bg node. That means it will be holding the\n-whole parsed tree. When iterating lists and dictionaries, those bdecode_node\n-objects will simply have references to the root or owning bdecode_node. If the\n-root node is destructed, all other nodes that refer to anything in that tree\n-become invalid.\n-However, the underlying buffer passed in to this function (start, end) must\n-also remain valid while the bdecoded tree is used. The parsed tree produced by\n-this function does not copy any data out of the buffer, but simply produces\n-references back into it.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* h\bha\bas\bsh\bhe\ber\br *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bh_\ba_\bs_\bh_\be_\br_\b._\bh_\bp_\bp\"\n-this is a SHA-1 hash class.\n-You use it by first instantiating it, then call update() to feed it with data.\n-i.e. you don't have to keep the entire buffer of which you want to create the\n-hash in memory. You can feed the _\bh_\ba_\bs_\bh_\be_\br parts of it at a time. When You have\n-fed the _\bh_\ba_\bs_\bh_\be_\br with all the data, you call final() and it will return the sha1-\n-hash of the data.\n-The constructor that takes a char const* and an integer will construct the sha1\n-context and feed it the data passed in.\n-If you want to reuse the _\bh_\ba_\bs_\bh_\be_\br object once you have created a hash, you have\n-to call reset() to reinitialize it.\n-The built-in software version of sha1-algorithm was implemented by Steve Reid\n-and released as public domain. For more info, see src/sha1.cpp.\n-class hasher\n-{\n- h\bha\bas\bsh\bhe\ber\br ();\n- hasher& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (hasher const&) &;\n- h\bha\bas\bsh\bhe\ber\br (char const* data, int len);\n- h\bha\bas\bsh\bhe\ber\br (hasher const&);\n- explicit h\bha\bas\bsh\bhe\ber\br (span data);\n- hasher& u\bup\bpd\bda\bat\bte\be (span data);\n- hasher& u\bup\bpd\bda\bat\bte\be (char const* data, int len);\n- sha1_hash f\bfi\bin\bna\bal\bl ();\n- void r\bre\bes\bse\bet\bt ();\n-};\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* o\bop\bpe\ber\bra\bat\bto\bor\br=\b=(\b()\b) h\bha\bas\bsh\bhe\ber\br(\b()\b) *\b**\b**\b**\b**\b*\n-hasher& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (hasher const&) &;\n-h\bha\bas\bsh\bhe\ber\br (char const* data, int len);\n-h\bha\bas\bsh\bhe\ber\br (hasher const&);\n-explicit h\bha\bas\bsh\bhe\ber\br (span data);\n-this is the same as default constructing followed by a call to update(data,\n-len).\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* u\bup\bpd\bda\bat\bte\be(\b()\b) *\b**\b**\b**\b**\b*\n-hasher& u\bup\bpd\bda\bat\bte\be (span data);\n-hasher& u\bup\bpd\bda\bat\bte\be (char const* data, int len);\n-append the following bytes to what is being hashed\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* f\bfi\bin\bna\bal\bl(\b()\b) *\b**\b**\b**\b**\b*\n-sha1_hash f\bfi\bin\bna\bal\bl ();\n-returns the SHA-1 digest of the buffers previously passed to _\bu_\bp_\bd_\ba_\bt_\be_\b(_\b) and the\n-_\bh_\ba_\bs_\bh_\be_\br constructor.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* r\bre\bes\bse\bet\bt(\b()\b) *\b**\b**\b**\b**\b*\n-void r\bre\bes\bse\bet\bt ();\n-restore the _\bh_\ba_\bs_\bh_\be_\br state to be as if the _\bh_\ba_\bs_\bh_\be_\br has just been default\n-constructed.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* h\bha\bas\bsh\bhe\ber\br2\b25\b56\b6 *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bh_\ba_\bs_\bh_\be_\br_\b._\bh_\bp_\bp\"\n-class hasher256\n-{\n- h\bha\bas\bsh\bhe\ber\br2\b25\b56\b6 ();\n- hasher256& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (hasher256 const&) &;\n- h\bha\bas\bsh\bhe\ber\br2\b25\b56\b6 (char const* data, int len);\n- explicit h\bha\bas\bsh\bhe\ber\br2\b25\b56\b6 (span data);\n- h\bha\bas\bsh\bhe\ber\br2\b25\b56\b6 (hasher256 const&);\n- hasher256& u\bup\bpd\bda\bat\bte\be (span data);\n- hasher256& u\bup\bpd\bda\bat\bte\be (char const* data, int len);\n- sha256_hash f\bfi\bin\bna\bal\bl ();\n- void r\bre\bes\bse\bet\bt ();\n- ~\b~h\bha\bas\bsh\bhe\ber\br2\b25\b56\b6 ();\n-};\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* h\bha\bas\bsh\bhe\ber\br2\b25\b56\b6(\b()\b) o\bop\bpe\ber\bra\bat\bto\bor\br=\b=(\b()\b) *\b**\b**\b**\b**\b*\n-hasher256& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (hasher256 const&) &;\n-h\bha\bas\bsh\bhe\ber\br2\b25\b56\b6 (char const* data, int len);\n-explicit h\bha\bas\bsh\bhe\ber\br2\b25\b56\b6 (span data);\n-h\bha\bas\bsh\bhe\ber\br2\b25\b56\b6 (hasher256 const&);\n-this is the same as default constructing followed by a call to update(data,\n-len).\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* u\bup\bpd\bda\bat\bte\be(\b()\b) *\b**\b**\b**\b**\b*\n-hasher256& u\bup\bpd\bda\bat\bte\be (span data);\n-hasher256& u\bup\bpd\bda\bat\bte\be (char const* data, int len);\n-append the following bytes to what is being hashed\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* f\bfi\bin\bna\bal\bl(\b()\b) *\b**\b**\b**\b**\b*\n-sha256_hash f\bfi\bin\bna\bal\bl ();\n-returns the SHA-1 digest of the buffers previously passed to _\bu_\bp_\bd_\ba_\bt_\be_\b(_\b) and the\n-_\bh_\ba_\bs_\bh_\be_\br constructor.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* r\bre\bes\bse\bet\bt(\b()\b) *\b**\b**\b**\b**\b*\n-void r\bre\bes\bse\bet\bt ();\n-restore the _\bh_\ba_\bs_\bh_\be_\br state to be as if the _\bh_\ba_\bs_\bh_\be_\br has just been default\n-constructed.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* b\bbi\bit\btf\bfi\bie\bel\bld\bd *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd_\b._\bh_\bp_\bp\"\n-The _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd type stores any number of bits as a _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd in a heap allocated\n-array.\n-struct bitfield\n-{\n- b\bbi\bit\btf\bfi\bie\bel\bld\bd () noexcept = default;\n- b\bbi\bit\btf\bfi\bie\bel\bld\bd (char const* b, int bits);\n- b\bbi\bit\btf\bfi\bie\bel\bld\bd (bitfield&& rhs) noexcept = default;\n- explicit b\bbi\bit\btf\bfi\bie\bel\bld\bd (int bits);\n- b\bbi\bit\btf\bfi\bie\bel\bld\bd (int bits, bool val);\n- b\bbi\bit\btf\bfi\bie\bel\bld\bd (bitfield const& rhs);\n- void a\bas\bss\bsi\big\bgn\bn (char const* b, int const bits);\n- bool g\bge\bet\bt_\b_b\bbi\bit\bt (int index) const noexcept;\n- bool o\bop\bpe\ber\bra\bat\bto\bor\br[\b[]\b] (int index) const noexcept;\n- void s\bse\bet\bt_\b_b\bbi\bit\bt (int index) noexcept;\n- void c\bcl\ble\bea\bar\br_\b_b\bbi\bit\bt (int index) noexcept;\n- bool a\bal\bll\bl_\b_s\bse\bet\bt () const noexcept;\n- bool n\bno\bon\bne\be_\b_s\bse\bet\bt () const noexcept;\n- int s\bsi\biz\bze\be () const noexcept;\n- int n\bnu\bum\bm_\b_w\bwo\bor\brd\bds\bs () const noexcept;\n- int n\bnu\bum\bm_\b_b\bby\byt\bte\bes\bs () const noexcept;\n- bool e\bem\bmp\bpt\bty\by () const noexcept;\n- char* d\bda\bat\bta\ba () noexcept;\n- char const* d\bda\bat\bta\ba () const noexcept;\n- void s\bsw\bwa\bap\bp (bitfield& rhs) noexcept;\n- int c\bco\bou\bun\bnt\bt () const noexcept;\n- int f\bfi\bin\bnd\bd_\b_f\bfi\bir\brs\bst\bt_\b_s\bse\bet\bt () const noexcept;\n- int f\bfi\bin\bnd\bd_\b_l\bla\bas\bst\bt_\b_c\bcl\ble\bea\bar\br () const noexcept;\n- bool o\bop\bpe\ber\bra\bat\bto\bor\br=\b==\b= (lt::bitfield const& rhs) const;\n-};\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* b\bbi\bit\btf\bfi\bie\bel\bld\bd(\b()\b) *\b**\b**\b**\b**\b*\n-b\bbi\bit\btf\bfi\bie\bel\bld\bd () noexcept = default;\n-b\bbi\bit\btf\bfi\bie\bel\bld\bd (char const* b, int bits);\n-b\bbi\bit\btf\bfi\bie\bel\bld\bd (bitfield&& rhs) noexcept = default;\n-explicit b\bbi\bit\btf\bfi\bie\bel\bld\bd (int bits);\n-b\bbi\bit\btf\bfi\bie\bel\bld\bd (int bits, bool val);\n-b\bbi\bit\btf\bfi\bie\bel\bld\bd (bitfield const& rhs);\n-constructs a new _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd. The default constructor creates an empty _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd.\n-bits is the size of the _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd (specified in bits). val is the value to\n-initialize the bits to. If not specified all bits are initialized to 0.\n-The constructor taking a pointer b and bits copies a _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd from the\n-specified buffer, and bits number of bits (rounded up to the nearest byte\n-boundary).\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* a\bas\bss\bsi\big\bgn\bn(\b()\b) *\b**\b**\b**\b**\b*\n-void a\bas\bss\bsi\big\bgn\bn (char const* b, int const bits);\n-copy _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd from buffer b of bits number of bits, rounded up to the nearest\n-byte boundary.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* o\bop\bpe\ber\bra\bat\bto\bor\br[\b[]\b](\b()\b) g\bge\bet\bt_\b_b\bbi\bit\bt(\b()\b) *\b**\b**\b**\b**\b*\n-bool g\bge\bet\bt_\b_b\bbi\bit\bt (int index) const noexcept;\n-bool o\bop\bpe\ber\bra\bat\bto\bor\br[\b[]\b] (int index) const noexcept;\n-query bit at index. Returns true if bit is 1, otherwise false.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* c\bcl\ble\bea\bar\br_\b_b\bbi\bit\bt(\b()\b) s\bse\bet\bt_\b_b\bbi\bit\bt(\b()\b) *\b**\b**\b**\b**\b*\n-void s\bse\bet\bt_\b_b\bbi\bit\bt (int index) noexcept;\n-void c\bcl\ble\bea\bar\br_\b_b\bbi\bit\bt (int index) noexcept;\n-set bit at index to 0 (clear_bit) or 1 (set_bit).\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* a\bal\bll\bl_\b_s\bse\bet\bt(\b()\b) *\b**\b**\b**\b**\b*\n-bool a\bal\bll\bl_\b_s\bse\bet\bt () const noexcept;\n-returns true if all bits in the _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd are set\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* n\bno\bon\bne\be_\b_s\bse\bet\bt(\b()\b) *\b**\b**\b**\b**\b*\n-bool n\bno\bon\bne\be_\b_s\bse\bet\bt () const noexcept;\n-returns true if no bit in the _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd is set\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* s\bsi\biz\bze\be(\b()\b) *\b**\b**\b**\b**\b*\n-int s\bsi\biz\bze\be () const noexcept;\n-returns the size of the _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd in bits.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* n\bnu\bum\bm_\b_w\bwo\bor\brd\bds\bs(\b()\b) *\b**\b**\b**\b**\b*\n-int n\bnu\bum\bm_\b_w\bwo\bor\brd\bds\bs () const noexcept;\n-returns the number of 32 bit words are needed to represent all bits in this\n-_\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* n\bnu\bum\bm_\b_b\bby\byt\bte\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n-int n\bnu\bum\bm_\b_b\bby\byt\bte\bes\bs () const noexcept;\n-returns the number of bytes needed to represent all bits in this _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* e\bem\bmp\bpt\bty\by(\b()\b) *\b**\b**\b**\b**\b*\n-bool e\bem\bmp\bpt\bty\by () const noexcept;\n-returns true if the _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd has zero size.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* d\bda\bat\bta\ba(\b()\b) *\b**\b**\b**\b**\b*\n-char* d\bda\bat\bta\ba () noexcept;\n-char const* d\bda\bat\bta\ba () const noexcept;\n-returns a pointer to the internal buffer of the _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd, or nullptr if it's\n-empty.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* s\bsw\bwa\bap\bp(\b()\b) *\b**\b**\b**\b**\b*\n-void s\bsw\bwa\bap\bp (bitfield& rhs) noexcept;\n-swaps the bit-fields two variables refer to\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* c\bco\bou\bun\bnt\bt(\b()\b) *\b**\b**\b**\b**\b*\n-int c\bco\bou\bun\bnt\bt () const noexcept;\n-count the number of bits in the _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd that are set to 1.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* f\bfi\bin\bnd\bd_\b_f\bfi\bir\brs\bst\bt_\b_s\bse\bet\bt(\b()\b) *\b**\b**\b**\b**\b*\n-int f\bfi\bin\bnd\bd_\b_f\bfi\bir\brs\bst\bt_\b_s\bse\bet\bt () const noexcept;\n-returns the index of the first set bit in the _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd, i.e. 1 bit.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* f\bfi\bin\bnd\bd_\b_l\bla\bas\bst\bt_\b_c\bcl\ble\bea\bar\br(\b()\b) *\b**\b**\b**\b**\b*\n-int f\bfi\bin\bnd\bd_\b_l\bla\bas\bst\bt_\b_c\bcl\ble\bea\bar\br () const noexcept;\n-returns the index to the last cleared bit in the _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd, i.e. 0 bit.\n The _\bp_\bo_\bp_\b__\ba_\bl_\be_\br_\bt_\bs_\b(_\b) function on _\bs_\be_\bs_\bs_\bi_\bo_\bn is the main interface for retrieving\n alerts (warnings, messages and errors from libtorrent). If no alerts have been\n posted by libtorrent _\bp_\bo_\bp_\b__\ba_\bl_\be_\br_\bt_\bs_\b(_\b) will return an empty list.\n By default, only errors are reported. _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk_\b:_\b:_\ba_\bl_\be_\br_\bt_\b__\bm_\ba_\bs_\bk can be used to\n specify which kinds of events should be reported. The _\ba_\bl_\be_\br_\bt mask is a\n combination of the _\ba_\bl_\be_\br_\bt_\b__\bc_\ba_\bt_\be_\bg_\bo_\br_\by_\b__\bt flags in the _\ba_\bl_\be_\br_\bt class.\n Every _\ba_\bl_\be_\br_\bt belongs to one or more category. There is a cost associated with\n@@ -4085,14 +647,103 @@\n that are generated for a specific torrent are derived from _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\ba_\bl_\be_\br_\bt, and\n tracker events derive from _\bt_\br_\ba_\bc_\bk_\be_\br_\b__\ba_\bl_\be_\br_\bt.\n Alerts returned by _\bp_\bo_\bp_\b__\ba_\bl_\be_\br_\bt_\bs_\b(_\b) are only valid until the next call to\n _\bp_\bo_\bp_\b__\ba_\bl_\be_\br_\bt_\bs_\b(_\b). You may not copy an _\ba_\bl_\be_\br_\bt object to access it after the next call\n to _\bp_\bo_\bp_\b__\ba_\bl_\be_\br_\bt_\bs_\b(_\b). Internal members of alerts also become invalid once _\bp_\bo_\bp_\b__\ba_\bl_\be_\br_\bt_\bs\n _\b(_\b) is called again.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* a\bal\ble\ber\brt\bt *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bl_\be_\br_\bt_\b._\bh_\bp_\bp\"\n+The alert class is the base class that specific messages are derived from.\n+_\ba_\bl_\be_\br_\bt types are not copyable, and cannot be constructed by the client. The\n+pointers returned by libtorrent are short lived (the details are described\n+under _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bh_\ba_\bn_\bd_\bl_\be_\b:_\b:_\bp_\bo_\bp_\b__\ba_\bl_\be_\br_\bt_\bs_\b(_\b))\n+struct alert\n+{\n+ time_point t\bti\bim\bme\bes\bst\bta\bam\bmp\bp () const;\n+ virtual int t\bty\byp\bpe\be () const noexcept = 0;\n+ virtual char const* w\bwh\bha\bat\bt () const noexcept = 0;\n+ virtual std::string m\bme\bes\bss\bsa\bag\bge\be () const = 0;\n+ virtual alert_category_t c\bca\bat\bte\beg\bgo\bor\bry\by () const noexcept = 0;\n+\n+ static constexpr alert_category_t e\ber\brr\bro\bor\br_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 0_bit;\n+ static constexpr alert_category_t p\bpe\bee\ber\br_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 1_bit;\n+ static constexpr alert_category_t p\bpo\bor\brt\bt_\b_m\bma\bap\bpp\bpi\bin\bng\bg_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 2_bit;\n+ static constexpr alert_category_t s\bst\bto\bor\bra\bag\bge\be_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 3_bit;\n+ static constexpr alert_category_t t\btr\bra\bac\bck\bke\ber\br_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 4_bit;\n+ static constexpr alert_category_t c\bco\bon\bnn\bne\bec\bct\bt_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 5_bit;\n+ static constexpr alert_category_t s\bst\bta\bat\btu\bus\bs_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 6_bit;\n+ static constexpr alert_category_t i\bip\bp_\b_b\bbl\blo\boc\bck\bk_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 8_bit;\n+ static constexpr alert_category_t p\bpe\ber\brf\bfo\bor\brm\bma\ban\bnc\bce\be_\b_w\bwa\bar\brn\bni\bin\bng\bg = 9_bit;\n+ static constexpr alert_category_t d\bdh\bht\bt_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 10_bit;\n+ static constexpr alert_category_t s\bse\bes\bss\bsi\bio\bon\bn_\b_l\blo\bog\bg_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 13_bit;\n+ static constexpr alert_category_t t\bto\bor\brr\bre\ben\bnt\bt_\b_l\blo\bog\bg_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 14_bit;\n+ static constexpr alert_category_t p\bpe\bee\ber\br_\b_l\blo\bog\bg_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 15_bit;\n+ static constexpr alert_category_t i\bin\bnc\bco\bom\bmi\bin\bng\bg_\b_r\bre\beq\bqu\bue\bes\bst\bt_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 16_bit;\n+ static constexpr alert_category_t d\bdh\bht\bt_\b_l\blo\bog\bg_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 17_bit;\n+ static constexpr alert_category_t d\bdh\bht\bt_\b_o\bop\bpe\ber\bra\bat\bti\bio\bon\bn_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 18_bit;\n+ static constexpr alert_category_t p\bpo\bor\brt\bt_\b_m\bma\bap\bpp\bpi\bin\bng\bg_\b_l\blo\bog\bg_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 19_bit;\n+ static constexpr alert_category_t p\bpi\bic\bck\bke\ber\br_\b_l\blo\bog\bg_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 20_bit;\n+ static constexpr alert_category_t f\bfi\bil\ble\be_\b_p\bpr\bro\bog\bgr\bre\bes\bss\bs_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 21_bit;\n+ static constexpr alert_category_t p\bpi\bie\bec\bce\be_\b_p\bpr\bro\bog\bgr\bre\bes\bss\bs_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 22_bit;\n+ static constexpr alert_category_t u\bup\bpl\blo\boa\bad\bd_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 23_bit;\n+ static constexpr alert_category_t b\bbl\blo\boc\bck\bk_\b_p\bpr\bro\bog\bgr\bre\bes\bss\bs_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 24_bit;\n+ static constexpr alert_category_t a\bal\bll\bl_\b_c\bca\bat\bte\beg\bgo\bor\bri\bie\bes\bs = alert_category_t::all();\n+};\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* t\bti\bim\bme\bes\bst\bta\bam\bmp\bp(\b()\b) *\b**\b**\b**\b**\b*\n+time_point t\bti\bim\bme\bes\bst\bta\bam\bmp\bp () const;\n+a timestamp is automatically created in the constructor\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* t\bty\byp\bpe\be(\b()\b) *\b**\b**\b**\b**\b*\n+virtual int t\bty\byp\bpe\be () const noexcept = 0;\n+returns an integer that is unique to this _\ba_\bl_\be_\br_\bt type. It can be compared\n+against a specific _\ba_\bl_\be_\br_\bt by querying a static constant called alert_type in the\n+_\ba_\bl_\be_\br_\bt. It can be used to determine the run-time type of an alert* in order to\n+cast to that _\ba_\bl_\be_\br_\bt type and access specific members.\n+e.g:\n+std::vector alerts;\n+ses.pop_alerts(&alerts);\n+for (alert* a : alerts) {\n+ switch (a->type()) {\n+\n+ case read_piece_alert::alert_type:\n+ {\n+ auto* p = static_cast(a);\n+ if (p->ec) {\n+ // read_piece failed\n+ break;\n+ }\n+ // use p\n+ break;\n+ }\n+ case file_renamed_alert::alert_type:\n+ {\n+ // etc...\n+ }\n+ }\n+}\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* w\bwh\bha\bat\bt(\b()\b) *\b**\b**\b**\b**\b*\n+virtual char const* w\bwh\bha\bat\bt () const noexcept = 0;\n+returns a string literal describing the type of the _\ba_\bl_\be_\br_\bt. It does not include\n+any information that might be bundled with the _\ba_\bl_\be_\br_\bt.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* m\bme\bes\bss\bsa\bag\bge\be(\b()\b) *\b**\b**\b**\b**\b*\n+virtual std::string m\bme\bes\bss\bsa\bag\bge\be () const = 0;\n+generate a string describing the _\ba_\bl_\be_\br_\bt and the information bundled with it.\n+This is mainly intended for debug and development use. It is not suitable to\n+use this for applications that may be localized. Instead, handle each _\ba_\bl_\be_\br_\bt\n+type individually and extract and render the information from the _\ba_\bl_\be_\br_\bt\n+depending on the locale.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* c\bca\bat\bte\beg\bgo\bor\bry\by(\b()\b) *\b**\b**\b**\b**\b*\n+virtual alert_category_t c\bca\bat\bte\beg\bgo\bor\bry\by () const noexcept = 0;\n+returns a bitmask specifying which categories this _\ba_\bl_\be_\br_\bt belong to.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* d\bdh\bht\bt_\b_r\bro\bou\but\bti\bin\bng\bg_\b_b\bbu\buc\bck\bke\bet\bt *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bl_\be_\br_\bt_\b__\bt_\by_\bp_\be_\bs_\b._\bh_\bp_\bp\"\n struct to hold information about a single DHT routing table bucket\n struct dht_routing_bucket\n {\n int num_nodes;\n int num_replacements;\n@@ -6228,17 +2879,17 @@\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bl_\be_\br_\bt_\b__\bt_\by_\bp_\be_\bs_\b._\bh_\bp_\bp\"\n this _\ba_\bl_\be_\br_\bt is posted to indicate to the client that some alerts were dropped.\n Dropped meaning that the _\ba_\bl_\be_\br_\bt failed to be delivered to the client. The most\n common cause of such failure is that the internal _\ba_\bl_\be_\br_\bt queue grew too big\n (controlled by alert_queue_size).\n struct alerts_dropped_alert final : alert\n {\n+ std::string m\bme\bes\bss\bsa\bag\bge\be () const override;\n s\bst\bta\bat\bti\bic\bc_\b_a\bas\bss\bse\ber\brt\bt (num_alert_types <= abi_alert_count, \"need to increase bitset.\n This is an ABI break\");\n- std::string m\bme\bes\bss\bsa\bag\bge\be () const override;\n \n static constexpr alert_category_t s\bst\bta\bat\bti\bic\bc_\b_c\bca\bat\bte\beg\bgo\bor\bry\by = alert_category::error;\n std::bitset dropped_alerts;\n };\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n dropped_alerts\n a bitmask indicating which alerts were dropped. Each bit represents the\n@@ -6406,118 +3057,29 @@\n static constexpr alert_category_t s\bst\bta\bat\bti\bic\bc_\b_c\bca\bat\bte\beg\bgo\bor\bry\by = alert_category::status;\n std::vector trackers;\n };\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n trackers\n list of trackers and their status for the torrent\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* a\bal\ble\ber\brt\bt *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bl_\be_\br_\bt_\b._\bh_\bp_\bp\"\n-The alert class is the base class that specific messages are derived from.\n-_\ba_\bl_\be_\br_\bt types are not copyable, and cannot be constructed by the client. The\n-pointers returned by libtorrent are short lived (the details are described\n-under _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bh_\ba_\bn_\bd_\bl_\be_\b:_\b:_\bp_\bo_\bp_\b__\ba_\bl_\be_\br_\bt_\bs_\b(_\b))\n-struct alert\n-{\n- time_point t\bti\bim\bme\bes\bst\bta\bam\bmp\bp () const;\n- virtual int t\bty\byp\bpe\be () const noexcept = 0;\n- virtual char const* w\bwh\bha\bat\bt () const noexcept = 0;\n- virtual std::string m\bme\bes\bss\bsa\bag\bge\be () const = 0;\n- virtual alert_category_t c\bca\bat\bte\beg\bgo\bor\bry\by () const noexcept = 0;\n-\n- static constexpr alert_category_t e\ber\brr\bro\bor\br_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 0_bit;\n- static constexpr alert_category_t p\bpe\bee\ber\br_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 1_bit;\n- static constexpr alert_category_t p\bpo\bor\brt\bt_\b_m\bma\bap\bpp\bpi\bin\bng\bg_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 2_bit;\n- static constexpr alert_category_t s\bst\bto\bor\bra\bag\bge\be_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 3_bit;\n- static constexpr alert_category_t t\btr\bra\bac\bck\bke\ber\br_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 4_bit;\n- static constexpr alert_category_t c\bco\bon\bnn\bne\bec\bct\bt_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 5_bit;\n- static constexpr alert_category_t s\bst\bta\bat\btu\bus\bs_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 6_bit;\n- static constexpr alert_category_t i\bip\bp_\b_b\bbl\blo\boc\bck\bk_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 8_bit;\n- static constexpr alert_category_t p\bpe\ber\brf\bfo\bor\brm\bma\ban\bnc\bce\be_\b_w\bwa\bar\brn\bni\bin\bng\bg = 9_bit;\n- static constexpr alert_category_t d\bdh\bht\bt_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 10_bit;\n- static constexpr alert_category_t s\bse\bes\bss\bsi\bio\bon\bn_\b_l\blo\bog\bg_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 13_bit;\n- static constexpr alert_category_t t\bto\bor\brr\bre\ben\bnt\bt_\b_l\blo\bog\bg_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 14_bit;\n- static constexpr alert_category_t p\bpe\bee\ber\br_\b_l\blo\bog\bg_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 15_bit;\n- static constexpr alert_category_t i\bin\bnc\bco\bom\bmi\bin\bng\bg_\b_r\bre\beq\bqu\bue\bes\bst\bt_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 16_bit;\n- static constexpr alert_category_t d\bdh\bht\bt_\b_l\blo\bog\bg_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 17_bit;\n- static constexpr alert_category_t d\bdh\bht\bt_\b_o\bop\bpe\ber\bra\bat\bti\bio\bon\bn_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 18_bit;\n- static constexpr alert_category_t p\bpo\bor\brt\bt_\b_m\bma\bap\bpp\bpi\bin\bng\bg_\b_l\blo\bog\bg_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 19_bit;\n- static constexpr alert_category_t p\bpi\bic\bck\bke\ber\br_\b_l\blo\bog\bg_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 20_bit;\n- static constexpr alert_category_t f\bfi\bil\ble\be_\b_p\bpr\bro\bog\bgr\bre\bes\bss\bs_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 21_bit;\n- static constexpr alert_category_t p\bpi\bie\bec\bce\be_\b_p\bpr\bro\bog\bgr\bre\bes\bss\bs_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 22_bit;\n- static constexpr alert_category_t u\bup\bpl\blo\boa\bad\bd_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 23_bit;\n- static constexpr alert_category_t b\bbl\blo\boc\bck\bk_\b_p\bpr\bro\bog\bgr\bre\bes\bss\bs_\b_n\bno\bot\bti\bif\bfi\bic\bca\bat\bti\bio\bon\bn = 24_bit;\n- static constexpr alert_category_t a\bal\bll\bl_\b_c\bca\bat\bte\beg\bgo\bor\bri\bie\bes\bs = alert_category_t::all();\n-};\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* t\bti\bim\bme\bes\bst\bta\bam\bmp\bp(\b()\b) *\b**\b**\b**\b**\b*\n-time_point t\bti\bim\bme\bes\bst\bta\bam\bmp\bp () const;\n-a timestamp is automatically created in the constructor\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* t\bty\byp\bpe\be(\b()\b) *\b**\b**\b**\b**\b*\n-virtual int t\bty\byp\bpe\be () const noexcept = 0;\n-returns an integer that is unique to this _\ba_\bl_\be_\br_\bt type. It can be compared\n-against a specific _\ba_\bl_\be_\br_\bt by querying a static constant called alert_type in the\n-_\ba_\bl_\be_\br_\bt. It can be used to determine the run-time type of an alert* in order to\n-cast to that _\ba_\bl_\be_\br_\bt type and access specific members.\n-e.g:\n-std::vector alerts;\n-ses.pop_alerts(&alerts);\n-for (alert* a : alerts) {\n- switch (a->type()) {\n-\n- case read_piece_alert::alert_type:\n- {\n- auto* p = static_cast(a);\n- if (p->ec) {\n- // read_piece failed\n- break;\n- }\n- // use p\n- break;\n- }\n- case file_renamed_alert::alert_type:\n- {\n- // etc...\n- }\n- }\n-}\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* w\bwh\bha\bat\bt(\b()\b) *\b**\b**\b**\b**\b*\n-virtual char const* w\bwh\bha\bat\bt () const noexcept = 0;\n-returns a string literal describing the type of the _\ba_\bl_\be_\br_\bt. It does not include\n-any information that might be bundled with the _\ba_\bl_\be_\br_\bt.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* m\bme\bes\bss\bsa\bag\bge\be(\b()\b) *\b**\b**\b**\b**\b*\n-virtual std::string m\bme\bes\bss\bsa\bag\bge\be () const = 0;\n-generate a string describing the _\ba_\bl_\be_\br_\bt and the information bundled with it.\n-This is mainly intended for debug and development use. It is not suitable to\n-use this for applications that may be localized. Instead, handle each _\ba_\bl_\be_\br_\bt\n-type individually and extract and render the information from the _\ba_\bl_\be_\br_\bt\n-depending on the locale.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* c\bca\bat\bte\beg\bgo\bor\bry\by(\b()\b) *\b**\b**\b**\b**\b*\n-virtual alert_category_t c\bca\bat\bte\beg\bgo\bor\bry\by () const noexcept = 0;\n-returns a bitmask specifying which categories this _\ba_\bl_\be_\br_\bt belong to.\n+*\b**\b**\b**\b**\b**\b* o\bop\bpe\ber\bra\bat\bti\bio\bon\bn_\b_n\bna\bam\bme\be(\b()\b) *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bo_\bp_\be_\br_\ba_\bt_\bi_\bo_\bn_\bs_\b._\bh_\bp_\bp\"\n+char const* o\bop\bpe\ber\bra\bat\bti\bio\bon\bn_\b_n\bna\bam\bme\be (operation_t op);\n+maps an operation id (from _\bp_\be_\be_\br_\b__\be_\br_\br_\bo_\br_\b__\ba_\bl_\be_\br_\bt and _\bp_\be_\be_\br_\b__\bd_\bi_\bs_\bc_\bo_\bn_\bn_\be_\bc_\bt_\be_\bd_\b__\ba_\bl_\be_\br_\bt) to its\n+name. See _\bo_\bp_\be_\br_\ba_\bt_\bi_\bo_\bn_\b__\bt for the constants\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* a\bal\ble\ber\brt\bt_\b_c\bca\bas\bst\bt(\b()\b) *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bl_\be_\br_\bt_\b._\bh_\bp_\bp\"\n-template T const* a\bal\ble\ber\brt\bt_\b_c\bca\bas\bst\bt (alert const* a);\n template T* a\bal\ble\ber\brt\bt_\b_c\bca\bas\bst\bt (alert* a);\n+template T const* a\bal\ble\ber\brt\bt_\b_c\bca\bas\bst\bt (alert const* a);\n When you get an _\ba_\bl_\be_\br_\bt, you can use alert_cast<> to attempt to cast the pointer\n to a specific _\ba_\bl_\be_\br_\bt type, in order to query it for more information.\n Note\n alert_cast<> can only cast to an exact _\ba_\bl_\be_\br_\bt type, not a base class\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* o\bop\bpe\ber\bra\bat\bti\bio\bon\bn_\b_n\bna\bam\bme\be(\b()\b) *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bo_\bp_\be_\br_\ba_\bt_\bi_\bo_\bn_\bs_\b._\bh_\bp_\bp\"\n-char const* o\bop\bpe\ber\bra\bat\bti\bio\bon\bn_\b_n\bna\bam\bme\be (operation_t op);\n-maps an operation id (from _\bp_\be_\be_\br_\b__\be_\br_\br_\bo_\br_\b__\ba_\bl_\be_\br_\bt and _\bp_\be_\be_\br_\b__\bd_\bi_\bs_\bc_\bo_\bn_\bn_\be_\bc_\bt_\be_\bd_\b__\ba_\bl_\be_\br_\bt) to its\n-name. See _\bo_\bp_\be_\br_\ba_\bt_\bi_\bo_\bn_\b__\bt for the constants\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* e\ben\bnu\bum\bm o\bop\bpe\ber\bra\bat\bti\bio\bon\bn_\b_t\bt *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bo_\bp_\be_\br_\ba_\bt_\bi_\bo_\bn_\bs_\b._\bh_\bp_\bp\"\n _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n |_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |unknown |0 |the error was unexpected and it is unknown which |\n |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bo_\bp_\be_\br_\ba_\bt_\bi_\bo_\bn_\b _\bc_\ba_\bu_\bs_\be_\bd_\b _\bi_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |bittorrent |1 |this is used when the bittorrent logic determines |\n@@ -6571,21 +3133,14 @@\n |_\be_\bn_\bu_\bm_\b__\br_\bo_\bu_\bt_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b4_\b2_\b _\b _\b _\b|_\be_\bn_\bu_\bm_\be_\br_\ba_\bt_\bi_\bo_\bn_\b _\bo_\bf_\b _\bn_\be_\bt_\bw_\bo_\br_\bk_\b _\br_\bo_\bu_\bt_\be_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |file_seek |43 |moving read/write position in a file, _\bo_\bp_\be_\br_\ba_\bt_\bi_\bo_\bn_\b__\bt_\b:_\b:|\n |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bh_\bo_\bs_\bt_\bn_\ba_\bm_\be_\b__\bl_\bo_\bo_\bk_\bu_\bp_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |_\bt_\bi_\bm_\be_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b4_\b4_\b _\b _\b _\b|_\ba_\bn_\b _\ba_\bs_\by_\bn_\bc_\b _\bw_\ba_\bi_\bt_\b _\bo_\bp_\be_\br_\ba_\bt_\bi_\bo_\bn_\b _\bo_\bn_\b _\ba_\b _\bt_\bi_\bm_\be_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |_\bf_\bi_\bl_\be_\b__\bm_\bm_\ba_\bp_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b4_\b5_\b _\b _\b _\b|_\bc_\ba_\bl_\bl_\b _\bt_\bo_\b _\bm_\bm_\ba_\bp_\b(_\b)_\b _\b(_\bo_\br_\b _\bw_\bi_\bn_\bd_\bo_\bw_\bs_\b _\bc_\bo_\bu_\bn_\bt_\be_\br_\bp_\ba_\br_\bt_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |_\bf_\bi_\bl_\be_\b__\bt_\br_\bu_\bn_\bc_\ba_\bt_\be_\b _\b _\b _\b _\b _\b _\b|_\b4_\b6_\b _\b _\b _\b|_\bc_\ba_\bl_\bl_\b _\bt_\bo_\b _\bf_\bt_\br_\bu_\bn_\bc_\ba_\bt_\be_\b(_\b)_\b _\b(_\bo_\br_\b _\bS_\be_\bt_\bE_\bn_\bd_\bO_\bf_\bF_\bi_\bl_\be_\b(_\b)_\b _\bo_\bn_\b _\bw_\bi_\bn_\bd_\bo_\bw_\bs_\b)_\b |\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* i\bin\bnt\bt *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bl_\be_\br_\bt_\b__\bt_\by_\bp_\be_\bs_\b._\bh_\bp_\bp\"\n- user_alert_id\n- user defined alerts should use IDs greater than this\n- num_alert_types\n- this constant represents \"max_alert_index\" + 1\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* a\bal\ble\ber\brt\bt_\b_c\bca\bat\bte\beg\bgo\bor\bry\by_\b_t\bt *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bl_\be_\br_\bt_\b._\bh_\bp_\bp\"\n error\n Enables alerts that report an error. This includes:\n * tracker errors\n * tracker warnings\n * file errors\n@@ -6656,14 +3211,2370 @@\n rejected, time-out and cancelled. This is likely to post alerts at a high\n rate.\n all\n The full bitmask, representing all available categories.\n since the enum is signed, make sure this isn't interpreted as -1. For\n instance, boost.python does that and fails when assigning it to an\n unsigned parameter.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* i\bin\bnt\bt *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bl_\be_\br_\bt_\b__\bt_\by_\bp_\be_\bs_\b._\bh_\bp_\bp\"\n+ user_alert_id\n+ user defined alerts should use IDs greater than this\n+ num_alert_types\n+ this constant represents \"max_alert_index\" + 1\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs_\b._\bh_\bp_\bp\"\n+The _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs is a parameters pack for configuring the _\bs_\be_\bs_\bs_\bi_\bo_\bn before it's\n+started.\n+struct session_params\n+{\n+ s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs (settings_pack&& sp);\n+ s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs (settings_pack const& sp);\n+ s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs ();\n+ s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs (settings_pack&& sp\n+ , std::vector> exts);\n+ s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs (settings_pack const& sp\n+ , std::vector> exts);\n+\n+ settings_pack settings;\n+ std::vector> extensions;\n+ dht::dht_state dht_state;\n+ dht::dht_storage_constructor_type dht_storage_constructor;\n+ disk_io_constructor_type disk_io_constructor;\n+ std::map ext_state;\n+ libtorrent::ip_filter ip_filter;\n+};\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs(\b()\b) *\b**\b**\b**\b**\b*\n+s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs (settings_pack&& sp);\n+s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs (settings_pack const& sp);\n+s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs ();\n+This constructor can be used to start with the default plugins (ut_metadata,\n+ut_pex and smart_ban). Pass a _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk to set the initial settings when\n+the _\bs_\be_\bs_\bs_\bi_\bo_\bn starts.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs(\b()\b) *\b**\b**\b**\b**\b*\n+s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs (settings_pack&& sp\n+ , std::vector> exts);\n+s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs (settings_pack const& sp\n+ , std::vector> exts);\n+This constructor helps to configure the set of initial plugins to be added to\n+the _\bs_\be_\bs_\bs_\bi_\bo_\bn before it's started.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ settings\n+ The settings to configure the _\bs_\be_\bs_\bs_\bi_\bo_\bn with\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ extensions\n+ the plugins to add to the _\bs_\be_\bs_\bs_\bi_\bo_\bn as it is constructed\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ dht_state\n+ DHT node ID and node addresses to bootstrap the DHT with.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ dht_storage_constructor\n+ function object to construct the storage object for DHT items.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ disk_io_constructor\n+ function object to create the disk I/O subsystem. Defaults to\n+ default_disk_io_constructor.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ ext_state\n+ this container can be used by extensions/plugins to store settings. It's\n+ primarily here to make it convenient to save and restore state across\n+ sessions, using _\br_\be_\ba_\bd_\b__\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs_\b(_\b) and _\bw_\br_\bi_\bt_\be_\b__\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs_\b(_\b).\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ ip_filter\n+ the IP filter to use for the _\bs_\be_\bs_\bs_\bi_\bo_\bn. This restricts which peers are\n+ allowed to connect. As if passed to _\bs_\be_\bt_\b__\bi_\bp_\b__\bf_\bi_\bl_\bt_\be_\br_\b(_\b).\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* s\bse\bes\bss\bsi\bio\bon\bn_\b_h\bha\ban\bnd\bdl\ble\be *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bh_\ba_\bn_\bd_\bl_\be_\b._\bh_\bp_\bp\"\n+this class provides a non-owning handle to a _\bs_\be_\bs_\bs_\bi_\bo_\bn and a subset of the\n+interface of the _\bs_\be_\bs_\bs_\bi_\bo_\bn class. If the underlying _\bs_\be_\bs_\bs_\bi_\bo_\bn is destructed any\n+handle to it will no longer be valid. _\bi_\bs_\b__\bv_\ba_\bl_\bi_\bd_\b(_\b) will return false and any\n+operation on it will throw a system_error exception, with error code\n+invalid_session_handle.\n+struct session_handle\n+{\n+ bool i\bis\bs_\b_v\bva\bal\bli\bid\bd () const;\n+ session_params s\bse\bes\bss\bsi\bio\bon\bn_\b_s\bst\bta\bat\bte\be (save_state_flags_t flags =\n+save_state_flags_t::all()) const;\n+ void r\bre\bef\bfr\bre\bes\bsh\bh_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_s\bst\bta\bat\btu\bus\bs (std::vector* ret\n+ , status_flags_t flags = {}) const;\n+ std::vector g\bge\bet\bt_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_s\bst\bta\bat\btu\bus\bs (\n+ std::function const& pred\n+ , status_flags_t flags = {}) const;\n+ void p\bpo\bos\bst\bt_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_u\bup\bpd\bda\bat\bte\bes\bs (status_flags_t flags = status_flags_t::all());\n+ void p\bpo\bos\bst\bt_\b_s\bse\bes\bss\bsi\bio\bon\bn_\b_s\bst\bta\bat\bts\bs ();\n+ void p\bpo\bos\bst\bt_\b_d\bdh\bht\bt_\b_s\bst\bta\bat\bts\bs ();\n+ void s\bse\bet\bt_\b_d\bdh\bht\bt_\b_s\bst\bta\bat\bte\be (dht::dht_state&& st);\n+ void s\bse\bet\bt_\b_d\bdh\bht\bt_\b_s\bst\bta\bat\bte\be (dht::dht_state const& st);\n+ std::vector g\bge\bet\bt_\b_t\bto\bor\brr\bre\ben\bnt\bts\bs () const;\n+ torrent_handle f\bfi\bin\bnd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt (sha1_hash const& info_hash) const;\n+ torrent_handle a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt (add_torrent_params const& params, error_code&\n+ec);\n+ torrent_handle a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt (add_torrent_params const& params);\n+ torrent_handle a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt (add_torrent_params&& params, error_code& ec);\n+ void a\bas\bsy\byn\bnc\bc_\b_a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt (add_torrent_params&& params);\n+ torrent_handle a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt (add_torrent_params&& params);\n+ void a\bas\bsy\byn\bnc\bc_\b_a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt (add_torrent_params const& params);\n+ void p\bpa\bau\bus\bse\be ();\n+ bool i\bis\bs_\b_p\bpa\bau\bus\bse\bed\bd () const;\n+ void r\bre\bes\bsu\bum\bme\be ();\n+ bool i\bis\bs_\b_d\bdh\bht\bt_\b_r\bru\bun\bnn\bni\bin\bng\bg () const;\n+ void s\bse\bet\bt_\b_d\bdh\bht\bt_\b_s\bst\bto\bor\bra\bag\bge\be (dht::dht_storage_constructor_type sc);\n+ void a\bad\bdd\bd_\b_d\bdh\bht\bt_\b_n\bno\bod\bde\be (std::pair const& node);\n+ void d\bdh\bht\bt_\b_g\bge\bet\bt_\b_i\bit\bte\bem\bm (sha1_hash const& target);\n+ void d\bdh\bht\bt_\b_g\bge\bet\bt_\b_i\bit\bte\bem\bm (std::array key\n+ , std::string salt = std::string());\n+ sha1_hash d\bdh\bht\bt_\b_p\bpu\but\bt_\b_i\bit\bte\bem\bm (entry data);\n+ void d\bdh\bht\bt_\b_p\bpu\but\bt_\b_i\bit\bte\bem\bm (std::array key\n+ , std::function&\n+ , std::int64_t&, std::string const&)> cb\n+ , std::string salt = std::string());\n+ void d\bdh\bht\bt_\b_g\bge\bet\bt_\b_p\bpe\bee\ber\brs\bs (sha1_hash const& info_hash);\n+ void d\bdh\bht\bt_\b_a\ban\bnn\bno\bou\bun\bnc\bce\be (sha1_hash const& info_hash, int port = 0, dht::\n+announce_flags_t flags = {});\n+ void d\bdh\bht\bt_\b_l\bli\biv\bve\be_\b_n\bno\bod\bde\bes\bs (sha1_hash const& nid);\n+ void d\bdh\bht\bt_\b_s\bsa\bam\bmp\bpl\ble\be_\b_i\bin\bnf\bfo\boh\bha\bas\bsh\bhe\bes\bs (udp::endpoint const& ep, sha1_hash const&\n+target);\n+ void d\bdh\bht\bt_\b_d\bdi\bir\bre\bec\bct\bt_\b_r\bre\beq\bqu\bue\bes\bst\bt (udp::endpoint const& ep, entry const& e,\n+client_data_t userdata = {});\n+ void a\bad\bdd\bd_\b_e\bex\bxt\bte\ben\bns\bsi\bio\bon\bn (std::function(\n+ torrent_handle const&, client_data_t)> ext);\n+ void a\bad\bdd\bd_\b_e\bex\bxt\bte\ben\bns\bsi\bio\bon\bn (std::shared_ptr ext);\n+ void s\bse\bet\bt_\b_i\bip\bp_\b_f\bfi\bil\blt\bte\ber\br (ip_filter f);\n+ ip_filter g\bge\bet\bt_\b_i\bip\bp_\b_f\bfi\bil\blt\bte\ber\br () const;\n+ void s\bse\bet\bt_\b_p\bpo\bor\brt\bt_\b_f\bfi\bil\blt\bte\ber\br (port_filter const& f);\n+ unsigned short l\bli\bis\bst\bte\ben\bn_\b_p\bpo\bor\brt\bt () const;\n+ bool i\bis\bs_\b_l\bli\bis\bst\bte\ben\bni\bin\bng\bg () const;\n+ unsigned short s\bss\bsl\bl_\b_l\bli\bis\bst\bte\ben\bn_\b_p\bpo\bor\brt\bt () const;\n+ ip_filter g\bge\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_f\bfi\bil\blt\bte\ber\br () const;\n+ void s\bse\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_f\bfi\bil\blt\bte\ber\br (ip_filter const& f);\n+ void s\bse\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_t\bty\byp\bpe\be_\b_f\bfi\bil\blt\bte\ber\br (peer_class_type_filter const& f);\n+ peer_class_type_filter g\bge\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_t\bty\byp\bpe\be_\b_f\bfi\bil\blt\bte\ber\br () const;\n+ peer_class_t c\bcr\bre\bea\bat\bte\be_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs (char const* name);\n+ void d\bde\bel\ble\bet\bte\be_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs (peer_class_t cid);\n+ peer_class_info g\bge\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs (peer_class_t cid) const;\n+ void s\bse\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs (peer_class_t cid, peer_class_info const& pci);\n+ void r\bre\bem\bmo\bov\bve\be_\b_t\bto\bor\brr\bre\ben\bnt\bt (const torrent_handle&, remove_flags_t = {});\n+ void a\bap\bpp\bpl\bly\by_\b_s\bse\bet\btt\bti\bin\bng\bgs\bs (settings_pack&&);\n+ settings_pack g\bge\bet\bt_\b_s\bse\bet\btt\bti\bin\bng\bgs\bs () const;\n+ void a\bap\bpp\bpl\bly\by_\b_s\bse\bet\btt\bti\bin\bng\bgs\bs (settings_pack const&);\n+ void p\bpo\bop\bp_\b_a\bal\ble\ber\brt\bts\bs (std::vector* alerts);\n+ void s\bse\bet\bt_\b_a\bal\ble\ber\brt\bt_\b_n\bno\bot\bti\bif\bfy\by (std::function const& fun);\n+ alert* w\bwa\bai\bit\bt_\b_f\bfo\bor\br_\b_a\bal\ble\ber\brt\bt (time_duration max_wait);\n+ std::vector a\bad\bdd\bd_\b_p\bpo\bor\brt\bt_\b_m\bma\bap\bpp\bpi\bin\bng\bg (portmap_protocol t, int\n+external_port, int local_port);\n+ void d\bde\bel\ble\bet\bte\be_\b_p\bpo\bor\brt\bt_\b_m\bma\bap\bpp\bpi\bin\bng\bg (port_mapping_t handle);\n+ void r\bre\beo\bop\bpe\ben\bn_\b_n\bne\bet\btw\bwo\bor\brk\bk_\b_s\bso\boc\bck\bke\bet\bts\bs (reopen_network_flags_t options =\n+reopen_map_ports);\n+ std::shared_ptr n\bna\bat\bti\biv\bve\be_\b_h\bha\ban\bnd\bdl\ble\be () const;\n+\n+ static constexpr save_state_flags_t s\bsa\bav\bve\be_\b_s\bse\bet\btt\bti\bin\bng\bgs\bs = 0_bit;\n+ static constexpr save_state_flags_t s\bsa\bav\bve\be_\b_d\bdh\bht\bt_\b_s\bst\bta\bat\bte\be = 2_bit;\n+ static constexpr save_state_flags_t s\bsa\bav\bve\be_\b_e\bex\bxt\bte\ben\bns\bsi\bio\bon\bn_\b_s\bst\bta\bat\bte\be = 11_bit;\n+ static constexpr save_state_flags_t s\bsa\bav\bve\be_\b_i\bip\bp_\b_f\bfi\bil\blt\bte\ber\br = 12_bit;\n+ static constexpr peer_class_t g\bgl\blo\bob\bba\bal\bl_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_i\bid\bd {0};\n+ static constexpr peer_class_t t\btc\bcp\bp_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_i\bid\bd {1};\n+ static constexpr peer_class_t l\blo\boc\bca\bal\bl_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_i\bid\bd {2};\n+ static constexpr remove_flags_t d\bde\bel\ble\bet\bte\be_\b_f\bfi\bil\ble\bes\bs = 0_bit;\n+ static constexpr remove_flags_t d\bde\bel\ble\bet\bte\be_\b_p\bpa\bar\brt\btf\bfi\bil\ble\be = 1_bit;\n+ static constexpr session_flags_t p\bpa\bau\bus\bse\bed\bd = 2_bit;\n+ static constexpr portmap_protocol u\bud\bdp\bp = portmap_protocol::udp;\n+ static constexpr portmap_protocol t\btc\bcp\bp = portmap_protocol::tcp;\n+ static constexpr reopen_network_flags_t r\bre\beo\bop\bpe\ben\bn_\b_m\bma\bap\bp_\b_p\bpo\bor\brt\bts\bs = 0_bit;\n+};\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* i\bis\bs_\b_v\bva\bal\bli\bid\bd(\b()\b) *\b**\b**\b**\b**\b*\n+bool i\bis\bs_\b_v\bva\bal\bli\bid\bd () const;\n+returns true if this handle refers to a valid _\bs_\be_\bs_\bs_\bi_\bo_\bn object. If the _\bs_\be_\bs_\bs_\bi_\bo_\bn\n+has been destroyed, all _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bh_\ba_\bn_\bd_\bl_\be objects will expire and not be valid.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* s\bse\bes\bss\bsi\bio\bon\bn_\b_s\bst\bta\bat\bte\be(\b()\b) *\b**\b**\b**\b**\b*\n+session_params s\bse\bes\bss\bsi\bio\bon\bn_\b_s\bst\bta\bat\bte\be (save_state_flags_t flags = save_state_flags_t::\n+all()) const;\n+returns the current _\bs_\be_\bs_\bs_\bi_\bo_\bn state. This can be passed to _\bw_\br_\bi_\bt_\be_\b__\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs_\b(_\b)\n+to save the state to disk and restored using _\br_\be_\ba_\bd_\b__\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs_\b(_\b) when\n+constructing a new _\bs_\be_\bs_\bs_\bi_\bo_\bn. The kind of state that's included is all settings,\n+the DHT routing table, possibly plugin-specific state. the flags parameter can\n+be used to only save certain parts of the _\bs_\be_\bs_\bs_\bi_\bo_\bn state\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* r\bre\bef\bfr\bre\bes\bsh\bh_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_s\bst\bta\bat\btu\bus\bs(\b()\b) g\bge\bet\bt_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_s\bst\bta\bat\btu\bus\bs(\b()\b) *\b**\b**\b**\b**\b*\n+void r\bre\bef\bfr\bre\bes\bsh\bh_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_s\bst\bta\bat\btu\bus\bs (std::vector* ret\n+ , status_flags_t flags = {}) const;\n+std::vector g\bge\bet\bt_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_s\bst\bta\bat\btu\bus\bs (\n+ std::function const& pred\n+ , status_flags_t flags = {}) const;\n+Note\n+these calls are potentially expensive and won't scale well with lots of\n+torrents. If you're concerned about performance, consider using\n+post_torrent_updates() instead.\n+get_torrent_status returns a vector of the _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bs_\bt_\ba_\bt_\bu_\bs for every torrent\n+which satisfies pred, which is a predicate function which determines if a\n+torrent should be included in the returned set or not. Returning true means it\n+should be included and false means excluded. The flags argument is the same as\n+to _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be_\b:_\b:_\bs_\bt_\ba_\bt_\bu_\bs_\b(_\b). Since pred is guaranteed to be called for every\n+torrent, it may be used to count the number of torrents of different categories\n+as well.\n+refresh_torrent_status takes a vector of _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bs_\bt_\ba_\bt_\bu_\bs structs (for instance\n+the same vector that was returned by _\bg_\be_\bt_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bs_\bt_\ba_\bt_\bu_\bs_\b(_\b) ) and refreshes the\n+status based on the handle member. It is possible to use this function by first\n+setting up a vector of default constructed torrent_status objects, only\n+initializing the handle member, in order to request the torrent status for\n+multiple torrents in a single call. This can save a significant amount of time\n+if you have a lot of torrents.\n+Any _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bs_\bt_\ba_\bt_\bu_\bs object whose handle member is not referring to a valid\n+torrent are ignored.\n+The intended use of these functions is to start off by calling\n+get_torrent_status() to get a list of all torrents that match your criteria.\n+Then call refresh_torrent_status() on that list. This will only refresh the\n+status for the torrents in your list, and thus ignore all other torrents you\n+might be running. This may save a significant amount of time, especially if the\n+number of torrents you're interested in is small. In order to keep your list of\n+interested torrents up to date, you can either call get_torrent_status() from\n+time to time, to include torrents you might have become interested in since the\n+last time. In order to stop refreshing a certain torrent, simply remove it from\n+the list.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* p\bpo\bos\bst\bt_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_u\bup\bpd\bda\bat\bte\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n+void p\bpo\bos\bst\bt_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_u\bup\bpd\bda\bat\bte\bes\bs (status_flags_t flags = status_flags_t::all());\n+This functions instructs the _\bs_\be_\bs_\bs_\bi_\bo_\bn to post the _\bs_\bt_\ba_\bt_\be_\b__\bu_\bp_\bd_\ba_\bt_\be_\b__\ba_\bl_\be_\br_\bt, containing\n+the status of all torrents whose state changed since the last time this\n+function was called.\n+Only torrents who has the state subscription flag set will be included. This\n+flag is on by default. See _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs. the flags argument is the same\n+as for _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be_\b:_\b:_\bs_\bt_\ba_\bt_\bu_\bs_\b(_\b). see status_flags_t in _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* p\bpo\bos\bst\bt_\b_s\bse\bes\bss\bsi\bio\bon\bn_\b_s\bst\bta\bat\bts\bs(\b()\b) *\b**\b**\b**\b**\b*\n+void p\bpo\bos\bst\bt_\b_s\bse\bes\bss\bsi\bio\bon\bn_\b_s\bst\bta\bat\bts\bs ();\n+This function will post a _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bs_\bt_\ba_\bt_\bs_\b__\ba_\bl_\be_\br_\bt object, containing a snapshot of\n+the performance _\bc_\bo_\bu_\bn_\bt_\be_\br_\bs from the internals of libtorrent. To interpret these\n+_\bc_\bo_\bu_\bn_\bt_\be_\br_\bs, query the _\bs_\be_\bs_\bs_\bi_\bo_\bn via _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bs_\bt_\ba_\bt_\bs_\b__\bm_\be_\bt_\br_\bi_\bc_\bs_\b(_\b).\n+For more information, see the _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b _\bs_\bt_\ba_\bt_\bi_\bs_\bt_\bi_\bc_\bs section.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* p\bpo\bos\bst\bt_\b_d\bdh\bht\bt_\b_s\bst\bta\bat\bts\bs(\b()\b) *\b**\b**\b**\b**\b*\n+void p\bpo\bos\bst\bt_\b_d\bdh\bht\bt_\b_s\bst\bta\bat\bts\bs ();\n+This will cause a _\bd_\bh_\bt_\b__\bs_\bt_\ba_\bt_\bs_\b__\ba_\bl_\be_\br_\bt to be posted.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* s\bse\bet\bt_\b_d\bdh\bht\bt_\b_s\bst\bta\bat\bte\be(\b()\b) *\b**\b**\b**\b**\b*\n+void s\bse\bet\bt_\b_d\bdh\bht\bt_\b_s\bst\bta\bat\bte\be (dht::dht_state&& st);\n+void s\bse\bet\bt_\b_d\bdh\bht\bt_\b_s\bst\bta\bat\bte\be (dht::dht_state const& st);\n+set the DHT state for the _\bs_\be_\bs_\bs_\bi_\bo_\bn. This will be taken into account the next\n+time the DHT is started, as if it had been passed in via the _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs on\n+startup.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* f\bfi\bin\bnd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt(\b()\b) g\bge\bet\bt_\b_t\bto\bor\brr\bre\ben\bnt\bts\bs(\b()\b) *\b**\b**\b**\b**\b*\n+std::vector g\bge\bet\bt_\b_t\bto\bor\brr\bre\ben\bnt\bts\bs () const;\n+torrent_handle f\bfi\bin\bnd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt (sha1_hash const& info_hash) const;\n+find_torrent() looks for a torrent with the given info-hash. In case there is\n+such a torrent in the _\bs_\be_\bs_\bs_\bi_\bo_\bn, a _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be to that torrent is returned. In\n+case the torrent cannot be found, an invalid _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be is returned.\n+See torrent_handle::is_valid() to know if the torrent was found or not.\n+get_torrents() returns a vector of torrent_handles to all the torrents\n+currently in the _\bs_\be_\bs_\bs_\bi_\bo_\bn.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* a\bas\bsy\byn\bnc\bc_\b_a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt(\b()\b) a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt(\b()\b) *\b**\b**\b**\b**\b*\n+torrent_handle a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt (add_torrent_params const& params, error_code& ec);\n+torrent_handle a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt (add_torrent_params const& params);\n+torrent_handle a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt (add_torrent_params&& params, error_code& ec);\n+void a\bas\bsy\byn\bnc\bc_\b_a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt (add_torrent_params&& params);\n+torrent_handle a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt (add_torrent_params&& params);\n+void a\bas\bsy\byn\bnc\bc_\b_a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt (add_torrent_params const& params);\n+You add torrents through the _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b) function where you give an object\n+with all the parameters. The _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b) overloads will block until the\n+torrent has been added (or failed to be added) and returns an error code and a\n+_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be. In order to add torrents more efficiently, consider using\n+_\ba_\bs_\by_\bn_\bc_\b__\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b) which returns immediately, without waiting for the torrent\n+to add. Notification of the torrent being added is sent as _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\ba_\bl_\be_\br_\bt.\n+The save_path field in _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs must be set to a valid path where the\n+files for the torrent will be saved. Even when using a custom storage, this\n+needs to be set to something. If the save_path is empty, the call to\n+_\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b) will throw a system_error exception.\n+The overload that does not take an error_code throws an exception on error and\n+is not available when building without exception support. The _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be\n+returned by _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b) can be used to retrieve information about the\n+torrent's progress, its peers etc. It is also used to abort a torrent.\n+If the torrent you are trying to add already exists in the _\bs_\be_\bs_\bs_\bi_\bo_\bn (is either\n+queued for checking, being checked or downloading) add_torrent() will throw\n+system_error which derives from std::exception unless duplicate_is_error is set\n+to false. In that case, _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b) will return the handle to the existing\n+torrent.\n+The _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs class has a flags field. It can be used to control what\n+state the new torrent will be added in. Common flags to want to control are\n+torrent_flags::paused and torrent_flags::auto_managed. In order to add a magnet\n+link that will just download the metadata, but no payload, set the\n+torrent_flags::upload_mode flag.\n+Special consideration has to be taken when adding hybrid torrents (i.e.\n+torrents that are BitTorrent v2 torrents that are backwards compatible with\n+v1). For more details, see _\bB_\bi_\bt_\bT_\bo_\br_\br_\be_\bn_\bt_\b _\bv_\b2_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\bs.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* p\bpa\bau\bus\bse\be(\b()\b) r\bre\bes\bsu\bum\bme\be(\b()\b) i\bis\bs_\b_p\bpa\bau\bus\bse\bed\bd(\b()\b) *\b**\b**\b**\b**\b*\n+void p\bpa\bau\bus\bse\be ();\n+bool i\bis\bs_\b_p\bpa\bau\bus\bse\bed\bd () const;\n+void r\bre\bes\bsu\bum\bme\be ();\n+Pausing the _\bs_\be_\bs_\bs_\bi_\bo_\bn has the same effect as pausing every torrent in it, except\n+that torrents will not be resumed by the auto-manage mechanism. Resuming will\n+restore the torrents to their previous paused state. i.e. the _\bs_\be_\bs_\bs_\bi_\bo_\bn pause\n+state is separate from the torrent pause state. A torrent is inactive if it is\n+paused or if the _\bs_\be_\bs_\bs_\bi_\bo_\bn is paused.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* i\bis\bs_\b_d\bdh\bht\bt_\b_r\bru\bun\bnn\bni\bin\bng\bg(\b()\b) *\b**\b**\b**\b**\b*\n+bool i\bis\bs_\b_d\bdh\bht\bt_\b_r\bru\bun\bnn\bni\bin\bng\bg () const;\n+is_dht_running() returns true if the DHT support has been started and false\n+otherwise.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* s\bse\bet\bt_\b_d\bdh\bht\bt_\b_s\bst\bto\bor\bra\bag\bge\be(\b()\b) *\b**\b**\b**\b**\b*\n+void s\bse\bet\bt_\b_d\bdh\bht\bt_\b_s\bst\bto\bor\bra\bag\bge\be (dht::dht_storage_constructor_type sc);\n+set_dht_storage set a dht custom storage constructor function to be used\n+internally when the dht is created.\n+Since the dht storage is a critical component for the dht behavior, this\n+function will only be effective the next time the dht is started. If you never\n+touch this feature, a default map-memory based storage is used.\n+If you want to make sure the dht is initially created with your custom storage,\n+create a _\bs_\be_\bs_\bs_\bi_\bo_\bn with the setting settings_pack::enable_dht to false, set your\n+constructor function and call apply_settings with settings_pack::enable_dht to\n+true.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_d\bdh\bht\bt_\b_n\bno\bod\bde\be(\b()\b) *\b**\b**\b**\b**\b*\n+void a\bad\bdd\bd_\b_d\bdh\bht\bt_\b_n\bno\bod\bde\be (std::pair const& node);\n+add_dht_node takes a host name and port pair. That endpoint will be pinged, and\n+if a valid DHT reply is received, the node will be added to the routing table.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* d\bdh\bht\bt_\b_g\bge\bet\bt_\b_i\bit\bte\bem\bm(\b()\b) *\b**\b**\b**\b**\b*\n+void d\bdh\bht\bt_\b_g\bge\bet\bt_\b_i\bit\bte\bem\bm (sha1_hash const& target);\n+query the DHT for an immutable item at the target hash. the result is posted as\n+a _\bd_\bh_\bt_\b__\bi_\bm_\bm_\bu_\bt_\ba_\bb_\bl_\be_\b__\bi_\bt_\be_\bm_\b__\ba_\bl_\be_\br_\bt.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* d\bdh\bht\bt_\b_g\bge\bet\bt_\b_i\bit\bte\bem\bm(\b()\b) *\b**\b**\b**\b**\b*\n+void d\bdh\bht\bt_\b_g\bge\bet\bt_\b_i\bit\bte\bem\bm (std::array key\n+ , std::string salt = std::string());\n+query the DHT for a mutable item under the public key key. this is an ed25519\n+key. salt is optional and may be left as an empty string if no salt is to be\n+used. if the item is found in the DHT, a _\bd_\bh_\bt_\b__\bm_\bu_\bt_\ba_\bb_\bl_\be_\b__\bi_\bt_\be_\bm_\b__\ba_\bl_\be_\br_\bt is posted.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* d\bdh\bht\bt_\b_p\bpu\but\bt_\b_i\bit\bte\bem\bm(\b()\b) *\b**\b**\b**\b**\b*\n+sha1_hash d\bdh\bht\bt_\b_p\bpu\but\bt_\b_i\bit\bte\bem\bm (entry data);\n+store the given bencoded data as an immutable item in the DHT. the returned\n+hash is the key that is to be used to look the item up again. It's just the\n+SHA-1 hash of the bencoded form of the structure.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* d\bdh\bht\bt_\b_p\bpu\but\bt_\b_i\bit\bte\bem\bm(\b()\b) *\b**\b**\b**\b**\b*\n+void d\bdh\bht\bt_\b_p\bpu\but\bt_\b_i\bit\bte\bem\bm (std::array key\n+ , std::function&\n+ , std::int64_t&, std::string const&)> cb\n+ , std::string salt = std::string());\n+store a mutable item. The key is the public key the blob is to be stored under.\n+The optional salt argument is a string that is to be mixed in with the key when\n+determining where in the DHT the value is to be stored. The callback function\n+is called from within the libtorrent network thread once we've found where to\n+store the blob, possibly with the current value stored under the key. The\n+values passed to the callback functions are:\n+ entry& value\n+ the current value stored under the key (may be empty). Also expected to\n+ be set to the value to be stored by the function.\n+ std::array& signature\n+ the signature authenticating the current value. This may be zeros if\n+ there is currently no value stored. The function is expected to fill in\n+ this buffer with the signature of the new value to store. To generate the\n+ signature, you may want to use the sign_mutable_item function.\n+ std::int64_t& seq\n+ current sequence number. May be zero if there is no current value. The\n+ function is expected to set this to the new sequence number of the value\n+ that is to be stored. Sequence numbers must be monotonically increasing.\n+ Attempting to overwrite a value with a lower or equal sequence number\n+ will fail, even if the signature is correct.\n+ std::string const& salt\n+ this is the salt that was used for this put call.\n+Since the callback function cb is called from within libtorrent, it is critical\n+to not perform any blocking operations. Ideally not even locking a mutex. Pass\n+any data required for this function along with the function object's context\n+and make the function entirely self-contained. The only reason data blob's\n+value is computed via a function instead of just passing in the new value is to\n+avoid race conditions. If you want to u\bup\bpd\bda\bat\bte\be the value in the DHT, you must\n+first retrieve it, then modify it, then write it back. The way the DHT works,\n+it is natural to always do a lookup before storing and calling the callback in\n+between is convenient.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* d\bdh\bht\bt_\b_a\ban\bnn\bno\bou\bun\bnc\bce\be(\b()\b) d\bdh\bht\bt_\b_g\bge\bet\bt_\b_p\bpe\bee\ber\brs\bs(\b()\b) *\b**\b**\b**\b**\b*\n+void d\bdh\bht\bt_\b_g\bge\bet\bt_\b_p\bpe\bee\ber\brs\bs (sha1_hash const& info_hash);\n+void d\bdh\bht\bt_\b_a\ban\bnn\bno\bou\bun\bnc\bce\be (sha1_hash const& info_hash, int port = 0, dht::\n+announce_flags_t flags = {});\n+dht_get_peers() will issue a DHT get_peer request to the DHT for the specified\n+info-hash. The response (the peers) will be posted back in a\n+_\bd_\bh_\bt_\b__\bg_\be_\bt_\b__\bp_\be_\be_\br_\bs_\b__\br_\be_\bp_\bl_\by_\b__\ba_\bl_\be_\br_\bt.\n+dht_announce() will issue a DHT announce request to the DHT to the specified\n+info-hash, advertising the specified port. If the port is left at its default,\n+0, the port will be implied by the DHT message's source port (which may improve\n+connectivity through a NAT). dht_announce() is not affected by the\n+announce_port override setting.\n+Both these functions are exposed for advanced custom use of the DHT. All\n+torrents eligible to be announce to the DHT will be automatically, by\n+libtorrent.\n+For possible flags, see _\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\bf_\bl_\ba_\bg_\bs_\b__\bt.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* d\bdh\bht\bt_\b_l\bli\biv\bve\be_\b_n\bno\bod\bde\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n+void d\bdh\bht\bt_\b_l\bli\biv\bve\be_\b_n\bno\bod\bde\bes\bs (sha1_hash const& nid);\n+Retrieve all the live DHT (identified by nid) nodes. All the nodes id and\n+endpoint will be returned in the list of nodes in the _\ba_\bl_\be_\br_\bt\n+dht_live_nodes_alert. Since this _\ba_\bl_\be_\br_\bt is a response to an explicit call, it\n+will always be posted, regardless of the _\ba_\bl_\be_\br_\bt mask.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* d\bdh\bht\bt_\b_s\bsa\bam\bmp\bpl\ble\be_\b_i\bin\bnf\bfo\boh\bha\bas\bsh\bhe\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n+void d\bdh\bht\bt_\b_s\bsa\bam\bmp\bpl\ble\be_\b_i\bin\bnf\bfo\boh\bha\bas\bsh\bhe\bes\bs (udp::endpoint const& ep, sha1_hash const& target);\n+Query the DHT node specified by ep to retrieve a sample of the info-hashes that\n+the node currently have in their storage. The target is included for iterative\n+lookups so that indexing nodes can perform a key space traversal with a single\n+RPC per node by adjusting the target value for each RPC. It has no effect on\n+the returned sample value. The result is posted as a\n+dht_sample_infohashes_alert.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* d\bdh\bht\bt_\b_d\bdi\bir\bre\bec\bct\bt_\b_r\bre\beq\bqu\bue\bes\bst\bt(\b()\b) *\b**\b**\b**\b**\b*\n+void d\bdh\bht\bt_\b_d\bdi\bir\bre\bec\bct\bt_\b_r\bre\beq\bqu\bue\bes\bst\bt (udp::endpoint const& ep, entry const& e, client_data_t\n+userdata = {});\n+Send an arbitrary DHT request directly to the specified endpoint. This function\n+is intended for use by plugins. When a response is received or the request\n+times out, a _\bd_\bh_\bt_\b__\bd_\bi_\br_\be_\bc_\bt_\b__\br_\be_\bs_\bp_\bo_\bn_\bs_\be_\b__\ba_\bl_\be_\br_\bt will be posted with the response (if\n+any) and the userdata pointer passed in here. Since this _\ba_\bl_\be_\br_\bt is a response to\n+an explicit call, it will always be posted, regardless of the _\ba_\bl_\be_\br_\bt mask.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_e\bex\bxt\bte\ben\bns\bsi\bio\bon\bn(\b()\b) *\b**\b**\b**\b**\b*\n+void a\bad\bdd\bd_\b_e\bex\bxt\bte\ben\bns\bsi\bio\bon\bn (std::function(\n+ torrent_handle const&, client_data_t)> ext);\n+void a\bad\bdd\bd_\b_e\bex\bxt\bte\ben\bns\bsi\bio\bon\bn (std::shared_ptr ext);\n+This function adds an extension to this _\bs_\be_\bs_\bs_\bi_\bo_\bn. The argument is a function\n+object that is called with a torrent_handle and which should return a std::\n+shared_ptr. To write custom plugins, see _\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b _\bp_\bl_\bu_\bg_\bi_\bn_\bs.\n+For the typical bittorrent client all of these extensions should be added. The\n+main plugins implemented in libtorrent are:\n+ uTorrent metadata\n+ Allows peers to download the metadata (.torrent files) from the swarm\n+ directly. Makes it possible to join a swarm with just a tracker and info-\n+ hash.\n+#include \n+ses.add_extension(<::create_ut_metadata_plugin);\n+ uTorrent peer exchange\n+ Exchanges peers between clients.\n+#include \n+ses.add_extension(<::create_ut_pex_plugin);\n+ smart ban _\bp_\bl_\bu_\bg_\bi_\bn\n+ A _\bp_\bl_\bu_\bg_\bi_\bn that, with a small overhead, can ban peers that sends bad data\n+ with very high accuracy. Should eliminate most problems on poisoned\n+ torrents.\n+#include \n+ses.add_extension(<::create_smart_ban_plugin);\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* g\bge\bet\bt_\b_i\bip\bp_\b_f\bfi\bil\blt\bte\ber\br(\b()\b) s\bse\bet\bt_\b_i\bip\bp_\b_f\bfi\bil\blt\bte\ber\br(\b()\b) *\b**\b**\b**\b**\b*\n+void s\bse\bet\bt_\b_i\bip\bp_\b_f\bfi\bil\blt\bte\ber\br (ip_filter f);\n+ip_filter g\bge\bet\bt_\b_i\bip\bp_\b_f\bfi\bil\blt\bte\ber\br () const;\n+Sets a filter that will be used to reject and accept incoming as well as\n+outgoing connections based on their originating ip address. The default filter\n+will allow connections to any ip address. To build a set of rules for which\n+addresses are accepted and not, see _\bi_\bp_\b__\bf_\bi_\bl_\bt_\be_\br.\n+Each time a peer is blocked because of the IP filter, a _\bp_\be_\be_\br_\b__\bb_\bl_\bo_\bc_\bk_\be_\bd_\b__\ba_\bl_\be_\br_\bt is\n+generated. get_ip_filter() Returns the _\bi_\bp_\b__\bf_\bi_\bl_\bt_\be_\br currently in the _\bs_\be_\bs_\bs_\bi_\bo_\bn. See\n+_\bi_\bp_\b__\bf_\bi_\bl_\bt_\be_\br.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* s\bse\bet\bt_\b_p\bpo\bor\brt\bt_\b_f\bfi\bil\blt\bte\ber\br(\b()\b) *\b**\b**\b**\b**\b*\n+void s\bse\bet\bt_\b_p\bpo\bor\brt\bt_\b_f\bfi\bil\blt\bte\ber\br (port_filter const& f);\n+apply _\bp_\bo_\br_\bt_\b__\bf_\bi_\bl_\bt_\be_\br f to incoming and outgoing peers. a port filter will reject\n+making outgoing peer connections to certain remote ports. The main intention is\n+to be able to avoid triggering certain anti-virus software by connecting to\n+SMTP, FTP ports.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* i\bis\bs_\b_l\bli\bis\bst\bte\ben\bni\bin\bng\bg(\b()\b) l\bli\bis\bst\bte\ben\bn_\b_p\bpo\bor\brt\bt(\b()\b) s\bss\bsl\bl_\b_l\bli\bis\bst\bte\ben\bn_\b_p\bpo\bor\brt\bt(\b()\b) *\b**\b**\b**\b**\b*\n+unsigned short l\bli\bis\bst\bte\ben\bn_\b_p\bpo\bor\brt\bt () const;\n+bool i\bis\bs_\b_l\bli\bis\bst\bte\ben\bni\bin\bng\bg () const;\n+unsigned short s\bss\bsl\bl_\b_l\bli\bis\bst\bte\ben\bn_\b_p\bpo\bor\brt\bt () const;\n+is_listening() will tell you whether or not the _\bs_\be_\bs_\bs_\bi_\bo_\bn has successfully opened\n+a listening port. If it hasn't, this function will return false, and then you\n+can set a new _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk_\b:_\b:_\bl_\bi_\bs_\bt_\be_\bn_\b__\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be_\bs to try another interface and\n+port to bind to.\n+listen_port() returns the port we ended up listening on.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* g\bge\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_f\bfi\bil\blt\bte\ber\br(\b()\b) s\bse\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_f\bfi\bil\blt\bte\ber\br(\b()\b) *\b**\b**\b**\b**\b*\n+ip_filter g\bge\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_f\bfi\bil\blt\bte\ber\br () const;\n+void s\bse\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_f\bfi\bil\blt\bte\ber\br (ip_filter const& f);\n+Sets the peer class filter for this _\bs_\be_\bs_\bs_\bi_\bo_\bn. All new peer connections will take\n+this into account and be added to the peer classes specified by this filter,\n+based on the peer's IP address.\n+The ip-filter essentially maps an IP -> uint32. Each bit in that 32 bit integer\n+represents a peer class. The least significant bit represents class 0, the next\n+bit class 1 and so on.\n+For more info, see _\bi_\bp_\b__\bf_\bi_\bl_\bt_\be_\br.\n+For example, to make all peers in the range 200.1.1.0 - 200.1.255.255 belong to\n+their own peer class, apply the following filter:\n+ip_filter f = ses.get_peer_class_filter();\n+peer_class_t my_class = ses.create_peer_class(\"200.1.x.x IP range\");\n+f.add_rule(make_address(\"200.1.1.0\"), make_address(\"200.1.255.255\")\n+ , 1 << static_cast(my_class));\n+ses.set_peer_class_filter(f);\n+This setting only applies to new connections, it won't affect existing peer\n+connections.\n+This function is limited to only peer class 0-31, since there are only 32 bits\n+in the IP range mapping. Only the set bits matter; no peer class will be\n+removed from a peer as a result of this call, peer classes are only added.\n+The peer_class argument cannot be greater than 31. The bitmasks representing\n+peer classes in the peer_class_filter are 32 bits.\n+The get_peer_class_filter() function returns the current filter.\n+For more information, see _\bp_\be_\be_\br_\b _\bc_\bl_\ba_\bs_\bs_\be_\bs.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* s\bse\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_t\bty\byp\bpe\be_\b_f\bfi\bil\blt\bte\ber\br(\b()\b) g\bge\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_t\bty\byp\bpe\be_\b_f\bfi\bil\blt\bte\ber\br(\b()\b) *\b**\b**\b**\b**\b*\n+void s\bse\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_t\bty\byp\bpe\be_\b_f\bfi\bil\blt\bte\ber\br (peer_class_type_filter const& f);\n+peer_class_type_filter g\bge\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_t\bty\byp\bpe\be_\b_f\bfi\bil\blt\bte\ber\br () const;\n+Sets and gets the p\bpe\bee\ber\br c\bcl\bla\bas\bss\bs t\bty\byp\bpe\be f\bfi\bil\blt\bte\ber\br. This is controls automatic peer class\n+assignments to peers based on what kind of socket it is.\n+It does not only support assigning peer classes, it also supports removing peer\n+classes based on socket type.\n+The order of these rules being applied are:\n+ 1. peer-class IP filter\n+ 2. peer-class type filter, removing classes\n+ 3. peer-class type filter, adding classes\n+For more information, see _\bp_\be_\be_\br_\b _\bc_\bl_\ba_\bs_\bs_\be_\bs.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* c\bcr\bre\bea\bat\bte\be_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs(\b()\b) *\b**\b**\b**\b**\b*\n+peer_class_t c\bcr\bre\bea\bat\bte\be_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs (char const* name);\n+Creates a new peer class (see _\bp_\be_\be_\br_\b _\bc_\bl_\ba_\bs_\bs_\be_\bs) with the given name. The returned\n+integer is the new peer class identifier. Peer classes may have the same name,\n+so each invocation of this function creates a new class and returns a unique\n+identifier.\n+Identifiers are assigned from low numbers to higher. So if you plan on using\n+certain peer classes in a call to _\bs_\be_\bt_\b__\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b__\bf_\bi_\bl_\bt_\be_\br_\b(_\b), make sure to create\n+those early on, to get low identifiers.\n+For more information on peer classes, see _\bp_\be_\be_\br_\b _\bc_\bl_\ba_\bs_\bs_\be_\bs.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* d\bde\bel\ble\bet\bte\be_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs(\b()\b) *\b**\b**\b**\b**\b*\n+void d\bde\bel\ble\bet\bte\be_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs (peer_class_t cid);\n+This call dereferences the reference count of the specified peer class. When\n+creating a peer class it's automatically referenced by 1. If you want to\n+recycle a peer class, you may call this function. You may only call this\n+function o\bon\bnc\bce\be per peer class you create. Calling it more than once for the same\n+class will lead to memory corruption.\n+Since peer classes are reference counted, this function will not remove the\n+peer class if it's still assigned to torrents or peers. It will however remove\n+it once the last peer and torrent drops their references to it.\n+There is no need to call this function for custom peer classes. All peer\n+classes will be properly destructed when the _\bs_\be_\bs_\bs_\bi_\bo_\bn object destructs.\n+For more information on peer classes, see _\bp_\be_\be_\br_\b _\bc_\bl_\ba_\bs_\bs_\be_\bs.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* s\bse\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs(\b()\b) g\bge\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs(\b()\b) *\b**\b**\b**\b**\b*\n+peer_class_info g\bge\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs (peer_class_t cid) const;\n+void s\bse\bet\bt_\b_p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs (peer_class_t cid, peer_class_info const& pci);\n+These functions queries information from a peer class and updates the\n+configuration of a peer class, respectively.\n+cid must refer to an existing peer class. If it does not, the return value of\n+get_peer_class() is undefined.\n+set_peer_class() sets all the information in the _\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b__\bi_\bn_\bf_\bo object in the\n+specified peer class. There is no option to only update a single property.\n+A peer or torrent belonging to more than one class, the highest priority among\n+any of its classes is the one that is taken into account.\n+For more information, see _\bp_\be_\be_\br_\b _\bc_\bl_\ba_\bs_\bs_\be_\bs.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* r\bre\bem\bmo\bov\bve\be_\b_t\bto\bor\brr\bre\ben\bnt\bt(\b()\b) *\b**\b**\b**\b**\b*\n+void r\bre\bem\bmo\bov\bve\be_\b_t\bto\bor\brr\bre\ben\bnt\bt (const torrent_handle&, remove_flags_t = {});\n+remove_torrent() will close all peer connections associated with the torrent\n+and tell the tracker that we've stopped participating in the swarm. This\n+operation cannot fail. When it completes, you will receive a\n+_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\br_\be_\bm_\bo_\bv_\be_\bd_\b__\ba_\bl_\be_\br_\bt.\n+_\br_\be_\bm_\bo_\bv_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b) is non-blocking, but will remove the torrent from the _\bs_\be_\bs_\bs_\bi_\bo_\bn\n+synchronously. Calling _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bh_\ba_\bn_\bd_\bl_\be_\b:_\b:_\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b) immediately afterward with\n+the same torrent will succeed. Note that this creates a new handle which is not\n+equal to the removed one.\n+The optional second argument options can be used to delete all the files\n+downloaded by this torrent. To do so, pass in the value session_handle::\n+delete_files. Once the torrent is deleted, a _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bd_\be_\bl_\be_\bt_\be_\bd_\b__\ba_\bl_\be_\br_\bt is posted.\n+The _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be remains valid for some time after _\br_\be_\bm_\bo_\bv_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b) is\n+called. It will become invalid only after all libtorrent tasks (such as I/\n+O tasks) release their references to the torrent. Until this happens,\n+_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be_\b:_\b:_\bi_\bs_\b__\bv_\ba_\bl_\bi_\bd_\b(_\b) will return true, and other calls such as\n+_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be_\b:_\b:_\bs_\bt_\ba_\bt_\bu_\bs_\b(_\b) will succeed. Because of this, and because\n+_\br_\be_\bm_\bo_\bv_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b) is non-blocking, the following sequence usually succeeds (does\n+not throw system_error): .. code:: c++\n+ session.remove_handle(handle); handle.save_resume_data();\n+Note that when a queued or downloading torrent is removed, its position in the\n+download queue is vacated and every subsequent torrent in the queue has their\n+queue positions updated. This can potentially cause a large state_update to be\n+posted. When removing all torrents, it is advised to remove them from the back\n+of the queue, to minimize the shifting.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* a\bap\bpp\bpl\bly\by_\b_s\bse\bet\btt\bti\bin\bng\bgs\bs(\b()\b) g\bge\bet\bt_\b_s\bse\bet\btt\bti\bin\bng\bgs\bs(\b()\b) *\b**\b**\b**\b**\b*\n+void a\bap\bpp\bpl\bly\by_\b_s\bse\bet\btt\bti\bin\bng\bgs\bs (settings_pack&&);\n+settings_pack g\bge\bet\bt_\b_s\bse\bet\btt\bti\bin\bng\bgs\bs () const;\n+void a\bap\bpp\bpl\bly\by_\b_s\bse\bet\btt\bti\bin\bng\bgs\bs (settings_pack const&);\n+Applies the settings specified by the _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk s. This is an asynchronous\n+operation that will return immediately and actually apply the settings to the\n+main thread of libtorrent some time later.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* w\bwa\bai\bit\bt_\b_f\bfo\bor\br_\b_a\bal\ble\ber\brt\bt(\b()\b) s\bse\bet\bt_\b_a\bal\ble\ber\brt\bt_\b_n\bno\bot\bti\bif\bfy\by(\b()\b) p\bpo\bop\bp_\b_a\bal\ble\ber\brt\bts\bs(\b()\b) *\b**\b**\b**\b**\b*\n+void p\bpo\bop\bp_\b_a\bal\ble\ber\brt\bts\bs (std::vector* alerts);\n+void s\bse\bet\bt_\b_a\bal\ble\ber\brt\bt_\b_n\bno\bot\bti\bif\bfy\by (std::function const& fun);\n+alert* w\bwa\bai\bit\bt_\b_f\bfo\bor\br_\b_a\bal\ble\ber\brt\bt (time_duration max_wait);\n+Alerts is the main mechanism for libtorrent to report errors and events.\n+pop_alerts fills in the vector passed to it with pointers to new alerts. The\n+_\bs_\be_\bs_\bs_\bi_\bo_\bn still owns these alerts and they will stay valid until the next time\n+pop_alerts is called. You may not delete the _\ba_\bl_\be_\br_\bt objects.\n+It is safe to call pop_alerts from multiple different threads, as long as the\n+alerts themselves are not accessed once another thread calls pop_alerts. Doing\n+this requires manual synchronization between the popping threads.\n+wait_for_alert will block the current thread for max_wait time duration, or\n+until another _\ba_\bl_\be_\br_\bt is posted. If an _\ba_\bl_\be_\br_\bt is available at the time of the\n+call, it returns immediately. The returned _\ba_\bl_\be_\br_\bt pointer is the head of the\n+_\ba_\bl_\be_\br_\bt queue. wait_for_alert does not pop alerts from the queue, it merely peeks\n+at it. The returned _\ba_\bl_\be_\br_\bt will stay valid until pop_alerts is called twice. The\n+first time will pop it and the second will free it.\n+If there is no _\ba_\bl_\be_\br_\bt in the queue and no _\ba_\bl_\be_\br_\bt arrives within the specified\n+timeout, wait_for_alert returns nullptr.\n+In the python binding, wait_for_alert takes the number of milliseconds to wait\n+as an integer.\n+The _\ba_\bl_\be_\br_\bt queue in the _\bs_\be_\bs_\bs_\bi_\bo_\bn will not grow indefinitely. Make sure to pop\n+periodically to not miss notifications. To control the max number of alerts\n+that's queued by the _\bs_\be_\bs_\bs_\bi_\bo_\bn, see settings_pack::alert_queue_size.\n+Some alerts are considered so important that they are posted even when the\n+_\ba_\bl_\be_\br_\bt queue is full. Some alerts are considered mandatory and cannot be\n+disabled by the alert_mask. For instance, _\bs_\ba_\bv_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b__\ba_\bl_\be_\br_\bt and\n+_\bs_\ba_\bv_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b__\bf_\ba_\bi_\bl_\be_\bd_\b__\ba_\bl_\be_\br_\bt are always posted, regardless of the _\ba_\bl_\be_\br_\bt mask.\n+To control which alerts are posted, set the alert_mask (_\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk_\b:_\b:\n+_\ba_\bl_\be_\br_\bt_\b__\bm_\ba_\bs_\bk).\n+If the _\ba_\bl_\be_\br_\bt queue fills up to the point where alerts are dropped, this will be\n+indicated by a _\ba_\bl_\be_\br_\bt_\bs_\b__\bd_\br_\bo_\bp_\bp_\be_\bd_\b__\ba_\bl_\be_\br_\bt, which contains a bitmask of which types of\n+alerts were dropped. Generally it is a good idea to make sure the _\ba_\bl_\be_\br_\bt queue\n+is large enough, the alert_mask doesn't have unnecessary categories enabled and\n+to call pop_alert() frequently, to avoid alerts being dropped.\n+the set_alert_notify function lets the client set a function object to be\n+invoked every time the _\ba_\bl_\be_\br_\bt queue goes from having 0 alerts to 1 _\ba_\bl_\be_\br_\bt. This\n+function is called from within libtorrent, it may be the main thread, or it may\n+be from within a user call. The intention of of the function is that the client\n+wakes up its main thread, to poll for more alerts using pop_alerts(). If the\n+notify function fails to do so, it won't be called again, until pop_alerts is\n+called for some other reason. For instance, it could signal an eventfd, post a\n+message to an HWND or some other main message pump. The actual retrieval of\n+alerts should not be done in the callback. In fact, the callback should not\n+block. It should not perform any expensive work. It really should just notify\n+the main application thread.\n+The type of an _\ba_\bl_\be_\br_\bt is returned by the polymorphic function alert::type() but\n+can also be queries from a concrete type via T::alert_type, as a static\n+constant.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_p\bpo\bor\brt\bt_\b_m\bma\bap\bpp\bpi\bin\bng\bg(\b()\b) d\bde\bel\ble\bet\bte\be_\b_p\bpo\bor\brt\bt_\b_m\bma\bap\bpp\bpi\bin\bng\bg(\b()\b) *\b**\b**\b**\b**\b*\n+std::vector a\bad\bdd\bd_\b_p\bpo\bor\brt\bt_\b_m\bma\bap\bpp\bpi\bin\bng\bg (portmap_protocol t, int\n+external_port, int local_port);\n+void d\bde\bel\ble\bet\bte\be_\b_p\bpo\bor\brt\bt_\b_m\bma\bap\bpp\bpi\bin\bng\bg (port_mapping_t handle);\n+add_port_mapping adds one or more port forwards on UPnP and/or NAT-PMP,\n+whichever is enabled. A mapping is created for each listen socket in the\n+_\bs_\be_\bs_\bs_\bi_\bo_\bn. The return values are all handles referring to the port mappings that\n+were just created. Pass them to _\bd_\be_\bl_\be_\bt_\be_\b__\bp_\bo_\br_\bt_\b__\bm_\ba_\bp_\bp_\bi_\bn_\bg_\b(_\b) to remove them.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* r\bre\beo\bop\bpe\ben\bn_\b_n\bne\bet\btw\bwo\bor\brk\bk_\b_s\bso\boc\bck\bke\bet\bts\bs(\b()\b) *\b**\b**\b**\b**\b*\n+void r\bre\beo\bop\bpe\ben\bn_\b_n\bne\bet\btw\bwo\bor\brk\bk_\b_s\bso\boc\bck\bke\bet\bts\bs (reopen_network_flags_t options =\n+reopen_map_ports);\n+Instructs the _\bs_\be_\bs_\bs_\bi_\bo_\bn to reopen all listen and outgoing sockets.\n+It's useful in the case your platform doesn't support the built in IP notifier\n+mechanism, or if you have a better more reliable way to detect changes in the\n+IP routing table.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* n\bna\bat\bti\biv\bve\be_\b_h\bha\ban\bnd\bdl\ble\be(\b()\b) *\b**\b**\b**\b**\b*\n+std::shared_ptr n\bna\bat\bti\biv\bve\be_\b_h\bha\ban\bnd\bdl\ble\be () const;\n+This function is intended only for use by plugins. This type does not have a\n+stable API and should be relied on as little as possible.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ save_settings\n+ saves settings (i.e. the _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk)\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ save_dht_state\n+ saves dht state such as nodes and node-id, possibly accelerating joining\n+ the DHT if provided at next _\bs_\be_\bs_\bs_\bi_\bo_\bn startup.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ save_extension_state\n+ load or save state from plugins\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ save_ip_filter\n+ load or save the IP filter set on the _\bs_\be_\bs_\bs_\bi_\bo_\bn\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ global_peer_class_id tcp_peer_class_id local_peer_class_id\n+ built-in peer classes\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ delete_files\n+ delete the files belonging to the torrent from disk. including the part-\n+ file, if there is one\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ delete_partfile\n+ delete just the part-file associated with this torrent\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ paused\n+ when set, the _\bs_\be_\bs_\bs_\bi_\bo_\bn will start paused. Call _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bh_\ba_\bn_\bd_\bl_\be_\b:_\b:_\br_\be_\bs_\bu_\bm_\be_\b(_\b) to\n+ start\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ udp tcp\n+ protocols used by _\ba_\bd_\bd_\b__\bp_\bo_\br_\bt_\b__\bm_\ba_\bp_\bp_\bi_\bn_\bg_\b(_\b)\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ reopen_map_ports\n+ This option indicates if the ports are mapped using natpmp and upnp. If\n+ mapping was already made, they are deleted and added again. This only\n+ works if natpmp and/or upnp are configured to be enable.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b._\bh_\bp_\bp\"\n+this is a holder for the internal _\bs_\be_\bs_\bs_\bi_\bo_\bn implementation object. Once the\n+_\bs_\be_\bs_\bs_\bi_\bo_\bn destruction is explicitly initiated, this holder is used to synchronize\n+the completion of the shutdown. The lifetime of this object may outlive\n+_\bs_\be_\bs_\bs_\bi_\bo_\bn, causing the _\bs_\be_\bs_\bs_\bi_\bo_\bn destructor to not block. The _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\br_\bo_\bx_\by\n+destructor will block however, until the underlying _\bs_\be_\bs_\bs_\bi_\bo_\bn is done shutting\n+down.\n+struct session_proxy\n+{\n+ ~\b~s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by ();\n+ s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by ();\n+ s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by (session_proxy const&);\n+ session_proxy& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (session_proxy const&) &;\n+ s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by (session_proxy&&) noexcept;\n+ session_proxy& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (session_proxy&&) & noexcept;\n+};\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* o\bop\bpe\ber\bra\bat\bto\bor\br=\b=(\b()\b) ~\b~s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by(\b()\b) s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by(\b()\b) *\b**\b**\b**\b**\b*\n+~\b~s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by ();\n+s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by ();\n+s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by (session_proxy const&);\n+session_proxy& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (session_proxy const&) &;\n+s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by (session_proxy&&) noexcept;\n+session_proxy& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (session_proxy&&) & noexcept;\n+default constructor, does not refer to any _\bs_\be_\bs_\bs_\bi_\bo_\bn implementation object.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* s\bse\bes\bss\bsi\bio\bon\bn *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b._\bh_\bp_\bp\"\n+The _\bs_\be_\bs_\bs_\bi_\bo_\bn holds all state that spans multiple torrents. Among other things it\n+runs the network loop and manages all torrents. Once it's created, the _\bs_\be_\bs_\bs_\bi_\bo_\bn\n+object will spawn the main thread that will do all the work. The main thread\n+will be idle as long it doesn't have any torrents to participate in.\n+You have some control over _\bs_\be_\bs_\bs_\bi_\bo_\bn configuration through the session_handle::\n+apply_settings() member function. To change one or more configuration options,\n+create a _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk. object and fill it with the settings to be set and pass\n+it in to session::apply_settings().\n+see _\ba_\bp_\bp_\bl_\by_\b__\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b(_\b).\n+struct session : session_handle\n+{\n+ s\bse\bes\bss\bsi\bio\bon\bn (session_params&& params, session_flags_t flags);\n+ s\bse\bes\bss\bsi\bio\bon\bn ();\n+ s\bse\bes\bss\bsi\bio\bon\bn (session_params const& params, session_flags_t flags);\n+ explicit s\bse\bes\bss\bsi\bio\bon\bn (session_params const& params);\n+ explicit s\bse\bes\bss\bsi\bio\bon\bn (session_params&& params);\n+ s\bse\bes\bss\bsi\bio\bon\bn (session_params const& params, io_context& ios, session_flags_t);\n+ s\bse\bes\bss\bsi\bio\bon\bn (session_params&& params, io_context& ios, session_flags_t);\n+ s\bse\bes\bss\bsi\bio\bon\bn (session_params const& params, io_context& ios);\n+ s\bse\bes\bss\bsi\bio\bon\bn (session_params&& params, io_context& ios);\n+ ~\b~s\bse\bes\bss\bsi\bio\bon\bn ();\n+ session_proxy a\bab\bbo\bor\brt\bt ();\n+};\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* s\bse\bes\bss\bsi\bio\bon\bn(\b()\b) *\b**\b**\b**\b**\b*\n+s\bse\bes\bss\bsi\bio\bon\bn (session_params&& params, session_flags_t flags);\n+s\bse\bes\bss\bsi\bio\bon\bn ();\n+s\bse\bes\bss\bsi\bio\bon\bn (session_params const& params, session_flags_t flags);\n+explicit s\bse\bes\bss\bsi\bio\bon\bn (session_params const& params);\n+explicit s\bse\bes\bss\bsi\bio\bon\bn (session_params&& params);\n+Constructs the _\bs_\be_\bs_\bs_\bi_\bo_\bn objects which acts as the container of torrents. In\n+order to avoid a race condition between starting the _\bs_\be_\bs_\bs_\bi_\bo_\bn and configuring\n+it, you can pass in a _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs object. Its settings will take effect\n+before the _\bs_\be_\bs_\bs_\bi_\bo_\bn starts up.\n+The overloads taking flags can be used to start a _\bs_\be_\bs_\bs_\bi_\bo_\bn in paused mode (by\n+passing in session::paused). Note that add_default_plugins do not have an\n+affect on constructors that take a _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs object. It already contains\n+the plugins to use.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* s\bse\bes\bss\bsi\bio\bon\bn(\b()\b) *\b**\b**\b**\b**\b*\n+s\bse\bes\bss\bsi\bio\bon\bn (session_params const& params, io_context& ios, session_flags_t);\n+s\bse\bes\bss\bsi\bio\bon\bn (session_params&& params, io_context& ios, session_flags_t);\n+s\bse\bes\bss\bsi\bio\bon\bn (session_params const& params, io_context& ios);\n+s\bse\bes\bss\bsi\bio\bon\bn (session_params&& params, io_context& ios);\n+Overload of the constructor that takes an external io_context to run the\n+_\bs_\be_\bs_\bs_\bi_\bo_\bn object on. This is primarily useful for tests that may want to run\n+multiple sessions on a single io_context, or low resource systems where\n+additional threads are expensive and sharing an io_context with other events is\n+fine.\n+Warning\n+The _\bs_\be_\bs_\bs_\bi_\bo_\bn object does not cleanly terminate with an external io_context. The\n+io_context::run() call m\bmu\bus\bst\bt have returned before it's safe to destruct the\n+_\bs_\be_\bs_\bs_\bi_\bo_\bn. Which means you M\bMU\bUS\bST\bT call _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b:_\b:_\ba_\bb_\bo_\br_\bt_\b(_\b) and save the _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\br_\bo_\bx_\by\n+first, then destruct the _\bs_\be_\bs_\bs_\bi_\bo_\bn object, then sync with the io_context, then\n+destruct the _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\br_\bo_\bx_\by object.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* ~\b~s\bse\bes\bss\bsi\bio\bon\bn(\b()\b) *\b**\b**\b**\b**\b*\n+~\b~s\bse\bes\bss\bsi\bio\bon\bn ();\n+The destructor of _\bs_\be_\bs_\bs_\bi_\bo_\bn will notify all trackers that our torrents have been\n+shut down. If some trackers are down, they will time out. All this before the\n+destructor of _\bs_\be_\bs_\bs_\bi_\bo_\bn returns. So, it's advised that any kind of interface\n+(such as windows) are closed before destructing the _\bs_\be_\bs_\bs_\bi_\bo_\bn object. Because it\n+can take a few second for it to finish. The timeout can be set with\n+_\ba_\bp_\bp_\bl_\by_\b__\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b(_\b).\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* a\bab\bbo\bor\brt\bt(\b()\b) *\b**\b**\b**\b**\b*\n+session_proxy a\bab\bbo\bor\brt\bt ();\n+In case you want to destruct the _\bs_\be_\bs_\bs_\bi_\bo_\bn asynchronously, you can request a\n+_\bs_\be_\bs_\bs_\bi_\bo_\bn destruction proxy. If you don't do this, the destructor of the _\bs_\be_\bs_\bs_\bi_\bo_\bn\n+object will block while the trackers are contacted. If you keep one\n+session_proxy to the _\bs_\be_\bs_\bs_\bi_\bo_\bn when destructing it, the destructor will not\n+block, but start to close down the _\bs_\be_\bs_\bs_\bi_\bo_\bn, the destructor of the proxy will\n+then synchronize the threads. So, the destruction of the _\bs_\be_\bs_\bs_\bi_\bo_\bn is performed\n+from the session destructor call until the session_proxy destructor call. The\n+session_proxy does not have any operations on it (since the _\bs_\be_\bs_\bs_\bi_\bo_\bn is being\n+closed down, no operations are allowed on it). The only valid operation is\n+calling the destructor:\n+struct session_proxy {};\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* r\bre\bea\bad\bd_\b_s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs(\b()\b) w\bwr\bri\bit\bte\be_\b_s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs_\b_b\bbu\buf\bf(\b()\b) w\bwr\bri\bit\bte\be_\b_s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs(\b()\b)\n+*\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs_\b._\bh_\bp_\bp\"\n+entry w\bwr\bri\bit\bte\be_\b_s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs (session_params const& sp\n+ , save_state_flags_t flags = save_state_flags_t::all());\n+session_params r\bre\bea\bad\bd_\b_s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs (span buf\n+ , save_state_flags_t flags = save_state_flags_t::all());\n+session_params r\bre\bea\bad\bd_\b_s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs (bdecode_node const& e\n+ , save_state_flags_t flags = save_state_flags_t::all());\n+std::vector w\bwr\bri\bit\bte\be_\b_s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs_\b_b\bbu\buf\bf (session_params const& sp\n+ , save_state_flags_t flags = save_state_flags_t::all());\n+These functions serialize and de-serialize a session_params object to and from\n+bencoded form. The _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs object is used to initialize a new _\bs_\be_\bs_\bs_\bi_\bo_\bn\n+using the state from a previous one (or by programmatically configure the\n+_\bs_\be_\bs_\bs_\bi_\bo_\bn up-front). The flags parameter can be used to only save and load\n+certain aspects of the session's state. The _buf suffix indicates the function\n+operates on buffer rather than the bencoded structure. The torrents in a\n+_\bs_\be_\bs_\bs_\bi_\bo_\bn are not part of the _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs state, they have to be restored\n+separately.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* b\bbd\bde\bec\bco\bod\bde\be_\b_n\bno\bod\bde\be *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bb_\bd_\be_\bc_\bo_\bd_\be_\b._\bh_\bp_\bp\"\n+Sometimes it's important to get a non-owning reference to the root node ( to be\n+able to copy it as a reference for instance). For that, use the _\bn_\bo_\bn_\b__\bo_\bw_\bn_\bi_\bn_\bg_\b(_\b)\n+member function.\n+There are 5 different types of nodes, see _\bt_\by_\bp_\be_\b__\bt.\n+struct bdecode_node\n+{\n+ b\bbd\bde\bec\bco\bod\bde\be_\b_n\bno\bod\bde\be () = default;\n+ bdecode_node& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (bdecode_node&&) & = default;\n+ b\bbd\bde\bec\bco\bod\bde\be_\b_n\bno\bod\bde\be (bdecode_node&&) noexcept;\n+ b\bbd\bde\bec\bco\bod\bde\be_\b_n\bno\bod\bde\be (bdecode_node const&);\n+ bdecode_node& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (bdecode_node const&) &;\n+ type_t t\bty\byp\bpe\be () const noexcept;\n+ explicit operator b\bbo\boo\bol\bl () const noexcept;\n+ bdecode_node n\bno\bon\bn_\b_o\bow\bwn\bni\bin\bng\bg () const;\n+ span d\bda\bat\bta\ba_\b_s\bse\bec\bct\bti\bio\bon\bn () const noexcept;\n+ std::ptrdiff_t d\bda\bat\bta\ba_\b_o\bof\bff\bfs\bse\bet\bt () const noexcept;\n+ int l\bli\bis\bst\bt_\b_s\bsi\biz\bze\be () const;\n+ std::int64_t l\bli\bis\bst\bt_\b_i\bin\bnt\bt_\b_v\bva\bal\blu\bue\be_\b_a\bat\bt (int i\n+ , std::int64_t default_val = 0) const;\n+ bdecode_node l\bli\bis\bst\bt_\b_a\bat\bt (int i) const;\n+ string_view l\bli\bis\bst\bt_\b_s\bst\btr\bri\bin\bng\bg_\b_v\bva\bal\blu\bue\be_\b_a\bat\bt (int i\n+ , string_view default_val = string_view()) const;\n+ bdecode_node d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_i\bin\bnt\bt (string_view key) const;\n+ bdecode_node d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_l\bli\bis\bst\bt (string_view key) const;\n+ bdecode_node d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_s\bst\btr\bri\bin\bng\bg (string_view key) const;\n+ std::pair d\bdi\bic\bct\bt_\b_a\bat\bt (int i) const;\n+ string_view d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_s\bst\btr\bri\bin\bng\bg_\b_v\bva\bal\blu\bue\be (string_view key\n+ , string_view default_value = string_view()) const;\n+ int d\bdi\bic\bct\bt_\b_s\bsi\biz\bze\be () const;\n+ bdecode_node d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd (string_view key) const;\n+ bdecode_node d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_d\bdi\bic\bct\bt (string_view key) const;\n+ std::int64_t d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_i\bin\bnt\bt_\b_v\bva\bal\blu\bue\be (string_view key\n+ , std::int64_t default_val = 0) const;\n+ std::pair d\bdi\bic\bct\bt_\b_a\bat\bt_\b_n\bno\bod\bde\be (int i) const;\n+ std::int64_t i\bin\bnt\bt_\b_v\bva\bal\blu\bue\be () const;\n+ string_view s\bst\btr\bri\bin\bng\bg_\b_v\bva\bal\blu\bue\be () const;\n+ int s\bst\btr\bri\bin\bng\bg_\b_l\ble\ben\bng\bgt\bth\bh () const;\n+ std::ptrdiff_t s\bst\btr\bri\bin\bng\bg_\b_o\bof\bff\bfs\bse\bet\bt () const;\n+ char const* s\bst\btr\bri\bin\bng\bg_\b_p\bpt\btr\br () const;\n+ void c\bcl\ble\bea\bar\br ();\n+ void s\bsw\bwa\bap\bp (bdecode_node& n);\n+ void r\bre\bes\bse\ber\brv\bve\be (int tokens);\n+ void s\bsw\bwi\bit\btc\bch\bh_\b_u\bun\bnd\bde\ber\brl\bly\byi\bin\bng\bg_\b_b\bbu\buf\bff\bfe\ber\br (char const* buf) noexcept;\n+ bool h\bha\bas\bs_\b_s\bso\bof\bft\bt_\b_e\ber\brr\bro\bor\br (span error) const;\n+\n+ enum type_t\n+ {\n+ none_t,\n+ dict_t,\n+ list_t,\n+ string_t,\n+ int_t,\n+ };\n+};\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* b\bbd\bde\bec\bco\bod\bde\be_\b_n\bno\bod\bde\be(\b()\b) *\b**\b**\b**\b**\b*\n+b\bbd\bde\bec\bco\bod\bde\be_\b_n\bno\bod\bde\be () = default;\n+creates a default constructed node, it will have the type none_t.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* b\bbd\bde\bec\bco\bod\bde\be_\b_n\bno\bod\bde\be(\b()\b) o\bop\bpe\ber\bra\bat\bto\bor\br=\b=(\b()\b) *\b**\b**\b**\b**\b*\n+bdecode_node& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (bdecode_node&&) & = default;\n+b\bbd\bde\bec\bco\bod\bde\be_\b_n\bno\bod\bde\be (bdecode_node&&) noexcept;\n+b\bbd\bde\bec\bco\bod\bde\be_\b_n\bno\bod\bde\be (bdecode_node const&);\n+bdecode_node& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (bdecode_node const&) &;\n+For owning nodes, the copy will create a copy of the tree, but the underlying\n+buffer remains the same.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* t\bty\byp\bpe\be(\b()\b) *\b**\b**\b**\b**\b*\n+type_t t\bty\byp\bpe\be () const noexcept;\n+the type of this node. See _\bt_\by_\bp_\be_\b__\bt.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* b\bbo\boo\bol\bl(\b()\b) *\b**\b**\b**\b**\b*\n+explicit operator b\bbo\boo\bol\bl () const noexcept;\n+returns true if _\bt_\by_\bp_\be_\b(_\b) != none_t.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* n\bno\bon\bn_\b_o\bow\bwn\bni\bin\bng\bg(\b()\b) *\b**\b**\b**\b**\b*\n+bdecode_node n\bno\bon\bn_\b_o\bow\bwn\bni\bin\bng\bg () const;\n+return a non-owning reference to this node. This is useful to refer to the root\n+node without copying it in assignments.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* d\bda\bat\bta\ba_\b_s\bse\bec\bct\bti\bio\bon\bn(\b()\b) d\bda\bat\bta\ba_\b_o\bof\bff\bfs\bse\bet\bt(\b()\b) *\b**\b**\b**\b**\b*\n+span d\bda\bat\bta\ba_\b_s\bse\bec\bct\bti\bio\bon\bn () const noexcept;\n+std::ptrdiff_t d\bda\bat\bta\ba_\b_o\bof\bff\bfs\bse\bet\bt () const noexcept;\n+returns the buffer and length of the section in the original bencoded buffer\n+where this node is defined. For a dictionary for instance, this starts with d\n+and ends with e, and has all the content of the dictionary in between. the\n+data_offset() function returns the byte-offset to this node in, starting from\n+the beginning of the buffer that was parsed.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* l\bli\bis\bst\bt_\b_a\bat\bt(\b()\b) l\bli\bis\bst\bt_\b_s\bst\btr\bri\bin\bng\bg_\b_v\bva\bal\blu\bue\be_\b_a\bat\bt(\b()\b) l\bli\bis\bst\bt_\b_i\bin\bnt\bt_\b_v\bva\bal\blu\bue\be_\b_a\bat\bt(\b()\b) l\bli\bis\bst\bt_\b_s\bsi\biz\bze\be(\b()\b) *\b**\b**\b**\b**\b*\n+int l\bli\bis\bst\bt_\b_s\bsi\biz\bze\be () const;\n+std::int64_t l\bli\bis\bst\bt_\b_i\bin\bnt\bt_\b_v\bva\bal\blu\bue\be_\b_a\bat\bt (int i\n+ , std::int64_t default_val = 0) const;\n+bdecode_node l\bli\bis\bst\bt_\b_a\bat\bt (int i) const;\n+string_view l\bli\bis\bst\bt_\b_s\bst\btr\bri\bin\bng\bg_\b_v\bva\bal\blu\bue\be_\b_a\bat\bt (int i\n+ , string_view default_val = string_view()) const;\n+functions with the list_ prefix operate on lists. These functions are only\n+valid if type() == list_t. list_at() returns the item in the list at index i. i\n+may not be greater than or equal to the size of the list. size() returns the\n+size of the list.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_l\bli\bis\bst\bt(\b()\b) d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_s\bst\btr\bri\bin\bng\bg_\b_v\bva\bal\blu\bue\be(\b()\b) d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_s\bst\btr\bri\bin\bng\bg(\b()\b)\n+d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_i\bin\bnt\bt_\b_v\bva\bal\blu\bue\be(\b()\b) d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_d\bdi\bic\bct\bt(\b()\b) d\bdi\bic\bct\bt_\b_s\bsi\biz\bze\be(\b()\b) d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_i\bin\bnt\bt(\b()\b) d\bdi\bic\bct\bt_\b_a\bat\bt(\b()\b)\n+d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd(\b()\b) d\bdi\bic\bct\bt_\b_a\bat\bt_\b_n\bno\bod\bde\be(\b()\b) *\b**\b**\b**\b**\b*\n+bdecode_node d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_i\bin\bnt\bt (string_view key) const;\n+bdecode_node d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_l\bli\bis\bst\bt (string_view key) const;\n+bdecode_node d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_s\bst\btr\bri\bin\bng\bg (string_view key) const;\n+std::pair d\bdi\bic\bct\bt_\b_a\bat\bt (int i) const;\n+string_view d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_s\bst\btr\bri\bin\bng\bg_\b_v\bva\bal\blu\bue\be (string_view key\n+ , string_view default_value = string_view()) const;\n+int d\bdi\bic\bct\bt_\b_s\bsi\biz\bze\be () const;\n+bdecode_node d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd (string_view key) const;\n+bdecode_node d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_d\bdi\bic\bct\bt (string_view key) const;\n+std::int64_t d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_i\bin\bnt\bt_\b_v\bva\bal\blu\bue\be (string_view key\n+ , std::int64_t default_val = 0) const;\n+std::pair d\bdi\bic\bct\bt_\b_a\bat\bt_\b_n\bno\bod\bde\be (int i) const;\n+Functions with the dict_ prefix operates on dictionaries. They are only valid\n+if type() == dict_t. In case a key you're looking up contains a 0 byte, you\n+cannot use the 0-terminated string overloads, but have to use string_view\n+instead. dict_find_list will return a valid bdecode_node if the key is found\n+_and_ it is a list. Otherwise it will return a default-constructed\n+_\bb_\bd_\be_\bc_\bo_\bd_\be_\b__\bn_\bo_\bd_\be.\n+Functions with the _value suffix return the value of the node directly, rather\n+than the nodes. In case the node is not found, or it has a different type, a\n+default value is returned (which can be specified).\n+dict_at() returns the (key, value)-pair at the specified index in a dictionary.\n+Keys are only allowed to be strings. dict_at_node() also returns the (key,\n+value)-pair, but the key is returned as a bdecode_node (and it will always be a\n+string).\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* i\bin\bnt\bt_\b_v\bva\bal\blu\bue\be(\b()\b) *\b**\b**\b**\b**\b*\n+std::int64_t i\bin\bnt\bt_\b_v\bva\bal\blu\bue\be () const;\n+this function is only valid if type() == int_t. It returns the value of the\n+integer.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* s\bst\btr\bri\bin\bng\bg_\b_v\bva\bal\blu\bue\be(\b()\b) s\bst\btr\bri\bin\bng\bg_\b_l\ble\ben\bng\bgt\bth\bh(\b()\b) s\bst\btr\bri\bin\bng\bg_\b_o\bof\bff\bfs\bse\bet\bt(\b()\b) s\bst\btr\bri\bin\bng\bg_\b_p\bpt\btr\br(\b()\b) *\b**\b**\b**\b**\b*\n+string_view s\bst\btr\bri\bin\bng\bg_\b_v\bva\bal\blu\bue\be () const;\n+int s\bst\btr\bri\bin\bng\bg_\b_l\ble\ben\bng\bgt\bth\bh () const;\n+std::ptrdiff_t s\bst\btr\bri\bin\bng\bg_\b_o\bof\bff\bfs\bse\bet\bt () const;\n+char const* s\bst\btr\bri\bin\bng\bg_\b_p\bpt\btr\br () const;\n+these functions are only valid if type() == string_t. They return the string\n+values. Note that string_ptr() is n\bno\bot\bt 0-terminated. string_length() returns the\n+number of bytes in the string. string_offset() returns the byte offset from the\n+start of the parsed bencoded buffer this string can be found.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* c\bcl\ble\bea\bar\br(\b()\b) *\b**\b**\b**\b**\b*\n+void c\bcl\ble\bea\bar\br ();\n+resets the bdecoded_node to a default constructed state. If this is an owning\n+node, the tree is freed and all child nodes are invalidated.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* s\bsw\bwa\bap\bp(\b()\b) *\b**\b**\b**\b**\b*\n+void s\bsw\bwa\bap\bp (bdecode_node& n);\n+Swap contents.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* r\bre\bes\bse\ber\brv\bve\be(\b()\b) *\b**\b**\b**\b**\b*\n+void r\bre\bes\bse\ber\brv\bve\be (int tokens);\n+preallocate memory for the specified numbers of tokens. This is useful if you\n+know approximately how many tokens are in the file you are about to parse.\n+Doing so will save realloc operations while parsing. You should only call this\n+on the root node, before passing it in to _\bb_\bd_\be_\bc_\bo_\bd_\be_\b(_\b).\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* s\bsw\bwi\bit\btc\bch\bh_\b_u\bun\bnd\bde\ber\brl\bly\byi\bin\bng\bg_\b_b\bbu\buf\bff\bfe\ber\br(\b()\b) *\b**\b**\b**\b**\b*\n+void s\bsw\bwi\bit\btc\bch\bh_\b_u\bun\bnd\bde\ber\brl\bly\byi\bin\bng\bg_\b_b\bbu\buf\bff\bfe\ber\br (char const* buf) noexcept;\n+this buffer M\bMU\bUS\bST\bT be identical to the one originally parsed. This operation is\n+only defined on owning root nodes, i.e. the one passed in to decode().\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* h\bha\bas\bs_\b_s\bso\bof\bft\bt_\b_e\ber\brr\bro\bor\br(\b()\b) *\b**\b**\b**\b**\b*\n+bool h\bha\bas\bs_\b_s\bso\bof\bft\bt_\b_e\ber\brr\bro\bor\br (span error) const;\n+returns true if there is a non-fatal error in the bencoding of this node or its\n+children\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* e\ben\bnu\bum\bm t\bty\byp\bpe\be_\b_t\bt *\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bb_\bd_\be_\bc_\bo_\bd_\be_\b._\bh_\bp_\bp\"\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n+|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|none_t |0 |uninitialized or default constructed. This is also used to|\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bi_\bn_\bd_\bi_\bc_\ba_\bt_\be_\b _\bt_\bh_\ba_\bt_\b _\ba_\b _\bn_\bo_\bd_\be_\b _\bw_\ba_\bs_\b _\bn_\bo_\bt_\b _\bf_\bo_\bu_\bn_\bd_\b _\bi_\bn_\b _\bs_\bo_\bm_\be_\b _\bc_\ba_\bs_\be_\bs_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bd_\bi_\bc_\bt_\b__\bt_\b _\b _\b|_\b1_\b _\b _\b _\b _\b|_\ba_\b _\bd_\bi_\bc_\bt_\bi_\bo_\bn_\ba_\br_\by_\b _\bn_\bo_\bd_\be_\b._\b _\bT_\bh_\be_\b _\bd_\bi_\bc_\bt_\b__\bf_\bi_\bn_\bd_\b__\b _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn_\bs_\b _\ba_\br_\be_\b _\bv_\ba_\bl_\bi_\bd_\b._\b _\b _\b _\b |\n+|_\bl_\bi_\bs_\bt_\b__\bt_\b _\b _\b|_\b2_\b _\b _\b _\b _\b|_\ba_\b _\bl_\bi_\bs_\bt_\b _\bn_\bo_\bd_\be_\b._\b _\bT_\bh_\be_\b _\bl_\bi_\bs_\bt_\b__\b _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn_\bs_\b _\ba_\br_\be_\b _\bv_\ba_\bl_\bi_\bd_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bs_\bt_\br_\bi_\bn_\bg_\b__\bt_\b|_\b3_\b _\b _\b _\b _\b|_\ba_\b _\bs_\bt_\br_\bi_\bn_\bg_\b _\bn_\bo_\bd_\be_\b,_\b _\bt_\bh_\be_\b _\bs_\bt_\br_\bi_\bn_\bg_\b__\b _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn_\bs_\b _\ba_\br_\be_\b _\bv_\ba_\bl_\bi_\bd_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bi_\bn_\bt_\b__\bt_\b _\b _\b _\b|_\b4_\b _\b _\b _\b _\b|_\ba_\bn_\b _\bi_\bn_\bt_\be_\bg_\be_\br_\b _\bn_\bo_\bd_\be_\b._\b _\bT_\bh_\be_\b _\bi_\bn_\bt_\b__\b _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn_\bs_\b _\ba_\br_\be_\b _\bv_\ba_\bl_\bi_\bd_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* p\bpr\bri\bin\bnt\bt_\b_e\ben\bnt\btr\bry\by(\b()\b) *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bb_\bd_\be_\bc_\bo_\bd_\be_\b._\bh_\bp_\bp\"\n+std::string p\bpr\bri\bin\bnt\bt_\b_e\ben\bnt\btr\bry\by (bdecode_node const& e\n+ , bool single_line = false, int indent = 0);\n+print the bencoded structure in a human-readable format to a string that's\n+returned.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* b\bbd\bde\bec\bco\bod\bde\be(\b()\b) *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bb_\bd_\be_\bc_\bo_\bd_\be_\b._\bh_\bp_\bp\"\n+bdecode_node b\bbd\bde\bec\bco\bod\bde\be (span buffer\n+ , error_code& ec, int* error_pos = nullptr, int depth_limit = 100\n+ , int token_limit = 2000000);\n+int b\bbd\bde\bec\bco\bod\bde\be (char const* start, char const* end, bdecode_node& ret\n+ , error_code& ec, int* error_pos = nullptr, int depth_limit = 100\n+ , int token_limit = 2000000);\n+bdecode_node b\bbd\bde\bec\bco\bod\bde\be (span buffer\n+ , int depth_limit = 100, int token_limit = 2000000);\n+This function decodes/parses bdecoded data (for example a .torrent file). The\n+data structure is returned in the ret argument. the buffer to parse is\n+specified by the start of the buffer as well as the end, i.e. one byte past the\n+end. If the buffer fails to parse, the function returns a non-zero value and\n+fills in ec with the error code. The optional argument error_pos, if set to\n+non-nullptr, will be set to the byte offset into the buffer where the parse\n+failure occurred.\n+depth_limit specifies the max number of nested lists or dictionaries are\n+allowed in the data structure. (This affects the stack usage of the function,\n+be careful not to set it too high).\n+token_limit is the max number of tokens allowed to be parsed from the buffer.\n+This is simply a sanity check to not have unbounded memory usage.\n+The resulting bdecode_node is an o\bow\bwn\bni\bin\bng\bg node. That means it will be holding the\n+whole parsed tree. When iterating lists and dictionaries, those bdecode_node\n+objects will simply have references to the root or owning bdecode_node. If the\n+root node is destructed, all other nodes that refer to anything in that tree\n+become invalid.\n+However, the underlying buffer passed in to this function (start, end) must\n+also remain valid while the bdecoded tree is used. The parsed tree produced by\n+this function does not copy any data out of the buffer, but simply produces\n+references back into it.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh_\b_t\bt *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bi_\bn_\bf_\bo_\b__\bh_\ba_\bs_\bh_\b._\bh_\bp_\bp\"\n+class holding the info-hash of a torrent. It can hold a v1 info-hash (SHA-1) or\n+a v2 info-hash (SHA-256) or both.\n+Note\n+If has_v2() is false then the v1 hash might actually be a truncated v2 hash\n+struct info_hash_t\n+{\n+ i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh_\b_t\bt () noexcept = default;\n+ explicit i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh_\b_t\bt (sha256_hash h2) noexcept;\n+ explicit i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh_\b_t\bt (sha1_hash h1) noexcept;\n+ i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh_\b_t\bt (sha1_hash h1, sha256_hash h2) noexcept;\n+ bool h\bha\bas\bs (protocol_version v) const;\n+ bool h\bha\bas\bs_\b_v\bv2\b2 () const;\n+ bool h\bha\bas\bs_\b_v\bv1\b1 () const;\n+ sha1_hash g\bge\bet\bt (protocol_version v) const;\n+ sha1_hash g\bge\bet\bt_\b_b\bbe\bes\bst\bt () const;\n+ friend bool o\bop\bpe\ber\bra\bat\bto\bor\br!\b!=\b= (info_hash_t const& lhs, info_hash_t const& rhs);\n+ friend bool o\bop\bpe\ber\bra\bat\bto\bor\br=\b==\b= (info_hash_t const& lhs, info_hash_t const& rhs)\n+noexcept;\n+ template void f\bfo\bor\br_\b_e\bea\bac\bch\bh (F f) const;\n+ bool o\bop\bpe\ber\bra\bat\bto\bor\br<\b< (info_hash_t const& o) const;\n+ friend std::ostream& o\bop\bpe\ber\bra\bat\bto\bor\br<\b<<\b< (std::ostream& os, info_hash_t const& ih);\n+\n+ sha1_hash v1;\n+ sha256_hash v2;\n+};\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh_\b_t\bt(\b()\b) *\b**\b**\b**\b**\b*\n+i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh_\b_t\bt () noexcept = default;\n+explicit i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh_\b_t\bt (sha256_hash h2) noexcept;\n+explicit i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh_\b_t\bt (sha1_hash h1) noexcept;\n+i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh_\b_t\bt (sha1_hash h1, sha256_hash h2) noexcept;\n+The default constructor creates an object that has neither a v1 or v2 hash.\n+For backwards compatibility, make it possible to construct directly from a v1\n+hash. This constructor allows i\bim\bmp\bpl\bli\bic\bci\bit\bt conversion from a v1 hash, but the\n+implicitness is deprecated.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* h\bha\bas\bs_\b_v\bv2\b2(\b()\b) h\bha\bas\bs_\b_v\bv1\b1(\b()\b) h\bha\bas\bs(\b()\b) *\b**\b**\b**\b**\b*\n+bool h\bha\bas\bs (protocol_version v) const;\n+bool h\bha\bas\bs_\b_v\bv2\b2 () const;\n+bool h\bha\bas\bs_\b_v\bv1\b1 () const;\n+returns true if the corresponding info hash is present in this object.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* g\bge\bet\bt(\b()\b) *\b**\b**\b**\b**\b*\n+sha1_hash g\bge\bet\bt (protocol_version v) const;\n+returns the has for the specified protocol version\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* g\bge\bet\bt_\b_b\bbe\bes\bst\bt(\b()\b) *\b**\b**\b**\b**\b*\n+sha1_hash g\bge\bet\bt_\b_b\bbe\bes\bst\bt () const;\n+returns the v2 (truncated) info-hash, if there is one, otherwise returns the v1\n+info-hash\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* f\bfo\bor\br_\b_e\bea\bac\bch\bh(\b()\b) *\b**\b**\b**\b**\b*\n+template void f\bfo\bor\br_\b_e\bea\bac\bch\bh (F f) const;\n+calls the function object f for each hash that is available. starting with v1.\n+The signature of F is:\n+void(sha1_hash const&, protocol_version);\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* p\bpi\bie\bec\bce\be_\b_b\bbl\blo\boc\bck\bk *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bp_\bi_\be_\bc_\be_\b__\bb_\bl_\bo_\bc_\bk_\b._\bh_\bp_\bp\"\n+struct piece_block\n+{\n+ p\bpi\bie\bec\bce\be_\b_b\bbl\blo\boc\bck\bk () = default;\n+ p\bpi\bie\bec\bce\be_\b_b\bbl\blo\boc\bck\bk (piece_index_t p_index, int b_index);\n+ bool o\bop\bpe\ber\bra\bat\bto\bor\br<\b< (piece_block const& b) const;\n+ bool o\bop\bpe\ber\bra\bat\bto\bor\br=\b==\b= (piece_block const& b) const;\n+ bool o\bop\bpe\ber\bra\bat\bto\bor\br!\b!=\b= (piece_block const& b) const;\n+\n+ static const piece_block invalid;\n+ piece_index_t piece_index {0};\n+ int b\bbl\blo\boc\bck\bk_\b_i\bin\bnd\bde\bex\bx = 0;\n+};\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* p\bpe\bee\ber\br_\b_r\bre\beq\bqu\bue\bes\bst\bt *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bp_\be_\be_\br_\b__\br_\be_\bq_\bu_\be_\bs_\bt_\b._\bh_\bp_\bp\"\n+represents a byte range within a piece. Internally this is is used for incoming\n+piece requests.\n+struct peer_request\n+{\n+ bool o\bop\bpe\ber\bra\bat\bto\bor\br=\b==\b= (peer_request const& r) const;\n+\n+ piece_index_t piece;\n+ int start;\n+ int length;\n+};\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* o\bop\bpe\ber\bra\bat\bto\bor\br=\b==\b=(\b()\b) *\b**\b**\b**\b**\b*\n+bool o\bop\bpe\ber\bra\bat\bto\bor\br=\b==\b= (peer_request const& r) const;\n+returns true if the right hand side _\bp_\be_\be_\br_\b__\br_\be_\bq_\bu_\be_\bs_\bt refers to the same range as\n+this does.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ piece\n+ The index of the piece in which the range starts.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ start\n+ The byte offset within that piece where the range starts.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ length\n+ The size of the range, in bytes.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* p\bpe\bee\ber\br_\b_i\bin\bnf\bfo\bo *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bp_\be_\be_\br_\b__\bi_\bn_\bf_\bo_\b._\bh_\bp_\bp\"\n+holds information and statistics about one peer that libtorrent is connected to\n+struct peer_info\n+{\n+ sha256_hash i\bi2\b2p\bp_\b_d\bde\bes\bst\bti\bin\bna\bat\bti\bio\bon\bn () const;\n+\n+ std::string client;\n+ typed_bitfield pieces;\n+ std::int64_t total_download;\n+ std::int64_t total_upload;\n+ time_duration last_request;\n+ time_duration last_active;\n+ time_duration download_queue_time;\n+ static constexpr peer_flags_t i\bin\bnt\bte\ber\bre\bes\bst\bti\bin\bng\bg = 0_bit;\n+ static constexpr peer_flags_t c\bch\bho\bok\bke\bed\bd = 1_bit;\n+ static constexpr peer_flags_t r\bre\bem\bmo\bot\bte\be_\b_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd = 2_bit;\n+ static constexpr peer_flags_t r\bre\bem\bmo\bot\bte\be_\b_c\bch\bho\bok\bke\bed\bd = 3_bit;\n+ static constexpr peer_flags_t s\bsu\bup\bpp\bpo\bor\brt\bts\bs_\b_e\bex\bxt\bte\ben\bns\bsi\bio\bon\bns\bs = 4_bit;\n+ static constexpr peer_flags_t o\bou\but\btg\bgo\boi\bin\bng\bg_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn = 5_bit;\n+ static constexpr peer_flags_t l\blo\boc\bca\bal\bl_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn = 5_bit;\n+ static constexpr peer_flags_t h\bha\ban\bnd\bds\bsh\bha\bak\bke\be = 6_bit;\n+ static constexpr peer_flags_t c\bco\bon\bnn\bne\bec\bct\bti\bin\bng\bg = 7_bit;\n+ static constexpr peer_flags_t o\bon\bn_\b_p\bpa\bar\bro\bol\ble\be = 9_bit;\n+ static constexpr peer_flags_t s\bse\bee\bed\bd = 10_bit;\n+ static constexpr peer_flags_t o\bop\bpt\bti\bim\bmi\bis\bst\bti\bic\bc_\b_u\bun\bnc\bch\bho\bok\bke\be = 11_bit;\n+ static constexpr peer_flags_t s\bsn\bnu\bub\bbb\bbe\bed\bd = 12_bit;\n+ static constexpr peer_flags_t u\bup\bpl\blo\boa\bad\bd_\b_o\bon\bnl\bly\by = 13_bit;\n+ static constexpr peer_flags_t e\ben\bnd\bdg\bga\bam\bme\be_\b_m\bmo\bod\bde\be = 14_bit;\n+ static constexpr peer_flags_t h\bho\bol\ble\bep\bpu\bun\bnc\bch\bhe\bed\bd = 15_bit;\n+ static constexpr peer_flags_t i\bi2\b2p\bp_\b_s\bso\boc\bck\bke\bet\bt = 16_bit;\n+ static constexpr peer_flags_t u\but\btp\bp_\b_s\bso\boc\bck\bke\bet\bt = 17_bit;\n+ static constexpr peer_flags_t s\bss\bsl\bl_\b_s\bso\boc\bck\bke\bet\bt = 18_bit;\n+ static constexpr peer_flags_t r\brc\bc4\b4_\b_e\ben\bnc\bcr\bry\byp\bpt\bte\bed\bd = 19_bit;\n+ static constexpr peer_flags_t p\bpl\bla\bai\bin\bnt\bte\bex\bxt\bt_\b_e\ben\bnc\bcr\bry\byp\bpt\bte\bed\bd = 20_bit;\n+ peer_flags_t flags;\n+ static constexpr peer_source_flags_t t\btr\bra\bac\bck\bke\ber\br = 0_bit;\n+ static constexpr peer_source_flags_t d\bdh\bht\bt = 1_bit;\n+ static constexpr peer_source_flags_t p\bpe\bex\bx = 2_bit;\n+ static constexpr peer_source_flags_t l\bls\bsd\bd = 3_bit;\n+ static constexpr peer_source_flags_t r\bre\bes\bsu\bum\bme\be_\b_d\bda\bat\bta\ba = 4_bit;\n+ static constexpr peer_source_flags_t i\bin\bnc\bco\bom\bmi\bin\bng\bg = 5_bit;\n+ peer_source_flags_t source;\n+ int up_speed;\n+ int down_speed;\n+ int payload_up_speed;\n+ int payload_down_speed;\n+ peer_id pid;\n+ int queue_bytes;\n+ int request_timeout;\n+ int send_buffer_size;\n+ int used_send_buffer;\n+ int receive_buffer_size;\n+ int used_receive_buffer;\n+ int receive_buffer_watermark;\n+ int num_hashfails;\n+ int download_queue_length;\n+ int timed_out_requests;\n+ int busy_requests;\n+ int requests_in_buffer;\n+ int target_dl_queue_length;\n+ int upload_queue_length;\n+ int failcount;\n+ piece_index_t downloading_piece_index;\n+ int downloading_block_index;\n+ int downloading_progress;\n+ int downloading_total;\n+ static constexpr connection_type_t s\bst\bta\ban\bnd\bda\bar\brd\bd_\b_b\bbi\bit\btt\bto\bor\brr\bre\ben\bnt\bt = 0_bit;\n+ static constexpr connection_type_t w\bwe\beb\bb_\b_s\bse\bee\bed\bd = 1_bit;\n+ static constexpr connection_type_t h\bht\btt\btp\bp_\b_s\bse\bee\bed\bd = 2_bit;\n+ connection_type_t connection_type;\n+ int pending_disk_bytes;\n+ int pending_disk_read_bytes;\n+ int send_quota;\n+ int receive_quota;\n+ int rtt;\n+ int num_pieces;\n+ int download_rate_peak;\n+ int upload_rate_peak;\n+ float progress;\n+ int progress_ppm;\n+ _\bt_\bc_\bp_\b:_\b:_\be_\bn_\bd_\bp_\bo_\bi_\bn_\bt ip;\n+ _\bt_\bc_\bp_\b:_\b:_\be_\bn_\bd_\bp_\bo_\bi_\bn_\bt local_endpoint;\n+ static constexpr bandwidth_state_flags_t b\bbw\bw_\b_i\bid\bdl\ble\be = 0_bit;\n+ static constexpr bandwidth_state_flags_t b\bbw\bw_\b_l\bli\bim\bmi\bit\bt = 1_bit;\n+ static constexpr bandwidth_state_flags_t b\bbw\bw_\b_n\bne\bet\btw\bwo\bor\brk\bk = 2_bit;\n+ static constexpr bandwidth_state_flags_t b\bbw\bw_\b_d\bdi\bis\bsk\bk = 4_bit;\n+ bandwidth_state_flags_t read_state;\n+ bandwidth_state_flags_t write_state;\n+};\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* i\bi2\b2p\bp_\b_d\bde\bes\bst\bti\bin\bna\bat\bti\bio\bon\bn(\b()\b) *\b**\b**\b**\b**\b*\n+sha256_hash i\bi2\b2p\bp_\b_d\bde\bes\bst\bti\bin\bna\bat\bti\bio\bon\bn () const;\n+If this peer is an i2p peer, this function returns the destination address of\n+the peer\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ client\n+ A human readable string describing the software at the other end of the\n+ connection. In some cases this information is not available, then it will\n+ contain a string that may give away something about which software is\n+ running in the other end. In the case of a web seed, the server type and\n+ version will be a part of this string. This is UTF-8 encoded.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ pieces\n+ a _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd, with one bit per piece in the torrent. Each bit tells you if\n+ the peer has that piece (if it's set to 1) or if the peer miss that piece\n+ (set to 0).\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ total_download total_upload\n+ the total number of bytes downloaded from and uploaded to this peer.\n+ These numbers do not include the protocol chatter, but only the payload\n+ data.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ last_request last_active\n+ the time since we last sent a request to this peer and since any transfer\n+ occurred with this peer\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ download_queue_time\n+ the time until all blocks in the request queue will be downloaded\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ interesting\n+ w\bwe\be are interested in pieces from this peer.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ choked\n+ w\bwe\be have choked this peer.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ remote_interested\n+ the peer is interested in u\bus\bs\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ remote_choked\n+ the peer has choked u\bus\bs.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ supports_extensions\n+ means that this peer supports the _\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\b _\bp_\br_\bo_\bt_\bo_\bc_\bo_\bl.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ outgoing_connection\n+ The connection was initiated by us, the peer has a listen port open, and\n+ that port is the same as in the address of this peer. If this flag is not\n+ set, this peer connection was opened by this peer connecting to us.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ local_connection\n+ deprecated synonym for outgoing_connection\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ handshake\n+ The connection is opened, and waiting for the handshake. Until the\n+ handshake is done, the peer cannot be identified.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ connecting\n+ The connection is in a half-open state (i.e. it is being connected).\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ on_parole\n+ The peer has participated in a piece that failed the hash check, and is\n+ now \"on parole\", which means we're only requesting whole pieces from this\n+ peer until it either fails that piece or proves that it doesn't send bad\n+ data.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ seed\n+ This peer is a seed (it has all the pieces).\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ optimistic_unchoke\n+ This peer is subject to an optimistic unchoke. It has been unchoked for a\n+ while to see if it might unchoke us in return an earn an upload/unchoke\n+ slot. If it doesn't within some period of time, it will be choked and\n+ another peer will be optimistically unchoked.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ snubbed\n+ This peer has recently failed to send a block within the request timeout\n+ from when the request was sent. We're currently picking one block at a\n+ time from this peer.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ upload_only\n+ This peer has either explicitly (with an extension) or implicitly (by\n+ becoming a seed) told us that it will not downloading anything more,\n+ regardless of which pieces we have.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ endgame_mode\n+ This means the last time this peer picket a piece, it could not pick as\n+ many as it wanted because there were not enough free ones. i.e. all\n+ pieces this peer has were already requested from other peers.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ holepunched\n+ This flag is set if the peer was in holepunch mode when the connection\n+ succeeded. This typically only happens if both peers are behind a NAT and\n+ the peers connect via the NAT holepunch mechanism.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ i2p_socket\n+ indicates that this socket is running on top of the I2P transport.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ utp_socket\n+ indicates that this socket is a uTP socket\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ ssl_socket\n+ indicates that this socket is running on top of an SSL (TLS) channel\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ rc4_encrypted\n+ this connection is obfuscated with RC4\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ plaintext_encrypted\n+ the handshake of this connection was obfuscated with a Diffie-Hellman\n+ exchange\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ flags\n+ tells you in which state the peer is in. It is set to any combination of\n+ the peer_flags_t flags above.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ tracker\n+ The peer was received from the tracker.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ dht\n+ The peer was received from the kademlia DHT.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ pex\n+ The peer was received from the peer exchange extension.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ lsd\n+ The peer was received from the local service discovery (The peer is on\n+ the local network).\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ resume_data\n+ The peer was added from the fast resume data.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ incoming\n+ we received an incoming connection from this peer\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ source\n+ a combination of flags describing from which sources this peer was\n+ received. A combination of the peer_source_flags_t above.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ up_speed down_speed\n+ the current upload and download speed we have to and from this peer\n+ (including any protocol messages). updated about once per second\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ payload_up_speed payload_down_speed\n+ The transfer rates of payload data only updated about once per second\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ pid\n+ the peer's id as used in the bittorrent protocol. This id can be used to\n+ extract 'fingerprints' from the peer. Sometimes it can tell you which\n+ client the peer is using. See identify_client()_\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ queue_bytes\n+ the number of bytes we have requested from this peer, but not yet\n+ received.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ request_timeout\n+ the number of seconds until the current front piece request will time\n+ out. This timeout can be adjusted through settings_pack::request_timeout.\n+ -1 means that there is not outstanding request.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ send_buffer_size used_send_buffer\n+ the number of bytes allocated and used for the peer's send buffer,\n+ respectively.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ receive_buffer_size used_receive_buffer receive_buffer_watermark\n+ the number of bytes allocated and used as receive buffer, respectively.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ num_hashfails\n+ the number of pieces this peer has participated in sending us that turned\n+ out to fail the hash check.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ download_queue_length\n+ this is the number of requests we have sent to this peer that we haven't\n+ got a response for yet\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ timed_out_requests\n+ the number of block requests that have timed out, and are still in the\n+ download queue\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ busy_requests\n+ the number of busy requests in the download queue. A busy request is a\n+ request for a block we've also requested from a different peer\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ requests_in_buffer\n+ the number of requests messages that are currently in the send buffer\n+ waiting to be sent.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ target_dl_queue_length\n+ the number of requests that is tried to be maintained (this is typically\n+ a function of download speed)\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ upload_queue_length\n+ the number of piece-requests we have received from this peer that we\n+ haven't answered with a piece yet.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ failcount\n+ the number of times this peer has \"failed\". i.e. failed to connect or\n+ disconnected us. The failcount is decremented when we see this peer in a\n+ tracker response or peer exchange message.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ downloading_piece_index downloading_block_index downloading_progress\n+ downloading_total\n+ You can know which piece, and which part of that piece, that is currently\n+ being downloaded from a specific peer by looking at these four members.\n+ downloading_piece_index is the index of the piece that is currently being\n+ downloaded. This may be set to -1 if there's currently no piece\n+ downloading from this peer. If it is >= 0, the other three members are\n+ valid. downloading_block_index is the index of the block (or sub-piece)\n+ that is being downloaded. downloading_progress is the number of bytes of\n+ this block we have received from the peer, and downloading_total is the\n+ total number of bytes in this block.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ standard_bittorrent\n+ Regular bittorrent connection\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ web_seed\n+ HTTP connection using the _\bB_\bE_\bP_\b _\b1_\b9 protocol\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ http_seed\n+ HTTP connection using the _\bB_\bE_\bP_\b _\b1_\b7 protocol\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ connection_type\n+ the kind of connection this peer uses. See connection_type_t.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ pending_disk_bytes\n+ the number of bytes this peer has pending in the disk-io thread.\n+ Downloaded and waiting to be written to disk. This is what is capped by\n+ settings_pack::max_queued_disk_bytes.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ pending_disk_read_bytes\n+ number of outstanding bytes to read from disk\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ send_quota receive_quota\n+ the number of bytes this peer has been assigned to be allowed to send and\n+ receive until it has to request more quota from the bandwidth manager.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ rtt\n+ an estimated round trip time to this peer, in milliseconds. It is\n+ estimated by timing the TCP connect(). It may be 0 for incoming\n+ connections.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ num_pieces\n+ the number of pieces this peer has.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ download_rate_peak upload_rate_peak\n+ the highest download and upload rates seen on this connection. They are\n+ given in bytes per second. This number is reset to 0 on reconnect.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ progress\n+ the progress of the peer in the range [0, 1]. This is always 0 when\n+ floating point operations are disabled, instead use progress_ppm.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ progress_ppm\n+ indicates the download progress of the peer in the range [0, 1000000]\n+ (parts per million).\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ ip\n+ the IP-address to this peer. The type is an asio endpoint. For more info,\n+ see the _\ba_\bs_\bi_\bo documentation. This field is not valid for i2p peers.\n+ Instead use the _\bi_\b2_\bp_\b__\bd_\be_\bs_\bt_\bi_\bn_\ba_\bt_\bi_\bo_\bn_\b(_\b) function.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ local_endpoint\n+ the IP and port pair the socket is bound to locally. i.e. the IP address\n+ of the interface it's going out over. This may be useful for multi-homed\n+ clients with multiple interfaces to the internet. This field is not valid\n+ for i2p peers.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ bw_idle\n+ The peer is not waiting for any external events to send or receive data.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ bw_limit\n+ The peer is waiting for the rate limiter.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ bw_network\n+ The peer has quota and is currently waiting for a network read or write\n+ operation to complete. This is the state all peers are in if there are no\n+ bandwidth limits.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ bw_disk\n+ The peer is waiting for the disk I/O thread to catch up writing buffers\n+ to disk before downloading more.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ read_state write_state\n+ bitmasks indicating what state this peer is in with regards to sending\n+ and receiving data. The states are defined as independent flags of type\n+ bandwidth_state_flags_t, in this class.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* v\bve\ber\brs\bsi\bio\bon\bn(\b()\b) *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bv_\be_\br_\bs_\bi_\bo_\bn_\b._\bh_\bp_\bp\"\n+char const* v\bve\ber\brs\bsi\bio\bon\bn ();\n+returns the libtorrent version as string form in this format:\n+\"...\"\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* t\bto\bor\brr\bre\ben\bnt\bt_\b_p\bpe\bee\ber\br_\b_e\beq\bqu\bua\bal\bl(\b()\b) *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\be_\be_\br_\b._\bh_\bp_\bp\"\n+inline bool t\bto\bor\brr\bre\ben\bnt\bt_\b_p\bpe\bee\ber\br_\b_e\beq\bqu\bua\bal\bl (torrent_peer const* lhs, torrent_peer const*\n+rhs);\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* t\btr\bru\bun\bnc\bca\bat\bte\be_\b_f\bfi\bil\ble\bes\bs(\b()\b) *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bt_\br_\bu_\bn_\bc_\ba_\bt_\be_\b._\bh_\bp_\bp\"\n+void t\btr\bru\bun\bnc\bca\bat\bte\be_\b_f\bfi\bil\ble\bes\bs (file_storage const& fs, std::string const& save_path,\n+storage_error& ec);\n+Truncates files larger than specified in the _\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be, saved under the\n+specified save_path.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* m\bma\bak\bke\be_\b_m\bma\bag\bgn\bne\bet\bt_\b_u\bur\bri\bi(\b()\b) *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bm_\ba_\bg_\bn_\be_\bt_\b__\bu_\br_\bi_\b._\bh_\bp_\bp\"\n+std::string m\bma\bak\bke\be_\b_m\bma\bag\bgn\bne\bet\bt_\b_u\bur\bri\bi (add_torrent_params const& atp);\n+std::string m\bma\bak\bke\be_\b_m\bma\bag\bgn\bne\bet\bt_\b_u\bur\bri\bi (torrent_info const& info);\n+std::string m\bma\bak\bke\be_\b_m\bma\bag\bgn\bne\bet\bt_\b_u\bur\bri\bi (torrent_handle const& handle);\n+Generates a magnet URI from the specified torrent.\n+Several fields from the _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs objects are recorded in the magnet\n+link. In order to not include them, they have to be cleared before calling\n+_\bm_\ba_\bk_\be_\b__\bm_\ba_\bg_\bn_\be_\bt_\b__\bu_\br_\bi_\b(_\b). These fields are used:\n+ ti, info_hashes, url_seeds, dht_nodes, file_priorities, trackers,\n+ name, peers.\n+Depending on what the use case for the resulting magnet link is, clearing peers\n+and dht_nodes is probably a good idea if the _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs came from a\n+running torrent. Those lists may be long and be ephemeral.\n+If none of the info_hashes or ti fields are set, there is not info-hash\n+available, and a magnet link cannot be created. In this case _\bm_\ba_\bk_\be_\b__\bm_\ba_\bg_\bn_\be_\bt_\b__\bu_\br_\bi_\b(_\b)\n+returns an empty string.\n+The recommended way to generate a magnet link from a _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be is to call\n+_\bs_\ba_\bv_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b), which will post a _\bs_\ba_\bv_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b__\ba_\bl_\be_\br_\bt containing an\n+_\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs object. This can then be passed to _\bm_\ba_\bk_\be_\b__\bm_\ba_\bg_\bn_\be_\bt_\b__\bu_\br_\bi_\b(_\b).\n+The overload that takes a _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be will make blocking calls to query\n+information about the torrent. If the torrent handle is invalid, an empty\n+string is returned.\n+For more information about magnet links, see _\bm_\ba_\bg_\bn_\be_\bt_\b _\bl_\bi_\bn_\bk_\bs.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* p\bpa\bar\brs\bse\be_\b_m\bma\bag\bgn\bne\bet\bt_\b_u\bur\bri\bi(\b()\b) *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bm_\ba_\bg_\bn_\be_\bt_\b__\bu_\br_\bi_\b._\bh_\bp_\bp\"\n+add_torrent_params p\bpa\bar\brs\bse\be_\b_m\bma\bag\bgn\bne\bet\bt_\b_u\bur\bri\bi (string_view uri, error_code& ec);\n+add_torrent_params p\bpa\bar\brs\bse\be_\b_m\bma\bag\bgn\bne\bet\bt_\b_u\bur\bri\bi (string_view uri);\n+void p\bpa\bar\brs\bse\be_\b_m\bma\bag\bgn\bne\bet\bt_\b_u\bur\bri\bi (string_view uri, add_torrent_params& p, error_code& ec);\n+This function parses out information from the magnet link and populates the\n+_\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs object. The overload that does not take an error_code\n+reference will throw a system_error on error The overload taking an\n+add_torrent_params reference will fill in the fields specified in the magnet\n+URI.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* l\blo\boa\bad\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be(\b()\b) l\blo\boa\bad\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_b\bbu\buf\bff\bfe\ber\br(\b()\b) l\blo\boa\bad\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_p\bpa\bar\brs\bse\bed\bd(\b()\b) *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bl_\bo_\ba_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bh_\bp_\bp\"\n+add_torrent_params l\blo\boa\bad\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be (\n+ std::string const& filename, load_torrent_limits const& cfg);\n+add_torrent_params l\blo\boa\bad\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_p\bpa\bar\brs\bse\bed\bd (\n+ bdecode_node const& torrent_file, load_torrent_limits const& cfg);\n+add_torrent_params l\blo\boa\bad\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_p\bpa\bar\brs\bse\bed\bd (\n+ bdecode_node const& torrent_file);\n+add_torrent_params l\blo\boa\bad\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_b\bbu\buf\bff\bfe\ber\br (\n+ span buffer, load_torrent_limits const& cfg);\n+add_torrent_params l\blo\boa\bad\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be (\n+ std::string const& filename);\n+add_torrent_params l\blo\boa\bad\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_b\bbu\buf\bff\bfe\ber\br (\n+ span buffer);\n+These functions load the content of a .torrent file into an _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs\n+object. The immutable part of a torrent file (the info-dictionary) is stored in\n+the ti field in the _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs object (as a _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo object). The\n+returned object is suitable to be:\n+ * added to a _\bs_\be_\bs_\bs_\bi_\bo_\bn via _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b) or _\ba_\bs_\by_\bn_\bc_\b__\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b)\n+ * saved as a .torrent_file via _\bw_\br_\bi_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bi_\bl_\be_\b(_\b)\n+ * turned into a magnet link via _\bm_\ba_\bk_\be_\b__\bm_\ba_\bg_\bn_\be_\bt_\b__\bu_\br_\bi_\b(_\b)\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* e\ben\bnu\bum\bm s\bso\boc\bck\bke\bet\bt_\b_t\bty\byp\bpe\be_\b_t\bt *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\bo_\bc_\bk_\be_\bt_\b__\bt_\by_\bp_\be_\b._\bh_\bp_\bp\"\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n+|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn|\n+|_\bt_\bc_\bp_\b _\b _\b _\b _\b _\b _\b _\b|_\b0_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bs_\bo_\bc_\bk_\bs_\b5_\b _\b _\b _\b _\b|_\b1_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bh_\bt_\bt_\bp_\b _\b _\b _\b _\b _\b _\b|_\b2_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bu_\bt_\bp_\b _\b _\b _\b _\b _\b _\b _\b|_\b3_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bi_\b2_\bp_\b _\b _\b _\b _\b _\b _\b _\b|_\b4_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bt_\bc_\bp_\b__\bs_\bs_\bl_\b _\b _\b _\b|_\b5_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bs_\bo_\bc_\bk_\bs_\b5_\b__\bs_\bs_\bl_\b|_\b6_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bh_\bt_\bt_\bp_\b__\bs_\bs_\bl_\b _\b _\b|_\b7_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bu_\bt_\bp_\b__\bs_\bs_\bl_\b _\b _\b _\b|_\b8_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* e\ben\bnu\bum\bm p\bpr\bro\bot\bto\boc\bco\bol\bl_\b_v\bve\ber\brs\bsi\bio\bon\bn *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bi_\bn_\bf_\bo_\b__\bh_\ba_\bs_\bh_\b._\bh_\bp_\bp\"\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n+|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bV_\b1_\b _\b _\b|_\b0_\b _\b _\b _\b _\b|_\bT_\bh_\be_\b _\bo_\br_\bi_\bg_\bi_\bn_\ba_\bl_\b _\bB_\bi_\bt_\bT_\bo_\br_\br_\be_\bn_\bt_\b _\bv_\be_\br_\bs_\bi_\bo_\bn_\b,_\b _\bu_\bs_\bi_\bn_\bg_\b _\bS_\bH_\bA_\b-_\b1_\b _\bh_\ba_\bs_\bh_\be_\bs_\b _\b _\b _\b _\b _\b _\b |\n+|_\bV_\b2_\b _\b _\b|_\b1_\b _\b _\b _\b _\b|_\bV_\be_\br_\bs_\bi_\bo_\bn_\b _\b2_\b _\bo_\bf_\b _\bt_\bh_\be_\b _\bB_\bi_\bt_\bT_\bo_\br_\br_\be_\bn_\bt_\b _\bp_\br_\bo_\bt_\bo_\bc_\bo_\bl_\b,_\b _\bu_\bs_\bi_\bn_\bg_\b _\bS_\bH_\bA_\b-_\b2_\b5_\b6_\b _\bh_\ba_\bs_\bh_\be_\bs|\n+|_\bN_\bU_\bM_\b _\b|_\b2_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* e\ben\bnu\bum\bm e\bev\bve\ben\bnt\bt_\b_t\bt *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bt_\br_\ba_\bc_\bk_\be_\br_\b__\bm_\ba_\bn_\ba_\bg_\be_\br_\b._\bh_\bp_\bp\"\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n+|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn|\n+|_\bn_\bo_\bn_\be_\b _\b _\b _\b _\b _\b|_\b0_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bc_\bo_\bm_\bp_\bl_\be_\bt_\be_\bd_\b|_\b1_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bs_\bt_\ba_\br_\bt_\be_\bd_\b _\b _\b|_\b2_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bs_\bt_\bo_\bp_\bp_\be_\bd_\b _\b _\b|_\b3_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bp_\ba_\bu_\bs_\be_\bd_\b _\b _\b _\b|_\b4_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* e\ben\bnu\bum\bm c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn_\b_t\bty\byp\bpe\be *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bp_\be_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b._\bh_\bp_\bp\"\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n+|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn|\n+|_\bb_\bi_\bt_\bt_\bo_\br_\br_\be_\bn_\bt_\b|_\b0_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bu_\br_\bl_\b__\bs_\be_\be_\bd_\b _\b _\b|_\b1_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bh_\bt_\bt_\bp_\b__\bs_\be_\be_\bd_\b _\b|_\b2_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* e\ben\bnu\bum\bm p\bpo\bor\brt\btm\bma\bap\bp_\b_t\btr\bra\ban\bns\bsp\bpo\bor\brt\bt *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bp_\bo_\br_\bt_\bm_\ba_\bp_\b._\bh_\bp_\bp\"\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n+|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bn_\ba_\bt_\bp_\bm_\bp_\b|_\b0_\b _\b _\b _\b _\b|_\bn_\ba_\bt_\bp_\bm_\bp_\b _\bc_\ba_\bn_\b _\bb_\be_\b _\bN_\bA_\bT_\b-_\bP_\bM_\bP_\b _\bo_\br_\b _\bP_\bC_\bP|\n+|_\bu_\bp_\bn_\bp_\b _\b _\b|_\b1_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* e\ben\bnu\bum\bm p\bpo\bor\brt\btm\bma\bap\bp_\b_p\bpr\bro\bot\bto\boc\bco\bol\bl *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bp_\bo_\br_\bt_\bm_\ba_\bp_\b._\bh_\bp_\bp\"\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n+|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn|\n+|_\bn_\bo_\bn_\be_\b|_\b0_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bt_\bc_\bp_\b _\b|_\b1_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bu_\bd_\bp_\b _\b|_\b2_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* p\bpe\bex\bx_\b_f\bfl\bla\bag\bgs\bs_\b_t\bt *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bp_\be_\bx_\b__\bf_\bl_\ba_\bg_\bs_\b._\bh_\bp_\bp\"\n+ pex_encryption\n+ the peer supports protocol encryption\n+ pex_seed\n+ the peer is a seed\n+ pex_utp\n+ the peer supports the uTP, transport protocol over UDP.\n+ pex_holepunch\n+ the peer supports the holepunch extension If this flag is received from a\n+ peer, it can be used as a rendezvous point in case direct connections to\n+ the peer fail\n+ pex_lt_v2\n+ protocol v2 this is not a standard flag, it is only used internally\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfl\bla\bag\bgs\bs_\b_t\bt *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bl_\ba_\bg_\bs_\b._\bh_\bp_\bp\"\n+ seed_mode\n+ If seed_mode is set, libtorrent will assume that all files are present\n+ for this torrent and that they all match the hashes in the torrent file.\n+ Each time a peer requests to download a block, the piece is verified\n+ against the hash, unless it has been verified already. If a hash fails,\n+ the torrent will automatically leave the seed mode and recheck all the\n+ files. The use case for this mode is if a torrent is created and seeded,\n+ or if the user already know that the files are complete, this is a way to\n+ avoid the initial file checks, and significantly reduce the startup time.\n+ Setting seed_mode on a torrent without metadata (a .torrent file) is a\n+ no-op and will be ignored.\n+ It is not possible to s\bse\bet\bt the seed_mode flag on a torrent after it has\n+ been added to a _\bs_\be_\bs_\bs_\bi_\bo_\bn. It is possible to c\bcl\ble\bea\bar\br it though.\n+ upload_mode\n+ If upload_mode is set, the torrent will be initialized in upload-mode,\n+ which means it will not make any piece requests. This state is typically\n+ entered on disk I/O errors, and if the torrent is also auto managed, it\n+ will be taken out of this state periodically (see settings_pack::\n+ optimistic_disk_retry).\n+ This mode can be used to avoid race conditions when adjusting priorities\n+ of pieces before allowing the torrent to start downloading.\n+ If the torrent is auto-managed (auto_managed), the torrent will\n+ eventually be taken out of upload-mode, regardless of how it got there.\n+ If it's important to manually control when the torrent leaves upload\n+ mode, don't make it auto managed.\n+ share_mode\n+ determines if the torrent should be added in s\bsh\bha\bar\bre\be m\bmo\bod\bde\be or not. Share\n+ mode indicates that we are not interested in downloading the torrent, but\n+ merely want to improve our share ratio (i.e. increase it). A torrent\n+ started in share mode will do its best to never download more than it\n+ uploads to the swarm. If the swarm does not have enough demand for upload\n+ capacity, the torrent will not download anything. This mode is intended\n+ to be safe to add any number of torrents to, without manual screening,\n+ without the risk of downloading more than is uploaded.\n+ A torrent in share mode sets the priority to all pieces to 0, except for\n+ the pieces that are downloaded, when pieces are decided to be downloaded.\n+ This affects the progress bar, which might be set to \"100% finished\" most\n+ of the time. Do not change file or piece priorities for torrents in share\n+ mode, it will make it not work.\n+ The share mode has one setting, the share ratio target, see\n+ settings_pack::share_mode_target for more info.\n+ apply_ip_filter\n+ determines if the IP filter should apply to this torrent or not. By\n+ default all torrents are subject to filtering by the IP filter (i.e. this\n+ flag is set by default). This is useful if certain torrents needs to be\n+ exempt for some reason, being an auto-update torrent for instance.\n+ paused\n+ specifies whether or not the torrent is paused. i.e. it won't connect to\n+ the tracker or any of the peers until it's resumed. Note that a paused\n+ torrent that also has the auto_managed flag set can be started at any\n+ time by libtorrent's queuing logic. See _\bq_\bu_\be_\bu_\bi_\bn_\bg.\n+ auto_managed\n+ If the torrent is auto-managed (auto_managed), the torrent may be resumed\n+ at any point, regardless of how it paused. If it's important to manually\n+ control when the torrent is paused and resumed, don't make it auto\n+ managed.\n+ If auto_managed is set, the torrent will be queued, started and seeded\n+ automatically by libtorrent. When this is set, the torrent should also be\n+ started as paused. The default queue order is the order the torrents were\n+ added. They are all downloaded in that order. For more details, see\n+ _\bq_\bu_\be_\bu_\bi_\bn_\bg.\n+ duplicate_is_error\n+ used in _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs to indicate that it's an error to attempt to\n+ add a torrent that's already in the _\bs_\be_\bs_\bs_\bi_\bo_\bn. If it's not considered an\n+ error, a handle to the existing torrent is returned. This flag is not\n+ saved by _\bw_\br_\bi_\bt_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b), since it is only meant for adding torrents.\n+ update_subscribe\n+ on by default and means that this torrent will be part of state updates\n+ when calling _\bp_\bo_\bs_\bt_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bu_\bp_\bd_\ba_\bt_\be_\bs_\b(_\b). This flag is not saved by\n+ _\bw_\br_\bi_\bt_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b).\n+ super_seeding\n+ sets the torrent into super seeding/initial seeding mode. If the torrent\n+ is not a seed, this flag has no effect.\n+ sequential_download\n+ sets the sequential download state for the torrent. In this mode the\n+ piece picker will pick pieces with low index numbers before pieces with\n+ high indices. The actual pieces that are picked depend on other factors\n+ still, such as which pieces a peer has and whether it is in parole mode\n+ or \"prefer whole pieces\"-mode. Sequential mode is not ideal for streaming\n+ media. For that, see _\bs_\be_\bt_\b__\bp_\bi_\be_\bc_\be_\b__\bd_\be_\ba_\bd_\bl_\bi_\bn_\be_\b(_\b) instead.\n+ stop_when_ready\n+ When this flag is set, the torrent will f\bfo\bor\brc\bce\be s\bst\bto\bop\bp whenever it\n+ transitions from a non-data-transferring state into a data-transferring\n+ state (referred to as being ready to download or seed). This is useful\n+ for torrents that should not start downloading or seeding yet, but want\n+ to be made ready to do so. A torrent may need to have its files checked\n+ for instance, so it needs to be started and possibly queued for checking\n+ (auto-managed and started) but as soon as it's done, it should be\n+ stopped.\n+ F\bFo\bor\brc\bce\be s\bst\bto\bop\bpp\bpe\bed\bd means auto-managed is set to false and it's paused. As if\n+ the auto_manages flag is cleared and the paused flag is set on the\n+ torrent.\n+ Note that the torrent may transition into a downloading state while\n+ setting this flag, and since the logic is edge triggered you may miss the\n+ edge. To avoid this race, if the torrent already is in a downloading\n+ state when this call is made, it will trigger the stop-when-ready\n+ immediately.\n+ When the stop-when-ready logic fires, the flag is cleared. Any subsequent\n+ transitions between downloading and non-downloading states will not be\n+ affected, until this flag is set again.\n+ The behavior is more robust when setting this flag as part of adding the\n+ torrent. See _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs.\n+ The stop-when-ready flag fixes the inherent race condition of waiting for\n+ the _\bs_\bt_\ba_\bt_\be_\b__\bc_\bh_\ba_\bn_\bg_\be_\bd_\b__\ba_\bl_\be_\br_\bt and then call _\bp_\ba_\bu_\bs_\be_\b(_\b). The download/seeding will\n+ most likely start in between posting the _\ba_\bl_\be_\br_\bt and receiving the call to\n+ pause.\n+ A downloading state is one where peers are being connected. Which means\n+ just downloading the metadata via the ut_metadata extension counts as a\n+ downloading state. In order to stop a torrent once the metadata has been\n+ downloaded, instead set all file priorities to dont_download\n+ override_trackers\n+ when this flag is set, the tracker list in the _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs object\n+ override any trackers from the torrent file. If the flag is not set, the\n+ trackers from the _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs object will be added to the list of\n+ trackers used by the torrent. This flag is set by _\br_\be_\ba_\bd_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b) if\n+ there are trackers present in the resume data file. This effectively\n+ makes the trackers saved in the resume data take precedence over the\n+ original trackers. This includes if there's an empty list of trackers, to\n+ support the case where they were explicitly removed in the previous\n+ _\bs_\be_\bs_\bs_\bi_\bo_\bn. This flag is not saved by _\bw_\br_\bi_\bt_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b)\n+ override_web_seeds\n+ If this flag is set, the web seeds from the _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs object\n+ will override any web seeds in the torrent file. If it's not set, web\n+ seeds in the _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs object will be added to the list of web\n+ seeds used by the torrent. This flag is set by _\br_\be_\ba_\bd_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b) if\n+ there are web seeds present in the resume data file. This effectively\n+ makes the web seeds saved in the resume data take precedence over the\n+ original ones. This includes if there's an empty list of web seeds, to\n+ support the case where they were explicitly removed in the previous\n+ _\bs_\be_\bs_\bs_\bi_\bo_\bn. This flag is not saved by _\bw_\br_\bi_\bt_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b)\n+ need_save_resume\n+ if this flag is set (which it is by default) the torrent will be\n+ considered needing to save its resume data immediately, in the category\n+ if_metadata_changed. See resume_data_flags_t and _\bs_\ba_\bv_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b) for\n+ details.\n+ This flag is cleared by a successful call to _\bs_\ba_\bv_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b) This flag\n+ is not saved by _\bw_\br_\bi_\bt_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b), since it represents an ephemeral\n+ state of a running torrent.\n+ disable_dht\n+ set this flag to disable DHT for this torrent. This lets you have the DHT\n+ enabled for the whole client, and still have specific torrents not\n+ participating in it. i.e. not announcing to the DHT nor picking up peers\n+ from it.\n+ disable_lsd\n+ set this flag to disable local service discovery for this torrent.\n+ disable_pex\n+ set this flag to disable peer exchange for this torrent.\n+ no_verify_files\n+ if this flag is set, the resume data will be assumed to be correct\n+ without validating it against any files on disk. This may be used when\n+ restoring a _\bs_\be_\bs_\bs_\bi_\bo_\bn by loading resume data from disk. It will save time\n+ and also delay any hard disk errors until files are actually needed. If\n+ the resume data cannot be trusted, or if a torrent is added for the first\n+ time to some save path that may already have some of the files, this flag\n+ should not be set.\n+ default_dont_download\n+ default all file priorities to dont_download. This is useful for adding\n+ magnet links where the number of files is unknown, but the\n+ file_priorities is still set for some files. Any file not covered by the\n+ file_priorities list will be set to normal download priority, unless this\n+ flag is set, in which case they will be set to 0 (dont_download).\n+ i2p_torrent\n+ this flag makes the torrent be considered an \"i2p torrent\" for purposes\n+ of the allow_i2p_mixed setting. When mixing regular peers and i2p peers\n+ is disabled, i2p torrents won't add normal peers to its peer list. Note\n+ that non i2p torrents may still allow i2p peers (on the off-chance that a\n+ tracker return them and the _\bs_\be_\bs_\bs_\bi_\bo_\bn is configured with a SAM connection).\n+ This flag is set automatically when adding a torrent that has at least\n+ one tracker whose hostname ends with .i2p. It's also set by\n+ _\bp_\ba_\br_\bs_\be_\b__\bm_\ba_\bg_\bn_\be_\bt_\b__\bu_\br_\bi_\b(_\b) if the tracker list contains such URL.\n+ all\n+ all torrent flags combined. Can conveniently be used when creating masks\n+ for flags\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* i\bin\bnt\bt *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bv_\be_\br_\bs_\bi_\bo_\bn_\b._\bh_\bp_\bp\"\n+ version_major\n+ the major, minor and tiny versions of libtorrent\n+ version_minor\n+ the major, minor and tiny versions of libtorrent\n+ version_tiny\n+ the major, minor and tiny versions of libtorrent\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* c\bch\bha\bar\br c\bco\bon\bns\bst\bt*\b* *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bv_\be_\br_\bs_\bi_\bo_\bn_\b._\bh_\bp_\bp\"\n+ version_str\n+ the libtorrent version in string form\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* s\bst\btd\bd:\b::\b:u\bui\bin\bnt\bt6\b64\b4_\b_t\bt *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bv_\be_\br_\bs_\bi_\bo_\bn_\b._\bh_\bp_\bp\"\n+ version_revision\n+ the git commit of this libtorrent version\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_p\bpr\bri\bio\bor\bri\bit\bty\by_\b_t\bt *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\b__\bp_\br_\bi_\bo_\br_\bi_\bt_\by_\b._\bh_\bp_\bp\"\n+ dont_download\n+ Don't download the file or piece. Partial pieces may still be downloaded\n+ when setting file priorities.\n+ default_priority\n+ The default priority for files and pieces.\n+ low_priority\n+ The lowest priority for files and pieces.\n+ top_priority\n+ The highest priority for files and pieces.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* t\bto\bor\brr\bre\ben\bnt\bt_\b_s\bst\bta\bat\btu\bus\bs *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bs_\bt_\ba_\bt_\bu_\bs_\b._\bh_\bp_\bp\"\n+holds a snapshot of the status of a torrent, as queried by _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be_\b:_\b:\n+_\bs_\bt_\ba_\bt_\bu_\bs_\b(_\b).\n+struct torrent_status\n+{\n+ bool o\bop\bpe\ber\bra\bat\bto\bor\br=\b==\b= (torrent_status const& st) const;\n+\n+ enum state_t\n+ {\n+ checking_files,\n+ downloading_metadata,\n+ downloading,\n+ finished,\n+ seeding,\n+ unused_enum_for_backwards_compatibility_allocating,\n+ checking_resume_data,\n+ };\n+\n+ torrent_handle handle;\n+ error_code errc;\n+ file_index_t e\ber\brr\bro\bor\br_\b_f\bfi\bil\ble\be = torrent_status::error_file_none;\n+ static constexpr file_index_t e\ber\brr\bro\bor\br_\b_f\bfi\bil\ble\be_\b_n\bno\bon\bne\be {-1};\n+ static constexpr file_index_t e\ber\brr\bro\bor\br_\b_f\bfi\bil\ble\be_\b_s\bss\bsl\bl_\b_c\bct\btx\bx {-3};\n+ static constexpr file_index_t e\ber\brr\bro\bor\br_\b_f\bfi\bil\ble\be_\b_m\bme\bet\bta\bad\bda\bat\bta\ba {-4};\n+ static constexpr file_index_t e\ber\brr\bro\bor\br_\b_f\bfi\bil\ble\be_\b_e\bex\bxc\bce\bep\bpt\bti\bio\bon\bn {-5};\n+ static constexpr file_index_t e\ber\brr\bro\bor\br_\b_f\bfi\bil\ble\be_\b_p\bpa\bar\brt\btf\bfi\bil\ble\be {-6};\n+ std::string save_path;\n+ std::string name;\n+ std::weak_ptr torrent_file;\n+ time_duration n\bne\bex\bxt\bt_\b_a\ban\bnn\bno\bou\bun\bnc\bce\be = seconds{0};\n+ std::string current_tracker;\n+ std::int64_t t\bto\bot\bta\bal\bl_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd = 0;\n+ std::int64_t t\bto\bot\bta\bal\bl_\b_u\bup\bpl\blo\boa\bad\bd = 0;\n+ std::int64_t t\bto\bot\bta\bal\bl_\b_p\bpa\bay\byl\blo\boa\bad\bd_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd = 0;\n+ std::int64_t t\bto\bot\bta\bal\bl_\b_p\bpa\bay\byl\blo\boa\bad\bd_\b_u\bup\bpl\blo\boa\bad\bd = 0;\n+ std::int64_t t\bto\bot\bta\bal\bl_\b_f\bfa\bai\bil\ble\bed\bd_\b_b\bby\byt\bte\bes\bs = 0;\n+ std::int64_t t\bto\bot\bta\bal\bl_\b_r\bre\bed\bdu\bun\bnd\bda\ban\bnt\bt_\b_b\bby\byt\bte\bes\bs = 0;\n+ typed_bitfield pieces;\n+ typed_bitfield verified_pieces;\n+ std::int64_t t\bto\bot\bta\bal\bl_\b_d\bdo\bon\bne\be = 0;\n+ std::int64_t t\bto\bot\bta\bal\bl = 0;\n+ std::int64_t t\bto\bot\bta\bal\bl_\b_w\bwa\ban\bnt\bte\bed\bd_\b_d\bdo\bon\bne\be = 0;\n+ std::int64_t t\bto\bot\bta\bal\bl_\b_w\bwa\ban\bnt\bte\bed\bd = 0;\n+ std::int64_t a\bal\bll\bl_\b_t\bti\bim\bme\be_\b_u\bup\bpl\blo\boa\bad\bd = 0;\n+ std::int64_t a\bal\bll\bl_\b_t\bti\bim\bme\be_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd = 0;\n+ std::time_t a\bad\bdd\bde\bed\bd_\b_t\bti\bim\bme\be = 0;\n+ std::time_t c\bco\bom\bmp\bpl\ble\bet\bte\bed\bd_\b_t\bti\bim\bme\be = 0;\n+ std::time_t l\bla\bas\bst\bt_\b_s\bse\bee\ben\bn_\b_c\bco\bom\bmp\bpl\ble\bet\bte\be = 0;\n+ storage_mode_t s\bst\bto\bor\bra\bag\bge\be_\b_m\bmo\bod\bde\be = storage_mode_sparse;\n+ float p\bpr\bro\bog\bgr\bre\bes\bss\bs = 0.f;\n+ int p\bpr\bro\bog\bgr\bre\bes\bss\bs_\b_p\bpp\bpm\bm = 0;\n+ queue_position_t q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn {};\n+ int d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_r\bra\bat\bte\be = 0;\n+ int u\bup\bpl\blo\boa\bad\bd_\b_r\bra\bat\bte\be = 0;\n+ int d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_p\bpa\bay\byl\blo\boa\bad\bd_\b_r\bra\bat\bte\be = 0;\n+ int u\bup\bpl\blo\boa\bad\bd_\b_p\bpa\bay\byl\blo\boa\bad\bd_\b_r\bra\bat\bte\be = 0;\n+ int n\bnu\bum\bm_\b_s\bse\bee\bed\bds\bs = 0;\n+ int n\bnu\bum\bm_\b_p\bpe\bee\ber\brs\bs = 0;\n+ int n\bnu\bum\bm_\b_c\bco\bom\bmp\bpl\ble\bet\bte\be = -1;\n+ int n\bnu\bum\bm_\b_i\bin\bnc\bco\bom\bmp\bpl\ble\bet\bte\be = -1;\n+ int l\bli\bis\bst\bt_\b_s\bse\bee\bed\bds\bs = 0;\n+ int l\bli\bis\bst\bt_\b_p\bpe\bee\ber\brs\bs = 0;\n+ int c\bco\bon\bnn\bne\bec\bct\bt_\b_c\bca\ban\bnd\bdi\bid\bda\bat\bte\bes\bs = 0;\n+ int n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs = 0;\n+ int d\bdi\bis\bst\btr\bri\bib\bbu\but\bte\bed\bd_\b_f\bfu\bul\bll\bl_\b_c\bco\bop\bpi\bie\bes\bs = 0;\n+ int d\bdi\bis\bst\btr\bri\bib\bbu\but\bte\bed\bd_\b_f\bfr\bra\bac\bct\bti\bio\bon\bn = 0;\n+ float d\bdi\bis\bst\btr\bri\bib\bbu\but\bte\bed\bd_\b_c\bco\bop\bpi\bie\bes\bs = 0.f;\n+ int b\bbl\blo\boc\bck\bk_\b_s\bsi\biz\bze\be = 0;\n+ int n\bnu\bum\bm_\b_u\bup\bpl\blo\boa\bad\bds\bs = 0;\n+ int n\bnu\bum\bm_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bns\bs = 0;\n+ int u\bup\bpl\blo\boa\bad\bds\bs_\b_l\bli\bim\bmi\bit\bt = 0;\n+ int c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bns\bs_\b_l\bli\bim\bmi\bit\bt = 0;\n+ int u\bup\bp_\b_b\bba\ban\bnd\bdw\bwi\bid\bdt\bth\bh_\b_q\bqu\bue\beu\bue\be = 0;\n+ int d\bdo\bow\bwn\bn_\b_b\bba\ban\bnd\bdw\bwi\bid\bdt\bth\bh_\b_q\bqu\bue\beu\bue\be = 0;\n+ int s\bse\bee\bed\bd_\b_r\bra\ban\bnk\bk = 0;\n+ state_t s\bst\bta\bat\bte\be = checking_resume_data;\n+ bool n\bne\bee\bed\bd_\b_s\bsa\bav\bve\be_\b_r\bre\bes\bsu\bum\bme\be = false;\n+ bool i\bis\bs_\b_s\bse\bee\bed\bdi\bin\bng\bg = false;\n+ bool i\bis\bs_\b_f\bfi\bin\bni\bis\bsh\bhe\bed\bd = false;\n+ bool h\bha\bas\bs_\b_m\bme\bet\bta\bad\bda\bat\bta\ba = false;\n+ bool h\bha\bas\bs_\b_i\bin\bnc\bco\bom\bmi\bin\bng\bg = false;\n+ bool m\bmo\bov\bvi\bin\bng\bg_\b_s\bst\bto\bor\bra\bag\bge\be = false;\n+ bool a\ban\bnn\bno\bou\bun\bnc\bci\bin\bng\bg_\b_t\bto\bo_\b_t\btr\bra\bac\bck\bke\ber\brs\bs = false;\n+ bool a\ban\bnn\bno\bou\bun\bnc\bci\bin\bng\bg_\b_t\bto\bo_\b_l\bls\bsd\bd = false;\n+ bool a\ban\bnn\bno\bou\bun\bnc\bci\bin\bng\bg_\b_t\bto\bo_\b_d\bdh\bht\bt = false;\n+ info_hash_t info_hashes;\n+ time_point last_upload;\n+ time_point last_download;\n+ seconds active_duration;\n+ seconds finished_duration;\n+ seconds seeding_duration;\n+ torrent_flags_t f\bfl\bla\bag\bgs\bs {};\n+};\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* o\bop\bpe\ber\bra\bat\bto\bor\br=\b==\b=(\b()\b) *\b**\b**\b**\b**\b*\n+bool o\bop\bpe\ber\bra\bat\bto\bor\br=\b==\b= (torrent_status const& st) const;\n+compares if the torrent status objects come from the same torrent. i.e. only\n+the _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be field is compared.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* e\ben\bnu\bum\bm s\bst\bta\bat\bte\be_\b_t\bt *\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bs_\bt_\ba_\bt_\bu_\bs_\b._\bh_\bp_\bp\"\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n+|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+| | |The torrent has not |\n+| | |started its download|\n+|checking_files |1 |yet, and is |\n+| | |currently checking |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\be_\bx_\bi_\bs_\bt_\bi_\bn_\bg_\b _\bf_\bi_\bl_\be_\bs_\b._\b _\b _\b _\b _\b |\n+| | |The torrent is |\n+| | |trying to download |\n+|downloading_metadata |2 |metadata from peers.|\n+| | |This implies the |\n+| | |ut_metadata |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\b _\bi_\bs_\b _\bi_\bn_\b _\bu_\bs_\be_\b.|\n+| | |The torrent is being|\n+| | |downloaded. This is |\n+| | |the state most |\n+| | |torrents will be in |\n+|downloading |3 |most of the time. |\n+| | |The progress meter |\n+| | |will tell how much |\n+| | |of the files that |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bh_\ba_\bs_\b _\bb_\be_\be_\bn_\b _\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\be_\bd_\b.|\n+| | |In this state the |\n+| | |torrent has finished|\n+| | |downloading but |\n+|finished |4 |still doesn't have |\n+| | |the entire torrent. |\n+| | |i.e. some pieces are|\n+| | |filtered and won't |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bg_\be_\bt_\b _\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\be_\bd_\b._\b _\b _\b _\b _\b |\n+| | |In this state the |\n+|seeding |5 |torrent has finished|\n+| | |downloading and is a|\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bp_\bu_\br_\be_\b _\bs_\be_\be_\bd_\be_\br_\b._\b _\b _\b _\b _\b _\b _\b _\b |\n+| | |If the torrent was |\n+| | |started in full |\n+| | |allocation mode, |\n+|unused_enum_for_backwards_compatibility_allocating|6 |this indicates that |\n+| | |the (disk) storage |\n+| | |for the torrent is |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\ba_\bl_\bl_\bo_\bc_\ba_\bt_\be_\bd_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+| | |The torrent is |\n+| | |currently checking |\n+| | |the fast resume data|\n+| | |and comparing it to |\n+| | |the files on disk. |\n+|checking_resume_data |7 |This is typically |\n+| | |completed in a |\n+| | |fraction of a |\n+| | |second, but if you |\n+| | |add a large number |\n+| | |of torrents at once,|\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bt_\bh_\be_\by_\b _\bw_\bi_\bl_\bl_\b _\bq_\bu_\be_\bu_\be_\b _\bu_\bp_\b._\b |\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ handle\n+ a handle to the torrent whose status the object represents.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ errc\n+ may be set to an error code describing why the torrent was paused, in\n+ case it was paused by an error. If the torrent is not paused or if it's\n+ paused but not because of an error, this error_code is not set. if the\n+ error is attributed specifically to a file, error_file is set to the\n+ index of that file in the .torrent file.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ error_file\n+ if the torrent is stopped because of an disk I/O error, this field\n+ contains the index of the file in the torrent that encountered the error.\n+ If the error did not originate in a file in the torrent, there are a few\n+ special values this can be set to: error_file_none, error_file_ssl_ctx,\n+ error_file_exception, error_file_partfile or error_file_metadata;\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ error_file_none\n+ special values for error_file to describe which file or component\n+ encountered the error (errc). the error did not occur on a file\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ error_file_ssl_ctx\n+ the error occurred setting up the SSL context\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ error_file_metadata\n+ the error occurred while loading the metadata for the torrent\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ error_file_exception\n+ there was a serious error reported in this torrent. The error code or a\n+ torrent log _\ba_\bl_\be_\br_\bt may provide more information.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ error_file_partfile\n+ the error occurred with the partfile\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ save_path\n+ the path to the directory where this torrent's files are stored. It's\n+ typically the path as was given to _\ba_\bs_\by_\bn_\bc_\b__\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b) or _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b)\n+ when this torrent was started. This field is only included if the torrent\n+ status is queried with torrent_handle::query_save_path.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ name\n+ the name of the torrent. Typically this is derived from the .torrent\n+ file. In case the torrent was started without metadata, and hasn't\n+ completely received it yet, it returns the name given to it when added to\n+ the _\bs_\be_\bs_\bs_\bi_\bo_\bn. See session::add_torrent. This field is only included if the\n+ torrent status is queried with torrent_handle::query_name.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ torrent_file\n+ set to point to the torrent_info object for this torrent. It's only\n+ included if the torrent status is queried with torrent_handle::\n+ query_torrent_file.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ next_announce\n+ the time until the torrent will announce itself to the tracker.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ current_tracker\n+ the URL of the last working tracker. If no tracker request has been\n+ successful yet, it's set to an empty string.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ total_download total_upload\n+ the number of bytes downloaded and uploaded to all peers, accumulated,\n+ t\bth\bhi\bis\bs s\bse\bes\bss\bsi\bio\bon\bn only. The _\bs_\be_\bs_\bs_\bi_\bo_\bn is considered to restart when a torrent is\n+ paused and restarted again. When a torrent is paused, these _\bc_\bo_\bu_\bn_\bt_\be_\br_\bs are\n+ reset to 0. If you want complete, persistent, stats, see all_time_upload\n+ and all_time_download.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ total_payload_download total_payload_upload\n+ counts the amount of bytes send and received this _\bs_\be_\bs_\bs_\bi_\bo_\bn, but only the\n+ actual payload data (i.e the interesting data), these _\bc_\bo_\bu_\bn_\bt_\be_\br_\bs ignore any\n+ protocol overhead. The _\bs_\be_\bs_\bs_\bi_\bo_\bn is considered to restart when a torrent is\n+ paused and restarted again. When a torrent is paused, these _\bc_\bo_\bu_\bn_\bt_\be_\br_\bs are\n+ reset to 0.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ total_failed_bytes\n+ the number of bytes that has been downloaded and that has failed the\n+ piece hash test. In other words, this is just how much crap that has been\n+ downloaded since the torrent was last started. If a torrent is paused and\n+ then restarted again, this counter will be reset.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ total_redundant_bytes\n+ the number of bytes that has been downloaded even though that data\n+ already was downloaded. The reason for this is that in some situations\n+ the same data can be downloaded by mistake. When libtorrent sends\n+ requests to a peer, and the peer doesn't send a response within a certain\n+ timeout, libtorrent will re-request that block. Another situation when\n+ libtorrent may re-request blocks is when the requests it sends out are\n+ not replied in FIFO-order (it will re-request blocks that are skipped by\n+ an out of order block). This is supposed to be as low as possible. This\n+ only counts bytes since the torrent was last started. If a torrent is\n+ paused and then restarted again, this counter will be reset.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ pieces\n+ a bitmask that represents which pieces we have (set to true) and the\n+ pieces we don't have. It's a pointer and may be set to 0 if the torrent\n+ isn't downloading or seeding.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ verified_pieces\n+ a bitmask representing which pieces has had their hash checked. This only\n+ applies to torrents in s\bse\bee\bed\bd m\bmo\bod\bde\be. If the torrent is not in seed mode,\n+ this bitmask may be empty.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ total_done\n+ the total number of bytes of the file(s) that we have. All this does not\n+ necessarily has to be downloaded during this _\bs_\be_\bs_\bs_\bi_\bo_\bn (that's\n+ total_payload_download).\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ total\n+ the total number of bytes to download for this torrent. This may be less\n+ than the size of the torrent in case there are pad files. This number\n+ only counts bytes that will actually be requested from peers.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ total_wanted_done\n+ the number of bytes we have downloaded, only counting the pieces that we\n+ actually want to download. i.e. excluding any pieces that we have but\n+ have priority 0 (i.e. not wanted). Once a torrent becomes seed, any\n+ piece- and file priorities are forgotten and all bytes are considered\n+ \"wanted\".\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ total_wanted\n+ The total number of bytes we want to download. This may be smaller than\n+ the total torrent size in case any pieces are prioritized to 0, i.e. not\n+ wanted. Once a torrent becomes seed, any piece- and file priorities are\n+ forgotten and all bytes are considered \"wanted\".\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ all_time_upload all_time_download\n+ are accumulated upload and download payload byte _\bc_\bo_\bu_\bn_\bt_\be_\br_\bs. They are saved\n+ in and restored from resume data to keep totals across sessions.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ added_time\n+ the posix-time when this torrent was added. i.e. what time(nullptr)\n+ returned at the time.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ completed_time\n+ the posix-time when this torrent was finished. If the torrent is not yet\n+ finished, this is 0.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ last_seen_complete\n+ the time when we, or one of our peers, last saw a complete copy of this\n+ torrent.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ storage_mode\n+ The allocation mode for the torrent. See _\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bm_\bo_\bd_\be_\b__\bt for the options.\n+ For more information, see _\bs_\bt_\bo_\br_\ba_\bg_\be_\b _\ba_\bl_\bl_\bo_\bc_\ba_\bt_\bi_\bo_\bn.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ progress\n+ a value in the range [0, 1], that represents the progress of the\n+ torrent's current task. It may be checking files or downloading.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ progress_ppm\n+ progress parts per million (progress * 1000000) when disabling floating\n+ point operations, this is the only option to query progress\n+ reflects the same value as progress, but instead in a range [0, 1000000]\n+ (ppm = parts per million). When floating point operations are disabled,\n+ this is the only alternative to the floating point value in progress.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ queue_position\n+ the position this torrent has in the download queue. If the torrent is a\n+ seed or finished, this is -1.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ download_rate upload_rate\n+ the total rates for all peers for this torrent. These will usually have\n+ better precision than summing the rates from all peers. The rates are\n+ given as the number of bytes per second.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ download_payload_rate upload_payload_rate\n+ the total transfer rate of payload only, not counting protocol chatter.\n+ This might be slightly smaller than the other rates, but if projected\n+ over a long time (e.g. when calculating ETA:s) the difference may be\n+ noticeable.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ num_seeds\n+ the number of peers that are seeding that this client is currently\n+ connected to.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ num_peers\n+ the number of peers this torrent currently is connected to. Peer\n+ connections that are in the half-open state (is attempting to connect) or\n+ are queued for later connection attempt do not count. Although they are\n+ visible in the peer list when you call _\bg_\be_\bt_\b__\bp_\be_\be_\br_\b__\bi_\bn_\bf_\bo_\b(_\b).\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ num_complete num_incomplete\n+ if the tracker sends scrape info in its announce reply, these fields will\n+ be set to the total number of peers that have the whole file and the\n+ total number of peers that are still downloading. set to -1 if the\n+ tracker did not send any scrape data in its announce reply.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ list_seeds list_peers\n+ the number of seeds in our peer list and the total number of peers\n+ (including seeds). We are not necessarily connected to all the peers in\n+ our peer list. This is the number of peers we know of in total, including\n+ banned peers and peers that we have failed to connect to.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ connect_candidates\n+ the number of peers in this torrent's peer list that is a candidate to be\n+ connected to. i.e. It has fewer connect attempts than the max fail count,\n+ it is not a seed if we are a seed, it is not banned etc. If this is 0, it\n+ means we don't know of any more peers that we can try.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ num_pieces\n+ the number of pieces that has been downloaded. It is equivalent to: std::\n+ accumulate(pieces->begin(), pieces->end()). So you don't have to count\n+ yourself. This can be used to see if anything has updated since last time\n+ if you want to keep a graph of the pieces up to date. Note that these\n+ pieces have not necessarily been written to disk yet, and there is a risk\n+ the write to disk will fail.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ distributed_full_copies\n+ the number of distributed copies of the torrent. Note that one copy may\n+ be spread out among many peers. It tells how many copies there are\n+ currently of the rarest piece(s) among the peers this client is connected\n+ to.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ distributed_fraction\n+ tells the share of pieces that have more copies than the rarest piece(s).\n+ Divide this number by 1000 to get the fraction.\n+ For example, if distributed_full_copies is 2 and distributed_fraction is\n+ 500, it means that the rarest pieces have only 2 copies among the peers\n+ this torrent is connected to, and that 50% of all the pieces have more\n+ than two copies.\n+ If we are a seed, the piece picker is deallocated as an optimization, and\n+ piece availability is no longer tracked. In this case the distributed\n+ copies members are set to -1.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ distributed_copies\n+ the number of distributed copies of the file. note that one copy may be\n+ spread out among many peers. This is a floating point representation of\n+ the distributed copies.\n+ the integer part tells how many copies\n+ there are of the rarest piece(s)\n+ the fractional part tells the fraction of pieces that\n+ have more copies than the rarest piece(s).\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ block_size\n+ the size of a block, in bytes. A block is a sub piece, it is the number\n+ of bytes that each piece request asks for and the number of bytes that\n+ each bit in the partial_piece_info's bitset represents, see\n+ _\bg_\be_\bt_\b__\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\b__\bq_\bu_\be_\bu_\be_\b(_\b). This is typically 16 kB, but it may be smaller, if\n+ the pieces are smaller.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ num_uploads\n+ the number of unchoked peers in this torrent.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ num_connections\n+ the number of peer connections this torrent has, including half-open\n+ connections that hasn't completed the bittorrent handshake yet. This is\n+ always >= num_peers.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ uploads_limit\n+ the set limit of upload slots (unchoked peers) for this torrent.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ connections_limit\n+ the set limit of number of connections for this torrent.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ up_bandwidth_queue down_bandwidth_queue\n+ the number of peers in this torrent that are waiting for more bandwidth\n+ quota from the torrent rate limiter. This can determine if the rate you\n+ get from this torrent is bound by the torrents limit or not. If there is\n+ no limit set on this torrent, the peers might still be waiting for\n+ bandwidth quota from the global limiter, but then they are counted in the\n+ session_status object.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ seed_rank\n+ A rank of how important it is to seed the torrent, it is used to\n+ determine which torrents to seed and which to queue. It is based on the\n+ peer to seed ratio from the tracker scrape. For more information, see\n+ _\bq_\bu_\be_\bu_\bi_\bn_\bg. Higher value means more important to seed\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ state\n+ the main state the torrent is in. See _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bs_\bt_\ba_\bt_\bu_\bs_\b:_\b:_\bs_\bt_\ba_\bt_\be_\b__\bt.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ need_save_resume\n+ true if this torrent has unsaved changes to its download state and\n+ statistics since the last resume data was saved.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ is_seeding\n+ true if all pieces have been downloaded.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ is_finished\n+ true if all pieces that have a priority > 0 are downloaded. There is only\n+ a distinction between finished and seeding if some pieces or files have\n+ been set to priority 0, i.e. are not downloaded.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ has_metadata\n+ true if this torrent has metadata (either it was started from a .torrent\n+ file or the metadata has been downloaded). The only scenario where this\n+ can be false is when the torrent was started torrent-less (i.e. with just\n+ an info-hash and tracker ip, a magnet link for instance).\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ has_incoming\n+ true if there has ever been an incoming connection attempt to this\n+ torrent.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ moving_storage\n+ this is true if this torrent's storage is currently being moved from one\n+ location to another. This may potentially be a long operation if a large\n+ file ends up being copied from one drive to another.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ announcing_to_trackers announcing_to_lsd announcing_to_dht\n+ these are set to true if this torrent is allowed to announce to the\n+ respective peer source. Whether they are true or false is determined by\n+ the queue logic/auto manager. Torrents that are not auto managed will\n+ always be allowed to announce to all peer sources.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ info_hashes\n+ the info-hash for this torrent\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ last_upload last_download\n+ the timestamps of the last time this torrent uploaded or downloaded\n+ payload to any peer.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ active_duration finished_duration seeding_duration\n+ these are cumulative _\bc_\bo_\bu_\bn_\bt_\be_\br_\bs of for how long the torrent has been in\n+ different states. active means not paused and added to _\bs_\be_\bs_\bs_\bi_\bo_\bn. Whether\n+ it has found any peers or not is not relevant. finished means all\n+ selected files/pieces were downloaded and available to other peers (this\n+ is always a subset of active time). seeding means all files/pieces were\n+ downloaded and available to peers. Being available to peers does not\n+ imply there are other peers asking for the payload.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ flags\n+ reflects several of the torrent's flags. For more information, see\n+ torrent_handle::flags().\n This section describes the functions and classes that are used to create\n torrent files. It is a layered API with low level classes and higher level\n convenience functions. A torrent is created in 4 steps:\n 1. first the files that will be part of the torrent are determined.\n 2. the torrent properties are set, such as tracker url, web seeds, DHT nodes\n etc.\n 3. Read through all the files in the torrent, SHA-1 all the data and set the\n@@ -6700,60 +5611,60 @@\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bc_\br_\be_\ba_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bh_\bp_\bp\"\n This class holds state for creating a torrent. After having added all\n information to it, call _\bc_\br_\be_\ba_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b:_\b:_\bg_\be_\bn_\be_\br_\ba_\bt_\be_\b(_\b) to generate the torrent. The\n _\be_\bn_\bt_\br_\by that's returned can then be bencoded into a .torrent file using _\bb_\be_\bn_\bc_\bo_\bd_\be\n _\b(_\b).\n struct create_torrent\n {\n+ explicit c\bcr\bre\bea\bat\bte\be_\b_t\bto\bor\brr\bre\ben\bnt\bt (torrent_info const& ti);\n explicit c\bcr\bre\bea\bat\bte\be_\b_t\bto\bor\brr\bre\ben\bnt\bt (file_storage& fs, int piece_size = 0\n , create_flags_t flags = {});\n- explicit c\bcr\bre\bea\bat\bte\be_\b_t\bto\bor\brr\bre\ben\bnt\bt (torrent_info const& ti);\n entry g\bge\ben\bne\ber\bra\bat\bte\be () const;\n std::vector g\bge\ben\bne\ber\bra\bat\bte\be_\b_b\bbu\buf\bf () const;\n file_storage const& f\bfi\bil\ble\bes\bs () const;\n void s\bse\bet\bt_\b_c\bco\bom\bmm\bme\ben\bnt\bt (char const* str);\n void s\bse\bet\bt_\b_c\bcr\bre\bea\bat\bto\bor\br (char const* str);\n void s\bse\bet\bt_\b_c\bcr\bre\bea\bat\bti\bio\bon\bn_\b_d\bda\bat\bte\be (std::time_t timestamp);\n void s\bse\bet\bt_\b_h\bha\bas\bsh\bh (piece_index_t index, sha1_hash const& h);\n void s\bse\bet\bt_\b_h\bha\bas\bsh\bh2\b2 (file_index_t file, piece_index_t::diff_type piece,\n sha256_hash const& h);\n void a\bad\bdd\bd_\b_h\bht\btt\btp\bp_\b_s\bse\bee\bed\bd (string_view url);\n void a\bad\bdd\bd_\b_u\bur\brl\bl_\b_s\bse\bee\bed\bd (string_view url);\n void a\bad\bdd\bd_\b_n\bno\bod\bde\be (std::pair node);\n void a\bad\bdd\bd_\b_t\btr\bra\bac\bck\bke\ber\br (string_view url, int tier = 0);\n void s\bse\bet\bt_\b_r\bro\boo\bot\bt_\b_c\bce\ber\brt\bt (string_view cert);\n- bool p\bpr\bri\biv\bv () const;\n void s\bse\bet\bt_\b_p\bpr\bri\biv\bv (bool p);\n- bool i\bis\bs_\b_v\bv2\b2_\b_o\bon\bnl\bly\by () const;\n+ bool p\bpr\bri\biv\bv () const;\n bool i\bis\bs_\b_v\bv1\b1_\b_o\bon\bnl\bly\by () const;\n+ bool i\bis\bs_\b_v\bv2\b2_\b_o\bon\bnl\bly\by () const;\n int n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs () const;\n piece_index_t e\ben\bnd\bd_\b_p\bpi\bie\bec\bce\be () const;\n index_range p\bpi\bie\bec\bce\be_\b_r\bra\ban\bng\bge\be () const noexcept;\n file_index_t e\ben\bnd\bd_\b_f\bfi\bil\ble\be () const;\n index_range f\bfi\bil\ble\be_\b_r\bra\ban\bng\bge\be () const noexcept;\n index_range f\bfi\bil\ble\be_\b_p\bpi\bie\bec\bce\be_\b_r\bra\ban\bng\bge\be (file_index_t f);\n std::int64_t t\bto\bot\bta\bal\bl_\b_s\bsi\biz\bze\be () const;\n int p\bpi\bie\bec\bce\be_\b_s\bsi\biz\bze\be (piece_index_t i) const;\n int p\bpi\bie\bec\bce\be_\b_l\ble\ben\bng\bgt\bth\bh () const;\n- void a\bad\bdd\bd_\b_c\bco\bol\bll\ble\bec\bct\bti\bio\bon\bn (string_view c);\n void a\bad\bdd\bd_\b_s\bsi\bim\bmi\bil\bla\bar\br_\b_t\bto\bor\brr\bre\ben\bnt\bt (sha1_hash ih);\n+ void a\bad\bdd\bd_\b_c\bco\bol\bll\ble\bec\bct\bti\bio\bon\bn (string_view c);\n \n static constexpr create_flags_t m\bmo\bod\bdi\bif\bfi\bic\bca\bat\bti\bio\bon\bn_\b_t\bti\bim\bme\be = 2_bit;\n static constexpr create_flags_t s\bsy\bym\bml\bli\bin\bnk\bks\bs = 3_bit;\n static constexpr create_flags_t v\bv2\b2_\b_o\bon\bnl\bly\by = 5_bit;\n static constexpr create_flags_t v\bv1\b1_\b_o\bon\bnl\bly\by = 6_bit;\n static constexpr create_flags_t c\bca\ban\bno\bon\bni\bic\bca\bal\bl_\b_f\bfi\bil\ble\bes\bs = 7_bit;\n static constexpr create_flags_t n\bno\bo_\b_a\bat\btt\btr\bri\bib\bbu\but\bte\bes\bs = 8_bit;\n static constexpr create_flags_t c\bca\ban\bno\bon\bni\bic\bca\bal\bl_\b_f\bfi\bil\ble\bes\bs_\b_n\bno\bo_\b_t\bta\bai\bil\bl_\b_p\bpa\bad\bdd\bdi\bin\bng\bg = 9_bit;\n };\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* c\bcr\bre\bea\bat\bte\be_\b_t\bto\bor\brr\bre\ben\bnt\bt(\b()\b) *\b**\b**\b**\b**\b*\n+explicit c\bcr\bre\bea\bat\bte\be_\b_t\bto\bor\brr\bre\ben\bnt\bt (torrent_info const& ti);\n explicit c\bcr\bre\bea\bat\bte\be_\b_t\bto\bor\brr\bre\ben\bnt\bt (file_storage& fs, int piece_size = 0\n , create_flags_t flags = {});\n-explicit c\bcr\bre\bea\bat\bte\be_\b_t\bto\bor\brr\bre\ben\bnt\bt (torrent_info const& ti);\n The piece_size is the size of each piece in bytes. It must be a power of 2 and\n a minimum of 16 kiB. If a piece size of 0 is specified, a piece_size will be\n set automatically. Piece sizes greater than 128 MiB are considered unreasonable\n and will be rejected (with an lt::system_error exception).\n The flags arguments specifies options for the torrent creation. It can be any\n combination of the flags defined by create_flags_t.\n The _\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be (fs) parameter defines the files, sizes and their properties\n@@ -6765,457 +5676,941 @@\n functions of _\bc_\br_\be_\ba_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt that affects the content of the info dictionary\n (such as _\bs_\be_\bt_\b__\bh_\ba_\bs_\bh_\b(_\b)), will have any affect. Instead of using this overload,\n consider using _\bw_\br_\bi_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bi_\bl_\be_\b(_\b) instead.\n Warning\n The _\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be and _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo objects must stay alive for the entire\n duration of the _\bc_\br_\be_\ba_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt object.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* g\bge\ben\bne\ber\bra\bat\bte\be(\b()\b) g\bge\ben\bne\ber\bra\bat\bte\be_\b_b\bbu\buf\bf(\b()\b) *\b**\b**\b**\b**\b*\n-entry g\bge\ben\bne\ber\bra\bat\bte\be () const;\n-std::vector g\bge\ben\bne\ber\bra\bat\bte\be_\b_b\bbu\buf\bf () const;\n-This function will generate the .torrent file as a bencode tree, or a bencoded\n-into a buffer. In order to encode the _\be_\bn_\bt_\br_\by into a flat file, use the _\bb_\be_\bn_\bc_\bo_\bd_\be_\b(_\b)\n-function.\n-The function returning an _\be_\bn_\bt_\br_\by may be useful to add custom entries to the\n-torrent file before bencoding it and saving it to disk.\n-Whether the resulting torrent object is v1, v2 or hybrid depends on whether any\n-of the v1_only or v2_only flags were set on the constructor. If neither were\n-set, the resulting torrent depends on which hashes were set. If both v1 and v2\n-hashes were set, a hybrid torrent is created.\n-Any failure will cause this function to throw system_error, with an appropriate\n-error message. These are the reasons this call may throw:\n- * the file storage has 0 files\n- * the total size of the file storage is 0 bytes (i.e. it only has empty\n- files)\n- * not all v1 hashes (_\bs_\be_\bt_\b__\bh_\ba_\bs_\bh_\b(_\b)) and not all v2 hashes (_\bs_\be_\bt_\b__\bh_\ba_\bs_\bh_\b2_\b(_\b)) were\n- set\n- * for v2 torrents, you may not have a directory with the same name as a\n- file. If that's encountered in the file storage, _\bg_\be_\bn_\be_\br_\ba_\bt_\be_\b(_\b) fails.\n+*\b**\b**\b**\b**\b* g\bge\ben\bne\ber\bra\bat\bte\be(\b()\b) g\bge\ben\bne\ber\bra\bat\bte\be_\b_b\bbu\buf\bf(\b()\b) *\b**\b**\b**\b**\b*\n+entry g\bge\ben\bne\ber\bra\bat\bte\be () const;\n+std::vector g\bge\ben\bne\ber\bra\bat\bte\be_\b_b\bbu\buf\bf () const;\n+This function will generate the .torrent file as a bencode tree, or a bencoded\n+into a buffer. In order to encode the _\be_\bn_\bt_\br_\by into a flat file, use the _\bb_\be_\bn_\bc_\bo_\bd_\be_\b(_\b)\n+function.\n+The function returning an _\be_\bn_\bt_\br_\by may be useful to add custom entries to the\n+torrent file before bencoding it and saving it to disk.\n+Whether the resulting torrent object is v1, v2 or hybrid depends on whether any\n+of the v1_only or v2_only flags were set on the constructor. If neither were\n+set, the resulting torrent depends on which hashes were set. If both v1 and v2\n+hashes were set, a hybrid torrent is created.\n+Any failure will cause this function to throw system_error, with an appropriate\n+error message. These are the reasons this call may throw:\n+ * the file storage has 0 files\n+ * the total size of the file storage is 0 bytes (i.e. it only has empty\n+ files)\n+ * not all v1 hashes (_\bs_\be_\bt_\b__\bh_\ba_\bs_\bh_\b(_\b)) and not all v2 hashes (_\bs_\be_\bt_\b__\bh_\ba_\bs_\bh_\b2_\b(_\b)) were\n+ set\n+ * for v2 torrents, you may not have a directory with the same name as a\n+ file. If that's encountered in the file storage, _\bg_\be_\bn_\be_\br_\ba_\bt_\be_\b(_\b) fails.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* f\bfi\bil\ble\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n+file_storage const& f\bfi\bil\ble\bes\bs () const;\n+returns an immutable reference to the _\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be used to create the torrent\n+from.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* s\bse\bet\bt_\b_c\bco\bom\bmm\bme\ben\bnt\bt(\b()\b) *\b**\b**\b**\b**\b*\n+void s\bse\bet\bt_\b_c\bco\bom\bmm\bme\ben\bnt\bt (char const* str);\n+Sets the comment for the torrent. The string str should be utf-8 encoded. The\n+comment in a torrent file is optional.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* s\bse\bet\bt_\b_c\bcr\bre\bea\bat\bto\bor\br(\b()\b) *\b**\b**\b**\b**\b*\n+void s\bse\bet\bt_\b_c\bcr\bre\bea\bat\bto\bor\br (char const* str);\n+Sets the creator of the torrent. The string str should be utf-8 encoded. This\n+is optional.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* s\bse\bet\bt_\b_c\bcr\bre\bea\bat\bti\bio\bon\bn_\b_d\bda\bat\bte\be(\b()\b) *\b**\b**\b**\b**\b*\n+void s\bse\bet\bt_\b_c\bcr\bre\bea\bat\bti\bio\bon\bn_\b_d\bda\bat\bte\be (std::time_t timestamp);\n+sets the \"creation time\" field. Defaults to the system clock at the time of\n+construction of the _\bc_\br_\be_\ba_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt object. The timestamp is specified in\n+seconds, posix time. If the creation date is set to 0, the \"creation date\"\n+field will be omitted from the generated torrent.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* s\bse\bet\bt_\b_h\bha\bas\bsh\bh(\b()\b) *\b**\b**\b**\b**\b*\n+void s\bse\bet\bt_\b_h\bha\bas\bsh\bh (piece_index_t index, sha1_hash const& h);\n+This sets the SHA-1 hash for the specified piece (index). You are required to\n+set the hash for every piece in the torrent before generating it. If you have\n+the files on disk, you can use the high level convenience function to do this.\n+See _\bs_\be_\bt_\b__\bp_\bi_\be_\bc_\be_\b__\bh_\ba_\bs_\bh_\be_\bs_\b(_\b). A SHA-1 hash of all zeros is internally used to\n+indicate a hash that has not been set. Setting such hash will not be considered\n+set when calling _\bg_\be_\bn_\be_\br_\ba_\bt_\be_\b(_\b). This function will throw std::system_error if it\n+is called on an object constructed with the v2_only flag.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* s\bse\bet\bt_\b_h\bha\bas\bsh\bh2\b2(\b()\b) *\b**\b**\b**\b**\b*\n+void s\bse\bet\bt_\b_h\bha\bas\bsh\bh2\b2 (file_index_t file, piece_index_t::diff_type piece, sha256_hash\n+const& h);\n+sets the bittorrent v2 hash for filefileof the piecepiece.pieceis relative to\n+the first piece of the file, starting at 0. The first piece in the file can be\n+computed with _\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b:_\b:_\bf_\bi_\bl_\be_\b__\bi_\bn_\bd_\be_\bx_\b__\ba_\bt_\b__\bp_\bi_\be_\bc_\be_\b(_\b). The hash,h, is the root of\n+the merkle tree formed by the piece's 16 kiB blocks. Note that piece sizes must\n+be powers-of-2, so all per-piece merkle trees are complete. A SHA-256 hash of\n+all zeros is internally used to indicate a hash that has not been set. Setting\n+such hash will not be considered set when calling _\bg_\be_\bn_\be_\br_\ba_\bt_\be_\b(_\b). This function\n+will throw std::system_error if it is called on an object constructed with the\n+v1_only flag.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_h\bht\btt\btp\bp_\b_s\bse\bee\bed\bd(\b()\b) a\bad\bdd\bd_\b_u\bur\brl\bl_\b_s\bse\bee\bed\bd(\b()\b) *\b**\b**\b**\b**\b*\n+void a\bad\bdd\bd_\b_h\bht\btt\btp\bp_\b_s\bse\bee\bed\bd (string_view url);\n+void a\bad\bdd\bd_\b_u\bur\brl\bl_\b_s\bse\bee\bed\bd (string_view url);\n+This adds a url seed to the torrent. You can have any number of url seeds. For\n+a single file torrent, this should be an HTTP url, pointing to a file with\n+identical content as the file of the torrent. For a multi-file torrent, it\n+should point to a directory containing a directory with the same name as this\n+torrent, and all the files of the torrent in it.\n+The second function, add_http_seed() adds an HTTP seed instead.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_n\bno\bod\bde\be(\b()\b) *\b**\b**\b**\b**\b*\n+void a\bad\bdd\bd_\b_n\bno\bod\bde\be (std::pair node);\n+This adds a DHT node to the torrent. This especially useful if you're creating\n+a tracker less torrent. It can be used by clients to bootstrap their DHT node\n+from. The node is a hostname and a port number where there is a DHT node\n+running. You can have any number of DHT nodes in a torrent.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_t\btr\bra\bac\bck\bke\ber\br(\b()\b) *\b**\b**\b**\b**\b*\n+void a\bad\bdd\bd_\b_t\btr\bra\bac\bck\bke\ber\br (string_view url, int tier = 0);\n+Adds a tracker to the torrent. This is not strictly required, but most torrents\n+use a tracker as their main source of peers. The url should be an _\bh_\bt_\bt_\bp_\b:_\b/_\b/ or\n+udp:// url to a machine running a bittorrent tracker that accepts announces for\n+this torrent's info-hash. The tier is the fallback priority of the tracker. All\n+trackers with tier 0 are tried first (in any order). If all fail, trackers with\n+tier 1 are tried. If all of those fail, trackers with tier 2 are tried, and so\n+on.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* s\bse\bet\bt_\b_r\bro\boo\bot\bt_\b_c\bce\ber\brt\bt(\b()\b) *\b**\b**\b**\b**\b*\n+void s\bse\bet\bt_\b_r\bro\boo\bot\bt_\b_c\bce\ber\brt\bt (string_view cert);\n+This function sets an X.509 certificate in PEM format to the torrent. This\n+makes the torrent an S\bSS\bSL\bL t\bto\bor\brr\bre\ben\bnt\bt. An SSL torrent requires that each peer has a\n+valid certificate signed by this root certificate. For SSL torrents, all peers\n+are connecting over SSL connections. For more information, see the section on\n+_\bs_\bs_\bl_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\bs.\n+The string is not the path to the cert, it's the actual content of the\n+certificate.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* s\bse\bet\bt_\b_p\bpr\bri\biv\bv(\b()\b) p\bpr\bri\biv\bv(\b()\b) *\b**\b**\b**\b**\b*\n+void s\bse\bet\bt_\b_p\bpr\bri\biv\bv (bool p);\n+bool p\bpr\bri\biv\bv () const;\n+Sets and queries the private flag of the torrent. Torrents with the private\n+flag set ask the client to not use any other sources than the tracker for\n+peers, and to not use DHT to advertise itself publicly, only the tracker.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n+int n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs () const;\n+returns the number of pieces in the associated _\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be object.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* p\bpi\bie\bec\bce\be_\b_r\bra\ban\bng\bge\be(\b()\b) *\b**\b**\b**\b**\b*\n+index_range p\bpi\bie\bec\bce\be_\b_r\bra\ban\bng\bge\be () const noexcept;\n+all piece indices in the torrent to be created\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* f\bfi\bil\ble\be_\b_r\bra\ban\bng\bge\be(\b()\b) *\b**\b**\b**\b**\b*\n+index_range f\bfi\bil\ble\be_\b_r\bra\ban\bng\bge\be () const noexcept;\n+all file indices in the torrent to be created\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* f\bfi\bil\ble\be_\b_p\bpi\bie\bec\bce\be_\b_r\bra\ban\bng\bge\be(\b()\b) *\b**\b**\b**\b**\b*\n+index_range f\bfi\bil\ble\be_\b_p\bpi\bie\bec\bce\be_\b_r\bra\ban\bng\bge\be (file_index_t f);\n+for v2 and hybrid torrents only, the pieces in the specified file, specified as\n+delta from the first piece in the file. i.e. the first index is 0.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* t\bto\bot\bta\bal\bl_\b_s\bsi\biz\bze\be(\b()\b) *\b**\b**\b**\b**\b*\n+std::int64_t t\bto\bot\bta\bal\bl_\b_s\bsi\biz\bze\be () const;\n+the total number of bytes of all files and pad files\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* p\bpi\bie\bec\bce\be_\b_l\ble\ben\bng\bgt\bth\bh(\b()\b) p\bpi\bie\bec\bce\be_\b_s\bsi\biz\bze\be(\b()\b) *\b**\b**\b**\b**\b*\n+int p\bpi\bie\bec\bce\be_\b_s\bsi\biz\bze\be (piece_index_t i) const;\n+int p\bpi\bie\bec\bce\be_\b_l\ble\ben\bng\bgt\bth\bh () const;\n+piece_length() returns the piece size of all pieces but the last one.\n+piece_size() returns the size of the specified piece. these functions are just\n+forwarding to the associated _\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_s\bsi\bim\bmi\bil\bla\bar\br_\b_t\bto\bor\brr\bre\ben\bnt\bt(\b()\b) a\bad\bdd\bd_\b_c\bco\bol\bll\ble\bec\bct\bti\bio\bon\bn(\b()\b) *\b**\b**\b**\b**\b*\n+void a\bad\bdd\bd_\b_s\bsi\bim\bmi\bil\bla\bar\br_\b_t\bto\bor\brr\bre\ben\bnt\bt (sha1_hash ih);\n+void a\bad\bdd\bd_\b_c\bco\bol\bll\ble\bec\bct\bti\bio\bon\bn (string_view c);\n+Add similar torrents (by info-hash) or collections of similar torrents. Similar\n+torrents are expected to share some files with this torrent. Torrents sharing a\n+collection name with this torrent are also expected to share files with this\n+torrent. A torrent may have more than one collection and more than one similar\n+torrents. For more information, see _\bB_\bE_\bP_\b _\b3_\b8.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ modification_time\n+ This will include the file modification time as part of the torrent. This\n+ is not enabled by default, as it might cause problems when you create a\n+ torrent from separate files with the same content, hoping to yield the\n+ same info-hash. If the files have different modification times, with this\n+ option enabled, you would get different info-hashes for the files.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ symlinks\n+ If this flag is set, files that are symlinks get a symlink attribute set\n+ on them and their data will not be included in the torrent. This is\n+ useful if you need to reconstruct a file hierarchy which contains\n+ symlinks.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ v2_only\n+ Do not generate v1 metadata. The resulting torrent will only be usable by\n+ clients which support v2. This requires setting all v2 hashes, with\n+ _\bs_\be_\bt_\b__\bh_\ba_\bs_\bh_\b2_\b(_\b) before calling _\bg_\be_\bn_\be_\br_\ba_\bt_\be_\b(_\b). Setting v1 hashes (with _\bs_\be_\bt_\b__\bh_\ba_\bs_\bh\n+ _\b(_\b)) is an error with this flag set.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ v1_only\n+ do not generate v2 metadata or enforce v2 alignment and padding rules\n+ this is mainly for tests, not recommended for production use. This\n+ requires setting all v1 hashes, with _\bs_\be_\bt_\b__\bh_\ba_\bs_\bh_\b(_\b), before calling _\bg_\be_\bn_\be_\br_\ba_\bt_\be\n+ _\b(_\b). Setting v2 hashes (with _\bs_\be_\bt_\b__\bh_\ba_\bs_\bh_\b2_\b(_\b)) is an error with this flag set.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ canonical_files\n+ This flag only affects v1-only torrents, and is only relevant together\n+ with the v1_only_flag. This flag will force the same file order and\n+ padding as a v2 (or hybrid) torrent would have. It has the effect of\n+ ordering files and inserting pad files to align them with piece\n+ boundaries.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ no_attributes\n+ passing this flag to _\ba_\bd_\bd_\b__\bf_\bi_\bl_\be_\bs_\b(_\b) will ignore file attributes (such as\n+ executable or hidden) when adding the files to the file storage. Since\n+ not all filesystems and operating systems support all file attributes the\n+ resulting torrent may differ depending on where it's created. If it's\n+ important for torrents to be created consistently across systems, this\n+ flag should be set.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ canonical_files_no_tail_padding\n+ this flag enforces the file layout to be canonical according to the\n+ bittorrent v2 specification (just like the canonical_files flag) with the\n+ one exception that tail padding is not added to the last file. This\n+ behavior deviates from the specification but was the way libtorrent\n+ created torrents in version up to and including 2.0.7. This flag is here\n+ for backwards compatibility.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_f\bfi\bil\ble\bes\bs(\b()\b) *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bc_\br_\be_\ba_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bh_\bp_\bp\"\n+void a\bad\bdd\bd_\b_f\bfi\bil\ble\bes\bs (file_storage& fs, std::string const& file\n+ , std::function p, create_flags_t flags = {});\n+void a\bad\bdd\bd_\b_f\bfi\bil\ble\bes\bs (file_storage& fs, std::string const& file\n+ , create_flags_t flags = {});\n+Adds the file specified by path to the _\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be object. In case path refers\n+to a directory, files will be added recursively from the directory.\n+If specified, the predicate p is called once for every file and directory that\n+is encountered. Files for which p returns true are added, and directories for\n+which p returns true are traversed. p must have the following signature:\n+bool Pred(std::string const& p);\n+The path that is passed in to the predicate is the full path of the file or\n+directory. If no predicate is specified, all files are added, and all\n+directories are traversed.\n+The \"..\" directory is never traversed.\n+The flags argument should be the same as the flags passed to the _\bc_\br_\be_\ba_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt\n+constructor.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* s\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_h\bha\bas\bsh\bhe\bes\bs(\b()\b) *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bc_\br_\be_\ba_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bh_\bp_\bp\"\n+inline void s\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_h\bha\bas\bsh\bhe\bes\bs (create_torrent& t, std::string const& p);\n+inline void s\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_h\bha\bas\bsh\bhe\bes\bs (create_torrent& t, std::string const& p,\n+error_code& ec);\n+void s\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_h\bha\bas\bsh\bhe\bes\bs (create_torrent& t, std::string const& p\n+ , settings_interface const& settings\n+ , std::function const& f, error_code& ec);\n+inline void s\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_h\bha\bas\bsh\bhe\bes\bs (create_torrent& t, std::string const& p\n+ , settings_interface const& settings\n+ , std::function const& f);\n+inline void s\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_h\bha\bas\bsh\bhe\bes\bs (create_torrent& t, std::string const& p\n+ , std::function const& f);\n+void s\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_h\bha\bas\bsh\bhe\bes\bs (create_torrent& t, std::string const& p\n+ , settings_interface const& settings, disk_io_constructor_type disk_io\n+ , std::function const& f, error_code& ec);\n+void s\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_h\bha\bas\bsh\bhe\bes\bs (create_torrent& t, std::string const& p\n+ , std::function const& f, error_code& ec);\n+This function will assume that the files added to the torrent file exists at\n+path p, read those files and hash the content and set the hashes in the\n+create_torrent object. The optional function f is called in between every hash\n+that is set. f must have the following signature:\n+void Fun(piece_index_t);\n+The overloads taking a _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk may be used to configure the underlying\n+disk access. Such as settings_pack::aio_threads.\n+The overloads that don't take an error_code& may throw an exception in case of\n+a file error, the other overloads sets the error code to reflect the error, if\n+any.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* s\bst\bta\bat\bts\bs_\b_m\bme\bet\btr\bri\bic\bc *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bs_\bt_\ba_\bt_\bs_\b._\bh_\bp_\bp\"\n+describes one statistics metric from the _\bs_\be_\bs_\bs_\bi_\bo_\bn. For more information, see the\n+_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b _\bs_\bt_\ba_\bt_\bi_\bs_\bt_\bi_\bc_\bs section.\n+struct stats_metric\n+{\n+ char const* name;\n+ int value_index;\n+ metric_type_t type;\n+};\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ name\n+ the name of the counter or gauge\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ value_index type\n+ the index into the _\bs_\be_\bs_\bs_\bi_\bo_\bn stats array, where the underlying value of\n+ this counter or gauge is found. The _\bs_\be_\bs_\bs_\bi_\bo_\bn stats array is part of the\n+ _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bs_\bt_\ba_\bt_\bs_\b__\ba_\bl_\be_\br_\bt object.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* c\bco\bou\bun\bnt\bte\ber\brs\bs *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bp_\be_\br_\bf_\bo_\br_\bm_\ba_\bn_\bc_\be_\b__\bc_\bo_\bu_\bn_\bt_\be_\br_\bs_\b._\bh_\bp_\bp\"\n+struct counters\n+{\n+ c\bco\bou\bun\bnt\bte\ber\brs\bs () ;\n+ c\bco\bou\bun\bnt\bte\ber\brs\bs (counters const&) ;\n+ counters& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (counters const&) & ;\n+ std::int64_t i\bin\bnc\bc_\b_s\bst\bta\bat\bts\bs_\b_c\bco\bou\bun\bnt\bte\ber\br (int c, std::int64_t value = 1) ;\n+ std::int64_t o\bop\bpe\ber\bra\bat\bto\bor\br[\b[]\b] (int i) const ;\n+ void b\bbl\ble\ben\bnd\bd_\b_s\bst\bta\bat\bts\bs_\b_c\bco\bou\bun\bnt\bte\ber\br (int c, std::int64_t value, int ratio) ;\n+ void s\bse\bet\bt_\b_v\bva\bal\blu\bue\be (int c, std::int64_t value) ;\n+};\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* o\bop\bpe\ber\bra\bat\bto\bor\br[\b[]\b](\b()\b) i\bin\bnc\bc_\b_s\bst\bta\bat\bts\bs_\b_c\bco\bou\bun\bnt\bte\ber\br(\b()\b) *\b**\b**\b**\b**\b*\n+std::int64_t i\bin\bnc\bc_\b_s\bst\bta\bat\bts\bs_\b_c\bco\bou\bun\bnt\bte\ber\br (int c, std::int64_t value = 1) ;\n+std::int64_t o\bop\bpe\ber\bra\bat\bto\bor\br[\b[]\b] (int i) const ;\n+returns the new value\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* s\bse\bes\bss\bsi\bio\bon\bn_\b_s\bst\bta\bat\bts\bs_\b_m\bme\bet\btr\bri\bic\bcs\bs(\b()\b) *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bs_\bt_\ba_\bt_\bs_\b._\bh_\bp_\bp\"\n+std::vector s\bse\bes\bss\bsi\bio\bon\bn_\b_s\bst\bta\bat\bts\bs_\b_m\bme\bet\btr\bri\bic\bcs\bs ();\n+This free function returns the list of available metrics exposed by\n+libtorrent's statistics API. Each metric has a name and a v\bva\bal\blu\bue\be i\bin\bnd\bde\bex\bx. The\n+value index is the index into the array in _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bs_\bt_\ba_\bt_\bs_\b__\ba_\bl_\be_\br_\bt where this\n+metric's value can be found when the _\bs_\be_\bs_\bs_\bi_\bo_\bn stats is sampled (by calling\n+_\bp_\bo_\bs_\bt_\b__\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bs_\bt_\ba_\bt_\bs_\b(_\b)).\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* f\bfi\bin\bnd\bd_\b_m\bme\bet\btr\bri\bic\bc_\b_i\bid\bdx\bx(\b()\b) *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bs_\bt_\ba_\bt_\bs_\b._\bh_\bp_\bp\"\n+int f\bfi\bin\bnd\bd_\b_m\bme\bet\btr\bri\bic\bc_\b_i\bid\bdx\bx (string_view name);\n+given a name of a metric, this function returns the counter index of it, or -\n+1 if it could not be found. The counter index is the index into the values\n+array returned by _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bs_\bt_\ba_\bt_\bs_\b__\ba_\bl_\be_\br_\bt.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* e\ben\bnu\bum\bm m\bme\bet\btr\bri\bic\bc_\b_t\bty\byp\bpe\be_\b_t\bt *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bs_\bt_\ba_\bt_\bs_\b._\bh_\bp_\bp\"\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n+|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn|\n+|_\bc_\bo_\bu_\bn_\bt_\be_\br_\b|_\b0_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bg_\ba_\bu_\bg_\be_\b _\b _\b|_\b1_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* f\bfi\bil\ble\be_\b_s\bsl\bli\bic\bce\be *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b._\bh_\bp_\bp\"\n+represents a window of a file in a torrent.\n+The file_index refers to the index of the file (in the _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo). To get\n+the path and filename, use file_path() and give the file_index as argument. The\n+offset is the byte offset in the file where the range starts, and size is the\n+number of bytes this range is. The size + offset will never be greater than the\n+file size.\n+struct file_slice\n+{\n+ file_index_t file_index;\n+ std::int64_t offset;\n+ std::int64_t size;\n+};\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ file_index\n+ the index of the file\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ offset\n+ the offset from the start of the file, in bytes\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ size\n+ the size of the window, in bytes\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* f\bfi\bil\ble\be_\b_s\bst\bto\bor\bra\bag\bge\be *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b._\bh_\bp_\bp\"\n+The file_storage class represents a file list and the piece size. Everything\n+necessary to interpret a regular bittorrent storage file structure.\n+class file_storage\n+{\n+ bool i\bis\bs_\b_v\bva\bal\bli\bid\bd () const;\n+ void r\bre\bes\bse\ber\brv\bve\be (int num_files);\n+ void a\bad\bdd\bd_\b_f\bfi\bil\ble\be_\b_b\bbo\bor\brr\bro\bow\bw (string_view filename\n+ , std::string const& path, std::int64_t file_size\n+ , file_flags_t file_flags = {}, char const* filehash = nullptr\n+ , std::int64_t mtime = 0, string_view symlink_path = string_view()\n+ , char const* root_hash = nullptr);\n+ void a\bad\bdd\bd_\b_f\bfi\bil\ble\be (std::string const& path, std::int64_t file_size\n+ , file_flags_t file_flags = {}\n+ , std::time_t mtime = 0, string_view symlink_path = string_view()\n+ , char const* root_hash = nullptr);\n+ void a\bad\bdd\bd_\b_f\bfi\bil\ble\be_\b_b\bbo\bor\brr\bro\bow\bw (error_code& ec, string_view filename\n+ , std::string const& path, std::int64_t file_size\n+ , file_flags_t file_flags = {}, char const* filehash = nullptr\n+ , std::int64_t mtime = 0, string_view symlink_path = string_view()\n+ , char const* root_hash = nullptr);\n+ void a\bad\bdd\bd_\b_f\bfi\bil\ble\be (error_code& ec, std::string const& path, std::int64_t\n+file_size\n+ , file_flags_t file_flags = {}\n+ , std::time_t mtime = 0, string_view symlink_path = string_view()\n+ , char const* root_hash = nullptr);\n+ void r\bre\ben\bna\bam\bme\be_\b_f\bfi\bil\ble\be (file_index_t index, std::string const& new_filename);\n+ std::vector m\bma\bap\bp_\b_b\bbl\blo\boc\bck\bk (piece_index_t piece, std::int64_t offset\n+ , std::int64_t size) const;\n+ peer_request m\bma\bap\bp_\b_f\bfi\bil\ble\be (file_index_t file, std::int64_t offset, int size)\n+const;\n+ int n\bnu\bum\bm_\b_f\bfi\bil\ble\bes\bs () const noexcept;\n+ file_index_t e\ben\bnd\bd_\b_f\bfi\bil\ble\be () const noexcept;\n+ index_range f\bfi\bil\ble\be_\b_r\bra\ban\bng\bge\be () const noexcept;\n+ std::int64_t t\bto\bot\bta\bal\bl_\b_s\bsi\biz\bze\be () const;\n+ int n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs () const;\n+ void s\bse\bet\bt_\b_n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs (int n);\n+ piece_index_t e\ben\bnd\bd_\b_p\bpi\bie\bec\bce\be () const;\n+ piece_index_t l\bla\bas\bst\bt_\b_p\bpi\bie\bec\bce\be () const;\n+ index_range p\bpi\bie\bec\bce\be_\b_r\bra\ban\bng\bge\be () const noexcept;\n+ void s\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_l\ble\ben\bng\bgt\bth\bh (int l);\n+ int p\bpi\bie\bec\bce\be_\b_l\ble\ben\bng\bgt\bth\bh () const;\n+ int p\bpi\bie\bec\bce\be_\b_s\bsi\biz\bze\be (piece_index_t index) const;\n+ int p\bpi\bie\bec\bce\be_\b_s\bsi\biz\bze\be2\b2 (piece_index_t index) const;\n+ int b\bbl\blo\boc\bck\bks\bs_\b_i\bin\bn_\b_p\bpi\bie\bec\bce\be2\b2 (piece_index_t index) const;\n+ int b\bbl\blo\boc\bck\bks\bs_\b_p\bpe\ber\br_\b_p\bpi\bie\bec\bce\be () const;\n+ std::string const& n\bna\bam\bme\be () const;\n+ void s\bse\bet\bt_\b_n\bna\bam\bme\be (std::string const& n);\n+ void s\bsw\bwa\bap\bp (file_storage& ti) noexcept;\n+ void c\bca\ban\bno\bon\bni\bic\bca\bal\bli\biz\bze\be ();\n+ sha1_hash h\bha\bas\bsh\bh (file_index_t index) const;\n+ std::string s\bsy\bym\bml\bli\bin\bnk\bk (file_index_t index) const;\n+ std::string f\bfi\bil\ble\be_\b_p\bpa\bat\bth\bh (file_index_t index, std::string const& save_path =\n+\"\") const;\n+ bool p\bpa\bad\bd_\b_f\bfi\bil\ble\be_\b_a\bat\bt (file_index_t index) const;\n+ std::int64_t f\bfi\bil\ble\be_\b_s\bsi\biz\bze\be (file_index_t index) const;\n+ std::time_t m\bmt\bti\bim\bme\be (file_index_t index) const;\n+ sha256_hash r\bro\boo\bot\bt (file_index_t index) const;\n+ std::int64_t f\bfi\bil\ble\be_\b_o\bof\bff\bfs\bse\bet\bt (file_index_t index) const;\n+ char const* r\bro\boo\bot\bt_\b_p\bpt\btr\br (file_index_t const index) const;\n+ string_view f\bfi\bil\ble\be_\b_n\bna\bam\bme\be (file_index_t index) const;\n+ int f\bfi\bil\ble\be_\b_n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs (file_index_t index) const;\n+ index_range f\bfi\bil\ble\be_\b_p\bpi\bie\bec\bce\be_\b_r\bra\ban\bng\bge\be (file_index_t) const;\n+ int f\bfi\bil\ble\be_\b_n\bnu\bum\bm_\b_b\bbl\blo\boc\bck\bks\bs (file_index_t index) const;\n+ int f\bfi\bil\ble\be_\b_f\bfi\bir\brs\bst\bt_\b_p\bpi\bie\bec\bce\be_\b_n\bno\bod\bde\be (file_index_t index) const;\n+ int f\bfi\bil\ble\be_\b_f\bfi\bir\brs\bst\bt_\b_b\bbl\blo\boc\bck\bk_\b_n\bno\bod\bde\be (file_index_t index) const;\n+ std::uint32_t f\bfi\bil\ble\be_\b_p\bpa\bat\bth\bh_\b_h\bha\bas\bsh\bh (file_index_t index, std::string const&\n+save_path) const;\n+ void a\bal\bll\bl_\b_p\bpa\bat\bth\bh_\b_h\bha\bas\bsh\bhe\bes\bs (std::unordered_set& table) const;\n+ file_flags_t f\bfi\bil\ble\be_\b_f\bfl\bla\bag\bgs\bs (file_index_t index) const;\n+ bool f\bfi\bil\ble\be_\b_a\bab\bbs\bso\bol\blu\but\bte\be_\b_p\bpa\bat\bth\bh (file_index_t index) const;\n+ file_index_t f\bfi\bil\ble\be_\b_i\bin\bnd\bde\bex\bx_\b_a\bat\bt_\b_o\bof\bff\bfs\bse\bet\bt (std::int64_t offset) const;\n+ file_index_t f\bfi\bil\ble\be_\b_i\bin\bnd\bde\bex\bx_\b_a\bat\bt_\b_p\bpi\bie\bec\bce\be (piece_index_t piece) const;\n+ file_index_t f\bfi\bil\ble\be_\b_i\bin\bnd\bde\bex\bx_\b_f\bfo\bor\br_\b_r\bro\boo\bot\bt (sha256_hash const& root_hash) const;\n+ piece_index_t p\bpi\bie\bec\bce\be_\b_i\bin\bnd\bde\bex\bx_\b_a\bat\bt_\b_f\bfi\bil\ble\be (file_index_t f) const;\n+ void s\bsa\ban\bni\bit\bti\biz\bze\be_\b_s\bsy\bym\bml\bli\bin\bnk\bks\bs ();\n+ bool v\bv2\b2 () const;\n+\n+ static constexpr file_flags_t f\bfl\bla\bag\bg_\b_p\bpa\bad\bd_\b_f\bfi\bil\ble\be = 0_bit;\n+ static constexpr file_flags_t f\bfl\bla\bag\bg_\b_h\bhi\bid\bdd\bde\ben\bn = 1_bit;\n+ static constexpr file_flags_t f\bfl\bla\bag\bg_\b_e\bex\bxe\bec\bcu\but\bta\bab\bbl\ble\be = 2_bit;\n+ static constexpr file_flags_t f\bfl\bla\bag\bg_\b_s\bsy\bym\bml\bli\bin\bnk\bk = 3_bit;\n+};\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* i\bis\bs_\b_v\bva\bal\bli\bid\bd(\b()\b) *\b**\b**\b**\b**\b*\n+bool i\bis\bs_\b_v\bva\bal\bli\bid\bd () const;\n+returns true if the piece length has been initialized on the _\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be. This\n+is typically taken as a proxy of whether the _\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be as a whole is\n+initialized or not.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* r\bre\bes\bse\ber\brv\bve\be(\b()\b) *\b**\b**\b**\b**\b*\n+void r\bre\bes\bse\ber\brv\bve\be (int num_files);\n+allocates space for num_files in the internal file list. This can be used to\n+avoid reallocating the internal file list when the number of files to be added\n+is known up-front.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_f\bfi\bil\ble\be(\b()\b) a\bad\bdd\bd_\b_f\bfi\bil\ble\be_\b_b\bbo\bor\brr\bro\bow\bw(\b()\b) *\b**\b**\b**\b**\b*\n+void a\bad\bdd\bd_\b_f\bfi\bil\ble\be_\b_b\bbo\bor\brr\bro\bow\bw (string_view filename\n+ , std::string const& path, std::int64_t file_size\n+ , file_flags_t file_flags = {}, char const* filehash = nullptr\n+ , std::int64_t mtime = 0, string_view symlink_path = string_view()\n+ , char const* root_hash = nullptr);\n+void a\bad\bdd\bd_\b_f\bfi\bil\ble\be (std::string const& path, std::int64_t file_size\n+ , file_flags_t file_flags = {}\n+ , std::time_t mtime = 0, string_view symlink_path = string_view()\n+ , char const* root_hash = nullptr);\n+void a\bad\bdd\bd_\b_f\bfi\bil\ble\be_\b_b\bbo\bor\brr\bro\bow\bw (error_code& ec, string_view filename\n+ , std::string const& path, std::int64_t file_size\n+ , file_flags_t file_flags = {}, char const* filehash = nullptr\n+ , std::int64_t mtime = 0, string_view symlink_path = string_view()\n+ , char const* root_hash = nullptr);\n+void a\bad\bdd\bd_\b_f\bfi\bil\ble\be (error_code& ec, std::string const& path, std::int64_t file_size\n+ , file_flags_t file_flags = {}\n+ , std::time_t mtime = 0, string_view symlink_path = string_view()\n+ , char const* root_hash = nullptr);\n+Adds a file to the file storage. The add_file_borrow version expects that\n+filename is the file name (without a path) of the file that's being added. This\n+memory is b\bbo\bor\brr\bro\bow\bwe\bed\bd, i.e. it is the caller's responsibility to make sure it\n+stays valid throughout the lifetime of this _\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be object or any copy of\n+it. The same thing applies to filehash, which is an optional pointer to a 20\n+byte binary SHA-1 hash of the file.\n+if filename is empty, the filename from path is used and not borrowed.\n+The path argument is the full path (in the torrent file) to the file to add.\n+Note that this is not supposed to be an absolute path, but it is expected to\n+include the name of the torrent as the first path element.\n+file_size is the size of the file in bytes.\n+The file_flags argument sets attributes on the file. The file attributes is an\n+extension and may not work in all bittorrent clients.\n+For possible file attributes, see file_storage::flags_t.\n+The mtime argument is optional and can be set to 0. If non-zero, it is the\n+posix time of the last modification time of this file.\n+symlink_path is the path the file is a symlink to. To make this a symlink you\n+also need to set the _\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b:_\b:_\bf_\bl_\ba_\bg_\b__\bs_\by_\bm_\bl_\bi_\bn_\bk file flag.\n+root_hash is an optional pointer to a 32 byte SHA-256 hash, being the merkle\n+tree root hash for this file. This is only used for v2 torrents. If the root\n+hash is specified for one file, it has to be specified for all, otherwise this\n+function will fail. Note that the buffer root_hash points to must out-live the\n+_\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be object, it will not be copied. This parameter is only used when\n+l\blo\boa\bad\bdi\bin\bng\bg torrents, that already have their file hashes computed. When creating\n+torrents, the file hashes will be computed by the piece hashes.\n+If more files than one are added, certain restrictions to their paths apply. In\n+a multi-file file storage (torrent), all files must share the same root\n+directory.\n+That is, the first path element of all files must be the same. This shared path\n+element is also set to the name of the torrent. It can be changed by calling\n+set_name.\n+The overloads that take anerror_codereference will report failures via that\n+variable, otherwisesystem_erroris thrown.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* r\bre\ben\bna\bam\bme\be_\b_f\bfi\bil\ble\be(\b()\b) *\b**\b**\b**\b**\b*\n+void r\bre\ben\bna\bam\bme\be_\b_f\bfi\bil\ble\be (file_index_t index, std::string const& new_filename);\n+renames the file at index to new_filename. Keep in mind that filenames are\n+expected to be UTF-8 encoded.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* m\bma\bap\bp_\b_b\bbl\blo\boc\bck\bk(\b()\b) *\b**\b**\b**\b**\b*\n+std::vector m\bma\bap\bp_\b_b\bbl\blo\boc\bck\bk (piece_index_t piece, std::int64_t offset\n+ , std::int64_t size) const;\n+returns a list of _\bf_\bi_\bl_\be_\b__\bs_\bl_\bi_\bc_\be objects representing the portions of files the\n+specified piece index, byte offset and size range overlaps. this is the inverse\n+mapping of _\bm_\ba_\bp_\b__\bf_\bi_\bl_\be_\b(_\b).\n+Preconditions of this function is that the input range is within the torrents\n+address space. piece may not be negative and\n+ piece * piece_size + offset + size\n+may not exceed the total size of the torrent.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* m\bma\bap\bp_\b_f\bfi\bil\ble\be(\b()\b) *\b**\b**\b**\b**\b*\n+peer_request m\bma\bap\bp_\b_f\bfi\bil\ble\be (file_index_t file, std::int64_t offset, int size) const;\n+returns a _\bp_\be_\be_\br_\b__\br_\be_\bq_\bu_\be_\bs_\bt representing the piece index, byte offset and size the\n+specified file range overlaps. This is the inverse mapping over _\bm_\ba_\bp_\b__\bb_\bl_\bo_\bc_\bk_\b(_\b).\n+Note that the peer_request return type is meant to hold bittorrent block\n+requests, which may not be larger than 16 kiB. Mapping a range larger than that\n+may return an overflown integer.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* n\bnu\bum\bm_\b_f\bfi\bil\ble\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n+int n\bnu\bum\bm_\b_f\bfi\bil\ble\bes\bs () const noexcept;\n+returns the number of files in the _\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* e\ben\bnd\bd_\b_f\bfi\bil\ble\be(\b()\b) *\b**\b**\b**\b**\b*\n+file_index_t e\ben\bnd\bd_\b_f\bfi\bil\ble\be () const noexcept;\n+returns the index of the one-past-end file in the file storage\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* f\bfi\bil\ble\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n-file_storage const& f\bfi\bil\ble\bes\bs () const;\n-returns an immutable reference to the _\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be used to create the torrent\n-from.\n+*\b**\b**\b**\b**\b* f\bfi\bil\ble\be_\b_r\bra\ban\bng\bge\be(\b()\b) *\b**\b**\b**\b**\b*\n+index_range f\bfi\bil\ble\be_\b_r\bra\ban\bng\bge\be () const noexcept;\n+returns an implementation-defined type that can be used as the container in a\n+range-for loop. Where the values are the indices of all files in the\n+_\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* s\bse\bet\bt_\b_c\bco\bom\bmm\bme\ben\bnt\bt(\b()\b) *\b**\b**\b**\b**\b*\n-void s\bse\bet\bt_\b_c\bco\bom\bmm\bme\ben\bnt\bt (char const* str);\n-Sets the comment for the torrent. The string str should be utf-8 encoded. The\n-comment in a torrent file is optional.\n+*\b**\b**\b**\b**\b* t\bto\bot\bta\bal\bl_\b_s\bsi\biz\bze\be(\b()\b) *\b**\b**\b**\b**\b*\n+std::int64_t t\bto\bot\bta\bal\bl_\b_s\bsi\biz\bze\be () const;\n+returns the total number of bytes all the files in this torrent spans\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* s\bse\bet\bt_\b_c\bcr\bre\bea\bat\bto\bor\br(\b()\b) *\b**\b**\b**\b**\b*\n-void s\bse\bet\bt_\b_c\bcr\bre\bea\bat\bto\bor\br (char const* str);\n-Sets the creator of the torrent. The string str should be utf-8 encoded. This\n-is optional.\n+*\b**\b**\b**\b**\b* s\bse\bet\bt_\b_n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs(\b()\b) n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n+int n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs () const;\n+void s\bse\bet\bt_\b_n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs (int n);\n+set and get the number of pieces in the torrent\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* s\bse\bet\bt_\b_c\bcr\bre\bea\bat\bti\bio\bon\bn_\b_d\bda\bat\bte\be(\b()\b) *\b**\b**\b**\b**\b*\n-void s\bse\bet\bt_\b_c\bcr\bre\bea\bat\bti\bio\bon\bn_\b_d\bda\bat\bte\be (std::time_t timestamp);\n-sets the \"creation time\" field. Defaults to the system clock at the time of\n-construction of the _\bc_\br_\be_\ba_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt object. The timestamp is specified in\n-seconds, posix time. If the creation date is set to 0, the \"creation date\"\n-field will be omitted from the generated torrent.\n+*\b**\b**\b**\b**\b* e\ben\bnd\bd_\b_p\bpi\bie\bec\bce\be(\b()\b) *\b**\b**\b**\b**\b*\n+piece_index_t e\ben\bnd\bd_\b_p\bpi\bie\bec\bce\be () const;\n+returns the index of the one-past-end piece in the file storage\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* s\bse\bet\bt_\b_h\bha\bas\bsh\bh(\b()\b) *\b**\b**\b**\b**\b*\n-void s\bse\bet\bt_\b_h\bha\bas\bsh\bh (piece_index_t index, sha1_hash const& h);\n-This sets the SHA-1 hash for the specified piece (index). You are required to\n-set the hash for every piece in the torrent before generating it. If you have\n-the files on disk, you can use the high level convenience function to do this.\n-See _\bs_\be_\bt_\b__\bp_\bi_\be_\bc_\be_\b__\bh_\ba_\bs_\bh_\be_\bs_\b(_\b). A SHA-1 hash of all zeros is internally used to\n-indicate a hash that has not been set. Setting such hash will not be considered\n-set when calling _\bg_\be_\bn_\be_\br_\ba_\bt_\be_\b(_\b). This function will throw std::system_error if it\n-is called on an object constructed with the v2_only flag.\n+*\b**\b**\b**\b**\b* l\bla\bas\bst\bt_\b_p\bpi\bie\bec\bce\be(\b()\b) *\b**\b**\b**\b**\b*\n+piece_index_t l\bla\bas\bst\bt_\b_p\bpi\bie\bec\bce\be () const;\n+returns the index of the last piece in the torrent. The last piece is special\n+in that it may be smaller than the other pieces (and the other pieces are all\n+the same size).\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* s\bse\bet\bt_\b_h\bha\bas\bsh\bh2\b2(\b()\b) *\b**\b**\b**\b**\b*\n-void s\bse\bet\bt_\b_h\bha\bas\bsh\bh2\b2 (file_index_t file, piece_index_t::diff_type piece, sha256_hash\n-const& h);\n-sets the bittorrent v2 hash for filefileof the piecepiece.pieceis relative to\n-the first piece of the file, starting at 0. The first piece in the file can be\n-computed with _\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b:_\b:_\bf_\bi_\bl_\be_\b__\bi_\bn_\bd_\be_\bx_\b__\ba_\bt_\b__\bp_\bi_\be_\bc_\be_\b(_\b). The hash,h, is the root of\n-the merkle tree formed by the piece's 16 kiB blocks. Note that piece sizes must\n-be powers-of-2, so all per-piece merkle trees are complete. A SHA-256 hash of\n-all zeros is internally used to indicate a hash that has not been set. Setting\n-such hash will not be considered set when calling _\bg_\be_\bn_\be_\br_\ba_\bt_\be_\b(_\b). This function\n-will throw std::system_error if it is called on an object constructed with the\n-v1_only flag.\n+*\b**\b**\b**\b**\b* p\bpi\bie\bec\bce\be_\b_r\bra\ban\bng\bge\be(\b()\b) *\b**\b**\b**\b**\b*\n+index_range p\bpi\bie\bec\bce\be_\b_r\bra\ban\bng\bge\be () const noexcept;\n+returns an implementation-defined type that can be used as the container in a\n+range-for loop. Where the values are the indices of all pieces in the\n+_\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_u\bur\brl\bl_\b_s\bse\bee\bed\bd(\b()\b) a\bad\bdd\bd_\b_h\bht\btt\btp\bp_\b_s\bse\bee\bed\bd(\b()\b) *\b**\b**\b**\b**\b*\n-void a\bad\bdd\bd_\b_h\bht\btt\btp\bp_\b_s\bse\bee\bed\bd (string_view url);\n-void a\bad\bdd\bd_\b_u\bur\brl\bl_\b_s\bse\bee\bed\bd (string_view url);\n-This adds a url seed to the torrent. You can have any number of url seeds. For\n-a single file torrent, this should be an HTTP url, pointing to a file with\n-identical content as the file of the torrent. For a multi-file torrent, it\n-should point to a directory containing a directory with the same name as this\n-torrent, and all the files of the torrent in it.\n-The second function, add_http_seed() adds an HTTP seed instead.\n+*\b**\b**\b**\b**\b* s\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_l\ble\ben\bng\bgt\bth\bh(\b()\b) p\bpi\bie\bec\bce\be_\b_l\ble\ben\bng\bgt\bth\bh(\b()\b) *\b**\b**\b**\b**\b*\n+void s\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_l\ble\ben\bng\bgt\bth\bh (int l);\n+int p\bpi\bie\bec\bce\be_\b_l\ble\ben\bng\bgt\bth\bh () const;\n+set and get the size of each piece in this torrent. It must be a power of two\n+and at least 16 kiB.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_n\bno\bod\bde\be(\b()\b) *\b**\b**\b**\b**\b*\n-void a\bad\bdd\bd_\b_n\bno\bod\bde\be (std::pair node);\n-This adds a DHT node to the torrent. This especially useful if you're creating\n-a tracker less torrent. It can be used by clients to bootstrap their DHT node\n-from. The node is a hostname and a port number where there is a DHT node\n-running. You can have any number of DHT nodes in a torrent.\n+*\b**\b**\b**\b**\b* p\bpi\bie\bec\bce\be_\b_s\bsi\biz\bze\be(\b()\b) *\b**\b**\b**\b**\b*\n+int p\bpi\bie\bec\bce\be_\b_s\bsi\biz\bze\be (piece_index_t index) const;\n+returns the piece size of index. This will be the same as _\bp_\bi_\be_\bc_\be_\b__\bl_\be_\bn_\bg_\bt_\bh_\b(_\b),\n+except for the last piece, which may be shorter.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_t\btr\bra\bac\bck\bke\ber\br(\b()\b) *\b**\b**\b**\b**\b*\n-void a\bad\bdd\bd_\b_t\btr\bra\bac\bck\bke\ber\br (string_view url, int tier = 0);\n-Adds a tracker to the torrent. This is not strictly required, but most torrents\n-use a tracker as their main source of peers. The url should be an _\bh_\bt_\bt_\bp_\b:_\b/_\b/ or\n-udp:// url to a machine running a bittorrent tracker that accepts announces for\n-this torrent's info-hash. The tier is the fallback priority of the tracker. All\n-trackers with tier 0 are tried first (in any order). If all fail, trackers with\n-tier 1 are tried. If all of those fail, trackers with tier 2 are tried, and so\n-on.\n+*\b**\b**\b**\b**\b* p\bpi\bie\bec\bce\be_\b_s\bsi\biz\bze\be2\b2(\b()\b) *\b**\b**\b**\b**\b*\n+int p\bpi\bie\bec\bce\be_\b_s\bsi\biz\bze\be2\b2 (piece_index_t index) const;\n+Returns the size of the given piece. If the piece spans multiple files, only\n+the first file is considered part of the piece. This is used for v2 torrents,\n+where all files are piece aligned and padded. i.e. The pad files are not\n+considered part of the piece for this purpose.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* s\bse\bet\bt_\b_r\bro\boo\bot\bt_\b_c\bce\ber\brt\bt(\b()\b) *\b**\b**\b**\b**\b*\n-void s\bse\bet\bt_\b_r\bro\boo\bot\bt_\b_c\bce\ber\brt\bt (string_view cert);\n-This function sets an X.509 certificate in PEM format to the torrent. This\n-makes the torrent an S\bSS\bSL\bL t\bto\bor\brr\bre\ben\bnt\bt. An SSL torrent requires that each peer has a\n-valid certificate signed by this root certificate. For SSL torrents, all peers\n-are connecting over SSL connections. For more information, see the section on\n-_\bs_\bs_\bl_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\bs.\n-The string is not the path to the cert, it's the actual content of the\n-certificate.\n+*\b**\b**\b**\b**\b* b\bbl\blo\boc\bck\bks\bs_\b_i\bin\bn_\b_p\bpi\bie\bec\bce\be2\b2(\b()\b) *\b**\b**\b**\b**\b*\n+int b\bbl\blo\boc\bck\bks\bs_\b_i\bin\bn_\b_p\bpi\bie\bec\bce\be2\b2 (piece_index_t index) const;\n+returns the number of blocks in the specified piece, for v2 torrents.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* p\bpr\bri\biv\bv(\b()\b) s\bse\bet\bt_\b_p\bpr\bri\biv\bv(\b()\b) *\b**\b**\b**\b**\b*\n-bool p\bpr\bri\biv\bv () const;\n-void s\bse\bet\bt_\b_p\bpr\bri\biv\bv (bool p);\n-Sets and queries the private flag of the torrent. Torrents with the private\n-flag set ask the client to not use any other sources than the tracker for\n-peers, and to not use DHT to advertise itself publicly, only the tracker.\n+*\b**\b**\b**\b**\b* b\bbl\blo\boc\bck\bks\bs_\b_p\bpe\ber\br_\b_p\bpi\bie\bec\bce\be(\b()\b) *\b**\b**\b**\b**\b*\n+int b\bbl\blo\boc\bck\bks\bs_\b_p\bpe\ber\br_\b_p\bpi\bie\bec\bce\be () const;\n+returns the number of blocks there are in the typical piece. There may be fewer\n+in the last piece)\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n-int n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs () const;\n-returns the number of pieces in the associated _\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be object.\n+*\b**\b**\b**\b**\b* s\bse\bet\bt_\b_n\bna\bam\bme\be(\b()\b) n\bna\bam\bme\be(\b()\b) *\b**\b**\b**\b**\b*\n+std::string const& n\bna\bam\bme\be () const;\n+void s\bse\bet\bt_\b_n\bna\bam\bme\be (std::string const& n);\n+set and get the name of this torrent. For multi-file torrents, this is also the\n+name of the root directory all the files are stored in.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* p\bpi\bie\bec\bce\be_\b_r\bra\ban\bng\bge\be(\b()\b) *\b**\b**\b**\b**\b*\n-index_range p\bpi\bie\bec\bce\be_\b_r\bra\ban\bng\bge\be () const noexcept;\n-all piece indices in the torrent to be created\n+*\b**\b**\b**\b**\b* s\bsw\bwa\bap\bp(\b()\b) *\b**\b**\b**\b**\b*\n+void s\bsw\bwa\bap\bp (file_storage& ti) noexcept;\n+swap all content of t\bth\bhi\bis\bs with t\bti\bi.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* f\bfi\bil\ble\be_\b_r\bra\ban\bng\bge\be(\b()\b) *\b**\b**\b**\b**\b*\n-index_range f\bfi\bil\ble\be_\b_r\bra\ban\bng\bge\be () const noexcept;\n-all file indices in the torrent to be created\n+*\b**\b**\b**\b**\b* c\bca\ban\bno\bon\bni\bic\bca\bal\bli\biz\bze\be(\b()\b) *\b**\b**\b**\b**\b*\n+void c\bca\ban\bno\bon\bni\bic\bca\bal\bli\biz\bze\be ();\n+arrange files and padding to match the canonical form required by BEP 52\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* f\bfi\bil\ble\be_\b_p\bpi\bie\bec\bce\be_\b_r\bra\ban\bng\bge\be(\b()\b) *\b**\b**\b**\b**\b*\n-index_range f\bfi\bil\ble\be_\b_p\bpi\bie\bec\bce\be_\b_r\bra\ban\bng\bge\be (file_index_t f);\n-for v2 and hybrid torrents only, the pieces in the specified file, specified as\n-delta from the first piece in the file. i.e. the first index is 0.\n+*\b**\b**\b**\b**\b* p\bpa\bad\bd_\b_f\bfi\bil\ble\be_\b_a\bat\bt(\b()\b) h\bha\bas\bsh\bh(\b()\b) s\bsy\bym\bml\bli\bin\bnk\bk(\b()\b) r\bro\boo\bot\bt_\b_p\bpt\btr\br(\b()\b) f\bfi\bil\ble\be_\b_p\bpa\bat\bth\bh(\b()\b) f\bfi\bil\ble\be_\b_s\bsi\biz\bze\be(\b()\b) m\bmt\bti\bim\bme\be(\b()\b)\n+r\bro\boo\bot\bt(\b()\b) f\bfi\bil\ble\be_\b_o\bof\bff\bfs\bse\bet\bt(\b()\b) f\bfi\bil\ble\be_\b_n\bna\bam\bme\be(\b()\b) *\b**\b**\b**\b**\b*\n+sha1_hash h\bha\bas\bsh\bh (file_index_t index) const;\n+std::string s\bsy\bym\bml\bli\bin\bnk\bk (file_index_t index) const;\n+std::string f\bfi\bil\ble\be_\b_p\bpa\bat\bth\bh (file_index_t index, std::string const& save_path = \"\")\n+const;\n+bool p\bpa\bad\bd_\b_f\bfi\bil\ble\be_\b_a\bat\bt (file_index_t index) const;\n+std::int64_t f\bfi\bil\ble\be_\b_s\bsi\biz\bze\be (file_index_t index) const;\n+std::time_t m\bmt\bti\bim\bme\be (file_index_t index) const;\n+sha256_hash r\bro\boo\bot\bt (file_index_t index) const;\n+std::int64_t f\bfi\bil\ble\be_\b_o\bof\bff\bfs\bse\bet\bt (file_index_t index) const;\n+char const* r\bro\boo\bot\bt_\b_p\bpt\btr\br (file_index_t const index) const;\n+string_view f\bfi\bil\ble\be_\b_n\bna\bam\bme\be (file_index_t index) const;\n+These functions are used to query attributes of files at a given index.\n+The hash() is a SHA-1 hash of the file, or 0 if none was provided in the\n+torrent file. This can potentially be used to join a bittorrent network with\n+other file sharing networks.\n+root() returns the SHA-256 merkle tree root of the specified file, in case this\n+is a v2 torrent. Otherwise returns zeros. root_ptr() returns a pointer to the\n+SHA-256 merkle tree root hash for the specified file. The pointer points into\n+storage referred to when the file was added, it is not owned by this object.\n+Torrents that are not v2 torrents return nullptr.\n+The mtime() is the modification time is the posix time when a file was last\n+modified when the torrent was created, or 0 if it was not included in the\n+torrent file.\n+file_path() returns the full path to a file.\n+file_size() returns the size of a file.\n+pad_file_at() returns true if the file at the given index is a pad-file.\n+file_name() returns j\bju\bus\bst\bt the name of the file, whereas file_path() returns the\n+path (inside the torrent file) with the filename appended.\n+file_offset() returns the byte offset within the torrent file where this file\n+starts. It can be used to map the file to a piece index (given the piece size).\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* t\bto\bot\bta\bal\bl_\b_s\bsi\biz\bze\be(\b()\b) *\b**\b**\b**\b**\b*\n-std::int64_t t\bto\bot\bta\bal\bl_\b_s\bsi\biz\bze\be () const;\n-the total number of bytes of all files and pad files\n+*\b**\b**\b**\b**\b* f\bfi\bil\ble\be_\b_p\bpi\bie\bec\bce\be_\b_r\bra\ban\bng\bge\be(\b()\b) f\bfi\bil\ble\be_\b_n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs(\b()\b) f\bfi\bil\ble\be_\b_n\bnu\bum\bm_\b_b\bbl\blo\boc\bck\bks\bs(\b()\b) *\b**\b**\b**\b**\b*\n+int f\bfi\bil\ble\be_\b_n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs (file_index_t index) const;\n+index_range f\bfi\bil\ble\be_\b_p\bpi\bie\bec\bce\be_\b_r\bra\ban\bng\bge\be (file_index_t) const;\n+int f\bfi\bil\ble\be_\b_n\bnu\bum\bm_\b_b\bbl\blo\boc\bck\bks\bs (file_index_t index) const;\n+Returns the number of pieces or blocks the file atindexspans, under the\n+assumption that the file is aligned to the start of a piece. This is only\n+meaningful for v2 torrents, where files are guaranteed such alignment. These\n+numbers are used to size and navigate the merkle hash tree for each file.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* p\bpi\bie\bec\bce\be_\b_s\bsi\biz\bze\be(\b()\b) p\bpi\bie\bec\bce\be_\b_l\ble\ben\bng\bgt\bth\bh(\b()\b) *\b**\b**\b**\b**\b*\n-int p\bpi\bie\bec\bce\be_\b_s\bsi\biz\bze\be (piece_index_t i) const;\n-int p\bpi\bie\bec\bce\be_\b_l\ble\ben\bng\bgt\bth\bh () const;\n-piece_length() returns the piece size of all pieces but the last one.\n-piece_size() returns the size of the specified piece. these functions are just\n-forwarding to the associated _\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be.\n+*\b**\b**\b**\b**\b* f\bfi\bil\ble\be_\b_f\bfi\bir\brs\bst\bt_\b_p\bpi\bie\bec\bce\be_\b_n\bno\bod\bde\be(\b()\b) f\bfi\bil\ble\be_\b_f\bfi\bir\brs\bst\bt_\b_b\bbl\blo\boc\bck\bk_\b_n\bno\bod\bde\be(\b()\b) *\b**\b**\b**\b**\b*\n+int f\bfi\bil\ble\be_\b_f\bfi\bir\brs\bst\bt_\b_p\bpi\bie\bec\bce\be_\b_n\bno\bod\bde\be (file_index_t index) const;\n+int f\bfi\bil\ble\be_\b_f\bfi\bir\brs\bst\bt_\b_b\bbl\blo\boc\bck\bk_\b_n\bno\bod\bde\be (file_index_t index) const;\n+index of first piece node in the merkle tree\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_c\bco\bol\bll\ble\bec\bct\bti\bio\bon\bn(\b()\b) a\bad\bdd\bd_\b_s\bsi\bim\bmi\bil\bla\bar\br_\b_t\bto\bor\brr\bre\ben\bnt\bt(\b()\b) *\b**\b**\b**\b**\b*\n-void a\bad\bdd\bd_\b_c\bco\bol\bll\ble\bec\bct\bti\bio\bon\bn (string_view c);\n-void a\bad\bdd\bd_\b_s\bsi\bim\bmi\bil\bla\bar\br_\b_t\bto\bor\brr\bre\ben\bnt\bt (sha1_hash ih);\n-Add similar torrents (by info-hash) or collections of similar torrents. Similar\n-torrents are expected to share some files with this torrent. Torrents sharing a\n-collection name with this torrent are also expected to share files with this\n-torrent. A torrent may have more than one collection and more than one similar\n-torrents. For more information, see _\bB_\bE_\bP_\b _\b3_\b8.\n+*\b**\b**\b**\b**\b* f\bfi\bil\ble\be_\b_p\bpa\bat\bth\bh_\b_h\bha\bas\bsh\bh(\b()\b) *\b**\b**\b**\b**\b*\n+std::uint32_t f\bfi\bil\ble\be_\b_p\bpa\bat\bth\bh_\b_h\bha\bas\bsh\bh (file_index_t index, std::string const& save_path)\n+const;\n+returns the crc32 hash of file_path(index)\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- modification_time\n- This will include the file modification time as part of the torrent. This\n- is not enabled by default, as it might cause problems when you create a\n- torrent from separate files with the same content, hoping to yield the\n- same info-hash. If the files have different modification times, with this\n- option enabled, you would get different info-hashes for the files.\n+*\b**\b**\b**\b**\b* a\bal\bll\bl_\b_p\bpa\bat\bth\bh_\b_h\bha\bas\bsh\bhe\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n+void a\bal\bll\bl_\b_p\bpa\bat\bth\bh_\b_h\bha\bas\bsh\bhe\bes\bs (std::unordered_set& table) const;\n+this will add the CRC32 hash of all directory entries to the table. No filename\n+will be included, just directories. Every depth of directories are added\n+separately to allow test for collisions with files at all levels. i.e. if one\n+path in the torrent is foo/bar/baz, the CRC32 hashes for foo, foo/bar and foo/\n+bar/baz will be added to the set.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- symlinks\n- If this flag is set, files that are symlinks get a symlink attribute set\n- on them and their data will not be included in the torrent. This is\n- useful if you need to reconstruct a file hierarchy which contains\n- symlinks.\n+*\b**\b**\b**\b**\b* f\bfi\bil\ble\be_\b_f\bfl\bla\bag\bgs\bs(\b()\b) *\b**\b**\b**\b**\b*\n+file_flags_t f\bfi\bil\ble\be_\b_f\bfl\bla\bag\bgs\bs (file_index_t index) const;\n+returns a bitmask of flags from file_flags_t that apply to file at index.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- v2_only\n- Do not generate v1 metadata. The resulting torrent will only be usable by\n- clients which support v2. This requires setting all v2 hashes, with\n- _\bs_\be_\bt_\b__\bh_\ba_\bs_\bh_\b2_\b(_\b) before calling _\bg_\be_\bn_\be_\br_\ba_\bt_\be_\b(_\b). Setting v1 hashes (with _\bs_\be_\bt_\b__\bh_\ba_\bs_\bh\n- _\b(_\b)) is an error with this flag set.\n+*\b**\b**\b**\b**\b* f\bfi\bil\ble\be_\b_a\bab\bbs\bso\bol\blu\but\bte\be_\b_p\bpa\bat\bth\bh(\b()\b) *\b**\b**\b**\b**\b*\n+bool f\bfi\bil\ble\be_\b_a\bab\bbs\bso\bol\blu\but\bte\be_\b_p\bpa\bat\bth\bh (file_index_t index) const;\n+returns true if the file at the specified index has been renamed to have an\n+absolute path, i.e. is not anchored in the save path of the torrent.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- v1_only\n- do not generate v2 metadata or enforce v2 alignment and padding rules\n- this is mainly for tests, not recommended for production use. This\n- requires setting all v1 hashes, with _\bs_\be_\bt_\b__\bh_\ba_\bs_\bh_\b(_\b), before calling _\bg_\be_\bn_\be_\br_\ba_\bt_\be\n- _\b(_\b). Setting v2 hashes (with _\bs_\be_\bt_\b__\bh_\ba_\bs_\bh_\b2_\b(_\b)) is an error with this flag set.\n+*\b**\b**\b**\b**\b* f\bfi\bil\ble\be_\b_i\bin\bnd\bde\bex\bx_\b_a\bat\bt_\b_p\bpi\bie\bec\bce\be(\b()\b) f\bfi\bil\ble\be_\b_i\bin\bnd\bde\bex\bx_\b_a\bat\bt_\b_o\bof\bff\bfs\bse\bet\bt(\b()\b) *\b**\b**\b**\b**\b*\n+file_index_t f\bfi\bil\ble\be_\b_i\bin\bnd\bde\bex\bx_\b_a\bat\bt_\b_o\bof\bff\bfs\bse\bet\bt (std::int64_t offset) const;\n+file_index_t f\bfi\bil\ble\be_\b_i\bin\bnd\bde\bex\bx_\b_a\bat\bt_\b_p\bpi\bie\bec\bce\be (piece_index_t piece) const;\n+returns the index of the file at the given offset in the torrent\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- canonical_files\n- This flag only affects v1-only torrents, and is only relevant together\n- with the v1_only_flag. This flag will force the same file order and\n- padding as a v2 (or hybrid) torrent would have. It has the effect of\n- ordering files and inserting pad files to align them with piece\n- boundaries.\n+*\b**\b**\b**\b**\b* f\bfi\bil\ble\be_\b_i\bin\bnd\bde\bex\bx_\b_f\bfo\bor\br_\b_r\bro\boo\bot\bt(\b()\b) *\b**\b**\b**\b**\b*\n+file_index_t f\bfi\bil\ble\be_\b_i\bin\bnd\bde\bex\bx_\b_f\bfo\bor\br_\b_r\bro\boo\bot\bt (sha256_hash const& root_hash) const;\n+finds the file with the given root hash and returns its index if there is no\n+file with the root hash, file_index_t{-1} is returned\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- no_attributes\n- passing this flag to _\ba_\bd_\bd_\b__\bf_\bi_\bl_\be_\bs_\b(_\b) will ignore file attributes (such as\n- executable or hidden) when adding the files to the file storage. Since\n- not all filesystems and operating systems support all file attributes the\n- resulting torrent may differ depending on where it's created. If it's\n- important for torrents to be created consistently across systems, this\n- flag should be set.\n+*\b**\b**\b**\b**\b* p\bpi\bie\bec\bce\be_\b_i\bin\bnd\bde\bex\bx_\b_a\bat\bt_\b_f\bfi\bil\ble\be(\b()\b) *\b**\b**\b**\b**\b*\n+piece_index_t p\bpi\bie\bec\bce\be_\b_i\bin\bnd\bde\bex\bx_\b_a\bat\bt_\b_f\bfi\bil\ble\be (file_index_t f) const;\n+returns the piece index the given file starts at\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- canonical_files_no_tail_padding\n- this flag enforces the file layout to be canonical according to the\n- bittorrent v2 specification (just like the canonical_files flag) with the\n- one exception that tail padding is not added to the last file. This\n- behavior deviates from the specification but was the way libtorrent\n- created torrents in version up to and including 2.0.7. This flag is here\n- for backwards compatibility.\n+*\b**\b**\b**\b**\b* s\bsa\ban\bni\bit\bti\biz\bze\be_\b_s\bsy\bym\bml\bli\bin\bnk\bks\bs(\b()\b) *\b**\b**\b**\b**\b*\n+void s\bsa\ban\bni\bit\bti\biz\bze\be_\b_s\bsy\bym\bml\bli\bin\bnk\bks\bs ();\n+validate any symlinks, to ensure they all point to other files or directories\n+inside this storage. Any invalid symlinks are updated to point to themselves.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_f\bfi\bil\ble\bes\bs(\b()\b) *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bc_\br_\be_\ba_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bh_\bp_\bp\"\n-void a\bad\bdd\bd_\b_f\bfi\bil\ble\bes\bs (file_storage& fs, std::string const& file\n- , std::function p, create_flags_t flags = {});\n-void a\bad\bdd\bd_\b_f\bfi\bil\ble\bes\bs (file_storage& fs, std::string const& file\n- , create_flags_t flags = {});\n-Adds the file specified by path to the _\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be object. In case path refers\n-to a directory, files will be added recursively from the directory.\n-If specified, the predicate p is called once for every file and directory that\n-is encountered. Files for which p returns true are added, and directories for\n-which p returns true are traversed. p must have the following signature:\n-bool Pred(std::string const& p);\n-The path that is passed in to the predicate is the full path of the file or\n-directory. If no predicate is specified, all files are added, and all\n-directories are traversed.\n-The \"..\" directory is never traversed.\n-The flags argument should be the same as the flags passed to the _\bc_\br_\be_\ba_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt\n-constructor.\n+*\b**\b**\b**\b**\b* v\bv2\b2(\b()\b) *\b**\b**\b**\b**\b*\n+bool v\bv2\b2 () const;\n+returns true if this torrent contains v2 metadata.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* s\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_h\bha\bas\bsh\bhe\bes\bs(\b()\b) *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bc_\br_\be_\ba_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bh_\bp_\bp\"\n-inline void s\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_h\bha\bas\bsh\bhe\bes\bs (create_torrent& t, std::string const& p\n- , std::function const& f);\n-void s\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_h\bha\bas\bsh\bhe\bes\bs (create_torrent& t, std::string const& p\n- , std::function const& f, error_code& ec);\n-inline void s\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_h\bha\bas\bsh\bhe\bes\bs (create_torrent& t, std::string const& p\n- , settings_interface const& settings\n- , std::function const& f);\n-void s\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_h\bha\bas\bsh\bhe\bes\bs (create_torrent& t, std::string const& p\n- , settings_interface const& settings, disk_io_constructor_type disk_io\n- , std::function const& f, error_code& ec);\n-inline void s\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_h\bha\bas\bsh\bhe\bes\bs (create_torrent& t, std::string const& p);\n-inline void s\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_h\bha\bas\bsh\bhe\bes\bs (create_torrent& t, std::string const& p,\n-error_code& ec);\n-void s\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_h\bha\bas\bsh\bhe\bes\bs (create_torrent& t, std::string const& p\n- , settings_interface const& settings\n- , std::function const& f, error_code& ec);\n-This function will assume that the files added to the torrent file exists at\n-path p, read those files and hash the content and set the hashes in the\n-create_torrent object. The optional function f is called in between every hash\n-that is set. f must have the following signature:\n-void Fun(piece_index_t);\n-The overloads taking a _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk may be used to configure the underlying\n-disk access. Such as settings_pack::aio_threads.\n-The overloads that don't take an error_code& may throw an exception in case of\n-a file error, the other overloads sets the error code to reflect the error, if\n-any.\n-Bencoding is a common representation in bittorrent used for dictionary, list,\n-_\bi_\bn_\bt and string hierarchies. It's used to encode .torrent files and some\n-messages in the network protocol. libtorrent also uses it to store settings,\n-resume data and other _\bs_\be_\bs_\bs_\bi_\bo_\bn state.\n-Strings in bencoded structures do not necessarily represent text. Strings are\n-raw byte buffers of a certain length. If a string is meant to be interpreted as\n-text, it is required to be UTF-8 encoded. See _\bB_\bE_\bP_\b _\b3.\n-The function for decoding bencoded data _\bb_\bd_\be_\bc_\bo_\bd_\be_\b(_\b), returning a _\bb_\bd_\be_\bc_\bo_\bd_\be_\b__\bn_\bo_\bd_\be.\n-This function builds a tree that points back into the original buffer. The\n-returned _\bb_\bd_\be_\bc_\bo_\bd_\be_\b__\bn_\bo_\bd_\be will not be valid once the buffer it was parsed out of is\n-discarded.\n-It's possible to construct an _\be_\bn_\bt_\br_\by from a _\bb_\bd_\be_\bc_\bo_\bd_\be_\b__\bn_\bo_\bd_\be, if a structure needs\n-to be altered and re-encoded.\n+ flag_pad_file\n+ the file is a pad file. It's required to contain zeros at it will not be\n+ saved to disk. Its purpose is to make the following file start on a piece\n+ boundary.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* e\ben\bnt\btr\bry\by *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\be_\bn_\bt_\br_\by_\b._\bh_\bp_\bp\"\n-The entry class represents one node in a bencoded hierarchy. It works as a\n-variant type, it can be either a list, a dictionary (std::map), an integer or a\n-string.\n-class entry\n+ flag_hidden\n+ this file has the hidden attribute set. This is primarily a windows\n+ attribute\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ flag_executable\n+ this file has the executable attribute set.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ flag_symlink\n+ this file is a symbolic link. It should have a link target string\n+ associated with it.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* s\bst\bto\bor\bra\bag\bge\be_\b_p\bpa\bar\bra\bam\bms\bs *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bd_\be_\bf_\bs_\b._\bh_\bp_\bp\"\n+a parameter pack used to construct the storage for a torrent, used in\n+_\bd_\bi_\bs_\bk_\b__\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be\n+struct storage_params\n {\n- data_type t\bty\byp\bpe\be () const;\n- e\ben\bnt\btr\bry\by (dictionary_type);\n- e\ben\bnt\btr\bry\by (preformatted_type);\n- e\ben\bnt\btr\bry\by (list_type);\n- e\ben\bnt\btr\bry\by (span);\n- e\ben\bnt\btr\bry\by (integer_type);\n- e\ben\bnt\btr\bry\by (U v);\n- e\ben\bnt\btr\bry\by (data_type t);\n- e\ben\bnt\btr\bry\by (bdecode_node const& n);\n- entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (preformatted_type) &;\n- entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (entry&&) & noexcept;\n- entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (dictionary_type) &;\n- entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (entry const&) &;\n- entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (bdecode_node const&) &;\n- entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (span) &;\n- entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (list_type) &;\n- entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (integer_type) &;\n- entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (U v) &;\n- string_type const& s\bst\btr\bri\bin\bng\bg () const;\n- string_type& s\bst\btr\bri\bin\bng\bg ();\n- dictionary_type& d\bdi\bic\bct\bt ();\n- list_type const& l\bli\bis\bst\bt () const;\n- integer_type const& i\bin\bnt\bte\beg\bge\ber\br () const;\n- list_type& l\bli\bis\bst\bt ();\n- integer_type& i\bin\bnt\bte\beg\bge\ber\br ();\n- preformatted_type const& p\bpr\bre\bef\bfo\bor\brm\bma\bat\btt\bte\bed\bd () const;\n- preformatted_type& p\bpr\bre\bef\bfo\bor\brm\bma\bat\btt\bte\bed\bd ();\n- dictionary_type const& d\bdi\bic\bct\bt () const;\n- void s\bsw\bwa\bap\bp (entry& e);\n- entry const& o\bop\bpe\ber\bra\bat\bto\bor\br[\b[]\b] (string_view key) const;\n- entry& o\bop\bpe\ber\bra\bat\bto\bor\br[\b[]\b] (string_view key);\n- entry const* f\bfi\bin\bnd\bd_\b_k\bke\bey\by (string_view key) const;\n- entry* f\bfi\bin\bnd\bd_\b_k\bke\bey\by (string_view key);\n- std::string t\bto\bo_\b_s\bst\btr\bri\bin\bng\bg (bool single_line = false) const;\n+ s\bst\bto\bor\bra\bag\bge\be_\b_p\bpa\bar\bra\bam\bms\bs (file_storage const& f, file_storage const* mf\n+ , std::string const& sp, storage_mode_t const sm\n+ , aux::vector const& prio\n+ , sha1_hash const& ih);\n \n- enum data_type\n- {\n- int_t,\n- string_t,\n- list_t,\n- dictionary_t,\n- undefined_t,\n- preformatted_t,\n- };\n+ file_storage const& files;\n+ file_storage const* m\bma\bap\bpp\bpe\bed\bd_\b_f\bfi\bil\ble\bes\bs = nullptr;\n+ std::string const& path;\n+ storage_mode_t m\bmo\bod\bde\be {storage_mode_sparse};\n+ aux::vector const& priorities;\n+ sha1_hash info_hash;\n };\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* t\bty\byp\bpe\be(\b()\b) *\b**\b**\b**\b**\b*\n-data_type t\bty\byp\bpe\be () const;\n-returns the concrete type of the _\be_\bn_\bt_\br_\by\n+*\b**\b**\b**\b**\b**\b* d\bde\bef\bfa\bau\bul\blt\bt_\b_d\bdi\bis\bsk\bk_\b_i\bio\bo_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br(\b()\b) *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b._\bh_\bp_\bp\"\n+std::unique_ptr d\bde\bef\bfa\bau\bul\blt\bt_\b_d\bdi\bis\bsk\bk_\b_i\bio\bo_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br (\n+ io_context& ios, settings_interface const&, counters& cnt);\n+the constructor function for the default storage. On systems that support\n+memory mapped files (and a 64 bit address space) the memory mapped storage will\n+be constructed, otherwise the portable posix storage.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* e\ben\bnt\btr\bry\by(\b()\b) *\b**\b**\b**\b**\b*\n-e\ben\bnt\btr\bry\by (dictionary_type);\n-e\ben\bnt\btr\bry\by (preformatted_type);\n-e\ben\bnt\btr\bry\by (list_type);\n-e\ben\bnt\btr\bry\by (span);\n-e\ben\bnt\btr\bry\by (integer_type);\n-constructors directly from a specific type. The content of the argument is\n-copied into the newly constructed _\be_\bn_\bt_\br_\by\n+*\b**\b**\b**\b**\b**\b* d\bdi\bis\bsa\bab\bbl\ble\bed\bd_\b_d\bdi\bis\bsk\bk_\b_i\bio\bo_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br(\b()\b) *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bd_\bi_\bs_\ba_\bb_\bl_\be_\bd_\b__\bd_\bi_\bs_\bk_\b__\bi_\bo_\b._\bh_\bp_\bp\"\n+std::unique_ptr d\bdi\bis\bsa\bab\bbl\ble\bed\bd_\b_d\bdi\bis\bsk\bk_\b_i\bio\bo_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br (\n+ io_context& ios, settings_interface const&, counters& cnt);\n+creates a disk io object that discards all data written to it, and only returns\n+zero-buffers when read from. May be useful for testing and benchmarking.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* e\ben\bnt\btr\bry\by(\b()\b) *\b**\b**\b**\b**\b*\n-e\ben\bnt\btr\bry\by (data_type t);\n-construct an empty _\be_\bn_\bt_\br_\by of the specified type. see _\bd_\ba_\bt_\ba_\b__\bt_\by_\bp_\be enum.\n+*\b**\b**\b**\b**\b**\b* p\bpo\bos\bsi\bix\bx_\b_d\bdi\bis\bsk\bk_\b_i\bio\bo_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br(\b()\b) *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bp_\bo_\bs_\bi_\bx_\b__\bd_\bi_\bs_\bk_\b__\bi_\bo_\b._\bh_\bp_\bp\"\n+std::unique_ptr p\bpo\bos\bsi\bix\bx_\b_d\bdi\bis\bsk\bk_\b_i\bio\bo_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br (\n+ io_context& ios, settings_interface const&, counters& cnt);\n+this is a simple posix disk I/O back-end, used for systems that don't have a 64\n+bit virtual address space or don't support memory mapped files. It's\n+implemented using portable C file functions and is single-threaded.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* e\ben\bnt\btr\bry\by(\b()\b) *\b**\b**\b**\b**\b*\n-e\ben\bnt\btr\bry\by (bdecode_node const& n);\n-construct from _\bb_\bd_\be_\bc_\bo_\bd_\be_\b__\bn_\bo_\bd_\be parsed form (see _\bb_\bd_\be_\bc_\bo_\bd_\be_\b(_\b))\n+*\b**\b**\b**\b**\b**\b* m\bmm\bma\bap\bp_\b_d\bdi\bis\bsk\bk_\b_i\bio\bo_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br(\b()\b) *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bm_\bm_\ba_\bp_\b__\bd_\bi_\bs_\bk_\b__\bi_\bo_\b._\bh_\bp_\bp\"\n+std::unique_ptr m\bmm\bma\bap\bp_\b_d\bdi\bis\bsk\bk_\b_i\bio\bo_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br (\n+ io_context& ios, settings_interface const&, counters& cnt);\n+constructs a memory mapped file disk I/O object.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* o\bop\bpe\ber\bra\bat\bto\bor\br=\b=(\b()\b) *\b**\b**\b**\b**\b*\n-entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (preformatted_type) &;\n-entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (entry&&) & noexcept;\n-entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (dictionary_type) &;\n-entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (entry const&) &;\n-entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (bdecode_node const&) &;\n-entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (span) &;\n-entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (list_type) &;\n-entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (integer_type) &;\n-copies the structure of the right hand side into this _\be_\bn_\bt_\br_\by.\n+*\b**\b**\b**\b**\b**\b* e\ben\bnu\bum\bm s\bst\bto\bor\bra\bag\bge\be_\b_m\bmo\bod\bde\be_\b_t\bt *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bd_\be_\bf_\bs_\b._\bh_\bp_\bp\"\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n+|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+| | |All pieces will be written to their final |\n+| | |position, all files will be allocated in full |\n+|storage_mode_allocate|0 |when the torrent is first started. This mode |\n+| | |minimizes fragmentation but could be a costly |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bo_\bp_\be_\br_\ba_\bt_\bi_\bo_\bn_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+| | |All pieces will be written to the place where |\n+|storage_mode_sparse |1 |they belong and sparse files will be used. This|\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bi_\bs_\b _\bt_\bh_\be_\b _\br_\be_\bc_\bo_\bm_\bm_\be_\bn_\bd_\be_\bd_\b,_\b _\ba_\bn_\bd_\b _\bd_\be_\bf_\ba_\bu_\bl_\bt_\b _\bm_\bo_\bd_\be_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* s\bst\btr\bri\bin\bng\bg(\b()\b) d\bdi\bic\bct\bt(\b()\b) l\bli\bis\bst\bt(\b()\b) i\bin\bnt\bte\beg\bge\ber\br(\b()\b) p\bpr\bre\bef\bfo\bor\brm\bma\bat\btt\bte\bed\bd(\b()\b) *\b**\b**\b**\b**\b*\n-string_type const& s\bst\btr\bri\bin\bng\bg () const;\n-string_type& s\bst\btr\bri\bin\bng\bg ();\n-dictionary_type& d\bdi\bic\bct\bt ();\n-list_type const& l\bli\bis\bst\bt () const;\n-integer_type const& i\bin\bnt\bte\beg\bge\ber\br () const;\n-list_type& l\bli\bis\bst\bt ();\n-integer_type& i\bin\bnt\bte\beg\bge\ber\br ();\n-preformatted_type const& p\bpr\bre\bef\bfo\bor\brm\bma\bat\btt\bte\bed\bd () const;\n-preformatted_type& p\bpr\bre\bef\bfo\bor\brm\bma\bat\btt\bte\bed\bd ();\n-dictionary_type const& d\bdi\bic\bct\bt () const;\n-The integer(), string(), list() and dict() functions are accessors that return\n-the respective type. If the entry object isn't of the type you request, the\n-accessor will throw system_error. You can ask an entry for its type through the\n-type() function.\n-If you want to create an entry you give it the type you want it to have in its\n-constructor, and then use one of the non-const accessors to get a reference\n-which you then can assign the value you want it to have.\n-The typical code to get info from a torrent file will then look like this:\n-entry torrent_file;\n-// ...\n-\n-// throws if this is not a dictionary\n-entry::dictionary_type const& dict = torrent_file.dict();\n-entry::dictionary_type::const_iterator i;\n-i = dict.find(\"announce\");\n-if (i != dict.end())\n+*\b**\b**\b**\b**\b**\b* e\ben\bnu\bum\bm s\bst\bta\bat\btu\bus\bs_\b_t\bt *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bd_\be_\bf_\bs_\b._\bh_\bp_\bp\"\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n+|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bn_\bo_\b__\be_\br_\br_\bo_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b0_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bf_\ba_\bt_\ba_\bl_\b__\bd_\bi_\bs_\bk_\b__\be_\br_\br_\bo_\br_\b|_\b1_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bn_\be_\be_\bd_\b__\bf_\bu_\bl_\bl_\b__\bc_\bh_\be_\bc_\bk_\b _\b|_\b2_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bf_\bi_\bl_\be_\b__\be_\bx_\bi_\bs_\bt_\b _\b _\b _\b _\b _\b _\b|_\b3_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+| | |this is not an enum value, but a flag that can be set|\n+| | |in the return from async_check_files, in case an |\n+|oversized_file |16 |existing file was found larger than specified in the |\n+| | |torrent. i.e. it has garbage at the end the _\bs_\bt_\ba_\bt_\bu_\bs_\b__\bt |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bf_\bi_\be_\bl_\bd_\b _\bi_\bs_\b _\bu_\bs_\be_\bd_\b _\bf_\bo_\br_\b _\bt_\bh_\bi_\bs_\b _\bt_\bo_\b _\bp_\br_\be_\bs_\be_\br_\bv_\be_\b _\bA_\bB_\bI_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* e\ben\bnu\bum\bm m\bmo\bov\bve\be_\b_f\bfl\bla\bag\bgs\bs_\b_t\bt *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bd_\be_\bf_\bs_\b._\bh_\bp_\bp\"\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n+|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|always_replace_files |0 |replace any files in the destination when |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bc_\bo_\bp_\by_\bi_\bn_\bg_\b _\bo_\br_\b _\bm_\bo_\bv_\bi_\bn_\bg_\b _\bt_\bh_\be_\b _\bs_\bt_\bo_\br_\ba_\bg_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+| | |if any files that we want to copy exist in |\n+| | |the destination exist, fail the whole |\n+| | |operation and don't perform any copy or move.|\n+| | |There is an inherent race condition in this |\n+|fail_if_exist |1 |mode. The files are checked for existence |\n+| | |before the operation starts. In between the |\n+| | |check and performing the copy, the |\n+| | |destination files may be created, in which |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bc_\ba_\bs_\be_\b _\bt_\bh_\be_\by_\b _\ba_\br_\be_\b _\br_\be_\bp_\bl_\ba_\bc_\be_\bd_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+| | |if any file exist in the target, take those |\n+|dont_replace |2 |files instead of the ones we may have in the |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bs_\bo_\bu_\br_\bc_\be_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+| | |don't move any source files, just forget |\n+|reset_save_path |3 |about them and begin checking files at new |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bs_\ba_\bv_\be_\b _\bp_\ba_\bt_\bh_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|reset_save_path_unchecked|4 |don't move any source files, just change save|\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bp_\ba_\bt_\bh_\b _\ba_\bn_\bd_\b _\bc_\bo_\bn_\bt_\bi_\bn_\bu_\be_\b _\bw_\bo_\br_\bk_\bi_\bn_\bg_\b _\bw_\bi_\bt_\bh_\bo_\bu_\bt_\b _\ba_\bn_\by_\b _\bc_\bh_\be_\bc_\bk_\bs_\b |\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_i\bin\bnf\bfo\boh\bha\bas\bsh\bh *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\be_\bn_\bt_\br_\by_\b._\bh_\bp_\bp\"\n+struct announce_infohash\n {\n- std::string tracker_url = i->second.string();\n- std::cout << tracker_url << \"\\n\";\n-}\n-The following code is equivalent, but a little bit shorter:\n-entry torrent_file;\n-// ...\n+ std::string message;\n+ error_code last_error;\n+ int s\bsc\bcr\bra\bap\bpe\be_\b_i\bin\bnc\bco\bom\bmp\bpl\ble\bet\bte\be = -1;\n+ int s\bsc\bcr\bra\bap\bpe\be_\b_c\bco\bom\bmp\bpl\ble\bet\bte\be = -1;\n+ int s\bsc\bcr\bra\bap\bpe\be_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bde\bed\bd = -1;\n+ std::uint8_t fails : 7;\n+ bool updating : 1;\n+ bool start_sent : 1;\n+ bool complete_sent : 1;\n+};\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ message\n+ if this tracker has returned an error or warning message that message is\n+ stored here\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ last_error\n+ if this tracker failed the last time it was contacted this error code\n+ specifies what error occurred\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ scrape_incomplete scrape_complete scrape_downloaded\n+ if this tracker has returned scrape data, these fields are filled in with\n+ valid numbers. Otherwise they are set to -1. incomplete counts the number\n+ of current downloaders. complete counts the number of current peers\n+ completed the download, or \"seeds\". downloaded is the cumulative number\n+ of completed downloads.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ fails\n+ the number of times in a row we have failed to announce to this tracker.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ updating\n+ true while we're waiting for a response from the tracker.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ start_sent\n+ set to true when we get a valid response from an announce with\n+ event=started. If it is set, we won't send start in the subsequent\n+ announces.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ complete_sent\n+ set to true when we send a event=completed.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnd\bdp\bpo\boi\bin\bnt\bt *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\be_\bn_\bt_\br_\by_\b._\bh_\bp_\bp\"\n+announces are sent to each tracker using every listen socket this class holds\n+information about one listen socket for one tracker\n+struct announce_endpoint\n+{\n+ a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnd\bdp\bpo\boi\bin\bnt\bt ();\n \n-// throws if this is not a dictionary\n-if (entry* i = torrent_file.find_key(\"announce\"))\n+ _\bt_\bc_\bp_\b:_\b:_\be_\bn_\bd_\bp_\bo_\bi_\bn_\bt local_endpoint;\n+ aux::array info_hashes;\n+ bool e\ben\bna\bab\bbl\ble\bed\bd = true;\n+};\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ local_endpoint\n+ the local endpoint of the listen interface associated with this endpoint\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ info_hashes\n+ info_hashes[0] is the v1 info hash (SHA1) info_hashes[1] is the v2 info\n+ hash (truncated SHA-256)\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ enabled\n+ set to false to not announce from this endpoint\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\be_\bn_\bt_\br_\by_\b._\bh_\bp_\bp\"\n+this class holds information about one bittorrent tracker, as it relates to a\n+specific torrent.\n+struct announce_entry\n {\n- std::string tracker_url = i->string();\n- std::cout << tracker_url << \"\\n\";\n-}\n-To make it easier to extract information from a torrent file, the class\n-_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo exists.\n+ announce_entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (announce_entry const&) &;\n+ a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by (announce_entry const&);\n+ explicit a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by (string_view u);\n+ ~\b~a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by ();\n+ a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by ();\n+\n+ enum tracker_source\n+ {\n+ source_torrent,\n+ source_client,\n+ source_magnet_link,\n+ source_tex,\n+ };\n+\n+ std::string url;\n+ std::string trackerid;\n+ std::vector endpoints;\n+ std::uint8_t t\bti\bie\ber\br = 0;\n+ std::uint8_t f\bfa\bai\bil\bl_\b_l\bli\bim\bmi\bit\bt = 0;\n+ std::uint8_t source:4;\n+ bool verified:1;\n+};\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* s\bsw\bwa\bap\bp(\b()\b) *\b**\b**\b**\b**\b*\n-void s\bsw\bwa\bap\bp (entry& e);\n-swaps the content of t\bth\bhi\bis\bs with e.\n+*\b**\b**\b**\b**\b* ~\b~a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by(\b()\b) a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by(\b()\b) o\bop\bpe\ber\bra\bat\bto\bor\br=\b=(\b()\b) *\b**\b**\b**\b**\b*\n+announce_entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (announce_entry const&) &;\n+a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by (announce_entry const&);\n+explicit a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by (string_view u);\n+~\b~a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by ();\n+a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by ();\n+constructs a tracker announce _\be_\bn_\bt_\br_\by with u as the URL.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* o\bop\bpe\ber\bra\bat\bto\bor\br[\b[]\b](\b()\b) *\b**\b**\b**\b**\b*\n-entry const& o\bop\bpe\ber\bra\bat\bto\bor\br[\b[]\b] (string_view key) const;\n-entry& o\bop\bpe\ber\bra\bat\bto\bor\br[\b[]\b] (string_view key);\n-All of these functions requires the _\be_\bn_\bt_\br_\by to be a dictionary, if it isn't they\n-will throw system_error.\n-The non-const versions of the operator[] will return a reference to either the\n-existing element at the given key or, if there is no element with the given\n-key, a reference to a newly inserted element at that key.\n-The const version of operator[] will only return a reference to an existing\n-element at the given key. If the key is not found, it will throw system_error.\n+*\b**\b**\b**\b**\b* e\ben\bnu\bum\bm t\btr\bra\bac\bck\bke\ber\br_\b_s\bso\bou\bur\brc\bce\be *\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\be_\bn_\bt_\br_\by_\b._\bh_\bp_\bp\"\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n+|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bs_\bo_\bu_\br_\bc_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b _\b _\b _\b _\b|_\b1_\b _\b _\b _\b _\b|_\bt_\bh_\be_\b _\bt_\br_\ba_\bc_\bk_\be_\br_\b _\bw_\ba_\bs_\b _\bp_\ba_\br_\bt_\b _\bo_\bf_\b _\bt_\bh_\be_\b _\b._\bt_\bo_\br_\br_\be_\bn_\bt_\b _\bf_\bi_\bl_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|source_client |2 |the tracker was added programmatically via the |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\ba_\bd_\bd_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\b(_\b)_\b _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bs_\bo_\bu_\br_\bc_\be_\b__\bm_\ba_\bg_\bn_\be_\bt_\b__\bl_\bi_\bn_\bk_\b|_\b4_\b _\b _\b _\b _\b|_\bt_\bh_\be_\b _\bt_\br_\ba_\bc_\bk_\be_\br_\b _\bw_\ba_\bs_\b _\bp_\ba_\br_\bt_\b _\bo_\bf_\b _\ba_\b _\bm_\ba_\bg_\bn_\be_\bt_\b _\bl_\bi_\bn_\bk_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|source_tex |8 |the tracker was received from the swarm via tracker|\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\be_\bx_\bc_\bh_\ba_\bn_\bg_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* f\bfi\bin\bnd\bd_\b_k\bke\bey\by(\b()\b) *\b**\b**\b**\b**\b*\n-entry const* f\bfi\bin\bnd\bd_\b_k\bke\bey\by (string_view key) const;\n-entry* f\bfi\bin\bnd\bd_\b_k\bke\bey\by (string_view key);\n-These functions requires the _\be_\bn_\bt_\br_\by to be a dictionary, if it isn't they will\n-throw system_error.\n-They will look for an element at the given key in the dictionary, if the\n-element cannot be found, they will return nullptr. If an element with the given\n-key is found, the return a pointer to it.\n+ url\n+ tracker URL as it appeared in the torrent file\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* t\bto\bo_\b_s\bst\btr\bri\bin\bng\bg(\b()\b) *\b**\b**\b**\b**\b*\n-std::string t\bto\bo_\b_s\bst\btr\bri\bin\bng\bg (bool single_line = false) const;\n-returns a pretty-printed string representation of the bencoded structure, with\n-JSON-style syntax\n+ trackerid\n+ the current &trackerid= argument passed to the tracker. this is optional\n+ and is normally empty (in which case no trackerid is sent).\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* e\ben\bnu\bum\bm d\bda\bat\bta\ba_\b_t\bty\byp\bpe\be *\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\be_\bn_\bt_\br_\by_\b._\bh_\bp_\bp\"\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n-|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn|\n-|_\bi_\bn_\bt_\b__\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b0_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bs_\bt_\br_\bi_\bn_\bg_\b__\bt_\b _\b _\b _\b _\b _\b _\b|_\b1_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bl_\bi_\bs_\bt_\b__\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b2_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bd_\bi_\bc_\bt_\bi_\bo_\bn_\ba_\br_\by_\b__\bt_\b _\b _\b|_\b3_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bu_\bn_\bd_\be_\bf_\bi_\bn_\be_\bd_\b__\bt_\b _\b _\b _\b|_\b4_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bp_\br_\be_\bf_\bo_\br_\bm_\ba_\bt_\bt_\be_\bd_\b__\bt_\b|_\b5_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+ endpoints\n+ each local listen socket (endpoint) will announce to the tracker. This\n+ list contains state per endpoint.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* b\bbe\ben\bnc\bco\bod\bde\be(\b()\b) *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bb_\be_\bn_\bc_\bo_\bd_\be_\b._\bh_\bp_\bp\"\n-template int b\bbe\ben\bnc\bco\bod\bde\be (OutIt out, const entry& e);\n-This function will encode data to bencoded form.\n-The _\be_\bn_\bt_\br_\by class is the internal representation of the bencoded data and it can\n-be used to retrieve information, an _\be_\bn_\bt_\br_\by can also be build by the program and\n-given to bencode() to encode it into the OutIt iterator.\n-OutIt is an _\bO_\bu_\bt_\bp_\bu_\bt_\bI_\bt_\be_\br_\ba_\bt_\bo_\br. It's a template and usually instantiated as\n-_\bo_\bs_\bt_\br_\be_\ba_\bm_\b__\bi_\bt_\be_\br_\ba_\bt_\bo_\br or _\bb_\ba_\bc_\bk_\b__\bi_\bn_\bs_\be_\br_\bt_\b__\bi_\bt_\be_\br_\ba_\bt_\bo_\br. This function assumes the value_type\n-of the iterator is a char. In order to encode _\be_\bn_\bt_\br_\by e into a buffer, do:\n-std::vector buf;\n-bencode(std::back_inserter(buf), e);\n+ tier\n+ the tier this tracker belongs to\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* o\bop\bpe\ber\bra\bat\bto\bor\br<\b<<\b<(\b()\b) *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\be_\bn_\bt_\br_\by_\b._\bh_\bp_\bp\"\n-inline std::ostream& o\bop\bpe\ber\bra\bat\bto\bor\br<\b<<\b< (std::ostream& os, const entry& e);\n-prints the bencoded structure to the ostream as a JSON-style structure.\n+ fail_limit\n+ the max number of failures to announce to this tracker in a row, before\n+ this tracker is not used anymore. 0 means unlimited\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ source\n+ a bitmask specifying which sources we got this tracker from.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ verified\n+ set to true the first time we receive a valid response from this tracker.\n The disk I/O can be customized in libtorrent. In previous versions, the\n customization was at the level of each torrent. Now, the customization point is\n at the _\bs_\be_\bs_\bs_\bi_\bo_\bn level. All torrents added to a _\bs_\be_\bs_\bs_\bi_\bo_\bn will use the same disk I/\n O subsystem, as determined by the disk_io_constructor (in _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs).\n This allows the disk subsystem to also customize threading and disk job\n management.\n To customize the disk subsystem, implement _\bd_\bi_\bs_\bk_\b__\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be and provide a factory\n@@ -7501,41 +6896,41 @@\n \n std::unique_ptr temp_disk_constructor(\n lt::io_context& ioc, lt::settings_interface const&, lt::counters&)\n {\n return std::make_unique(ioc);\n }\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* d\bdi\bis\bsk\bk_\b_o\bob\bbs\bse\ber\brv\bve\ber\br *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bd_\bi_\bs_\bk_\b__\bo_\bb_\bs_\be_\br_\bv_\be_\br_\b._\bh_\bp_\bp\"\n+struct disk_observer\n+{\n+ virtual void o\bon\bn_\b_d\bdi\bis\bsk\bk () = 0;\n+};\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* o\bon\bn_\b_d\bdi\bis\bsk\bk(\b()\b) *\b**\b**\b**\b**\b*\n+virtual void o\bon\bn_\b_d\bdi\bis\bsk\bk () = 0;\n+called when the disk cache size has dropped below the low watermark again and\n+we can resume downloading from peers\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* s\bse\bet\btt\bti\bin\bng\bgs\bs_\b_i\bin\bnt\bte\ber\brf\bfa\bac\bce\be *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk_\b._\bh_\bp_\bp\"\n the common interface to _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk and the internal representation of\n settings.\n struct settings_interface\n {\n virtual void s\bse\bet\bt_\b_b\bbo\boo\bol\bl (int name, bool val) = 0;\n virtual void s\bse\bet\bt_\b_i\bin\bnt\bt (int name, int val) = 0;\n virtual bool h\bha\bas\bs_\b_v\bva\bal\bl (int name) const = 0;\n virtual void s\bse\bet\bt_\b_s\bst\btr\br (int name, std::string val) = 0;\n+ virtual int g\bge\bet\bt_\b_i\bin\bnt\bt (int name) const = 0;\n virtual std::string const& g\bge\bet\bt_\b_s\bst\btr\br (int name) const = 0;\n virtual bool g\bge\bet\bt_\b_b\bbo\boo\bol\bl (int name) const = 0;\n- virtual int g\bge\bet\bt_\b_i\bin\bnt\bt (int name) const = 0;\n-};\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* d\bdi\bis\bsk\bk_\b_o\bob\bbs\bse\ber\brv\bve\ber\br *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bd_\bi_\bs_\bk_\b__\bo_\bb_\bs_\be_\br_\bv_\be_\br_\b._\bh_\bp_\bp\"\n-struct disk_observer\n-{\n- virtual void o\bon\bn_\b_d\bdi\bis\bsk\bk () = 0;\n };\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* o\bon\bn_\b_d\bdi\bis\bsk\bk(\b()\b) *\b**\b**\b**\b**\b*\n-virtual void o\bon\bn_\b_d\bdi\bis\bsk\bk () = 0;\n-called when the disk cache size has dropped below the low watermark again and\n-we can resume downloading from peers\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* o\bop\bpe\ben\bn_\b_f\bfi\bil\ble\be_\b_s\bst\bta\bat\bte\be *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bd_\bi_\bs_\bk_\b__\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be_\b._\bh_\bp_\bp\"\n this contains information about a file that's currently open by the libtorrent\n disk I/O subsystem. It's associated with a single torrent.\n struct open_file_state\n {\n file_index_t file_index;\n@@ -7571,21 +6966,21 @@\n thread via the io_context object passed into the constructor. The callbacks\n will be run in the network thread.\n struct disk_interface\n {\n virtual storage_holder n\bne\bew\bw_\b_t\bto\bor\brr\bre\ben\bnt\bt (storage_params const& p\n , std::shared_ptr const& torrent) = 0;\n virtual void r\bre\bem\bmo\bov\bve\be_\b_t\bto\bor\brr\bre\ben\bnt\bt (storage_index_t) = 0;\n+ virtual void a\bas\bsy\byn\bnc\bc_\b_r\bre\bea\bad\bd (storage_index_t storage, peer_request const& r\n+ , std::function handler\n+ , disk_job_flags_t flags = {}) = 0;\n virtual bool a\bas\bsy\byn\bnc\bc_\b_w\bwr\bri\bit\bte\be (storage_index_t storage, peer_request const& r\n , char const* buf, std::shared_ptr o\n , std::function handler\n , disk_job_flags_t flags = {}) = 0;\n- virtual void a\bas\bsy\byn\bnc\bc_\b_r\bre\bea\bad\bd (storage_index_t storage, peer_request const& r\n- , std::function handler\n- , disk_job_flags_t flags = {}) = 0;\n virtual void a\bas\bsy\byn\bnc\bc_\b_h\bha\bas\bsh\bh (storage_index_t storage, piece_index_t piece,\n span v2\n , disk_job_flags_t flags\n , std::function handler) = 0;\n virtual void a\bas\bsy\byn\bnc\bc_\b_h\bha\bas\bsh\bh2\b2 (storage_index_t storage, piece_index_t piece, int\n offset, disk_job_flags_t flags\n@@ -7640,22 +7035,22 @@\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* r\bre\bem\bmo\bov\bve\be_\b_t\bto\bor\brr\bre\ben\bnt\bt(\b()\b) *\b**\b**\b**\b**\b*\n virtual void r\bre\bem\bmo\bov\bve\be_\b_t\bto\bor\brr\bre\ben\bnt\bt (storage_index_t) = 0;\n remove the storage with the specified index. This is not expected to delete any\n files from disk, just to clean up any resources associated with the specified\n storage.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* a\bas\bsy\byn\bnc\bc_\b_r\bre\bea\bad\bd(\b()\b) a\bas\bsy\byn\bnc\bc_\b_w\bwr\bri\bit\bte\be(\b()\b) *\b**\b**\b**\b**\b*\n+*\b**\b**\b**\b**\b* a\bas\bsy\byn\bnc\bc_\b_w\bwr\bri\bit\bte\be(\b()\b) a\bas\bsy\byn\bnc\bc_\b_r\bre\bea\bad\bd(\b()\b) *\b**\b**\b**\b**\b*\n+virtual void a\bas\bsy\byn\bnc\bc_\b_r\bre\bea\bad\bd (storage_index_t storage, peer_request const& r\n+ , std::function handler\n+ , disk_job_flags_t flags = {}) = 0;\n virtual bool a\bas\bsy\byn\bnc\bc_\b_w\bwr\bri\bit\bte\be (storage_index_t storage, peer_request const& r\n , char const* buf, std::shared_ptr o\n , std::function handler\n , disk_job_flags_t flags = {}) = 0;\n-virtual void a\bas\bsy\byn\bnc\bc_\b_r\bre\bea\bad\bd (storage_index_t storage, peer_request const& r\n- , std::function handler\n- , disk_job_flags_t flags = {}) = 0;\n perform a read or write operation from/to the specified storage index and the\n specified request. When the operation completes, call handler possibly with a\n _\bd_\bi_\bs_\bk_\b__\bb_\bu_\bf_\bf_\be_\br_\b__\bh_\bo_\bl_\bd_\be_\br, holding the buffer with the result. Flags may be set to\n affect the read operation. See disk_job_flags_t.\n The _\bd_\bi_\bs_\bk_\b__\bo_\bb_\bs_\be_\br_\bv_\be_\br is a callback to indicate that the store buffer/disk write\n queue is below the watermark to let peers start writing buffers to disk again.\n When async_write() returns true, indicating the write queue is full, the peer\n@@ -7842,17 +7237,17 @@\n a unique, owning, reference to the storage of a torrent in a disk io subsystem\n (class that implements _\bd_\bi_\bs_\bk_\b__\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be). This is held by the internal libtorrent\n torrent object to tie the storage object allocated for a torrent to the\n lifetime of the internal torrent object. When a torrent is removed from the\n _\bs_\be_\bs_\bs_\bi_\bo_\bn, this holder is destructed and will inform the disk object.\n struct storage_holder\n {\n+ ~\b~s\bst\bto\bor\bra\bag\bge\be_\b_h\bho\bol\bld\bde\ber\br ();\n s\bst\bto\bor\bra\bag\bge\be_\b_h\bho\bol\bld\bde\ber\br () = default;\n s\bst\bto\bor\bra\bag\bge\be_\b_h\bho\bol\bld\bde\ber\br (storage_index_t idx, disk_interface& disk_io);\n- ~\b~s\bst\bto\bor\bra\bag\bge\be_\b_h\bho\bol\bld\bde\ber\br ();\n explicit operator b\bbo\boo\bol\bl () const;\n operator s\bst\bto\bor\bra\bag\bge\be_\b_i\bin\bnd\bde\bex\bx_\b_t\bt () const;\n void r\bre\bes\bse\bet\bt ();\n s\bst\bto\bor\bra\bag\bge\be_\b_h\bho\bol\bld\bde\ber\br (storage_holder const&) = delete;\n storage_holder& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (storage_holder const&) = delete;\n s\bst\bto\bor\bra\bag\bge\be_\b_h\bho\bol\bld\bde\ber\br (storage_holder&& rhs) noexcept;\n storage_holder& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (storage_holder&& rhs) noexcept;\n@@ -7874,16 +7269,16 @@\n it's destructed\n If this buffer holder is moved-from, default constructed or reset, data() will\n return nullptr.\n struct disk_buffer_holder\n {\n d\bdi\bis\bsk\bk_\b_b\bbu\buf\bff\bfe\ber\br_\b_h\bho\bol\bld\bde\ber\br (disk_buffer_holder&&) noexcept;\n disk_buffer_holder& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (disk_buffer_holder&&) & noexcept;\n- disk_buffer_holder& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (disk_buffer_holder const&) = delete;\n d\bdi\bis\bsk\bk_\b_b\bbu\buf\bff\bfe\ber\br_\b_h\bho\bol\bld\bde\ber\br (disk_buffer_holder const&) = delete;\n+ disk_buffer_holder& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (disk_buffer_holder const&) = delete;\n d\bdi\bis\bsk\bk_\b_b\bbu\buf\bff\bfe\ber\br_\b_h\bho\bol\bld\bde\ber\br (buffer_allocator_interface& alloc\n , char* buf, int sz) noexcept;\n d\bdi\bis\bsk\bk_\b_b\bbu\buf\bff\bfe\ber\br_\b_h\bho\bol\bld\bde\ber\br () noexcept = default;\n ~\b~d\bdi\bis\bsk\bk_\b_b\bbu\buf\bff\bfe\ber\br_\b_h\bho\bol\bld\bde\ber\br ();\n char* d\bda\bat\bta\ba () const noexcept;\n void r\bre\bes\bse\bet\bt ();\n void s\bsw\bwa\bap\bp (disk_buffer_holder& h) noexcept;\n@@ -7944,14 +7339,765 @@\n operating system and filesystem). this generally improves disk\n performance.\n random_access\n When this is not set, the kernel is hinted that access to this file will\n be made sequentially.\n mmapped\n the file is memory mapped\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_p\bpa\bar\bra\bam\bms\bs *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs_\b._\bh_\bp_\bp\"\n+The _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs contains all the information in a .torrent file along\n+with all information necessary to add that torrent to a _\bs_\be_\bs_\bs_\bi_\bo_\bn. The key fields\n+when adding a torrent are:\n+ * ti - the immutable info-dict part of the torrent\n+ * info_hash - when you don't have the metadata (.torrent file). This\n+ uniquely identifies the torrent and can validate the info-dict when\n+ received from the swarm.\n+In order to add a torrent to a _\bs_\be_\bs_\bs_\bi_\bo_\bn, one of those fields must be set in\n+addition to save_path. The _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs object can then be passed into\n+one of the session::add_torrent() overloads or session::async_add_torrent().\n+If you only specify the info-hash, the torrent file will be downloaded from\n+peers, which requires them to support the metadata extension. For the metadata\n+extension to work, libtorrent must be built with extensions enabled\n+(TORRENT_DISABLE_EXTENSIONS must not be defined). It also takes an optional\n+name argument. This may be left empty in case no name should be assigned to the\n+torrent. In case it's not, the name is used for the torrent as long as it\n+doesn't have metadata. See torrent_handle::name.\n+The add_torrent_params is also used when requesting resume data for a torrent.\n+It can be saved to and restored from a file and added back to a new _\bs_\be_\bs_\bs_\bi_\bo_\bn.\n+For serialization and de-serialization of add_torrent_params objects, see\n+_\br_\be_\ba_\bd_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b) and _\bw_\br_\bi_\bt_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b).\n+The add_torrent_params is also used to represent a parsed .torrent file. It can\n+be loaded via _\bl_\bo_\ba_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bi_\bl_\be_\b(_\b), _\bl_\bo_\ba_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bb_\bu_\bf_\bf_\be_\br_\b(_\b) and\n+_\bl_\bo_\ba_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\bs_\be_\bd_\b(_\b). It can be saved via _\bw_\br_\bi_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bi_\bl_\be_\b(_\b).\n+struct add_torrent_params\n+{\n+ int v\bve\ber\brs\bsi\bio\bon\bn = LIBTORRENT_VERSION_NUM;\n+ std::shared_ptr ti;\n+ aux::noexcept_movable> trackers;\n+ aux::noexcept_movable> tracker_tiers;\n+ aux::noexcept_movable>> dht_nodes;\n+ std::string name;\n+ std::string save_path;\n+ storage_mode_t s\bst\bto\bor\bra\bag\bge\be_\b_m\bmo\bod\bde\be = storage_mode_sparse;\n+ client_data_t userdata;\n+ aux::noexcept_movable> file_priorities;\n+ std::string trackerid;\n+ torrent_flags_t f\bfl\bla\bag\bgs\bs = torrent_flags::default_flags;\n+ info_hash_t info_hashes;\n+ int m\bma\bax\bx_\b_u\bup\bpl\blo\boa\bad\bds\bs = -1;\n+ int m\bma\bax\bx_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bns\bs = -1;\n+ int u\bup\bpl\blo\boa\bad\bd_\b_l\bli\bim\bmi\bit\bt = -1;\n+ int d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_l\bli\bim\bmi\bit\bt = -1;\n+ std::int64_t t\bto\bot\bta\bal\bl_\b_u\bup\bpl\blo\boa\bad\bde\bed\bd = 0;\n+ std::int64_t t\bto\bot\bta\bal\bl_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bde\bed\bd = 0;\n+ int a\bac\bct\bti\biv\bve\be_\b_t\bti\bim\bme\be = 0;\n+ int f\bfi\bin\bni\bis\bsh\bhe\bed\bd_\b_t\bti\bim\bme\be = 0;\n+ int s\bse\bee\bed\bdi\bin\bng\bg_\b_t\bti\bim\bme\be = 0;\n+ std::time_t a\bad\bdd\bde\bed\bd_\b_t\bti\bim\bme\be = 0;\n+ std::time_t c\bco\bom\bmp\bpl\ble\bet\bte\bed\bd_\b_t\bti\bim\bme\be = 0;\n+ std::time_t l\bla\bas\bst\bt_\b_s\bse\bee\ben\bn_\b_c\bco\bom\bmp\bpl\ble\bet\bte\be = 0;\n+ int n\bnu\bum\bm_\b_c\bco\bom\bmp\bpl\ble\bet\bte\be = -1;\n+ int n\bnu\bum\bm_\b_i\bin\bnc\bco\bom\bmp\bpl\ble\bet\bte\be = -1;\n+ int n\bnu\bum\bm_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bde\bed\bd = -1;\n+ aux::noexcept_movable> http_seeds;\n+ aux::noexcept_movable> url_seeds;\n+ aux::noexcept_movable> peers;\n+ aux::noexcept_movable> banned_peers;\n+ aux::noexcept_movable> unfinished_pieces;\n+ typed_bitfield have_pieces;\n+ typed_bitfield verified_pieces;\n+ aux::noexcept_movable> piece_priorities;\n+ aux::vector, file_index_t> merkle_trees;\n+ aux::vector, file_index_t> merkle_tree_mask;\n+ aux::vector, file_index_t> verified_leaf_hashes;\n+ aux::noexcept_movable> renamed_files;\n+ std::time_t l\bla\bas\bst\bt_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd = 0;\n+ std::time_t l\bla\bas\bst\bt_\b_u\bup\bpl\blo\boa\bad\bd = 0;\n+};\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ version\n+ filled in by the constructor and should be left untouched. It is used for\n+ forward binary compatibility.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ ti\n+ _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo object with the torrent to add. Unless the info_hash is set,\n+ this is required to be initialized.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ trackers\n+ If the torrent doesn't have a tracker, but relies on the DHT to find\n+ peers, the trackers can specify tracker URLs for the torrent.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ tracker_tiers\n+ the tiers the URLs in trackers belong to. Trackers belonging to different\n+ tiers may be treated differently, as defined by the multi tracker\n+ extension. This is optional, if not specified trackers are assumed to be\n+ part of tier 0, or whichever the last tier was as iterating over the\n+ trackers.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ dht_nodes\n+ a list of hostname and port pairs, representing DHT nodes to be added to\n+ the _\bs_\be_\bs_\bs_\bi_\bo_\bn (if DHT is enabled). The hostname may be an IP address.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ name\n+ in case there's no other name in this torrent, this name will be used.\n+ The name out of the _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo object takes precedence if available.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ save_path\n+ the path where the torrent is or will be stored.\n+ Note\n+ On windows this path (and other paths) are interpreted as UNC paths. This\n+ means they must use backslashes as directory separators and may not\n+ contain the special directories \".\" or \"..\".\n+ Setting this to an absolute path performs slightly better than a relative\n+ path.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ storage_mode\n+ One of the values from _\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bm_\bo_\bd_\be_\b__\bt. For more information, see _\bs_\bt_\bo_\br_\ba_\bg_\be\n+ _\ba_\bl_\bl_\bo_\bc_\ba_\bt_\bi_\bo_\bn.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ userdata\n+ The userdata parameter is optional and will be passed on to the extension\n+ constructor functions, if any (see _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be_\b:_\b:_\ba_\bd_\bd_\b__\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\b(_\b)). It\n+ will also be stored in the torrent object and can be retrieved by calling\n+ _\bu_\bs_\be_\br_\bd_\ba_\bt_\ba_\b(_\b).\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ file_priorities\n+ can be set to control the initial file priorities when adding a torrent.\n+ The semantics are the same as for torrent_handle::prioritize_files(). The\n+ file priorities specified in here take precedence over those specified in\n+ the resume data, if any. If this vector of file priorities is shorter\n+ than the number of files in the torrent, the remaining files (not covered\n+ by this) will still have the default download priority. This default can\n+ be changed by setting the default_dont_download torrent_flag.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ trackerid\n+ the default tracker id to be used when announcing to trackers. By default\n+ this is empty, and no tracker ID is used, since this is an optional\n+ argument. If a tracker returns a tracker ID, that ID is used instead of\n+ this.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ flags\n+ flags controlling aspects of this torrent and how it's added. See\n+ _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bl_\ba_\bg_\bs_\b__\bt for details.\n+ Note\n+ The flags field is initialized with default flags by the constructor. In\n+ order to preserve default behavior when clearing or setting other flags,\n+ make sure to bitwise OR or in a flag or bitwise AND the inverse of a flag\n+ to clear it.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ info_hashes\n+ set this to the info hash of the torrent to add in case the info-hash is\n+ the only known property of the torrent. i.e. you don't have a .torrent\n+ file nor a magnet link. To add a magnet link, use _\bp_\ba_\br_\bs_\be_\b__\bm_\ba_\bg_\bn_\be_\bt_\b__\bu_\br_\bi_\b(_\b) to\n+ populate fields in the _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs object.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ max_uploads max_connections\n+ max_uploads, max_connections, upload_limit, download_limit correspond to\n+ the set_max_uploads(), set_max_connections(), set_upload_limit() and\n+ set_download_limit() functions on _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be. These values let you\n+ initialize these settings when the torrent is added, instead of calling\n+ these functions immediately following adding it.\n+ -1 means unlimited on these settings just like their counterpart\n+ functions on _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be\n+ For fine grained control over rate limits, including making them apply to\n+ local peers, see _\bp_\be_\be_\br_\b _\bc_\bl_\ba_\bs_\bs_\be_\bs.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ upload_limit download_limit\n+ the upload and download rate limits for this torrent, specified in bytes\n+ per second. -1 means unlimited.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ total_uploaded total_downloaded\n+ the total number of bytes uploaded and downloaded by this torrent so far.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ active_time finished_time seeding_time\n+ the number of seconds this torrent has spent in started, finished and\n+ seeding state so far, respectively.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ added_time completed_time\n+ if set to a non-zero value, this is the posix time of when this torrent\n+ was first added, including previous runs/sessions. If set to zero, the\n+ internal added_time will be set to the time of when _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b) is\n+ called.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ last_seen_complete\n+ if set to non-zero, initializes the time (expressed in posix time) when\n+ we last saw a seed or peers that together formed a complete copy of the\n+ torrent. If left set to zero, the internal counterpart to this field will\n+ be updated when we see a seed or a distributed copies >= 1.0.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ num_complete num_incomplete num_downloaded\n+ these field can be used to initialize the torrent's cached scrape data.\n+ The scrape data is high level metadata about the current state of the\n+ swarm, as returned by the tracker (either when announcing to it or by\n+ sending a specific scrape request). num_complete is the number of peers\n+ in the swarm that are seeds, or have every piece in the torrent.\n+ num_incomplete is the number of peers in the swarm that do not have every\n+ piece. num_downloaded is the number of times the torrent has been\n+ downloaded (not initiated, but the number of times a download has\n+ completed).\n+ Leaving any of these values set to -1 indicates we don't know, or we have\n+ not received any scrape data.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ http_seeds url_seeds\n+ URLs can be added to these two lists to specify additional web seeds to\n+ be used by the torrent. If the flag_override_web_seeds is set, these will\n+ be the _only_ ones to be used. i.e. any web seeds found in the .torrent\n+ file will be overridden.\n+ http_seeds expects URLs to web servers implementing the original HTTP\n+ seed specification _\bB_\bE_\bP_\b _\b1_\b7.\n+ url_seeds expects URLs to regular web servers, aka \"get right\" style,\n+ specified in _\bB_\bE_\bP_\b _\b1_\b9.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ peers\n+ peers to add to the torrent, to be tried to be connected to as bittorrent\n+ peers.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ banned_peers\n+ peers banned from this torrent. The will not be connected to\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ unfinished_pieces\n+ this is a map of partially downloaded piece. The key is the piece index\n+ and the value is a _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd where each bit represents a 16 kiB block. A\n+ set bit means we have that block.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ have_pieces\n+ this is a _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd indicating which pieces we already have of this\n+ torrent.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ verified_pieces\n+ when in seed_mode, pieces with a set bit in this _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd have been\n+ verified to be valid. Other pieces will be verified the first time a peer\n+ requests it.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ piece_priorities\n+ this sets the priorities for each individual piece in the torrent. Each\n+ element in the vector represent the piece with the same index. If you set\n+ both file- and piece priorities, file priorities will take precedence.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ merkle_trees\n+ v2 hashes, if known\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ merkle_tree_mask\n+ if set, indicates which hashes are included in the corresponding vector\n+ of merkle_trees. These bitmasks always cover the full tree, a cleared bit\n+ means the hash is all zeros (i.e. not set) and set bit means the next\n+ hash in the corresponding vector in merkle_trees is the hash for that\n+ node. This is an optimization to avoid storing a lot of zeros.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ verified_leaf_hashes\n+ bit-fields indicating which v2 leaf hashes have been verified against the\n+ root hash. If this vector is empty and merkle_trees is non-empty it\n+ implies that all hashes in merkle_trees are verified.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ renamed_files\n+ this is a map of file indices in the torrent and new filenames to be\n+ applied before the torrent is added.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ last_download last_upload\n+ the posix time of the last time payload was received or sent for this\n+ torrent, respectively. A value of 0 means we don't know when we last\n+ uploaded or downloaded, or we have never uploaded or downloaded any\n+ payload for this torrent.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* c\bcl\bli\bie\ben\bnt\bt_\b_d\bda\bat\bta\ba_\b_t\bt *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bc_\bl_\bi_\be_\bn_\bt_\b__\bd_\ba_\bt_\ba_\b._\bh_\bp_\bp\"\n+A thin wrapper around a void pointer used as \"user data\". i.e. an opaque cookie\n+passed in to libtorrent and returned on demand. It adds type-safety by\n+requiring the same type be requested out of it as was assigned to it.\n+struct client_data_t\n+{\n+ c\bcl\bli\bie\ben\bnt\bt_\b_d\bda\bat\bta\ba_\b_t\bt () = default;\n+ explicit c\bcl\bli\bie\ben\bnt\bt_\b_d\bda\bat\bta\ba_\b_t\bt (T* v);\n+ client_data_t& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (T* v);\n+ explicit operator T\bT () const;\n+ T* g\bge\bet\bt () const;\n+ client_data_t& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (void*) = delete;\n+ client_data_t& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (void const*) = delete;\n+ operator v\bvo\boi\bid\bd*\b* () const = delete;\n+ operator void c\bco\bon\bns\bst\bt*\b* () const = delete;\n+\n+ template ::value>::type>\n+};\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* c\bcl\bli\bie\ben\bnt\bt_\b_d\bda\bat\bta\ba_\b_t\bt(\b()\b) *\b**\b**\b**\b**\b*\n+c\bcl\bli\bie\ben\bnt\bt_\b_d\bda\bat\bta\ba_\b_t\bt () = default;\n+construct a nullptr client data\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* o\bop\bpe\ber\bra\bat\bto\bor\br=\b=(\b()\b) v\bvo\boi\bid\bd*\b*(\b()\b) c\bco\bon\bns\bst\bt*\b*(\b()\b) *\b**\b**\b**\b**\b*\n+client_data_t& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (void*) = delete;\n+client_data_t& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (void const*) = delete;\n+operator v\bvo\boi\bid\bd*\b* () const = delete;\n+operator void c\bco\bon\bns\bst\bt*\b* () const = delete;\n+we don't allow type-unsafe operations\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* w\bwe\beb\bb_\b_s\bse\bee\bed\bd_\b_e\ben\bnt\btr\bry\by *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b._\bh_\bp_\bp\"\n+the _\bw_\be_\bb_\b__\bs_\be_\be_\bd_\b__\be_\bn_\bt_\br_\by holds information about a web seed (also known as URL seed\n+or HTTP seed). It is essentially a URL with some state associated with it. For\n+more information, see _\bB_\bE_\bP_\b _\b1_\b7 and _\bB_\bE_\bP_\b _\b1_\b9.\n+struct web_seed_entry\n+{\n+ bool o\bop\bpe\ber\bra\bat\bto\bor\br=\b==\b= (web_seed_entry const& e) const;\n+ bool o\bop\bpe\ber\bra\bat\bto\bor\br<\b< (web_seed_entry const& e) const;\n+\n+ enum type_t\n+ {\n+ url_seed,\n+ http_seed,\n+ };\n+\n+ std::string url;\n+ std::string auth;\n+ headers_t extra_headers;\n+ std::uint8_t type;\n+};\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* o\bop\bpe\ber\bra\bat\bto\bor\br=\b==\b=(\b()\b) *\b**\b**\b**\b**\b*\n+bool o\bop\bpe\ber\bra\bat\bto\bor\br=\b==\b= (web_seed_entry const& e) const;\n+URL and type comparison\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* o\bop\bpe\ber\bra\bat\bto\bor\br<\b<(\b()\b) *\b**\b**\b**\b**\b*\n+bool o\bop\bpe\ber\bra\bat\bto\bor\br<\b< (web_seed_entry const& e) const;\n+URL and type less-than comparison\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* e\ben\bnu\bum\bm t\bty\byp\bpe\be_\b_t\bt *\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b._\bh_\bp_\bp\"\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n+|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn|\n+|_\bu_\br_\bl_\b__\bs_\be_\be_\bd_\b _\b|_\b0_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bh_\bt_\bt_\bp_\b__\bs_\be_\be_\bd_\b|_\b1_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ url\n+ The URL of the web seed\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ auth\n+ Optional authentication. If this is set, it's passed in as HTTP basic\n+ auth to the web seed. The format is: username:password.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ extra_headers\n+ Any extra HTTP headers that need to be passed to the web seed\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ type\n+ The type of web seed (see _\bt_\by_\bp_\be_\b__\bt)\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* l\blo\boa\bad\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_l\bli\bim\bmi\bit\bts\bs *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b._\bh_\bp_\bp\"\n+this object holds configuration options for limits to use when loading\n+torrents. They are meant to prevent loading potentially malicious torrents that\n+cause excessive memory allocations.\n+struct load_torrent_limits\n+{\n+ int m\bma\bax\bx_\b_b\bbu\buf\bff\bfe\ber\br_\b_s\bsi\biz\bze\be = 10000000;\n+ int m\bma\bax\bx_\b_p\bpi\bie\bec\bce\bes\bs = 0x200000;\n+ int m\bma\bax\bx_\b_d\bde\bec\bco\bod\bde\be_\b_d\bde\bep\bpt\bth\bh = 100;\n+ int m\bma\bax\bx_\b_d\bde\bec\bco\bod\bde\be_\b_t\bto\bok\bke\ben\bns\bs = 3000000;\n+};\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ max_buffer_size\n+ the max size of a .torrent file to load into RAM\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ max_pieces\n+ the max number of pieces allowed in the torrent\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ max_decode_depth\n+ the max recursion depth in the bdecoded structure\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ max_decode_tokens\n+ the max number of bdecode tokens\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b._\bh_\bp_\bp\"\n+the _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo class holds the information found in a .torrent file.\n+class torrent_info\n+{\n+ t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (span buffer, load_torrent_limits const& cfg,\n+from_span_t);\n+ t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (std::string const& filename, error_code& ec);\n+ explicit t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (span buffer, from_span_t);\n+ t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (torrent_info const& t);\n+ explicit t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (info_hash_t const& info_hash);\n+ t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (span buffer, error_code& ec, from_span_t);\n+ t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (std::string const& filename, load_torrent_limits const& cfg);\n+ t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (char const* buffer, int size, error_code& ec);\n+ t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (bdecode_node const& torrent_file, load_torrent_limits const&\n+cfg);\n+ explicit t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (std::string const& filename);\n+ explicit t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (bdecode_node const& torrent_file);\n+ t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (bdecode_node const& torrent_file, error_code& ec);\n+ t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (char const* buffer, int size);\n+ ~\b~t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo ();\n+ file_storage const& f\bfi\bil\ble\bes\bs () const;\n+ file_storage const& o\bor\bri\big\bg_\b_f\bfi\bil\ble\bes\bs () const;\n+ void r\bre\ben\bna\bam\bme\be_\b_f\bfi\bil\ble\be (file_index_t index, std::string const& new_filename);\n+ void r\bre\bem\bma\bap\bp_\b_f\bfi\bil\ble\bes\bs (file_storage const& f);\n+ std::vector const& t\btr\bra\bac\bck\bke\ber\brs\bs () const;\n+ void a\bad\bdd\bd_\b_t\btr\bra\bac\bck\bke\ber\br (std::string const& url, int tier = 0);\n+ void a\bad\bdd\bd_\b_t\btr\bra\bac\bck\bke\ber\br (std::string const& url, int tier\n+ , announce_entry::tracker_source source);\n+ void c\bcl\ble\bea\bar\br_\b_t\btr\bra\bac\bck\bke\ber\brs\bs ();\n+ std::vector c\bco\bol\bll\ble\bec\bct\bti\bio\bon\bns\bs () const;\n+ std::vector s\bsi\bim\bmi\bil\bla\bar\br_\b_t\bto\bor\brr\bre\ben\bnt\bts\bs () const;\n+ std::vector const& w\bwe\beb\bb_\b_s\bse\bee\bed\bds\bs () const;\n+ void a\bad\bdd\bd_\b_h\bht\btt\btp\bp_\b_s\bse\bee\bed\bd (std::string const& url\n+ , std::string const& extern_auth = std::string()\n+ , web_seed_entry::headers_t const& extra_headers = web_seed_entry::\n+headers_t());\n+ void a\bad\bdd\bd_\b_u\bur\brl\bl_\b_s\bse\bee\bed\bd (std::string const& url\n+ , std::string const& ext_auth = std::string()\n+ , web_seed_entry::headers_t const& ext_headers = web_seed_entry::\n+headers_t());\n+ void s\bse\bet\bt_\b_w\bwe\beb\bb_\b_s\bse\bee\bed\bds\bs (std::vector seeds);\n+ std::int64_t t\bto\bot\bta\bal\bl_\b_s\bsi\biz\bze\be () const;\n+ int n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs () const;\n+ int p\bpi\bie\bec\bce\be_\b_l\ble\ben\bng\bgt\bth\bh () const;\n+ int b\bbl\blo\boc\bck\bks\bs_\b_p\bpe\ber\br_\b_p\bpi\bie\bec\bce\be () const;\n+ piece_index_t l\bla\bas\bst\bt_\b_p\bpi\bie\bec\bce\be () const;\n+ piece_index_t e\ben\bnd\bd_\b_p\bpi\bie\bec\bce\be () const;\n+ index_range p\bpi\bie\bec\bce\be_\b_r\bra\ban\bng\bge\be () const;\n+ sha1_hash i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh () const noexcept;\n+ info_hash_t const& i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bhe\bes\bs () const;\n+ bool v\bv1\b1 () const;\n+ bool v\bv2\b2 () const;\n+ int n\bnu\bum\bm_\b_f\bfi\bil\ble\bes\bs () const;\n+ std::vector m\bma\bap\bp_\b_b\bbl\blo\boc\bck\bk (piece_index_t const piece\n+ , std::int64_t offset, int size) const;\n+ peer_request m\bma\bap\bp_\b_f\bfi\bil\ble\be (file_index_t const file, std::int64_t offset, int\n+size) const;\n+ string_view s\bss\bsl\bl_\b_c\bce\ber\brt\bt () const;\n+ bool i\bis\bs_\b_v\bva\bal\bli\bid\bd () const;\n+ bool p\bpr\bri\biv\bv () const;\n+ bool i\bis\bs_\b_i\bi2\b2p\bp () const;\n+ int p\bpi\bie\bec\bce\be_\b_s\bsi\biz\bze\be (piece_index_t index) const;\n+ sha1_hash h\bha\bas\bsh\bh_\b_f\bfo\bor\br_\b_p\bpi\bie\bec\bce\be (piece_index_t index) const;\n+ char const* h\bha\bas\bsh\bh_\b_f\bfo\bor\br_\b_p\bpi\bie\bec\bce\be_\b_p\bpt\btr\br (piece_index_t const index) const;\n+ bool i\bis\bs_\b_l\blo\boa\bad\bde\bed\bd () const;\n+ const std::string& n\bna\bam\bme\be () const;\n+ std::time_t c\bcr\bre\bea\bat\bti\bio\bon\bn_\b_d\bda\bat\bte\be () const;\n+ const std::string& c\bcr\bre\bea\bat\bto\bor\br () const;\n+ const std::string& c\bco\bom\bmm\bme\ben\bnt\bt () const;\n+ std::vector> const& n\bno\bod\bde\bes\bs () const;\n+ void a\bad\bdd\bd_\b_n\bno\bod\bde\be (std::pair const& node);\n+ bool p\bpa\bar\brs\bse\be_\b_i\bin\bnf\bfo\bo_\b_s\bse\bec\bct\bti\bio\bon\bn (bdecode_node const& info, error_code& ec, int\n+max_pieces);\n+ bdecode_node i\bin\bnf\bfo\bo (char const* key) const;\n+ span i\bin\bnf\bfo\bo_\b_s\bse\bec\bct\bti\bio\bon\bn () const;\n+ span p\bpi\bie\bec\bce\be_\b_l\bla\bay\bye\ber\br (file_index_t) const;\n+ void f\bfr\bre\bee\be_\b_p\bpi\bie\bec\bce\be_\b_l\bla\bay\bye\ber\brs\bs ();\n+};\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo(\b()\b) *\b**\b**\b**\b**\b*\n+t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (span buffer, load_torrent_limits const& cfg,\n+from_span_t);\n+t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (std::string const& filename, error_code& ec);\n+explicit t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (span buffer, from_span_t);\n+t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (torrent_info const& t);\n+explicit t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (info_hash_t const& info_hash);\n+t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (span buffer, error_code& ec, from_span_t);\n+t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (std::string const& filename, load_torrent_limits const& cfg);\n+t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (char const* buffer, int size, error_code& ec);\n+t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (bdecode_node const& torrent_file, load_torrent_limits const&\n+cfg);\n+explicit t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (std::string const& filename);\n+explicit t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (bdecode_node const& torrent_file);\n+t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (bdecode_node const& torrent_file, error_code& ec);\n+t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (char const* buffer, int size);\n+The constructor that takes an info-hash will initialize the info-hash to the\n+given value, but leave all other fields empty. This is used internally when\n+downloading torrents without the metadata. The metadata will be created by\n+libtorrent as soon as it has been downloaded from the swarm.\n+The constructor that takes a _\bb_\bd_\be_\bc_\bo_\bd_\be_\b__\bn_\bo_\bd_\be will create a _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo object\n+from the information found in the given torrent_file. The _\bb_\bd_\be_\bc_\bo_\bd_\be_\b__\bn_\bo_\bd_\be\n+represents a tree node in an bencoded file. To load an ordinary .torrent file\n+into a _\bb_\bd_\be_\bc_\bo_\bd_\be_\b__\bn_\bo_\bd_\be, use _\bb_\bd_\be_\bc_\bo_\bd_\be_\b(_\b).\n+The version that takes a buffer pointer and a size will decode it as a .torrent\n+file and initialize the _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo object for you.\n+The version that takes a filename will simply load the torrent file and decode\n+it inside the constructor, for convenience. This might not be the most suitable\n+for applications that want to be able to report detailed errors on what might\n+go wrong.\n+There is an upper limit on the size of the torrent file that will be loaded by\n+the overload taking a filename. If it's important that even very large torrent\n+files are loaded, use one of the other overloads.\n+The overloads that takes an error_code const& never throws if an error occur,\n+they will simply set the error code to describe what went wrong and not fully\n+initialize the _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo object. The overloads that do not take the extra\n+error_code parameter will always throw if an error occurs. These overloads are\n+not available when building without exception support.\n+The overload that takes a span also needs an extra parameter of type\n+from_span_t to disambiguate the std::string overload for string literals. There\n+is an object in the libtorrent namespace of this type called from_span.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* ~\b~t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo(\b()\b) *\b**\b**\b**\b**\b*\n+~\b~t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo ();\n+frees all storage associated with this _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo object\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* f\bfi\bil\ble\bes\bs(\b()\b) o\bor\bri\big\bg_\b_f\bfi\bil\ble\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n+file_storage const& f\bfi\bil\ble\bes\bs () const;\n+file_storage const& o\bor\bri\big\bg_\b_f\bfi\bil\ble\bes\bs () const;\n+The _\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be object contains the information on how to map the pieces to\n+files. It is separated from the _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo object because when creating\n+torrents a storage object needs to be created without having a torrent file.\n+When renaming files in a storage, the storage needs to make its own copy of the\n+_\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be in order to make its mapping differ from the one in the torrent\n+file.\n+orig_files() returns the original (unmodified) file storage for this torrent.\n+This is used by the web server connection, which needs to request files with\n+the original names. Filename may be changed using torrent_info::rename_file().\n+For more information on the _\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be object, see the separate document on\n+how to create torrents.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* r\bre\ben\bna\bam\bme\be_\b_f\bfi\bil\ble\be(\b()\b) *\b**\b**\b**\b**\b*\n+void r\bre\ben\bna\bam\bme\be_\b_f\bfi\bil\ble\be (file_index_t index, std::string const& new_filename);\n+Renames the file with the specified index to the new name. The new filename is\n+reflected by the file_storage returned by files() but not by the one returned\n+by orig_files().\n+If you want to rename the base name of the torrent (for a multi file torrent),\n+you can copy the file_storage (see _\bf_\bi_\bl_\be_\bs_\b(_\b) and _\bo_\br_\bi_\bg_\b__\bf_\bi_\bl_\be_\bs_\b(_\b) ), change the name,\n+and then use _\br_\be_\bm_\ba_\bp_\b__\bf_\bi_\bl_\be_\bs_\b(_\b).\n+The new_filename can both be a relative path, in which case the file name is\n+relative to the save_path of the torrent. If the new_filename is an absolute\n+path (i.e. is_complete(new_filename) == true), then the file is detached from\n+the save_path of the torrent. In this case the file is not moved when\n+_\bm_\bo_\bv_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b(_\b) is invoked.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* r\bre\bem\bma\bap\bp_\b_f\bfi\bil\ble\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n+void r\bre\bem\bma\bap\bp_\b_f\bfi\bil\ble\bes\bs (file_storage const& f);\n+Warning\n+Usingremap_files()is discouraged as it's incompatible with v2 torrents. This is\n+because the piece boundaries and piece hashes in v2 torrents are intimately\n+tied to the file boundaries. Instead, just rename individual files, or\n+implement a custom _\bd_\bi_\bs_\bk_\b__\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be to customize how to store files.\n+Remaps the file storage to a new file layout. This can be used to, for\n+instance, download all data in a torrent to a single file, or to a number of\n+fixed size sector aligned files, regardless of the number and sizes of the\n+files in the torrent.\n+The new specified file_storage must have the exact same size as the current\n+one.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* c\bcl\ble\bea\bar\br_\b_t\btr\bra\bac\bck\bke\ber\brs\bs(\b()\b) t\btr\bra\bac\bck\bke\ber\brs\bs(\b()\b) a\bad\bdd\bd_\b_t\btr\bra\bac\bck\bke\ber\br(\b()\b) *\b**\b**\b**\b**\b*\n+std::vector const& t\btr\bra\bac\bck\bke\ber\brs\bs () const;\n+void a\bad\bdd\bd_\b_t\btr\bra\bac\bck\bke\ber\br (std::string const& url, int tier = 0);\n+void a\bad\bdd\bd_\b_t\btr\bra\bac\bck\bke\ber\br (std::string const& url, int tier\n+ , announce_entry::tracker_source source);\n+void c\bcl\ble\bea\bar\br_\b_t\btr\bra\bac\bck\bke\ber\brs\bs ();\n+add_tracker() adds a tracker to the announce-list. The tier determines the\n+order in which the trackers are to be tried. The trackers() function will\n+return a sorted vector of _\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\be_\bn_\bt_\br_\by. Each announce _\be_\bn_\bt_\br_\by contains a\n+string, which is the tracker url, and a tier index. The tier index is the high-\n+level priority. No matter which trackers that works or not, the ones with lower\n+tier will always be tried before the one with higher tier number. For more\n+information, see _\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\be_\bn_\bt_\br_\by.\n+trackers() returns all entries from announce-list.\n+clear_trackers() removes all trackers from announce-list.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* s\bsi\bim\bmi\bil\bla\bar\br_\b_t\bto\bor\brr\bre\ben\bnt\bts\bs(\b()\b) c\bco\bol\bll\ble\bec\bct\bti\bio\bon\bns\bs(\b()\b) *\b**\b**\b**\b**\b*\n+std::vector c\bco\bol\bll\ble\bec\bct\bti\bio\bon\bns\bs () const;\n+std::vector s\bsi\bim\bmi\bil\bla\bar\br_\b_t\bto\bor\brr\bre\ben\bnt\bts\bs () const;\n+These two functions are related to _\bB_\bE_\bP_\b _\b3_\b8 (mutable torrents). The vectors\n+returned from these correspond to the \"similar\" and \"collections\" keys in the\n+.torrent file. Both info-hashes and collections from within the info-dict and\n+from outside of it are included.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* w\bwe\beb\bb_\b_s\bse\bee\bed\bds\bs(\b()\b) s\bse\bet\bt_\b_w\bwe\beb\bb_\b_s\bse\bee\bed\bds\bs(\b()\b) a\bad\bdd\bd_\b_h\bht\btt\btp\bp_\b_s\bse\bee\bed\bd(\b()\b) a\bad\bdd\bd_\b_u\bur\brl\bl_\b_s\bse\bee\bed\bd(\b()\b) *\b**\b**\b**\b**\b*\n+std::vector const& w\bwe\beb\bb_\b_s\bse\bee\bed\bds\bs () const;\n+void a\bad\bdd\bd_\b_h\bht\btt\btp\bp_\b_s\bse\bee\bed\bd (std::string const& url\n+ , std::string const& extern_auth = std::string()\n+ , web_seed_entry::headers_t const& extra_headers = web_seed_entry::\n+headers_t());\n+void a\bad\bdd\bd_\b_u\bur\brl\bl_\b_s\bse\bee\bed\bd (std::string const& url\n+ , std::string const& ext_auth = std::string()\n+ , web_seed_entry::headers_t const& ext_headers = web_seed_entry::\n+headers_t());\n+void s\bse\bet\bt_\b_w\bwe\beb\bb_\b_s\bse\bee\bed\bds\bs (std::vector seeds);\n+web_seeds() returns all url seeds and http seeds in the torrent. Each _\be_\bn_\bt_\br_\by is\n+a web_seed_entry and may refer to either a url seed or http seed.\n+add_url_seed() and add_http_seed() adds one url to the list of url/http seeds.\n+set_web_seeds() replaces all web seeds with the ones specified in the seeds\n+vector.\n+The extern_auth argument can be used for other authorization schemes than basic\n+HTTP authorization. If set, it will override any username and password found in\n+the URL itself. The string will be sent as the HTTP authorization header's\n+value (without specifying \"Basic\").\n+The extra_headers argument defaults to an empty list, but can be used to insert\n+custom HTTP headers in the requests to a specific web seed.\n+See _\bh_\bt_\bt_\bp_\b _\bs_\be_\be_\bd_\bi_\bn_\bg for more information.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* t\bto\bot\bta\bal\bl_\b_s\bsi\biz\bze\be(\b()\b) *\b**\b**\b**\b**\b*\n+std::int64_t t\bto\bot\bta\bal\bl_\b_s\bsi\biz\bze\be () const;\n+total_size() returns the total number of bytes the torrent-file represents.\n+Note that this is the number of pieces times the piece size (modulo the last\n+piece possibly being smaller). With pad files, the total size will be larger\n+than the sum of all (regular) file sizes.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* p\bpi\bie\bec\bce\be_\b_l\ble\ben\bng\bgt\bth\bh(\b()\b) n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n+int n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs () const;\n+int p\bpi\bie\bec\bce\be_\b_l\ble\ben\bng\bgt\bth\bh () const;\n+piece_length() and num_pieces() returns the number of byte for each piece and\n+the total number of pieces, respectively. The difference between piece_size()\n+and piece_length() is that piece_size() takes the piece index as argument and\n+gives you the exact size of that piece. It will always be the same as\n+piece_length() except in the case of the last piece, which may be smaller.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* b\bbl\blo\boc\bck\bks\bs_\b_p\bpe\ber\br_\b_p\bpi\bie\bec\bce\be(\b()\b) *\b**\b**\b**\b**\b*\n+int b\bbl\blo\boc\bck\bks\bs_\b_p\bpe\ber\br_\b_p\bpi\bie\bec\bce\be () const;\n+returns the number of blocks there are in the typical piece. There may be fewer\n+in the last piece)\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* p\bpi\bie\bec\bce\be_\b_r\bra\ban\bng\bge\be(\b()\b) e\ben\bnd\bd_\b_p\bpi\bie\bec\bce\be(\b()\b) l\bla\bas\bst\bt_\b_p\bpi\bie\bec\bce\be(\b()\b) *\b**\b**\b**\b**\b*\n+piece_index_t l\bla\bas\bst\bt_\b_p\bpi\bie\bec\bce\be () const;\n+piece_index_t e\ben\bnd\bd_\b_p\bpi\bie\bec\bce\be () const;\n+index_range p\bpi\bie\bec\bce\be_\b_r\bra\ban\bng\bge\be () const;\n+last_piece() returns the index to the last piece in the torrent and end_piece()\n+returns the index to the one-past-end piece in the torrent piece_range()\n+returns an implementation-defined type that can be used as the container in a\n+range-for loop. Where the values are the indices of all pieces in the\n+_\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bhe\bes\bs(\b()\b) i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh(\b()\b) *\b**\b**\b**\b**\b*\n+sha1_hash i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh () const noexcept;\n+info_hash_t const& i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bhe\bes\bs () const;\n+returns the info-hash of the torrent. For BitTorrent v2 support, use\n+info_hashes() to get an object that may hold both a v1 and v2 info-hash\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* v\bv2\b2(\b()\b) v\bv1\b1(\b()\b) *\b**\b**\b**\b**\b*\n+bool v\bv1\b1 () const;\n+bool v\bv2\b2 () const;\n+returns whether this torrent has v1 and/or v2 metadata, respectively. Hybrid\n+torrents have both. These are shortcuts for info_hashes().has_v1() and\n+info_hashes().has_v2() calls.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* n\bnu\bum\bm_\b_f\bfi\bil\ble\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n+int n\bnu\bum\bm_\b_f\bfi\bil\ble\bes\bs () const;\n+If you need index-access to files you can use the num_files() along with the\n+file_path(), file_size()-family of functions to access files using indices.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* m\bma\bap\bp_\b_b\bbl\blo\boc\bck\bk(\b()\b) *\b**\b**\b**\b**\b*\n+std::vector m\bma\bap\bp_\b_b\bbl\blo\boc\bck\bk (piece_index_t const piece\n+ , std::int64_t offset, int size) const;\n+This function will map a piece index, a byte offset within that piece and a\n+size (in bytes) into the corresponding files with offsets where that data for\n+that piece is supposed to be stored. See _\bf_\bi_\bl_\be_\b__\bs_\bl_\bi_\bc_\be.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* m\bma\bap\bp_\b_f\bfi\bil\ble\be(\b()\b) *\b**\b**\b**\b**\b*\n+peer_request m\bma\bap\bp_\b_f\bfi\bil\ble\be (file_index_t const file, std::int64_t offset, int size)\n+const;\n+This function will map a range in a specific file into a range in the torrent.\n+The file_offset parameter is the offset in the file, given in bytes, where 0 is\n+the start of the file. See _\bp_\be_\be_\br_\b__\br_\be_\bq_\bu_\be_\bs_\bt.\n+The input range is assumed to be valid within the torrent. file_offset + size\n+is not allowed to be greater than the file size. file_index must refer to a\n+valid file, i.e. it cannot be >= num_files().\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* s\bss\bsl\bl_\b_c\bce\ber\brt\bt(\b()\b) *\b**\b**\b**\b**\b*\n+string_view s\bss\bsl\bl_\b_c\bce\ber\brt\bt () const;\n+Returns the SSL root certificate for the torrent, if it is an SSL torrent.\n+Otherwise returns an empty string. The certificate is the public certificate in\n+x509 format.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* i\bis\bs_\b_v\bva\bal\bli\bid\bd(\b()\b) *\b**\b**\b**\b**\b*\n+bool i\bis\bs_\b_v\bva\bal\bli\bid\bd () const;\n+returns true if this _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo object has a torrent loaded. This is\n+primarily used to determine if a magnet link has had its metadata resolved yet\n+or not.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* p\bpr\bri\biv\bv(\b()\b) *\b**\b**\b**\b**\b*\n+bool p\bpr\bri\biv\bv () const;\n+returns true if this torrent is private. i.e., the client should not advertise\n+itself on the trackerless network (the Kademlia DHT) for this torrent.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* i\bis\bs_\b_i\bi2\b2p\bp(\b()\b) *\b**\b**\b**\b**\b*\n+bool i\bis\bs_\b_i\bi2\b2p\bp () const;\n+returns true if this is an i2p torrent. This is determined by whether or not it\n+has a tracker whose URL domain name ends with \".i2p\". i2p torrents disable the\n+DHT and local peer discovery as well as talking to peers over anything other\n+than the i2p network.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* p\bpi\bie\bec\bce\be_\b_s\bsi\biz\bze\be(\b()\b) *\b**\b**\b**\b**\b*\n+int p\bpi\bie\bec\bce\be_\b_s\bsi\biz\bze\be (piece_index_t index) const;\n+returns the piece size of file with index. This will be the same as\n+_\bp_\bi_\be_\bc_\be_\b__\bl_\be_\bn_\bg_\bt_\bh_\b(_\b), except for the last piece, which may be shorter.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* h\bha\bas\bsh\bh_\b_f\bfo\bor\br_\b_p\bpi\bie\bec\bce\be_\b_p\bpt\btr\br(\b()\b) h\bha\bas\bsh\bh_\b_f\bfo\bor\br_\b_p\bpi\bie\bec\bce\be(\b()\b) *\b**\b**\b**\b**\b*\n+sha1_hash h\bha\bas\bsh\bh_\b_f\bfo\bor\br_\b_p\bpi\bie\bec\bce\be (piece_index_t index) const;\n+char const* h\bha\bas\bsh\bh_\b_f\bfo\bor\br_\b_p\bpi\bie\bec\bce\be_\b_p\bpt\btr\br (piece_index_t const index) const;\n+hash_for_piece() takes a piece-index and returns the 20-bytes sha1-hash for\n+that piece and info_hash() returns the 20-bytes sha1-hash for the info-section\n+of the torrent file. hash_for_piece_ptr() returns a pointer to the 20 byte sha1\n+digest for the piece. Note that the string is not 0-terminated.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* n\bna\bam\bme\be(\b()\b) *\b**\b**\b**\b**\b*\n+const std::string& n\bna\bam\bme\be () const;\n+name() returns the name of the torrent. name contains UTF-8 encoded string.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* c\bcr\bre\bea\bat\bti\bio\bon\bn_\b_d\bda\bat\bte\be(\b()\b) *\b**\b**\b**\b**\b*\n+std::time_t c\bcr\bre\bea\bat\bti\bio\bon\bn_\b_d\bda\bat\bte\be () const;\n+creation_date() returns the creation date of the torrent as time_t (_\bp_\bo_\bs_\bi_\bx\n+_\bt_\bi_\bm_\be). If there's no time stamp in the torrent file, 0 is returned. .. posix\n+time: _\bh_\bt_\bt_\bp_\b:_\b/_\b/_\bw_\bw_\bw_\b._\bo_\bp_\be_\bn_\bg_\br_\bo_\bu_\bp_\b._\bo_\br_\bg_\b/_\bo_\bn_\bl_\bi_\bn_\be_\bp_\bu_\bb_\bs_\b/_\b0_\b0_\b9_\b6_\b9_\b5_\b3_\b9_\b9_\b/_\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn_\bs_\b/_\bt_\bi_\bm_\be_\b._\bh_\bt_\bm_\bl\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* c\bcr\bre\bea\bat\bto\bor\br(\b()\b) *\b**\b**\b**\b**\b*\n+const std::string& c\bcr\bre\bea\bat\bto\bor\br () const;\n+creator() returns the creator string in the torrent. If there is no creator\n+string it will return an empty string.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* c\bco\bom\bmm\bme\ben\bnt\bt(\b()\b) *\b**\b**\b**\b**\b*\n+const std::string& c\bco\bom\bmm\bme\ben\bnt\bt () const;\n+comment() returns the comment associated with the torrent. If there's no\n+comment, it will return an empty string. comment contains UTF-8 encoded string.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* n\bno\bod\bde\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n+std::vector> const& n\bno\bod\bde\bes\bs () const;\n+If this torrent contains any DHT nodes, they are put in this vector in their\n+original form (host name and port number).\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_n\bno\bod\bde\be(\b()\b) *\b**\b**\b**\b**\b*\n+void a\bad\bdd\bd_\b_n\bno\bod\bde\be (std::pair const& node);\n+This is used when creating torrent. Use this to add a known DHT node. It may be\n+used, by the client, to bootstrap into the DHT network.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* p\bpa\bar\brs\bse\be_\b_i\bin\bnf\bfo\bo_\b_s\bse\bec\bct\bti\bio\bon\bn(\b()\b) *\b**\b**\b**\b**\b*\n+bool p\bpa\bar\brs\bse\be_\b_i\bin\bnf\bfo\bo_\b_s\bse\bec\bct\bti\bio\bon\bn (bdecode_node const& info, error_code& ec, int\n+max_pieces);\n+populates the _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo by providing just the info-dict buffer. This is used\n+when loading a torrent from a magnet link for instance, where we only have the\n+info-dict. The _\bb_\bd_\be_\bc_\bo_\bd_\be_\b__\bn_\bo_\bd_\be e points to a parsed info-dictionary. ec returns an\n+error code if something fails (typically if the info dictionary is malformed).\n+Themax_piecesparameter allows limiting the amount of memory dedicated to\n+loading the torrent, and fails for torrents that exceed the limit. To load\n+large torrents, this limit may also need to be raised in _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk_\b:_\b:\n+_\bm_\ba_\bx_\b__\bp_\bi_\be_\bc_\be_\b__\bc_\bo_\bu_\bn_\bt and in calls to _\br_\be_\ba_\bd_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b).\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* i\bin\bnf\bfo\bo(\b()\b) *\b**\b**\b**\b**\b*\n+bdecode_node i\bin\bnf\bfo\bo (char const* key) const;\n+This function looks up keys from the info-dictionary of the loaded torrent\n+file. It can be used to access extension values put in the .torrent file. If\n+the specified key cannot be found, it returns nullptr.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* i\bin\bnf\bfo\bo_\b_s\bse\bec\bct\bti\bio\bon\bn(\b()\b) *\b**\b**\b**\b**\b*\n+span i\bin\bnf\bfo\bo_\b_s\bse\bec\bct\bti\bio\bon\bn () const;\n+returns a the raw info section of the torrent file. The underlying buffer is\n+still owned by the _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo object\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* p\bpi\bie\bec\bce\be_\b_l\bla\bay\bye\ber\br(\b()\b) *\b**\b**\b**\b**\b*\n+span p\bpi\bie\bec\bce\be_\b_l\bla\bay\bye\ber\br (file_index_t) const;\n+return the bytes of the piece layer hashes for the specified file. If the file\n+doesn't have a piece layer, an empty span is returned. The span size is\n+divisible by 32, the size of a SHA-256 hash. If the size of the file is smaller\n+than or equal to the piece size, the files \"root hash\" is the hash of the file\n+and is not saved separately in the \"piece layers\" field, but this function\n+still returns the root hash of the file in that case.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* f\bfr\bre\bee\be_\b_p\bpi\bie\bec\bce\be_\b_l\bla\bay\bye\ber\brs\bs(\b()\b) *\b**\b**\b**\b**\b*\n+void f\bfr\bre\bee\be_\b_p\bpi\bie\bec\bce\be_\b_l\bla\bay\bye\ber\brs\bs ();\n+clears the piece layers from the _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo. This is done by the _\bs_\be_\bs_\bs_\bi_\bo_\bn when\n+a torrent is added, to avoid storing it twice. The piece layer (or other hashes\n+part of the merkle tree) are stored in the internal torrent object.\n You have some control over _\bs_\be_\bs_\bs_\bi_\bo_\bn configuration through the session::\n apply_settings() member function. To change one or more configuration options,\n create a _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk object and fill it with the settings to be set and pass\n it in to session::apply_settings().\n The _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk object is a collection of settings updates that are applied\n to the _\bs_\be_\bs_\bs_\bi_\bo_\bn when passed to session::apply_settings(). It's empty when\n constructed.\n@@ -9361,23 +9507,23 @@\n of the actual local listening port.\n struct settings_pack final : settings_interface\n {\n friend void a\bap\bpp\bpl\bly\by_\b_p\bpa\bac\bck\bk_\b_i\bim\bmp\bpl\bl (settings_pack const*\n , aux::session_settings_single_thread&\n , std::vector*);\n void s\bse\bet\bt_\b_i\bin\bnt\bt (int name, flags::bitfield_flag const val);\n- void s\bse\bet\bt_\b_b\bbo\boo\bol\bl (int name, bool val) override;\n void s\bse\bet\bt_\b_s\bst\btr\br (int name, std::string val) override;\n void s\bse\bet\bt_\b_i\bin\bnt\bt (int name, int val) override;\n+ void s\bse\bet\bt_\b_b\bbo\boo\bol\bl (int name, bool val) override;\n bool h\bha\bas\bs_\b_v\bva\bal\bl (int name) const override;\n void c\bcl\ble\bea\bar\br ();\n void c\bcl\ble\bea\bar\br (int name);\n- int g\bge\bet\bt_\b_i\bin\bnt\bt (int name) const override;\n std::string const& g\bge\bet\bt_\b_s\bst\btr\br (int name) const override;\n bool g\bge\bet\bt_\b_b\bbo\boo\bol\bl (int name) const override;\n+ int g\bge\bet\bt_\b_i\bin\bnt\bt (int name) const override;\n void f\bfo\bor\br_\b_e\bea\bac\bch\bh (Fun&& f) const;\n \n enum type_bases\n {\n string_type_base,\n int_type_base,\n bool_type_base,\n@@ -9447,19 +9593,19 @@\n socks5,\n socks5_pw,\n http,\n http_pw,\n };\n };\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* s\bse\bet\bt_\b_b\bbo\boo\bol\bl(\b()\b) s\bse\bet\bt_\b_s\bst\btr\br(\b()\b) s\bse\bet\bt_\b_i\bin\bnt\bt(\b()\b) *\b**\b**\b**\b**\b*\n+*\b**\b**\b**\b**\b* s\bse\bet\bt_\b_s\bst\btr\br(\b()\b) s\bse\bet\bt_\b_b\bbo\boo\bol\bl(\b()\b) s\bse\bet\bt_\b_i\bin\bnt\bt(\b()\b) *\b**\b**\b**\b**\b*\n void s\bse\bet\bt_\b_i\bin\bnt\bt (int name, flags::bitfield_flag const val);\n-void s\bse\bet\bt_\b_b\bbo\boo\bol\bl (int name, bool val) override;\n void s\bse\bet\bt_\b_s\bst\btr\br (int name, std::string val) override;\n void s\bse\bet\bt_\b_i\bin\bnt\bt (int name, int val) override;\n+void s\bse\bet\bt_\b_b\bbo\boo\bol\bl (int name, bool val) override;\n set a configuration option in the _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk. name is one of the enum values\n from string_types, int_types or bool_types. They must match the respective type\n of the set_* function.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* h\bha\bas\bs_\b_v\bva\bal\bl(\b()\b) *\b**\b**\b**\b**\b*\n bool h\bha\bas\bs_\b_v\bva\bal\bl (int name) const override;\n queries whether the specified configuration option has a value set in this\n@@ -9470,18 +9616,18 @@\n void c\bcl\ble\bea\bar\br ();\n clear the settings pack from all settings\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* c\bcl\ble\bea\bar\br(\b()\b) *\b**\b**\b**\b**\b*\n void c\bcl\ble\bea\bar\br (int name);\n clear a specific setting from the pack\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* g\bge\bet\bt_\b_i\bin\bnt\bt(\b()\b) g\bge\bet\bt_\b_s\bst\btr\br(\b()\b) g\bge\bet\bt_\b_b\bbo\boo\bol\bl(\b()\b) *\b**\b**\b**\b**\b*\n-int g\bge\bet\bt_\b_i\bin\bnt\bt (int name) const override;\n+*\b**\b**\b**\b**\b* g\bge\bet\bt_\b_b\bbo\boo\bol\bl(\b()\b) g\bge\bet\bt_\b_i\bin\bnt\bt(\b()\b) g\bge\bet\bt_\b_s\bst\btr\br(\b()\b) *\b**\b**\b**\b**\b*\n std::string const& g\bge\bet\bt_\b_s\bst\btr\br (int name) const override;\n bool g\bge\bet\bt_\b_b\bbo\boo\bol\bl (int name) const override;\n+int g\bge\bet\bt_\b_i\bin\bnt\bt (int name) const override;\n queries the current configuration option from the _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk. name is one of\n the enumeration values from string_types, int_types or bool_types. The enum\n value must match the type of the get_* function. If the specified setting field\n has not been set, the default value is returned.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* e\ben\bnu\bum\bm t\bty\byp\bpe\be_\b_b\bba\bas\bse\bes\bs *\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk_\b._\bh_\bp_\bp\"\n@@ -9608,14 +9754,39 @@\n | | |trackers, a plain proxy will suffice. The proxy is assumed to|\n | | |not require authorization. The username and password will not|\n |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bb_\be_\b _\bu_\bs_\be_\bd_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n | | |The server is assumed to be an HTTP proxy that requires user |\n |http_pw |5 |authorization. The username and password will be sent to the |\n |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bp_\br_\bo_\bx_\by_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* g\bge\ben\bne\ber\bra\bat\bte\be_\b_f\bfi\bin\bng\bge\ber\brp\bpr\bri\bin\bnt\bt(\b()\b) *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bf_\bi_\bn_\bg_\be_\br_\bp_\br_\bi_\bn_\bt_\b._\bh_\bp_\bp\"\n+std::string g\bge\ben\bne\ber\bra\bat\bte\be_\b_f\bfi\bin\bng\bge\ber\brp\bpr\bri\bin\bnt\bt (std::string name\n+ , int major, int minor = 0, int revision = 0, int tag = 0);\n+This is a utility function to produce a client ID fingerprint formatted to the\n+most common convention. The fingerprint can be set via the peer_fingerprint\n+setting, in _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk.\n+The name string should contain exactly two characters. These are the characters\n+unique to your client, used to identify it. Make sure not to clash with anybody\n+else. Here are some taken id's:\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n+|_\bi\bi_\bd\bd_\b _\bc\bc_\bh\bh_\ba\ba_\br\br_\bs\bs_\b|_\bc\bc_\bl\bl_\bi\bi_\be\be_\bn\bn_\bt\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bL_\bT_\b _\b _\b _\b _\b _\b _\b|_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b _\b(_\bd_\be_\bf_\ba_\bu_\bl_\bt_\b)|\n+|_\bU_\bT_\b _\b _\b _\b _\b _\b _\b|_\bu_\bT_\bo_\br_\br_\be_\bn_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bU_\bM_\b _\b _\b _\b _\b _\b _\b|_\bu_\bT_\bo_\br_\br_\be_\bn_\bt_\b _\bM_\ba_\bc_\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bq_\bB_\b _\b _\b _\b _\b _\b _\b|_\bq_\bB_\bi_\bt_\bt_\bo_\br_\br_\be_\bn_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bB_\bP_\b _\b _\b _\b _\b _\b _\b|_\bB_\bi_\bt_\bT_\bo_\br_\br_\be_\bn_\bt_\b _\bP_\br_\bo_\b _\b _\b _\b _\b _\b |\n+|_\bB_\bT_\b _\b _\b _\b _\b _\b _\b|_\bB_\bi_\bt_\bT_\bo_\br_\br_\be_\bn_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bD_\bE_\b _\b _\b _\b _\b _\b _\b|_\bD_\be_\bl_\bu_\bg_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bA_\bZ_\b _\b _\b _\b _\b _\b _\b|_\bA_\bz_\bu_\br_\be_\bu_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bT_\bL_\b _\b _\b _\b _\b _\b _\b|_\bT_\br_\bi_\bb_\bl_\be_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+There's an informal directory of client id's _\bh_\be_\br_\be.\n+The major, minor, revision and tag parameters are used to identify the version\n+of your client.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* h\bhi\big\bgh\bh_\b_p\bpe\ber\brf\bfo\bor\brm\bma\ban\bnc\bce\be_\b_s\bse\bee\bed\bd(\b()\b) m\bmi\bin\bn_\b_m\bme\bem\bmo\bor\bry\by_\b_u\bus\bsa\bag\bge\be(\b()\b) *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b._\bh_\bp_\bp\"\n settings_pack m\bmi\bin\bn_\b_m\bme\bem\bmo\bor\bry\by_\b_u\bus\bsa\bag\bge\be ();\n settings_pack h\bhi\big\bgh\bh_\b_p\bpe\ber\brf\bfo\bor\brm\bma\ban\bnc\bce\be_\b_s\bse\bee\bed\bd ();\n The default values of the _\bs_\be_\bs_\bs_\bi_\bo_\bn settings are set for a regular bittorrent\n client running on a desktop system. There are functions that can set the\n _\bs_\be_\bs_\bs_\bi_\bo_\bn settings to pre set settings for other environments. These can be used\n@@ -9634,345 +9805,610 @@\n high_performance_seed returns settings optimized for a seed box, serving many\n peers and that doesn't do any downloading. It has a 128 MB disk cache and has a\n limit of 400 files in its file pool. It support fast upload rates by allowing\n large send buffers.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* n\bna\bam\bme\be_\b_f\bfo\bor\br_\b_s\bse\bet\btt\bti\bin\bng\bg(\b()\b) s\bse\bet\btt\bti\bin\bng\bg_\b_b\bby\by_\b_n\bna\bam\bme\be(\b()\b) *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk_\b._\bh_\bp_\bp\"\n-int s\bse\bet\btt\bti\bin\bng\bg_\b_b\bby\by_\b_n\bna\bam\bme\be (string_view name);\n char const* n\bna\bam\bme\be_\b_f\bfo\bor\br_\b_s\bse\bet\btt\bti\bin\bng\bg (int s);\n+int s\bse\bet\btt\bti\bin\bng\bg_\b_b\bby\by_\b_n\bna\bam\bme\be (string_view name);\n converts a setting integer (from the enums string_types, int_types or\n bool_types) to a string, and vice versa.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* d\bde\bef\bfa\bau\bul\blt\bt_\b_s\bse\bet\btt\bti\bin\bng\bgs\bs(\b()\b) *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk_\b._\bh_\bp_\bp\"\n settings_pack d\bde\bef\bfa\bau\bul\blt\bt_\b_s\bse\bet\btt\bti\bin\bng\bgs\bs ();\n returns a _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk with every setting set to its default value\n+libtorrent has a _\bp_\bl_\bu_\bg_\bi_\bn interface for implementing extensions to the protocol.\n+These can be general extensions for transferring metadata or peer exchange\n+extensions, or it could be used to provide a way to customize the protocol to\n+fit a particular (closed) network.\n+In short, the _\bp_\bl_\bu_\bg_\bi_\bn interface makes it possible to:\n+ * register extension messages (sent in the extension handshake), see\n+ _\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\bs.\n+ * add data and parse data from the extension handshake.\n+ * send extension messages and standard bittorrent messages.\n+ * override or block the handling of standard bittorrent messages.\n+ * save and restore state via the _\bs_\be_\bs_\bs_\bi_\bo_\bn state\n+ * see all alerts that are posted\n+*\b**\b**\b**\b**\b**\b* a\ba w\bwo\bor\brd\bd o\bof\bf c\bca\bau\but\bti\bio\bon\bn *\b**\b**\b**\b**\b**\b*\n+Writing your own _\bp_\bl_\bu_\bg_\bi_\bn is a very easy way to introduce serious bugs such as\n+dead locks and race conditions. Since a _\bp_\bl_\bu_\bg_\bi_\bn has access to internal\n+structures it is also quite easy to sabotage libtorrent's operation.\n+All the callbacks are always called from the libtorrent network thread. In case\n+portions of your _\bp_\bl_\bu_\bg_\bi_\bn are called from other threads, typically the main\n+thread, you cannot use any of the member functions on the internal structures\n+in libtorrent, since those require being called from the libtorrent network\n+thread . Furthermore, you also need to synchronize your own shared data within\n+the _\bp_\bl_\bu_\bg_\bi_\bn, to make sure it is not accessed at the same time from the\n+libtorrent thread (through a callback). If you need to send out a message from\n+another thread, it is advised to use an internal queue, and do the actual\n+sending in tick().\n+Since the _\bp_\bl_\bu_\bg_\bi_\bn interface gives you easy access to internal structures, it is\n+not supported as a stable API. Plugins should be considered specific to a\n+specific version of libtorrent. Although, in practice the internals mostly\n+don't change that dramatically.\n+*\b**\b**\b**\b**\b**\b* p\bpl\blu\bug\bgi\bin\bn-\b-i\bin\bnt\bte\ber\brf\bfa\bac\bce\be *\b**\b**\b**\b**\b**\b*\n+The _\bp_\bl_\bu_\bg_\bi_\bn interface consists of three base classes that the _\bp_\bl_\bu_\bg_\bi_\bn may\n+implement. These are called _\bp_\bl_\bu_\bg_\bi_\bn, _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\bl_\bu_\bg_\bi_\bn and _\bp_\be_\be_\br_\b__\bp_\bl_\bu_\bg_\bi_\bn. They are\n+found in the header.\n+These plugins are instantiated for each _\bs_\be_\bs_\bs_\bi_\bo_\bn, torrent and possibly each\n+peer, respectively.\n+For plugins that only need per torrent state, it is enough to only implement\n+torrent_plugin and pass a constructor function or function object to session::\n+add_extension() or torrent_handle::add_extension() (if the torrent has already\n+been started and you want to hook in the extension at run-time).\n+The signature of the function is:\n+std::shared_ptr (*)(torrent_handle const&, client_data_t);\n+The second argument is the userdata passed to session::add_torrent() or\n+torrent_handle::add_extension().\n+The function should return a std::shared_ptr which may or may\n+not be 0. If it is a nullptr, the extension is simply ignored for this torrent.\n+If it is a valid pointer (to a class inheriting torrent_plugin), it will be\n+associated with this torrent and callbacks will be made on torrent events.\n+For more elaborate plugins which require _\bs_\be_\bs_\bs_\bi_\bo_\bn wide state, you would\n+implement plugin, construct an object (in a std::shared_ptr) and pass it in to\n+session::add_extension().\n+*\b**\b**\b**\b**\b**\b* c\bcu\bus\bst\bto\bom\bm a\bal\ble\ber\brt\bts\bs *\b**\b**\b**\b**\b**\b*\n+Since plugins are running within internal libtorrent threads, one convenient\n+way to communicate with the client is to post custom alerts.\n+The expected interface of any _\ba_\bl_\be_\br_\bt, apart from deriving from the _\ba_\bl_\be_\br_\bt base\n+class, looks like this:\n+static const int alert_type = <\b\b>;\n+virtual int type() const { return alert_type; }\n+\n+virtual std::string message() const;\n+\n+static const alert_category_t static_category = <\b\b>;\n+virtual alert_category_t category() const { return static_category; }\n+\n+virtual char const* what() const { return <\b\b>; }\n+The alert_type is used for the type-checking in alert_cast. It must not collide\n+with any other _\ba_\bl_\be_\br_\bt. The built-in alerts in libtorrent will not use _\ba_\bl_\be_\br_\bt type\n+IDs greater than user_alert_id. When defining your own _\ba_\bl_\be_\br_\bt, make sure it's\n+greater than this constant.\n+type() is the run-time equivalence of the alert_type.\n+The message() virtual function is expected to construct a useful string\n+representation of the _\ba_\bl_\be_\br_\bt and the event or data it represents. Something\n+convenient to put in a log file for instance.\n+clone() is used internally to copy alerts. The suggested implementation of\n+simply allocating a new instance as a copy of *this is all that's expected.\n+The static category is required for checking whether or not the category for a\n+specific _\ba_\bl_\be_\br_\bt is enabled or not, without instantiating the _\ba_\bl_\be_\br_\bt. The category\n+virtual function is the run-time equivalence.\n+The what() virtual function may simply be a string literal of the class name of\n+your _\ba_\bl_\be_\br_\bt.\n+For more information, see the _\ba_\bl_\be_\br_\bt_\b _\bs_\be_\bc_\bt_\bi_\bo_\bn.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* g\bge\ben\bne\ber\bra\bat\bte\be_\b_f\bfi\bin\bng\bge\ber\brp\bpr\bri\bin\bnt\bt(\b()\b) *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bf_\bi_\bn_\bg_\be_\br_\bp_\br_\bi_\bn_\bt_\b._\bh_\bp_\bp\"\n-std::string g\bge\ben\bne\ber\bra\bat\bte\be_\b_f\bfi\bin\bng\bge\ber\brp\bpr\bri\bin\bnt\bt (std::string name\n- , int major, int minor = 0, int revision = 0, int tag = 0);\n-This is a utility function to produce a client ID fingerprint formatted to the\n-most common convention. The fingerprint can be set via the peer_fingerprint\n-setting, in _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk.\n-The name string should contain exactly two characters. These are the characters\n-unique to your client, used to identify it. Make sure not to clash with anybody\n-else. Here are some taken id's:\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n-|_\bi\bi_\bd\bd_\b _\bc\bc_\bh\bh_\ba\ba_\br\br_\bs\bs_\b|_\bc\bc_\bl\bl_\bi\bi_\be\be_\bn\bn_\bt\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bL_\bT_\b _\b _\b _\b _\b _\b _\b|_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b _\b(_\bd_\be_\bf_\ba_\bu_\bl_\bt_\b)|\n-|_\bU_\bT_\b _\b _\b _\b _\b _\b _\b|_\bu_\bT_\bo_\br_\br_\be_\bn_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bU_\bM_\b _\b _\b _\b _\b _\b _\b|_\bu_\bT_\bo_\br_\br_\be_\bn_\bt_\b _\bM_\ba_\bc_\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bq_\bB_\b _\b _\b _\b _\b _\b _\b|_\bq_\bB_\bi_\bt_\bt_\bo_\br_\br_\be_\bn_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bB_\bP_\b _\b _\b _\b _\b _\b _\b|_\bB_\bi_\bt_\bT_\bo_\br_\br_\be_\bn_\bt_\b _\bP_\br_\bo_\b _\b _\b _\b _\b _\b |\n-|_\bB_\bT_\b _\b _\b _\b _\b _\b _\b|_\bB_\bi_\bt_\bT_\bo_\br_\br_\be_\bn_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bD_\bE_\b _\b _\b _\b _\b _\b _\b|_\bD_\be_\bl_\bu_\bg_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bA_\bZ_\b _\b _\b _\b _\b _\b _\b|_\bA_\bz_\bu_\br_\be_\bu_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bT_\bL_\b _\b _\b _\b _\b _\b _\b|_\bT_\br_\bi_\bb_\bl_\be_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-There's an informal directory of client id's _\bh_\be_\br_\be.\n-The major, minor, revision and tag parameters are used to identify the version\n-of your client.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* c\bcl\bli\bie\ben\bnt\bt_\b_d\bda\bat\bta\ba_\b_t\bt *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bc_\bl_\bi_\be_\bn_\bt_\b__\bd_\ba_\bt_\ba_\b._\bh_\bp_\bp\"\n-A thin wrapper around a void pointer used as \"user data\". i.e. an opaque cookie\n-passed in to libtorrent and returned on demand. It adds type-safety by\n-requiring the same type be requested out of it as was assigned to it.\n-struct client_data_t\n+*\b**\b**\b**\b**\b**\b* p\bpl\blu\bug\bgi\bin\bn *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\bs_\b._\bh_\bp_\bp\"\n+this is the base class for a _\bs_\be_\bs_\bs_\bi_\bo_\bn _\bp_\bl_\bu_\bg_\bi_\bn. One primary feature is that it is\n+notified of all torrents that are added to the _\bs_\be_\bs_\bs_\bi_\bo_\bn, and can add its own\n+torrent_plugins.\n+struct plugin\n {\n- c\bcl\bli\bie\ben\bnt\bt_\b_d\bda\bat\bta\ba_\b_t\bt () = default;\n- explicit c\bcl\bli\bie\ben\bnt\bt_\b_d\bda\bat\bta\ba_\b_t\bt (T* v);\n- client_data_t& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (T* v);\n- explicit operator T\bT () const;\n- T* g\bge\bet\bt () const;\n- operator v\bvo\boi\bid\bd*\b* () const = delete;\n- client_data_t& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (void const*) = delete;\n- client_data_t& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (void*) = delete;\n- operator void c\bco\bon\bns\bst\bt*\b* () const = delete;\n+ virtual feature_flags_t i\bim\bmp\bpl\ble\bem\bme\ben\bnt\bte\bed\bd_\b_f\bfe\bea\bat\btu\bur\bre\bes\bs ();\n+ virtual std::shared_ptr n\bne\bew\bw_\b_t\bto\bor\brr\bre\ben\bnt\bt (torrent_handle const&,\n+client_data_t);\n+ virtual void a\bad\bdd\bde\bed\bd (session_handle const&);\n+ virtual void a\bab\bbo\bor\brt\bt ();\n+ virtual bool o\bon\bn_\b_d\bdh\bht\bt_\b_r\bre\beq\bqu\bue\bes\bst\bt (string_view /\b/*\b* q\bqu\bue\ber\bry\by *\b*/\b/\n+ , udp::endpoint const& /\b/*\b* s\bso\bou\bur\brc\bce\be *\b*/\b/, bdecode_node const& /\b/*\b* m\bme\bes\bss\bsa\bag\bge\be *\b*/\b/\n+ , entry& /\b/*\b* r\bre\bes\bsp\bpo\bon\bns\bse\be *\b*/\b/);\n+ virtual void o\bon\bn_\b_a\bal\ble\ber\brt\bt (alert const*);\n+ virtual bool o\bon\bn_\b_u\bun\bnk\bkn\bno\bow\bwn\bn_\b_t\bto\bor\brr\bre\ben\bnt\bt (info_hash_t const& /\b/*\b* i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh *\b*/\b/\n+ , peer_connection_handle const& /\b/*\b* p\bpc\bc *\b*/\b/, add_torrent_params& /\b/*\b* p\bp *\b*/\b/);\n+ virtual void o\bon\bn_\b_t\bti\bic\bck\bk ();\n+ virtual uint64_t g\bge\bet\bt_\b_u\bun\bnc\bch\bho\bok\bke\be_\b_p\bpr\bri\bio\bor\bri\bit\bty\by (peer_connection_handle const& /\b/*\b* p\bpe\bee\ber\br\n+*\b*/\b/);\n+ virtual std::map s\bsa\bav\bve\be_\b_s\bst\bta\bat\bte\be () const;\n+ virtual void l\blo\boa\bad\bd_\b_s\bst\bta\bat\bte\be (std::map const&);\n \n- template ::value>::type>\n+ static constexpr feature_flags_t o\bop\bpt\bti\bim\bmi\bis\bst\bti\bic\bc_\b_u\bun\bnc\bch\bho\bok\bke\be_\b_f\bfe\bea\bat\btu\bur\bre\be = 1_bit;\n+ static constexpr feature_flags_t t\bti\bic\bck\bk_\b_f\bfe\bea\bat\btu\bur\bre\be = 2_bit;\n+ static constexpr feature_flags_t d\bdh\bht\bt_\b_r\bre\beq\bqu\bue\bes\bst\bt_\b_f\bfe\bea\bat\btu\bur\bre\be = 3_bit;\n+ static constexpr feature_flags_t a\bal\ble\ber\brt\bt_\b_f\bfe\bea\bat\btu\bur\bre\be = 4_bit;\n+ static constexpr feature_flags_t u\bun\bnk\bkn\bno\bow\bwn\bn_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfe\bea\bat\btu\bur\bre\be = 5_bit;\n };\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* c\bcl\bli\bie\ben\bnt\bt_\b_d\bda\bat\bta\ba_\b_t\bt(\b()\b) *\b**\b**\b**\b**\b*\n-c\bcl\bli\bie\ben\bnt\bt_\b_d\bda\bat\bta\ba_\b_t\bt () = default;\n-construct a nullptr client data\n+*\b**\b**\b**\b**\b* i\bim\bmp\bpl\ble\bem\bme\ben\bnt\bte\bed\bd_\b_f\bfe\bea\bat\btu\bur\bre\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n+virtual feature_flags_t i\bim\bmp\bpl\ble\bem\bme\ben\bnt\bte\bed\bd_\b_f\bfe\bea\bat\btu\bur\bre\bes\bs ();\n+This function is expected to return a bitmask indicating which features this\n+_\bp_\bl_\bu_\bg_\bi_\bn implements. Some callbacks on this object may not be called unless the\n+corresponding feature flag is returned here. Note that callbacks may still be\n+called even if the corresponding feature is not specified in the return value\n+here. See feature_flags_t for possible flags to return.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* o\bop\bpe\ber\bra\bat\bto\bor\br=\b=(\b()\b) c\bco\bon\bns\bst\bt*\b*(\b()\b) v\bvo\boi\bid\bd*\b*(\b()\b) *\b**\b**\b**\b**\b*\n-operator v\bvo\boi\bid\bd*\b* () const = delete;\n-client_data_t& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (void const*) = delete;\n-client_data_t& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (void*) = delete;\n-operator void c\bco\bon\bns\bst\bt*\b* () const = delete;\n-we don't allow type-unsafe operations\n+*\b**\b**\b**\b**\b* n\bne\bew\bw_\b_t\bto\bor\brr\bre\ben\bnt\bt(\b()\b) *\b**\b**\b**\b**\b*\n+virtual std::shared_ptr n\bne\bew\bw_\b_t\bto\bor\brr\bre\ben\bnt\bt (torrent_handle const&,\n+client_data_t);\n+this is called by the _\bs_\be_\bs_\bs_\bi_\bo_\bn every time a new torrent is added. The torrent*\n+points to the internal torrent object created for the new torrent. The\n+_\bc_\bl_\bi_\be_\bn_\bt_\b__\bd_\ba_\bt_\ba_\b__\bt is the userdata pointer as passed in via _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs.\n+If the _\bp_\bl_\bu_\bg_\bi_\bn returns a _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\bl_\bu_\bg_\bi_\bn instance, it will be added to the new\n+torrent. Otherwise, return an empty shared_ptr to a _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\bl_\bu_\bg_\bi_\bn (the\n+default).\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_p\bpa\bar\bra\bam\bms\bs *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs_\b._\bh_\bp_\bp\"\n-The _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs contains all the information in a .torrent file along\n-with all information necessary to add that torrent to a _\bs_\be_\bs_\bs_\bi_\bo_\bn. The key fields\n-when adding a torrent are:\n- * ti - the immutable info-dict part of the torrent\n- * info_hash - when you don't have the metadata (.torrent file). This\n- uniquely identifies the torrent and can validate the info-dict when\n- received from the swarm.\n-In order to add a torrent to a _\bs_\be_\bs_\bs_\bi_\bo_\bn, one of those fields must be set in\n-addition to save_path. The _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs object can then be passed into\n-one of the session::add_torrent() overloads or session::async_add_torrent().\n-If you only specify the info-hash, the torrent file will be downloaded from\n-peers, which requires them to support the metadata extension. For the metadata\n-extension to work, libtorrent must be built with extensions enabled\n-(TORRENT_DISABLE_EXTENSIONS must not be defined). It also takes an optional\n-name argument. This may be left empty in case no name should be assigned to the\n-torrent. In case it's not, the name is used for the torrent as long as it\n-doesn't have metadata. See torrent_handle::name.\n-The add_torrent_params is also used when requesting resume data for a torrent.\n-It can be saved to and restored from a file and added back to a new _\bs_\be_\bs_\bs_\bi_\bo_\bn.\n-For serialization and de-serialization of add_torrent_params objects, see\n-_\br_\be_\ba_\bd_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b) and _\bw_\br_\bi_\bt_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b).\n-The add_torrent_params is also used to represent a parsed .torrent file. It can\n-be loaded via _\bl_\bo_\ba_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bi_\bl_\be_\b(_\b), _\bl_\bo_\ba_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bb_\bu_\bf_\bf_\be_\br_\b(_\b) and\n-_\bl_\bo_\ba_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\bs_\be_\bd_\b(_\b). It can be saved via _\bw_\br_\bi_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bi_\bl_\be_\b(_\b).\n-struct add_torrent_params\n+*\b**\b**\b**\b**\b* a\bad\bdd\bde\bed\bd(\b()\b) *\b**\b**\b**\b**\b*\n+virtual void a\bad\bdd\bde\bed\bd (session_handle const&);\n+called when _\bp_\bl_\bu_\bg_\bi_\bn is added to a _\bs_\be_\bs_\bs_\bi_\bo_\bn\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* a\bab\bbo\bor\brt\bt(\b()\b) *\b**\b**\b**\b**\b*\n+virtual void a\bab\bbo\bor\brt\bt ();\n+called when the _\bs_\be_\bs_\bs_\bi_\bo_\bn is aborted the _\bp_\bl_\bu_\bg_\bi_\bn should perform any cleanup\n+necessary to allow the session's destruction (e.g. cancel outstanding async\n+operations)\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* o\bon\bn_\b_d\bdh\bht\bt_\b_r\bre\beq\bqu\bue\bes\bst\bt(\b()\b) *\b**\b**\b**\b**\b*\n+virtual bool o\bon\bn_\b_d\bdh\bht\bt_\b_r\bre\beq\bqu\bue\bes\bst\bt (string_view /\b/*\b* q\bqu\bue\ber\bry\by *\b*/\b/\n+ , udp::endpoint const& /\b/*\b* s\bso\bou\bur\brc\bce\be *\b*/\b/, bdecode_node const& /\b/*\b* m\bme\bes\bss\bsa\bag\bge\be *\b*/\b/\n+ , entry& /\b/*\b* r\bre\bes\bsp\bpo\bon\bns\bse\be *\b*/\b/);\n+called when a dht request is received. If your _\bp_\bl_\bu_\bg_\bi_\bn expects this to be\n+called, make sure to include the flag dht_request_feature in the return value\n+from _\bi_\bm_\bp_\bl_\be_\bm_\be_\bn_\bt_\be_\bd_\b__\bf_\be_\ba_\bt_\bu_\br_\be_\bs_\b(_\b).\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* o\bon\bn_\b_a\bal\ble\ber\brt\bt(\b()\b) *\b**\b**\b**\b**\b*\n+virtual void o\bon\bn_\b_a\bal\ble\ber\brt\bt (alert const*);\n+called when an _\ba_\bl_\be_\br_\bt is posted alerts that are filtered are not posted. If your\n+_\bp_\bl_\bu_\bg_\bi_\bn expects this to be called, make sure to include the flag alert_feature\n+in the return value from _\bi_\bm_\bp_\bl_\be_\bm_\be_\bn_\bt_\be_\bd_\b__\bf_\be_\ba_\bt_\bu_\br_\be_\bs_\b(_\b).\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* o\bon\bn_\b_u\bun\bnk\bkn\bno\bow\bwn\bn_\b_t\bto\bor\brr\bre\ben\bnt\bt(\b()\b) *\b**\b**\b**\b**\b*\n+virtual bool o\bon\bn_\b_u\bun\bnk\bkn\bno\bow\bwn\bn_\b_t\bto\bor\brr\bre\ben\bnt\bt (info_hash_t const& /\b/*\b* i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh *\b*/\b/\n+ , peer_connection_handle const& /\b/*\b* p\bpc\bc *\b*/\b/, add_torrent_params& /\b/*\b* p\bp *\b*/\b/);\n+return true if the _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs should be added\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* o\bon\bn_\b_t\bti\bic\bck\bk(\b()\b) *\b**\b**\b**\b**\b*\n+virtual void o\bon\bn_\b_t\bti\bic\bck\bk ();\n+called once per second. If your _\bp_\bl_\bu_\bg_\bi_\bn expects this to be called, make sure to\n+include the flag tick_feature in the return value from _\bi_\bm_\bp_\bl_\be_\bm_\be_\bn_\bt_\be_\bd_\b__\bf_\be_\ba_\bt_\bu_\br_\be_\bs_\b(_\b).\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* g\bge\bet\bt_\b_u\bun\bnc\bch\bho\bok\bke\be_\b_p\bpr\bri\bio\bor\bri\bit\bty\by(\b()\b) *\b**\b**\b**\b**\b*\n+virtual uint64_t g\bge\bet\bt_\b_u\bun\bnc\bch\bho\bok\bke\be_\b_p\bpr\bri\bio\bor\bri\bit\bty\by (peer_connection_handle const& /\b/*\b* p\bpe\bee\ber\br *\b*/\b/\n+);\n+called when choosing peers to optimistically unchoke. The return value\n+indicates the peer's priority for unchoking. Lower return values correspond to\n+higher priority. Priorities above 2^63-1 are reserved. If your _\bp_\bl_\bu_\bg_\bi_\bn has no\n+priority to assign a peer it should return 2^64-1. If your _\bp_\bl_\bu_\bg_\bi_\bn expects this\n+to be called, make sure to include the flag optimistic_unchoke_feature in the\n+return value from _\bi_\bm_\bp_\bl_\be_\bm_\be_\bn_\bt_\be_\bd_\b__\bf_\be_\ba_\bt_\bu_\br_\be_\bs_\b(_\b). If multiple plugins implement this\n+function the lowest return value (i.e. the highest priority) is used.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* l\blo\boa\bad\bd_\b_s\bst\bta\bat\bte\be(\b()\b) *\b**\b**\b**\b**\b*\n+virtual void l\blo\boa\bad\bd_\b_s\bst\bta\bat\bte\be (std::map const&);\n+called on startup while loading settings state from the _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ optimistic_unchoke_feature\n+ include this bit if your _\bp_\bl_\bu_\bg_\bi_\bn needs to alter the order of the\n+ optimistic unchoke of peers. i.e. have the on_optimistic_unchoke()\n+ callback be called.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ tick_feature\n+ include this bit if your _\bp_\bl_\bu_\bg_\bi_\bn needs to have _\bo_\bn_\b__\bt_\bi_\bc_\bk_\b(_\b) called\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ dht_request_feature\n+ include this bit if your _\bp_\bl_\bu_\bg_\bi_\bn needs to have _\bo_\bn_\b__\bd_\bh_\bt_\b__\br_\be_\bq_\bu_\be_\bs_\bt_\b(_\b) called\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ alert_feature\n+ include this bit if your _\bp_\bl_\bu_\bg_\bi_\bn needs to have _\bo_\bn_\b__\ba_\bl_\be_\br_\bt_\b(_\b) called\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ unknown_torrent_feature\n+ include this bit if your _\bp_\bl_\bu_\bg_\bi_\bn needs to have _\bo_\bn_\b__\bu_\bn_\bk_\bn_\bo_\bw_\bn_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b) called\n+ even if there is no active torrent in the _\bs_\be_\bs_\bs_\bi_\bo_\bn\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* t\bto\bor\brr\bre\ben\bnt\bt_\b_p\bpl\blu\bug\bgi\bin\bn *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\bs_\b._\bh_\bp_\bp\"\n+Torrent plugins are associated with a single torrent and have a number of\n+functions called at certain events. Many of its functions have the ability to\n+change or override the default libtorrent behavior.\n+struct torrent_plugin\n {\n- int v\bve\ber\brs\bsi\bio\bon\bn = LIBTORRENT_VERSION_NUM;\n- std::shared_ptr ti;\n- aux::noexcept_movable> trackers;\n- aux::noexcept_movable> tracker_tiers;\n- aux::noexcept_movable>> dht_nodes;\n- std::string name;\n- std::string save_path;\n- storage_mode_t s\bst\bto\bor\bra\bag\bge\be_\b_m\bmo\bod\bde\be = storage_mode_sparse;\n- client_data_t userdata;\n- aux::noexcept_movable> file_priorities;\n- std::string trackerid;\n- torrent_flags_t f\bfl\bla\bag\bgs\bs = torrent_flags::default_flags;\n- info_hash_t info_hashes;\n- int m\bma\bax\bx_\b_u\bup\bpl\blo\boa\bad\bds\bs = -1;\n- int m\bma\bax\bx_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bns\bs = -1;\n- int u\bup\bpl\blo\boa\bad\bd_\b_l\bli\bim\bmi\bit\bt = -1;\n- int d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_l\bli\bim\bmi\bit\bt = -1;\n- std::int64_t t\bto\bot\bta\bal\bl_\b_u\bup\bpl\blo\boa\bad\bde\bed\bd = 0;\n- std::int64_t t\bto\bot\bta\bal\bl_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bde\bed\bd = 0;\n- int a\bac\bct\bti\biv\bve\be_\b_t\bti\bim\bme\be = 0;\n- int f\bfi\bin\bni\bis\bsh\bhe\bed\bd_\b_t\bti\bim\bme\be = 0;\n- int s\bse\bee\bed\bdi\bin\bng\bg_\b_t\bti\bim\bme\be = 0;\n- std::time_t a\bad\bdd\bde\bed\bd_\b_t\bti\bim\bme\be = 0;\n- std::time_t c\bco\bom\bmp\bpl\ble\bet\bte\bed\bd_\b_t\bti\bim\bme\be = 0;\n- std::time_t l\bla\bas\bst\bt_\b_s\bse\bee\ben\bn_\b_c\bco\bom\bmp\bpl\ble\bet\bte\be = 0;\n- int n\bnu\bum\bm_\b_c\bco\bom\bmp\bpl\ble\bet\bte\be = -1;\n- int n\bnu\bum\bm_\b_i\bin\bnc\bco\bom\bmp\bpl\ble\bet\bte\be = -1;\n- int n\bnu\bum\bm_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bde\bed\bd = -1;\n- aux::noexcept_movable> http_seeds;\n- aux::noexcept_movable> url_seeds;\n- aux::noexcept_movable> peers;\n- aux::noexcept_movable> banned_peers;\n- aux::noexcept_movable> unfinished_pieces;\n- typed_bitfield have_pieces;\n- typed_bitfield verified_pieces;\n- aux::noexcept_movable> piece_priorities;\n- aux::vector, file_index_t> merkle_trees;\n- aux::vector, file_index_t> merkle_tree_mask;\n- aux::vector, file_index_t> verified_leaf_hashes;\n- aux::noexcept_movable> renamed_files;\n- std::time_t l\bla\bas\bst\bt_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd = 0;\n- std::time_t l\bla\bas\bst\bt_\b_u\bup\bpl\blo\boa\bad\bd = 0;\n+ virtual std::shared_ptr n\bne\bew\bw_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn (peer_connection_handle\n+const&);\n+ virtual void o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_f\bfa\bai\bil\ble\bed\bd (piece_index_t);\n+ virtual void o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_p\bpa\bas\bss\bs (piece_index_t);\n+ virtual void t\bti\bic\bck\bk ();\n+ virtual bool o\bon\bn_\b_r\bre\bes\bsu\bum\bme\be ();\n+ virtual bool o\bon\bn_\b_p\bpa\bau\bus\bse\be ();\n+ virtual void o\bon\bn_\b_f\bfi\bil\ble\bes\bs_\b_c\bch\bhe\bec\bck\bke\bed\bd ();\n+ virtual void o\bon\bn_\b_s\bst\bta\bat\bte\be (torrent_status::state_t);\n+ virtual void o\bon\bn_\b_a\bad\bdd\bd_\b_p\bpe\bee\ber\br (tcp::endpoint const&,\n+ peer_source_flags_t, add_peer_flags_t);\n+\n+ static constexpr add_peer_flags_t f\bfi\bir\brs\bst\bt_\b_t\bti\bim\bme\be = 1_bit;\n+ static constexpr add_peer_flags_t f\bfi\bil\blt\bte\ber\bre\bed\bd = 2_bit;\n };\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- version\n- filled in by the constructor and should be left untouched. It is used for\n- forward binary compatibility.\n+*\b**\b**\b**\b**\b* n\bne\bew\bw_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn(\b()\b) *\b**\b**\b**\b**\b*\n+virtual std::shared_ptr n\bne\bew\bw_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn (peer_connection_handle\n+const&);\n+This function is called each time a new peer is connected to the torrent. You\n+may choose to ignore this by just returning a default constructed shared_ptr\n+(in which case you don't need to override this member function).\n+If you need an extension to the peer connection (which most plugins do) you are\n+supposed to return an instance of your _\bp_\be_\be_\br_\b__\bp_\bl_\bu_\bg_\bi_\bn class. Which in turn will\n+have its hook functions called on event specific to that peer.\n+The peer_connection_handle will be valid as long as the shared_ptr is being\n+held by the torrent object. So, it is generally a good idea to not keep a\n+shared_ptr to your own _\bp_\be_\be_\br_\b__\bp_\bl_\bu_\bg_\bi_\bn. If you want to keep references to it, use\n+weak_ptr.\n+If this function throws an exception, the connection will be closed.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- ti\n- _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo object with the torrent to add. Unless the info_hash is set,\n- this is required to be initialized.\n+*\b**\b**\b**\b**\b* o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_f\bfa\bai\bil\ble\bed\bd(\b()\b) o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_p\bpa\bas\bss\bs(\b()\b) *\b**\b**\b**\b**\b*\n+virtual void o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_f\bfa\bai\bil\ble\bed\bd (piece_index_t);\n+virtual void o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_p\bpa\bas\bss\bs (piece_index_t);\n+These hooks are called when a piece passes the hash check or fails the hash\n+check, respectively. The index is the piece index that was downloaded. It is\n+possible to access the list of peers that participated in sending the piece\n+through the torrent and the piece_picker.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- trackers\n- If the torrent doesn't have a tracker, but relies on the DHT to find\n- peers, the trackers can specify tracker URLs for the torrent.\n+*\b**\b**\b**\b**\b* t\bti\bic\bck\bk(\b()\b) *\b**\b**\b**\b**\b*\n+virtual void t\bti\bic\bck\bk ();\n+This hook is called approximately once per second. It is a way of making it\n+easy for plugins to do timed events, for sending messages or whatever.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- tracker_tiers\n- the tiers the URLs in trackers belong to. Trackers belonging to different\n- tiers may be treated differently, as defined by the multi tracker\n- extension. This is optional, if not specified trackers are assumed to be\n- part of tier 0, or whichever the last tier was as iterating over the\n- trackers.\n+*\b**\b**\b**\b**\b* o\bon\bn_\b_r\bre\bes\bsu\bum\bme\be(\b()\b) o\bon\bn_\b_p\bpa\bau\bus\bse\be(\b()\b) *\b**\b**\b**\b**\b*\n+virtual bool o\bon\bn_\b_r\bre\bes\bsu\bum\bme\be ();\n+virtual bool o\bon\bn_\b_p\bpa\bau\bus\bse\be ();\n+These hooks are called when the torrent is paused and resumed respectively. The\n+return value indicates if the event was handled. A return value of true\n+indicates that it was handled, and no other _\bp_\bl_\bu_\bg_\bi_\bn after this one will have\n+this hook function called, and the standard handler will also not be invoked.\n+So, returning true effectively overrides the standard behavior of pause or\n+resume.\n+Note that if you call pause() or resume() on the torrent from your handler it\n+will recurse back into your handler, so in order to invoke the standard\n+handler, you have to keep your own state on whether you want standard behavior\n+or overridden behavior.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- dht_nodes\n- a list of hostname and port pairs, representing DHT nodes to be added to\n- the _\bs_\be_\bs_\bs_\bi_\bo_\bn (if DHT is enabled). The hostname may be an IP address.\n+*\b**\b**\b**\b**\b* o\bon\bn_\b_f\bfi\bil\ble\bes\bs_\b_c\bch\bhe\bec\bck\bke\bed\bd(\b()\b) *\b**\b**\b**\b**\b*\n+virtual void o\bon\bn_\b_f\bfi\bil\ble\bes\bs_\b_c\bch\bhe\bec\bck\bke\bed\bd ();\n+This function is called when the initial files of the torrent have been\n+checked. If there are no files to check, this function is called immediately.\n+i.e. This function is always called when the torrent is in a state where it can\n+start downloading.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- name\n- in case there's no other name in this torrent, this name will be used.\n- The name out of the _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo object takes precedence if available.\n+*\b**\b**\b**\b**\b* o\bon\bn_\b_s\bst\bta\bat\bte\be(\b()\b) *\b**\b**\b**\b**\b*\n+virtual void o\bon\bn_\b_s\bst\bta\bat\bte\be (torrent_status::state_t);\n+called when the torrent changes state the state is one of _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bs_\bt_\ba_\bt_\bu_\bs_\b:_\b:\n+_\bs_\bt_\ba_\bt_\be_\b__\bt enum members\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- save_path\n- the path where the torrent is or will be stored.\n- Note\n- On windows this path (and other paths) are interpreted as UNC paths. This\n- means they must use backslashes as directory separators and may not\n- contain the special directories \".\" or \"..\".\n- Setting this to an absolute path performs slightly better than a relative\n- path.\n+*\b**\b**\b**\b**\b* o\bon\bn_\b_a\bad\bdd\bd_\b_p\bpe\bee\ber\br(\b()\b) *\b**\b**\b**\b**\b*\n+virtual void o\bon\bn_\b_a\bad\bdd\bd_\b_p\bpe\bee\ber\br (tcp::endpoint const&,\n+ peer_source_flags_t, add_peer_flags_t);\n+called every time a new peer is added to the peer list. This is before the peer\n+is connected to. For flags, see torrent_plugin::flags_t. The source argument\n+refers to the source where we learned about this peer from. It's a bitmask,\n+because many sources may have told us about the same peer. For peer source\n+flags, see peer_info::peer_source_flags.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- storage_mode\n- One of the values from _\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bm_\bo_\bd_\be_\b__\bt. For more information, see _\bs_\bt_\bo_\br_\ba_\bg_\be\n- _\ba_\bl_\bl_\bo_\bc_\ba_\bt_\bi_\bo_\bn.\n+ first_time\n+ this is the first time we see this peer\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- userdata\n- The userdata parameter is optional and will be passed on to the extension\n- constructor functions, if any (see _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be_\b:_\b:_\ba_\bd_\bd_\b__\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\b(_\b)). It\n- will also be stored in the torrent object and can be retrieved by calling\n- _\bu_\bs_\be_\br_\bd_\ba_\bt_\ba_\b(_\b).\n+ filtered\n+ this peer was not added because it was filtered by the IP filter\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- file_priorities\n- can be set to control the initial file priorities when adding a torrent.\n- The semantics are the same as for torrent_handle::prioritize_files(). The\n- file priorities specified in here take precedence over those specified in\n- the resume data, if any. If this vector of file priorities is shorter\n- than the number of files in the torrent, the remaining files (not covered\n- by this) will still have the default download priority. This default can\n- be changed by setting the default_dont_download torrent_flag.\n+*\b**\b**\b**\b**\b**\b* p\bpe\bee\ber\br_\b_p\bpl\blu\bug\bgi\bin\bn *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\bs_\b._\bh_\bp_\bp\"\n+peer plugins are associated with a specific peer. A peer could be both a\n+regular bittorrent peer (bt_peer_connection) or one of the web seed connections\n+(web_peer_connection or http_seed_connection). In order to only attach to\n+certain peers, make your torrent_plugin::new_connection only return a _\bp_\bl_\bu_\bg_\bi_\bn\n+for certain peer connection types\n+struct peer_plugin\n+{\n+ virtual string_view t\bty\byp\bpe\be () const;\n+ virtual void a\bad\bdd\bd_\b_h\bha\ban\bnd\bds\bsh\bha\bak\bke\be (entry&);\n+ virtual void o\bon\bn_\b_d\bdi\bis\bsc\bco\bon\bnn\bne\bec\bct\bt (error_code const&);\n+ virtual void o\bon\bn_\b_c\bco\bon\bnn\bne\bec\bct\bte\bed\bd ();\n+ virtual bool o\bon\bn_\b_h\bha\ban\bnd\bds\bsh\bha\bak\bke\be (span);\n+ virtual bool o\bon\bn_\b_e\bex\bxt\bte\ben\bns\bsi\bio\bon\bn_\b_h\bha\ban\bnd\bds\bsh\bha\bak\bke\be (bdecode_node const&);\n+ virtual bool o\bon\bn_\b_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd ();\n+ virtual bool o\bon\bn_\b_n\bno\bot\bt_\b_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd ();\n+ virtual bool o\bon\bn_\b_d\bdo\bon\bnt\bt_\b_h\bha\bav\bve\be (piece_index_t);\n+ virtual bool o\bon\bn_\b_c\bch\bho\bok\bke\be ();\n+ virtual bool o\bon\bn_\b_u\bun\bnc\bch\bho\bok\bke\be ();\n+ virtual bool o\bon\bn_\b_h\bha\bav\bve\be (piece_index_t);\n+ virtual bool o\bon\bn_\b_a\bal\bll\blo\bow\bwe\bed\bd_\b_f\bfa\bas\bst\bt (piece_index_t);\n+ virtual bool o\bon\bn_\b_r\bre\beq\bqu\bue\bes\bst\bt (peer_request const&);\n+ virtual bool o\bon\bn_\b_b\bbi\bit\btf\bfi\bie\bel\bld\bd (bitfield const& /\b/*\b*b\bbi\bit\btf\bfi\bie\bel\bld\bd*\b*/\b/);\n+ virtual bool o\bon\bn_\b_h\bha\bav\bve\be_\b_n\bno\bon\bne\be ();\n+ virtual bool o\bon\bn_\b_h\bha\bav\bve\be_\b_a\bal\bll\bl ();\n+ virtual bool o\bon\bn_\b_p\bpi\bie\bec\bce\be (peer_request const& /\b/*\b*p\bpi\bie\bec\bce\be*\b*/\b/\n+ , span /\b/*\b*b\bbu\buf\bf*\b*/\b/);\n+ virtual bool o\bon\bn_\b_s\bsu\bug\bgg\bge\bes\bst\bt (piece_index_t);\n+ virtual bool o\bon\bn_\b_c\bca\ban\bnc\bce\bel\bl (peer_request const&);\n+ virtual bool o\bon\bn_\b_r\bre\bej\bje\bec\bct\bt (peer_request const&);\n+ virtual void s\bse\ben\bnt\bt_\b_r\bre\bej\bje\bec\bct\bt_\b_r\bre\beq\bqu\bue\bes\bst\bt (peer_request const&);\n+ virtual void s\bse\ben\bnt\bt_\b_r\bre\beq\bqu\bue\bes\bst\bt (peer_request const&);\n+ virtual void s\bse\ben\bnt\bt_\b_a\bal\bll\blo\bow\bw_\b_f\bfa\bas\bst\bt (piece_index_t);\n+ virtual void s\bse\ben\bnt\bt_\b_s\bsu\bug\bgg\bge\bes\bst\bt (piece_index_t);\n+ virtual void s\bse\ben\bnt\bt_\b_h\bha\bav\bve\be_\b_a\bal\bll\bl ();\n+ virtual void s\bse\ben\bnt\bt_\b_c\bch\bho\bok\bke\be ();\n+ virtual void s\bse\ben\bnt\bt_\b_h\bha\bav\bve\be_\b_n\bno\bon\bne\be ();\n+ virtual void s\bse\ben\bnt\bt_\b_c\bca\ban\bnc\bce\bel\bl (peer_request const&);\n+ virtual void s\bse\ben\bnt\bt_\b_h\bha\bav\bve\be (piece_index_t);\n+ virtual void s\bse\ben\bnt\bt_\b_u\bun\bnc\bch\bho\bok\bke\be ();\n+ virtual void s\bse\ben\bnt\bt_\b_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd ();\n+ virtual void s\bse\ben\bnt\bt_\b_p\bpi\bie\bec\bce\be (peer_request const&);\n+ virtual void s\bse\ben\bnt\bt_\b_n\bno\bot\bt_\b_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd ();\n+ virtual void s\bse\ben\bnt\bt_\b_p\bpa\bay\byl\blo\boa\bad\bd (int /\b/*\b* b\bby\byt\bte\bes\bs *\b*/\b/);\n+ virtual bool c\bca\ban\bn_\b_d\bdi\bis\bsc\bco\bon\bnn\bne\bec\bct\bt (error_code const& /\b/*\b*e\bec\bc*\b*/\b/);\n+ virtual bool o\bon\bn_\b_e\bex\bxt\bte\ben\bnd\bde\bed\bd (int /\b/*\b*l\ble\ben\bng\bgt\bth\bh*\b*/\b/, int /\b/*\b*m\bms\bsg\bg*\b*/\b/,\n+ span /\b/*\b*b\bbo\bod\bdy\by*\b*/\b/);\n+ virtual bool o\bon\bn_\b_u\bun\bnk\bkn\bno\bow\bwn\bn_\b_m\bme\bes\bss\bsa\bag\bge\be (int /\b/*\b*l\ble\ben\bng\bgt\bth\bh*\b*/\b/, int /\b/*\b*m\bms\bsg\bg*\b*/\b/,\n+ span /\b/*\b*b\bbo\bod\bdy\by*\b*/\b/);\n+ virtual void o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_f\bfa\bai\bil\ble\bed\bd (piece_index_t);\n+ virtual void o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_p\bpa\bas\bss\bs (piece_index_t);\n+ virtual void t\bti\bic\bck\bk ();\n+ virtual bool w\bwr\bri\bit\bte\be_\b_r\bre\beq\bqu\bue\bes\bst\bt (peer_request const&);\n+};\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- trackerid\n- the default tracker id to be used when announcing to trackers. By default\n- this is empty, and no tracker ID is used, since this is an optional\n- argument. If a tracker returns a tracker ID, that ID is used instead of\n- this.\n+*\b**\b**\b**\b**\b* t\bty\byp\bpe\be(\b()\b) *\b**\b**\b**\b**\b*\n+virtual string_view t\bty\byp\bpe\be () const;\n+This function is expected to return the name of the _\bp_\bl_\bu_\bg_\bi_\bn.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- flags\n- flags controlling aspects of this torrent and how it's added. See\n- _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bl_\ba_\bg_\bs_\b__\bt for details.\n- Note\n- The flags field is initialized with default flags by the constructor. In\n- order to preserve default behavior when clearing or setting other flags,\n- make sure to bitwise OR or in a flag or bitwise AND the inverse of a flag\n- to clear it.\n+*\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_h\bha\ban\bnd\bds\bsh\bha\bak\bke\be(\b()\b) *\b**\b**\b**\b**\b*\n+virtual void a\bad\bdd\bd_\b_h\bha\ban\bnd\bds\bsh\bha\bak\bke\be (entry&);\n+can add entries to the extension handshake this is not called for web seeds\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- info_hashes\n- set this to the info hash of the torrent to add in case the info-hash is\n- the only known property of the torrent. i.e. you don't have a .torrent\n- file nor a magnet link. To add a magnet link, use _\bp_\ba_\br_\bs_\be_\b__\bm_\ba_\bg_\bn_\be_\bt_\b__\bu_\br_\bi_\b(_\b) to\n- populate fields in the _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs object.\n+*\b**\b**\b**\b**\b* o\bon\bn_\b_d\bdi\bis\bsc\bco\bon\bnn\bne\bec\bct\bt(\b()\b) *\b**\b**\b**\b**\b*\n+virtual void o\bon\bn_\b_d\bdi\bis\bsc\bco\bon\bnn\bne\bec\bct\bt (error_code const&);\n+called when the peer is being disconnected.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- max_uploads max_connections\n- max_uploads, max_connections, upload_limit, download_limit correspond to\n- the set_max_uploads(), set_max_connections(), set_upload_limit() and\n- set_download_limit() functions on _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be. These values let you\n- initialize these settings when the torrent is added, instead of calling\n- these functions immediately following adding it.\n- -1 means unlimited on these settings just like their counterpart\n- functions on _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be\n- For fine grained control over rate limits, including making them apply to\n- local peers, see _\bp_\be_\be_\br_\b _\bc_\bl_\ba_\bs_\bs_\be_\bs.\n+*\b**\b**\b**\b**\b* o\bon\bn_\b_c\bco\bon\bnn\bne\bec\bct\bte\bed\bd(\b()\b) *\b**\b**\b**\b**\b*\n+virtual void o\bon\bn_\b_c\bco\bon\bnn\bne\bec\bct\bte\bed\bd ();\n+called when the peer is successfully connected. Note that incoming connections\n+will have been connected by the time the peer _\bp_\bl_\bu_\bg_\bi_\bn is attached to it, and\n+won't have this hook called.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- upload_limit download_limit\n- the upload and download rate limits for this torrent, specified in bytes\n- per second. -1 means unlimited.\n+*\b**\b**\b**\b**\b* o\bon\bn_\b_h\bha\ban\bnd\bds\bsh\bha\bak\bke\be(\b()\b) *\b**\b**\b**\b**\b*\n+virtual bool o\bon\bn_\b_h\bha\ban\bnd\bds\bsh\bha\bak\bke\be (span);\n+this is called when the initial bittorrent handshake is received. Returning\n+false means that the other end doesn't support this extension and will remove\n+it from the list of plugins. this is not called for web seeds\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- total_uploaded total_downloaded\n- the total number of bytes uploaded and downloaded by this torrent so far.\n+*\b**\b**\b**\b**\b* o\bon\bn_\b_e\bex\bxt\bte\ben\bns\bsi\bio\bon\bn_\b_h\bha\ban\bnd\bds\bsh\bha\bak\bke\be(\b()\b) *\b**\b**\b**\b**\b*\n+virtual bool o\bon\bn_\b_e\bex\bxt\bte\ben\bns\bsi\bio\bon\bn_\b_h\bha\ban\bnd\bds\bsh\bha\bak\bke\be (bdecode_node const&);\n+called when the extension handshake from the other end is received if this\n+returns false, it means that this extension isn't supported by this peer. It\n+will result in this _\bp_\be_\be_\br_\b__\bp_\bl_\bu_\bg_\bi_\bn being removed from the peer_connection and\n+destructed. this is not called for web seeds\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- active_time finished_time seeding_time\n- the number of seconds this torrent has spent in started, finished and\n- seeding state so far, respectively.\n+*\b**\b**\b**\b**\b* o\bon\bn_\b_b\bbi\bit\btf\bfi\bie\bel\bld\bd(\b()\b) o\bon\bn_\b_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd(\b()\b) o\bon\bn_\b_n\bno\bot\bt_\b_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd(\b()\b) o\bon\bn_\b_c\bch\bho\bok\bke\be(\b()\b) o\bon\bn_\b_h\bha\bav\bve\be_\b_n\bno\bon\bne\be\n+(\b()\b) o\bon\bn_\b_u\bun\bnc\bch\bho\bok\bke\be(\b()\b) o\bon\bn_\b_d\bdo\bon\bnt\bt_\b_h\bha\bav\bve\be(\b()\b) o\bon\bn_\b_h\bha\bav\bve\be_\b_a\bal\bll\bl(\b()\b) o\bon\bn_\b_a\bal\bll\blo\bow\bwe\bed\bd_\b_f\bfa\bas\bst\bt(\b()\b) o\bon\bn_\b_h\bha\bav\bve\be(\b()\b)\n+o\bon\bn_\b_r\bre\beq\bqu\bue\bes\bst\bt(\b()\b) *\b**\b**\b**\b**\b*\n+virtual bool o\bon\bn_\b_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd ();\n+virtual bool o\bon\bn_\b_n\bno\bot\bt_\b_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd ();\n+virtual bool o\bon\bn_\b_d\bdo\bon\bnt\bt_\b_h\bha\bav\bve\be (piece_index_t);\n+virtual bool o\bon\bn_\b_c\bch\bho\bok\bke\be ();\n+virtual bool o\bon\bn_\b_u\bun\bnc\bch\bho\bok\bke\be ();\n+virtual bool o\bon\bn_\b_h\bha\bav\bve\be (piece_index_t);\n+virtual bool o\bon\bn_\b_a\bal\bll\blo\bow\bwe\bed\bd_\b_f\bfa\bas\bst\bt (piece_index_t);\n+virtual bool o\bon\bn_\b_r\bre\beq\bqu\bue\bes\bst\bt (peer_request const&);\n+virtual bool o\bon\bn_\b_b\bbi\bit\btf\bfi\bie\bel\bld\bd (bitfield const& /\b/*\b*b\bbi\bit\btf\bfi\bie\bel\bld\bd*\b*/\b/);\n+virtual bool o\bon\bn_\b_h\bha\bav\bve\be_\b_n\bno\bon\bne\be ();\n+virtual bool o\bon\bn_\b_h\bha\bav\bve\be_\b_a\bal\bll\bl ();\n+returning true from any of the message handlers indicates that the _\bp_\bl_\bu_\bg_\bi_\bn has\n+handled the message. it will break the _\bp_\bl_\bu_\bg_\bi_\bn chain traversing and not let\n+anyone else handle the message, including the default handler.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- added_time completed_time\n- if set to a non-zero value, this is the posix time of when this torrent\n- was first added, including previous runs/sessions. If set to zero, the\n- internal added_time will be set to the time of when _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b) is\n- called.\n+*\b**\b**\b**\b**\b* o\bon\bn_\b_p\bpi\bie\bec\bce\be(\b()\b) *\b**\b**\b**\b**\b*\n+virtual bool o\bon\bn_\b_p\bpi\bie\bec\bce\be (peer_request const& /\b/*\b*p\bpi\bie\bec\bce\be*\b*/\b/\n+ , span /\b/*\b*b\bbu\buf\bf*\b*/\b/);\n+This function is called when the peer connection is receiving a piece. buf\n+points (non-owning pointer) to the data in an internal immutable disk buffer.\n+The length of the data is specified in the length member of the piece\n+parameter. returns true to indicate that the piece is handled and the rest of\n+the logic should be ignored.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- last_seen_complete\n- if set to non-zero, initializes the time (expressed in posix time) when\n- we last saw a seed or peers that together formed a complete copy of the\n- torrent. If left set to zero, the internal counterpart to this field will\n- be updated when we see a seed or a distributed copies >= 1.0.\n+*\b**\b**\b**\b**\b* s\bse\ben\bnt\bt_\b_h\bha\bav\bve\be(\b()\b) s\bse\ben\bnt\bt_\b_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd(\b()\b) s\bse\ben\bnt\bt_\b_p\bpi\bie\bec\bce\be(\b()\b) s\bse\ben\bnt\bt_\b_u\bun\bnc\bch\bho\bok\bke\be(\b()\b)\n+s\bse\ben\bnt\bt_\b_n\bno\bot\bt_\b_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd(\b()\b) *\b**\b**\b**\b**\b*\n+virtual void s\bse\ben\bnt\bt_\b_h\bha\bav\bve\be (piece_index_t);\n+virtual void s\bse\ben\bnt\bt_\b_u\bun\bnc\bch\bho\bok\bke\be ();\n+virtual void s\bse\ben\bnt\bt_\b_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd ();\n+virtual void s\bse\ben\bnt\bt_\b_p\bpi\bie\bec\bce\be (peer_request const&);\n+virtual void s\bse\ben\bnt\bt_\b_n\bno\bot\bt_\b_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd ();\n+called after a choke message has been sent to the peer\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- num_complete num_incomplete num_downloaded\n- these field can be used to initialize the torrent's cached scrape data.\n- The scrape data is high level metadata about the current state of the\n- swarm, as returned by the tracker (either when announcing to it or by\n- sending a specific scrape request). num_complete is the number of peers\n- in the swarm that are seeds, or have every piece in the torrent.\n- num_incomplete is the number of peers in the swarm that do not have every\n- piece. num_downloaded is the number of times the torrent has been\n- downloaded (not initiated, but the number of times a download has\n- completed).\n- Leaving any of these values set to -1 indicates we don't know, or we have\n- not received any scrape data.\n+*\b**\b**\b**\b**\b* s\bse\ben\bnt\bt_\b_p\bpa\bay\byl\blo\boa\bad\bd(\b()\b) *\b**\b**\b**\b**\b*\n+virtual void s\bse\ben\bnt\bt_\b_p\bpa\bay\byl\blo\boa\bad\bd (int /\b/*\b* b\bby\byt\bte\bes\bs *\b*/\b/);\n+called after piece data has been sent to the peer this can be used for stats\n+book keeping\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- http_seeds url_seeds\n- URLs can be added to these two lists to specify additional web seeds to\n- be used by the torrent. If the flag_override_web_seeds is set, these will\n- be the _only_ ones to be used. i.e. any web seeds found in the .torrent\n- file will be overridden.\n- http_seeds expects URLs to web servers implementing the original HTTP\n- seed specification _\bB_\bE_\bP_\b _\b1_\b7.\n- url_seeds expects URLs to regular web servers, aka \"get right\" style,\n- specified in _\bB_\bE_\bP_\b _\b1_\b9.\n+*\b**\b**\b**\b**\b* c\bca\ban\bn_\b_d\bdi\bis\bsc\bco\bon\bnn\bne\bec\bct\bt(\b()\b) *\b**\b**\b**\b**\b*\n+virtual bool c\bca\ban\bn_\b_d\bdi\bis\bsc\bco\bon\bnn\bne\bec\bct\bt (error_code const& /\b/*\b*e\bec\bc*\b*/\b/);\n+called when libtorrent think this peer should be disconnected. if the _\bp_\bl_\bu_\bg_\bi_\bn\n+returns false, the peer will not be disconnected.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- peers\n- peers to add to the torrent, to be tried to be connected to as bittorrent\n- peers.\n+*\b**\b**\b**\b**\b* o\bon\bn_\b_e\bex\bxt\bte\ben\bnd\bde\bed\bd(\b()\b) *\b**\b**\b**\b**\b*\n+virtual bool o\bon\bn_\b_e\bex\bxt\bte\ben\bnd\bde\bed\bd (int /\b/*\b*l\ble\ben\bng\bgt\bth\bh*\b*/\b/, int /\b/*\b*m\bms\bsg\bg*\b*/\b/,\n+ span /\b/*\b*b\bbo\bod\bdy\by*\b*/\b/);\n+called when an extended message is received. If returning true, the message is\n+not processed by any other _\bp_\bl_\bu_\bg_\bi_\bn and if false is returned the next _\bp_\bl_\bu_\bg_\bi_\bn in\n+the chain will receive it to be able to handle it. This is not called for web\n+seeds. thus function may be called more than once per incoming message, but\n+only the last of the calls will the body size equal the length. i.e. Every time\n+another fragment of the message is received, this function will be called,\n+until finally the whole message has been received. The purpose of this is to\n+allow early disconnects for invalid messages and for reporting progress of\n+receiving large messages.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- banned_peers\n- peers banned from this torrent. The will not be connected to\n+*\b**\b**\b**\b**\b* o\bon\bn_\b_u\bun\bnk\bkn\bno\bow\bwn\bn_\b_m\bme\bes\bss\bsa\bag\bge\be(\b()\b) *\b**\b**\b**\b**\b*\n+virtual bool o\bon\bn_\b_u\bun\bnk\bkn\bno\bow\bwn\bn_\b_m\bme\bes\bss\bsa\bag\bge\be (int /\b/*\b*l\ble\ben\bng\bgt\bth\bh*\b*/\b/, int /\b/*\b*m\bms\bsg\bg*\b*/\b/,\n+ span /\b/*\b*b\bbo\bod\bdy\by*\b*/\b/);\n+this is not called for web seeds\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- unfinished_pieces\n- this is a map of partially downloaded piece. The key is the piece index\n- and the value is a _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd where each bit represents a 16 kiB block. A\n- set bit means we have that block.\n+*\b**\b**\b**\b**\b* o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_f\bfa\bai\bil\ble\bed\bd(\b()\b) o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_p\bpa\bas\bss\bs(\b()\b) *\b**\b**\b**\b**\b*\n+virtual void o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_f\bfa\bai\bil\ble\bed\bd (piece_index_t);\n+virtual void o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_p\bpa\bas\bss\bs (piece_index_t);\n+called when a piece that this peer participated in either fails or passes the\n+hash_check\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- have_pieces\n- this is a _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd indicating which pieces we already have of this\n- torrent.\n+*\b**\b**\b**\b**\b* t\bti\bic\bck\bk(\b()\b) *\b**\b**\b**\b**\b*\n+virtual void t\bti\bic\bck\bk ();\n+called approximately once every second\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- verified_pieces\n- when in seed_mode, pieces with a set bit in this _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd have been\n- verified to be valid. Other pieces will be verified the first time a peer\n- requests it.\n+*\b**\b**\b**\b**\b* w\bwr\bri\bit\bte\be_\b_r\bre\beq\bqu\bue\bes\bst\bt(\b()\b) *\b**\b**\b**\b**\b*\n+virtual bool w\bwr\bri\bit\bte\be_\b_r\bre\beq\bqu\bue\bes\bst\bt (peer_request const&);\n+called each time a request message is to be sent. If true is returned, the\n+original request message won't be sent and no other _\bp_\bl_\bu_\bg_\bi_\bn will have this\n+function called.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- piece_priorities\n- this sets the priorities for each individual piece in the torrent. Each\n- element in the vector represent the piece with the same index. If you set\n- both file- and piece priorities, file priorities will take precedence.\n+*\b**\b**\b**\b**\b**\b* c\bcr\bry\byp\bpt\bto\bo_\b_p\bpl\blu\bug\bgi\bin\bn *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\bs_\b._\bh_\bp_\bp\"\n+struct crypto_plugin\n+{\n+ virtual void s\bse\bet\bt_\b_o\bou\but\btg\bgo\boi\bin\bng\bg_\b_k\bke\bey\by (span key) = 0;\n+ virtual void s\bse\bet\bt_\b_i\bin\bnc\bco\bom\bmi\bin\bng\bg_\b_k\bke\bey\by (span key) = 0;\n+ e\ben\bnc\bcr\bry\byp\bpt\bt (span> /\b/*\b*s\bse\ben\bnd\bd_\b_v\bve\bec\bc*\b*/\b/) = 0;\n+ virtual std::tuple d\bde\bec\bcr\bry\byp\bpt\bt (span> /\b/*\b*r\bre\bec\bce\bei\biv\bve\be_\b_v\bve\bec\bc*\b*/\b/\n+) = 0;\n+};\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- merkle_trees\n- v2 hashes, if known\n+*\b**\b**\b**\b**\b* d\bde\bec\bcr\bry\byp\bpt\bt(\b()\b) *\b**\b**\b**\b**\b*\n+virtual std::tuple d\bde\bec\bcr\bry\byp\bpt\bt (span> /\b/*\b*r\bre\bec\bce\bei\biv\bve\be_\b_v\bve\bec\bc*\b*/\b/) =\n+0;\n+decrypt the provided buffers. returns is a tuple representing the values\n+(consume, produce, packet_size)\n+consume is set to the number of bytes which should be trimmed from the head of\n+the buffers, default is 0\n+produce is set to the number of bytes of payload which are now ready to be sent\n+to the upper layer. default is the number of bytes passed in receive_vec\n+packet_size is set to the minimum number of bytes which must be read to advance\n+the next step of decryption. default is 0\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- merkle_tree_mask\n- if set, indicates which hashes are included in the corresponding vector\n- of merkle_trees. These bitmasks always cover the full tree, a cleared bit\n- means the hash is all zeros (i.e. not set) and set bit means the next\n- hash in the corresponding vector in merkle_trees is the hash for that\n- node. This is an optimization to avoid storing a lot of zeros.\n+*\b**\b**\b**\b**\b**\b* p\bpe\bee\ber\br_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn_\b_h\bha\ban\bnd\bdl\ble\be *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bp_\be_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b__\bh_\ba_\bn_\bd_\bl_\be_\b._\bh_\bp_\bp\"\n+the _\bp_\be_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b__\bh_\ba_\bn_\bd_\bl_\be class provides a handle to the internal peer\n+connection object, to be used by plugins. This is a low level interface that\n+may not be stable across libtorrent versions\n+struct peer_connection_handle\n+{\n+ explicit p\bpe\bee\ber\br_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn_\b_h\bha\ban\bnd\bdl\ble\be (std::weak_ptr impl);\n+ connection_type t\bty\byp\bpe\be () const;\n+ peer_plugin const* f\bfi\bin\bnd\bd_\b_p\bpl\blu\bug\bgi\bin\bn (string_view type) const;\n+ void a\bad\bdd\bd_\b_e\bex\bxt\bte\ben\bns\bsi\bio\bon\bn (std::shared_ptr);\n+ bool i\bis\bs_\b_s\bse\bee\bed\bd () const;\n+ bool u\bup\bpl\blo\boa\bad\bd_\b_o\bon\bnl\bly\by () const;\n+ bool h\bha\bas\bs_\b_p\bpi\bie\bec\bce\be (piece_index_t i) const;\n+ peer_id const& p\bpi\bid\bd () const;\n+ bool i\bis\bs_\b_c\bch\bho\bok\bke\bed\bd () const;\n+ bool i\bis\bs_\b_i\bin\bnt\bte\ber\bre\bes\bst\bti\bin\bng\bg () const;\n+ bool i\bis\bs_\b_p\bpe\bee\ber\br_\b_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd () const;\n+ bool h\bha\bas\bs_\b_p\bpe\bee\ber\br_\b_c\bch\bho\bok\bke\bed\bd () const;\n+ void c\bch\bho\bok\bke\be_\b_t\bth\bhi\bis\bs_\b_p\bpe\bee\ber\br ();\n+ void m\bma\bay\byb\bbe\be_\b_u\bun\bnc\bch\bho\bok\bke\be_\b_t\bth\bhi\bis\bs_\b_p\bpe\bee\ber\br ();\n+ void g\bge\bet\bt_\b_p\bpe\bee\ber\br_\b_i\bin\bnf\bfo\bo (peer_info& p) const;\n+ torrent_handle a\bas\bss\bso\boc\bci\bia\bat\bte\bed\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt () const;\n+ _\bt_\bc_\bp_\b:_\b:_\be_\bn_\bd_\bp_\bo_\bi_\bn_\bt l\blo\boc\bca\bal\bl_\b_e\ben\bnd\bdp\bpo\boi\bin\bnt\bt () const;\n+ _\bt_\bc_\bp_\b:_\b:_\be_\bn_\bd_\bp_\bo_\bi_\bn_\bt const& r\bre\bem\bmo\bot\bte\be () const;\n+ bool i\bis\bs_\b_o\bou\but\btg\bgo\boi\bin\bng\bg () const;\n+ bool i\bis\bs_\b_d\bdi\bis\bsc\bco\bon\bnn\bne\bec\bct\bti\bin\bng\bg () const;\n+ bool i\bis\bs_\b_c\bco\bon\bnn\bne\bec\bct\bti\bin\bng\bg () const;\n+ void d\bdi\bis\bsc\bco\bon\bnn\bne\bec\bct\bt (error_code const& ec, operation_t op\n+ , disconnect_severity_t = peer_connection_interface::normal);\n+ bool i\big\bgn\bno\bor\bre\be_\b_u\bun\bnc\bch\bho\bok\bke\be_\b_s\bsl\blo\bot\bts\bs () const;\n+ bool o\bon\bn_\b_l\blo\boc\bca\bal\bl_\b_n\bne\bet\btw\bwo\bor\brk\bk () const;\n+ bool f\bfa\bai\bil\ble\bed\bd () const;\n+ void p\bpe\bee\ber\br_\b_l\blo\bog\bg (peer_log_alert::direction_t direction\n+ , char const* event, char const* fmt = \"\", ...) const TORRENT_FORMAT\n+(4,5);\n+ bool s\bsh\bho\bou\bul\bld\bd_\b_l\blo\bog\bg (peer_log_alert::direction_t direction) const;\n+ bool c\bca\ban\bn_\b_d\bdi\bis\bsc\bco\bon\bnn\bne\bec\bct\bt (error_code const& ec) const;\n+ bool h\bha\bas\bs_\b_m\bme\bet\bta\bad\bda\bat\bta\ba () const;\n+ bool i\bin\bn_\b_h\bha\ban\bnd\bds\bsh\bha\bak\bke\be () const;\n+ void s\bse\ben\bnd\bd_\b_b\bbu\buf\bff\bfe\ber\br (char const* begin, int size);\n+ time_point t\bti\bim\bme\be_\b_o\bof\bf_\b_l\bla\bas\bst\bt_\b_u\bun\bnc\bch\bho\bok\bke\be () const;\n+ std::time_t l\bla\bas\bst\bt_\b_s\bse\bee\ben\bn_\b_c\bco\bom\bmp\bpl\ble\bet\bte\be () const;\n+ bool o\bop\bpe\ber\bra\bat\bto\bor\br<\b< (peer_connection_handle const& o) const;\n+ bool o\bop\bpe\ber\bra\bat\bto\bor\br!\b!=\b= (peer_connection_handle const& o) const;\n+ bool o\bop\bpe\ber\bra\bat\bto\bor\br=\b==\b= (peer_connection_handle const& o) const;\n+ std::shared_ptr n\bna\bat\bti\biv\bve\be_\b_h\bha\ban\bnd\bdl\ble\be () const;\n+};\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- verified_leaf_hashes\n- bit-fields indicating which v2 leaf hashes have been verified against the\n- root hash. If this vector is empty and merkle_trees is non-empty it\n- implies that all hashes in merkle_trees are verified.\n+*\b**\b**\b**\b**\b**\b* b\bbt\bt_\b_p\bpe\bee\ber\br_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn_\b_h\bha\ban\bnd\bdl\ble\be *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bp_\be_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b__\bh_\ba_\bn_\bd_\bl_\be_\b._\bh_\bp_\bp\"\n+The _\bb_\bt_\b__\bp_\be_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b__\bh_\ba_\bn_\bd_\bl_\be provides a handle to the internal bittorrent peer\n+connection object to plugins. It's low level and may not be a stable API across\n+libtorrent versions.\n+struct bt_peer_connection_handle : peer_connection_handle\n+{\n+ explicit b\bbt\bt_\b_p\bpe\bee\ber\br_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn_\b_h\bha\ban\bnd\bdl\ble\be (peer_connection_handle pc);\n+ bool s\bsu\bup\bpp\bpo\bor\brt\bt_\b_e\bex\bxt\bte\ben\bns\bsi\bio\bon\bns\bs () const;\n+ bool p\bpa\bac\bck\bke\bet\bt_\b_f\bfi\bin\bni\bis\bsh\bhe\bed\bd () const;\n+ bool s\bsu\bup\bpp\bpo\bor\brt\bts\bs_\b_e\ben\bnc\bcr\bry\byp\bpt\bti\bio\bon\bn () const;\n+ void s\bsw\bwi\bit\btc\bch\bh_\b_s\bse\ben\bnd\bd_\b_c\bcr\bry\byp\bpt\bto\bo (std::shared_ptr crypto);\n+ void s\bsw\bwi\bit\btc\bch\bh_\b_r\bre\bec\bcv\bv_\b_c\bcr\bry\byp\bpt\bto\bo (std::shared_ptr crypto);\n+ std::shared_ptr n\bna\bat\bti\biv\bve\be_\b_h\bha\ban\bnd\bdl\ble\be () const;\n+};\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- renamed_files\n- this is a map of file indices in the torrent and new filenames to be\n- applied before the torrent is added.\n+*\b**\b**\b**\b**\b**\b* c\bcr\bre\bea\bat\bte\be_\b_u\but\bt_\b_m\bme\bet\bta\bad\bda\bat\bta\ba_\b_p\bpl\blu\bug\bgi\bin\bn(\b()\b) *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\bs_\b/_\bu_\bt_\b__\bm_\be_\bt_\ba_\bd_\ba_\bt_\ba_\b._\bh_\bp_\bp\"\n+std::shared_ptr c\bcr\bre\bea\bat\bte\be_\b_u\but\bt_\b_m\bme\bet\bta\bad\bda\bat\bta\ba_\b_p\bpl\blu\bug\bgi\bin\bn (torrent_handle\n+const&, client_data_t);\n+constructor function for the ut_metadata extension. The ut_metadata extension\n+allows peers to request the .torrent file (or more specifically the info-\n+dictionary of the .torrent file) from each other. This is the main building\n+block in making magnet links work. This extension is enabled by default unless\n+explicitly disabled in the _\bs_\be_\bs_\bs_\bi_\bo_\bn constructor.\n+This can either be passed in the add_torrent_params::extensions field, or via\n+_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be_\b:_\b:_\ba_\bd_\bd_\b__\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\b(_\b).\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- last_download last_upload\n- the posix time of the last time payload was received or sent for this\n- torrent, respectively. A value of 0 means we don't know when we last\n- uploaded or downloaded, or we have never uploaded or downloaded any\n- payload for this torrent.\n+*\b**\b**\b**\b**\b**\b* c\bcr\bre\bea\bat\bte\be_\b_u\but\bt_\b_p\bpe\bex\bx_\b_p\bpl\blu\bug\bgi\bin\bn(\b()\b) *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\bs_\b/_\bu_\bt_\b__\bp_\be_\bx_\b._\bh_\bp_\bp\"\n+std::shared_ptr c\bcr\bre\bea\bat\bte\be_\b_u\but\bt_\b_p\bpe\bex\bx_\b_p\bpl\blu\bug\bgi\bin\bn (torrent_handle const&,\n+client_data_t);\n+constructor function for the ut_pex extension. The ut_pex extension allows\n+peers to gossip about their connections, allowing the swarm stay well connected\n+and peers aware of more peers in the swarm. This extension is enabled by\n+default unless explicitly disabled in the _\bs_\be_\bs_\bs_\bi_\bo_\bn constructor.\n+This can either be passed in the add_torrent_params::extensions field, or via\n+_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be_\b:_\b:_\ba_\bd_\bd_\b__\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\b(_\b).\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* c\bcr\bre\bea\bat\bte\be_\b_s\bsm\bma\bar\brt\bt_\b_b\bba\ban\bn_\b_p\bpl\blu\bug\bgi\bin\bn(\b()\b) *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\bs_\b/_\bs_\bm_\ba_\br_\bt_\b__\bb_\ba_\bn_\b._\bh_\bp_\bp\"\n+std::shared_ptr c\bcr\bre\bea\bat\bte\be_\b_s\bsm\bma\bar\brt\bt_\b_b\bba\ban\bn_\b_p\bpl\blu\bug\bgi\bin\bn (torrent_handle const&,\n+client_data_t);\n+constructor function for the smart ban extension. The extension keeps track of\n+the data peers have sent us for failing pieces and once the piece completes and\n+passes the hash check bans the peers that turned out to have sent corrupt data.\n+This function can either be passed in the add_torrent_params::extensions field,\n+or via _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be_\b:_\b:_\ba_\bd_\bd_\b__\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\b(_\b).\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* b\bbl\blo\boc\bck\bk_\b_i\bin\bnf\bfo\bo *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be_\b._\bh_\bp_\bp\"\n holds the state of a block in a piece. Who we requested it from and how far\n along we are at downloading it.\n struct block_info\n {\n- void s\bse\bet\bt_\b_p\bpe\bee\ber\br (tcp::endpoint const& ep);\n _\bt_\bc_\bp_\b:_\b:_\be_\bn_\bd_\bp_\bo_\bi_\bn_\bt p\bpe\bee\ber\br () const;\n+ void s\bse\bet\bt_\b_p\bpe\bee\ber\br (tcp::endpoint const& ep);\n \n enum block_state_t\n {\n none,\n requested,\n writing,\n finished,\n@@ -9980,17 +10416,17 @@\n \n unsigned bytes_progress:15;\n unsigned block_size:15;\n unsigned state:2;\n unsigned num_peers:14;\n };\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* s\bse\bet\bt_\b_p\bpe\bee\ber\br(\b()\b) p\bpe\bee\ber\br(\b()\b) *\b**\b**\b**\b**\b*\n-void s\bse\bet\bt_\b_p\bpe\bee\ber\br (tcp::endpoint const& ep);\n+*\b**\b**\b**\b**\b* p\bpe\bee\ber\br(\b()\b) s\bse\bet\bt_\b_p\bpe\bee\ber\br(\b()\b) *\b**\b**\b**\b**\b*\n _\bt_\bc_\bp_\b:_\b:_\be_\bn_\bd_\bp_\bo_\bi_\bn_\bt p\bpe\bee\ber\br () const;\n+void s\bse\bet\bt_\b_p\bpe\bee\ber\br (tcp::endpoint const& ep);\n The peer is the ip address of the peer this block was downloaded from.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* e\ben\bnu\bum\bm b\bbl\blo\boc\bck\bk_\b_s\bst\bta\bat\bte\be_\b_t\bt *\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be_\b._\bh_\bp_\bp\"\n _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n |_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |none |0 |This block has not been downloaded or requested form any |\n@@ -10078,117 +10514,117 @@\n the handle is no longer referring to a torrent. There is one exception _\bi_\bs_\b__\bv_\ba_\bl_\bi_\bd\n _\b(_\b) will never throw. Since the torrents are processed by a background thread,\n there is no guarantee that a handle will remain valid between two calls.\n struct torrent_handle\n {\n friend std::size_t h\bha\bas\bsh\bh_\b_v\bva\bal\blu\bue\be (torrent_handle const& th);\n t\bto\bor\brr\bre\ben\bnt\bt_\b_h\bha\ban\bnd\bdl\ble\be () noexcept = default;\n- void a\bad\bdd\bd_\b_p\bpi\bie\bec\bce\be (piece_index_t piece, char const* data, add_piece_flags_t\n-flags = {}) const;\n void a\bad\bdd\bd_\b_p\bpi\bie\bec\bce\be (piece_index_t piece, std::vector data,\n add_piece_flags_t flags = {}) const;\n+ void a\bad\bdd\bd_\b_p\bpi\bie\bec\bce\be (piece_index_t piece, char const* data, add_piece_flags_t\n+flags = {}) const;\n void r\bre\bea\bad\bd_\b_p\bpi\bie\bec\bce\be (piece_index_t piece) const;\n bool h\bha\bav\bve\be_\b_p\bpi\bie\bec\bce\be (piece_index_t piece) const;\n void p\bpo\bos\bst\bt_\b_p\bpe\bee\ber\br_\b_i\bin\bnf\bfo\bo () const;\n void g\bge\bet\bt_\b_p\bpe\bee\ber\br_\b_i\bin\bnf\bfo\bo (std::vector& v) const;\n- void p\bpo\bos\bst\bt_\b_s\bst\bta\bat\btu\bus\bs (status_flags_t flags = status_flags_t::all()) const;\n torrent_status s\bst\bta\bat\btu\bus\bs (status_flags_t flags = status_flags_t::all()) const;\n- void p\bpo\bos\bst\bt_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_q\bqu\bue\beu\bue\be () const;\n- void g\bge\bet\bt_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_q\bqu\bue\beu\bue\be (std::vector& queue) const;\n+ void p\bpo\bos\bst\bt_\b_s\bst\bta\bat\btu\bus\bs (status_flags_t flags = status_flags_t::all()) const;\n std::vector g\bge\bet\bt_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_q\bqu\bue\beu\bue\be () const;\n- void r\bre\bes\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_d\bde\bea\bad\bdl\bli\bin\bne\be (piece_index_t index) const;\n+ void g\bge\bet\bt_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_q\bqu\bue\beu\bue\be (std::vector& queue) const;\n+ void p\bpo\bos\bst\bt_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_q\bqu\bue\beu\bue\be () const;\n void s\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_d\bde\bea\bad\bdl\bli\bin\bne\be (piece_index_t index, int deadline, deadline_flags_t\n flags = {}) const;\n void c\bcl\ble\bea\bar\br_\b_p\bpi\bie\bec\bce\be_\b_d\bde\bea\bad\bdl\bli\bin\bne\bes\bs () const;\n- void p\bpo\bos\bst\bt_\b_f\bfi\bil\ble\be_\b_p\bpr\bro\bog\bgr\bre\bes\bss\bs (file_progress_flags_t flags) const;\n+ void r\bre\bes\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_d\bde\bea\bad\bdl\bli\bin\bne\be (piece_index_t index) const;\n std::vector f\bfi\bil\ble\be_\b_p\bpr\bro\bog\bgr\bre\bes\bss\bs (file_progress_flags_t flags = {})\n const;\n+ void p\bpo\bos\bst\bt_\b_f\bfi\bil\ble\be_\b_p\bpr\bro\bog\bgr\bre\bes\bss\bs (file_progress_flags_t flags) const;\n void f\bfi\bil\ble\be_\b_p\bpr\bro\bog\bgr\bre\bes\bss\bs (std::vector& progress,\n file_progress_flags_t flags = {}) const;\n std::vector f\bfi\bil\ble\be_\b_s\bst\bta\bat\btu\bus\bs () const;\n void c\bcl\ble\bea\bar\br_\b_e\ber\brr\bro\bor\br () const;\n void p\bpo\bos\bst\bt_\b_t\btr\bra\bac\bck\bke\ber\brs\bs () const;\n+ std::vector t\btr\bra\bac\bck\bke\ber\brs\bs () const;\n void a\bad\bdd\bd_\b_t\btr\bra\bac\bck\bke\ber\br (announce_entry const&) const;\n void r\bre\bep\bpl\bla\bac\bce\be_\b_t\btr\bra\bac\bck\bke\ber\brs\bs (std::vector const&) const;\n- std::vector t\btr\bra\bac\bck\bke\ber\brs\bs () const;\n std::set u\bur\brl\bl_\b_s\bse\bee\bed\bds\bs () const;\n void r\bre\bem\bmo\bov\bve\be_\b_u\bur\brl\bl_\b_s\bse\bee\bed\bd (std::string const& url) const;\n void a\bad\bdd\bd_\b_u\bur\brl\bl_\b_s\bse\bee\bed\bd (std::string const& url) const;\n- std::set h\bht\btt\btp\bp_\b_s\bse\bee\bed\bds\bs () const;\n void a\bad\bdd\bd_\b_h\bht\btt\btp\bp_\b_s\bse\bee\bed\bd (std::string const& url) const;\n void r\bre\bem\bmo\bov\bve\be_\b_h\bht\btt\btp\bp_\b_s\bse\bee\bed\bd (std::string const& url) const;\n+ std::set h\bht\btt\btp\bp_\b_s\bse\bee\bed\bds\bs () const;\n void a\bad\bdd\bd_\b_e\bex\bxt\bte\ben\bns\bsi\bio\bon\bn (\n std::function(torrent_handle const&,\n client_data_t)> const& ext\n , client_data_t userdata = client_data_t{});\n bool s\bse\bet\bt_\b_m\bme\bet\bta\bad\bda\bat\bta\ba (span metadata) const;\n bool i\bis\bs_\b_v\bva\bal\bli\bid\bd () const;\n void r\bre\bes\bsu\bum\bme\be () const;\n void p\bpa\bau\bus\bse\be (pause_flags_t flags = {}) const;\n- void s\bse\bet\bt_\b_f\bfl\bla\bag\bgs\bs (torrent_flags_t flags, torrent_flags_t mask) const;\n torrent_flags_t f\bfl\bla\bag\bgs\bs () const;\n- void s\bse\bet\bt_\b_f\bfl\bla\bag\bgs\bs (torrent_flags_t flags) const;\n void u\bun\bns\bse\bet\bt_\b_f\bfl\bla\bag\bgs\bs (torrent_flags_t flags) const;\n+ void s\bse\bet\bt_\b_f\bfl\bla\bag\bgs\bs (torrent_flags_t flags) const;\n+ void s\bse\bet\bt_\b_f\bfl\bla\bag\bgs\bs (torrent_flags_t flags, torrent_flags_t mask) const;\n void f\bfl\blu\bus\bsh\bh_\b_c\bca\bac\bch\bhe\be () const;\n void f\bfo\bor\brc\bce\be_\b_r\bre\bec\bch\bhe\bec\bck\bk () const;\n void s\bsa\bav\bve\be_\b_r\bre\bes\bsu\bum\bme\be_\b_d\bda\bat\bta\ba (resume_data_flags_t flags = {}) const;\n bool n\bne\bee\bed\bd_\b_s\bsa\bav\bve\be_\b_r\bre\bes\bsu\bum\bme\be_\b_d\bda\bat\bta\ba (resume_data_flags_t flags) const;\n bool n\bne\bee\bed\bd_\b_s\bsa\bav\bve\be_\b_r\bre\bes\bsu\bum\bme\be_\b_d\bda\bat\bta\ba () const;\n void q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn_\b_u\bup\bp () const;\n+ queue_position_t q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn () const;\n void q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn_\b_d\bdo\bow\bwn\bn () const;\n void q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn_\b_b\bbo\bot\btt\bto\bom\bm () const;\n- queue_position_t q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn () const;\n void q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn_\b_t\bto\bop\bp () const;\n void q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn_\b_s\bse\bet\bt (queue_position_t p) const;\n void s\bse\bet\bt_\b_s\bss\bsl\bl_\b_c\bce\ber\brt\bti\bif\bfi\bic\bca\bat\bte\be (std::string const& certificate\n , std::string const& private_key\n , std::string const& dh_params\n , std::string const& passphrase = \"\");\n void s\bse\bet\bt_\b_s\bss\bsl\bl_\b_c\bce\ber\brt\bti\bif\bfi\bic\bca\bat\bte\be_\b_b\bbu\buf\bff\bfe\ber\br (std::string const& certificate\n , std::string const& private_key\n , std::string const& dh_params);\n- std::shared_ptr t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be () const;\n std::shared_ptr t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be_\b_w\bwi\bit\bth\bh_\b_h\bha\bas\bsh\bhe\bes\bs () const;\n+ std::shared_ptr t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be () const;\n std::vector> p\bpi\bie\bec\bce\be_\b_l\bla\bay\bye\ber\brs\bs () const;\n- void p\bpi\bie\bec\bce\be_\b_a\bav\bva\bai\bil\bla\bab\bbi\bil\bli\bit\bty\by (std::vector& avail) const;\n void p\bpo\bos\bst\bt_\b_p\bpi\bie\bec\bce\be_\b_a\bav\bva\bai\bil\bla\bab\bbi\bil\bli\bit\bty\by () const;\n+ void p\bpi\bie\bec\bce\be_\b_a\bav\bva\bai\bil\bla\bab\bbi\bil\bli\bit\bty\by (std::vector& avail) const;\n+ std::vector g\bge\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_p\bpr\bri\bio\bor\bri\bit\bti\bie\bes\bs () const;\n void p\bpr\bri\bio\bor\bri\bit\bti\biz\bze\be_\b_p\bpi\bie\bec\bce\bes\bs (std::vector const& pieces)\n const;\n+ void p\bpr\bri\bio\bor\bri\bit\bti\biz\bze\be_\b_p\bpi\bie\bec\bce\bes\bs (std::vector> const& pieces) const;\n download_priority_t p\bpi\bie\bec\bce\be_\b_p\bpr\bri\bio\bor\bri\bit\bty\by (piece_index_t index) const;\n- std::vector g\bge\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_p\bpr\bri\bio\bor\bri\bit\bti\bie\bes\bs () const;\n void p\bpi\bie\bec\bce\be_\b_p\bpr\bri\bio\bor\bri\bit\bty\by (piece_index_t index, download_priority_t priority)\n const;\n- void p\bpr\bri\bio\bor\bri\bit\bti\biz\bze\be_\b_p\bpi\bie\bec\bce\bes\bs (std::vector> const& pieces) const;\n std::vector g\bge\bet\bt_\b_f\bfi\bil\ble\be_\b_p\bpr\bri\bio\bor\bri\bit\bti\bie\bes\bs () const;\n- void p\bpr\bri\bio\bor\bri\bit\bti\biz\bze\be_\b_f\bfi\bil\ble\bes\bs (std::vector const& files) const;\n void f\bfi\bil\ble\be_\b_p\bpr\bri\bio\bor\bri\bit\bty\by (file_index_t index, download_priority_t priority) const;\n+ void p\bpr\bri\bio\bor\bri\bit\bti\biz\bze\be_\b_f\bfi\bil\ble\bes\bs (std::vector const& files) const;\n download_priority_t f\bfi\bil\ble\be_\b_p\bpr\bri\bio\bor\bri\bit\bty\by (file_index_t index) const;\n void f\bfo\bor\brc\bce\be_\b_l\bls\bsd\bd_\b_a\ban\bnn\bno\bou\bun\bnc\bce\be () const;\n void f\bfo\bor\brc\bce\be_\b_d\bdh\bht\bt_\b_a\ban\bnn\bno\bou\bun\bnc\bce\be () const;\n void f\bfo\bor\brc\bce\be_\b_r\bre\bea\ban\bnn\bno\bou\bun\bnc\bce\be (int seconds = 0, int idx = -1, reannounce_flags_t =\n {}) const;\n void s\bsc\bcr\bra\bap\bpe\be_\b_t\btr\bra\bac\bck\bke\ber\br (int idx = -1) const;\n- void s\bse\bet\bt_\b_u\bup\bpl\blo\boa\bad\bd_\b_l\bli\bim\bmi\bit\bt (int limit) const;\n int u\bup\bpl\blo\boa\bad\bd_\b_l\bli\bim\bmi\bit\bt () const;\n int d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_l\bli\bim\bmi\bit\bt () const;\n void s\bse\bet\bt_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_l\bli\bim\bmi\bit\bt (int limit) const;\n+ void s\bse\bet\bt_\b_u\bup\bpl\blo\boa\bad\bd_\b_l\bli\bim\bmi\bit\bt (int limit) const;\n void c\bco\bon\bnn\bne\bec\bct\bt_\b_p\bpe\bee\ber\br (tcp::endpoint const& adr, peer_source_flags_t source = {}\n , pex_flags_t flags = pex_encryption | pex_utp | pex_holepunch) const;\n void c\bcl\ble\bea\bar\br_\b_p\bpe\bee\ber\brs\bs ();\n- int m\bma\bax\bx_\b_u\bup\bpl\blo\boa\bad\bds\bs () const;\n void s\bse\bet\bt_\b_m\bma\bax\bx_\b_u\bup\bpl\blo\boa\bad\bds\bs (int max_uploads) const;\n- void s\bse\bet\bt_\b_m\bma\bax\bx_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bns\bs (int max_connections) const;\n+ int m\bma\bax\bx_\b_u\bup\bpl\blo\boa\bad\bds\bs () const;\n int m\bma\bax\bx_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bns\bs () const;\n+ void s\bse\bet\bt_\b_m\bma\bax\bx_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bns\bs (int max_connections) const;\n void m\bmo\bov\bve\be_\b_s\bst\bto\bor\bra\bag\bge\be (std::string const& save_path\n , move_flags_t flags = move_flags_t::always_replace_files\n ) const;\n void r\bre\ben\bna\bam\bme\be_\b_f\bfi\bil\ble\be (file_index_t index, std::string const& new_name) const;\n- sha1_hash i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh () const;\n info_hash_t i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bhe\bes\bs () const;\n+ sha1_hash i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh () const;\n bool o\bop\bpe\ber\bra\bat\bto\bor\br!\b!=\b= (const torrent_handle& h) const;\n bool o\bop\bpe\ber\bra\bat\bto\bor\br<\b< (const torrent_handle& h) const;\n bool o\bop\bpe\ber\bra\bat\bto\bor\br=\b==\b= (const torrent_handle& h) const;\n std::uint32_t i\bid\bd () const;\n std::shared_ptr n\bna\bat\bti\biv\bve\be_\b_h\bha\ban\bnd\bdl\ble\be () const;\n client_data_t u\bus\bse\ber\brd\bda\bat\bta\ba () const;\n bool i\bin\bn_\b_s\bse\bes\bss\bsi\bio\bon\bn () const;\n@@ -10218,18 +10654,18 @@\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* t\bto\bor\brr\bre\ben\bnt\bt_\b_h\bha\ban\bnd\bdl\ble\be(\b()\b) *\b**\b**\b**\b**\b*\n t\bto\bor\brr\bre\ben\bnt\bt_\b_h\bha\ban\bnd\bdl\ble\be () noexcept = default;\n constructs a torrent handle that does not refer to a torrent. i.e. _\bi_\bs_\b__\bv_\ba_\bl_\bi_\bd_\b(_\b)\n will return false.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_p\bpi\bie\bec\bce\be(\b()\b) *\b**\b**\b**\b**\b*\n-void a\bad\bdd\bd_\b_p\bpi\bie\bec\bce\be (piece_index_t piece, char const* data, add_piece_flags_t flags\n-= {}) const;\n void a\bad\bdd\bd_\b_p\bpi\bie\bec\bce\be (piece_index_t piece, std::vector data, add_piece_flags_t\n flags = {}) const;\n+void a\bad\bdd\bd_\b_p\bpi\bie\bec\bce\be (piece_index_t piece, char const* data, add_piece_flags_t flags\n+= {}) const;\n This function will write data to the storage as piece piece, as if it had been\n downloaded from a peer.\n By default, data that's already been downloaded is not overwritten by this\n buffer. If you trust this data to be correct (and pass the piece hash check)\n you may pass the overwrite_existing flag. This will instruct libtorrent to\n overwrite any data that may already have been downloaded with this data.\n Since the data is written asynchronously, you may know that is passed or failed\n@@ -10257,30 +10693,30 @@\n to finish in the same order as you initiated them.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* h\bha\bav\bve\be_\b_p\bpi\bie\bec\bce\be(\b()\b) *\b**\b**\b**\b**\b*\n bool h\bha\bav\bve\be_\b_p\bpi\bie\bec\bce\be (piece_index_t piece) const;\n Returns true if this piece has been completely downloaded and written to disk,\n and false otherwise.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* g\bge\bet\bt_\b_p\bpe\bee\ber\br_\b_i\bin\bnf\bfo\bo(\b()\b) p\bpo\bos\bst\bt_\b_p\bpe\bee\ber\br_\b_i\bin\bnf\bfo\bo(\b()\b) *\b**\b**\b**\b**\b*\n+*\b**\b**\b**\b**\b* p\bpo\bos\bst\bt_\b_p\bpe\bee\ber\br_\b_i\bin\bnf\bfo\bo(\b()\b) g\bge\bet\bt_\b_p\bpe\bee\ber\br_\b_i\bin\bnf\bfo\bo(\b()\b) *\b**\b**\b**\b**\b*\n void p\bpo\bos\bst\bt_\b_p\bpe\bee\ber\br_\b_i\bin\bnf\bfo\bo () const;\n void g\bge\bet\bt_\b_p\bpe\bee\ber\br_\b_i\bin\bnf\bfo\bo (std::vector& v) const;\n Query information about connected peers for this torrent. If the _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be\n is invalid, it will throw a system_error exception.\n post_peer_info() is asynchronous and will trigger the posting of a\n _\bp_\be_\be_\br_\b__\bi_\bn_\bf_\bo_\b__\ba_\bl_\be_\br_\bt. The _\ba_\bl_\be_\br_\bt contain a list of _\bp_\be_\be_\br_\b__\bi_\bn_\bf_\bo objects, one for each\n connected peer.\n get_peer_info() is synchronous and takes a reference to a vector that will be\n cleared and filled with one _\be_\bn_\bt_\br_\by for each peer connected to this torrent,\n given the handle is valid. Each _\be_\bn_\bt_\br_\by in the vector contains information about\n that particular peer. See _\bp_\be_\be_\br_\b__\bi_\bn_\bf_\bo.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* p\bpo\bos\bst\bt_\b_s\bst\bta\bat\btu\bus\bs(\b()\b) s\bst\bta\bat\btu\bus\bs(\b()\b) *\b**\b**\b**\b**\b*\n-void p\bpo\bos\bst\bt_\b_s\bst\bta\bat\btu\bus\bs (status_flags_t flags = status_flags_t::all()) const;\n+*\b**\b**\b**\b**\b* s\bst\bta\bat\btu\bus\bs(\b()\b) p\bpo\bos\bst\bt_\b_s\bst\bta\bat\btu\bus\bs(\b()\b) *\b**\b**\b**\b**\b*\n torrent_status s\bst\bta\bat\btu\bus\bs (status_flags_t flags = status_flags_t::all()) const;\n+void p\bpo\bos\bst\bt_\b_s\bst\bta\bat\btu\bus\bs (status_flags_t flags = status_flags_t::all()) const;\n status() will return a structure with information about the status of this\n torrent. If the _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be is invalid, it will throw system_error\n exception. See _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bs_\bt_\ba_\bt_\bu_\bs. The flags argument filters what information is\n returned in the _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bs_\bt_\ba_\bt_\bu_\bs. Some information in there is relatively\n expensive to calculate, and if you're not interested in it (and see performance\n issues), you can filter them out.\n The status() function will block until the internal libtorrent thread responds\n@@ -10288,29 +10724,29 @@\n It will trigger posting of a _\bs_\bt_\ba_\bt_\be_\b__\bu_\bp_\bd_\ba_\bt_\be_\b__\ba_\bl_\be_\br_\bt with a single _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bs_\bt_\ba_\bt_\bu_\bs\n object for this torrent.\n In order to get regular updates for torrents whose status changes, consider\n calling session::post_torrent_updates()`` instead.\n By default everything is included. The flags you can use to decide what to\n i\bin\bnc\bcl\blu\bud\bde\be are defined in this class.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* g\bge\bet\bt_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_q\bqu\bue\beu\bue\be(\b()\b) p\bpo\bos\bst\bt_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_q\bqu\bue\beu\bue\be(\b()\b) *\b**\b**\b**\b**\b*\n-void p\bpo\bos\bst\bt_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_q\bqu\bue\beu\bue\be () const;\n-void g\bge\bet\bt_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_q\bqu\bue\beu\bue\be (std::vector& queue) const;\n+*\b**\b**\b**\b**\b* p\bpo\bos\bst\bt_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_q\bqu\bue\beu\bue\be(\b()\b) g\bge\bet\bt_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_q\bqu\bue\beu\bue\be(\b()\b) *\b**\b**\b**\b**\b*\n std::vector g\bge\bet\bt_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_q\bqu\bue\beu\bue\be () const;\n+void g\bge\bet\bt_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_q\bqu\bue\beu\bue\be (std::vector& queue) const;\n+void p\bpo\bos\bst\bt_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_q\bqu\bue\beu\bue\be () const;\n post_download_queue() triggers a download_queue_alert to be posted.\n get_download_queue() is a synchronous call and returns a vector with\n information about pieces that are partially downloaded or not downloaded but\n partially requested. See _\bp_\ba_\br_\bt_\bi_\ba_\bl_\b__\bp_\bi_\be_\bc_\be_\b__\bi_\bn_\bf_\bo for the fields in the returned\n vector.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* s\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_d\bde\bea\bad\bdl\bli\bin\bne\be(\b()\b) c\bcl\ble\bea\bar\br_\b_p\bpi\bie\bec\bce\be_\b_d\bde\bea\bad\bdl\bli\bin\bne\bes\bs(\b()\b) r\bre\bes\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_d\bde\bea\bad\bdl\bli\bin\bne\be(\b()\b) *\b**\b**\b**\b**\b*\n-void r\bre\bes\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_d\bde\bea\bad\bdl\bli\bin\bne\be (piece_index_t index) const;\n+*\b**\b**\b**\b**\b* s\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_d\bde\bea\bad\bdl\bli\bin\bne\be(\b()\b) r\bre\bes\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_d\bde\bea\bad\bdl\bli\bin\bne\be(\b()\b) c\bcl\ble\bea\bar\br_\b_p\bpi\bie\bec\bce\be_\b_d\bde\bea\bad\bdl\bli\bin\bne\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n void s\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_d\bde\bea\bad\bdl\bli\bin\bne\be (piece_index_t index, int deadline, deadline_flags_t\n flags = {}) const;\n void c\bcl\ble\bea\bar\br_\b_p\bpi\bie\bec\bce\be_\b_d\bde\bea\bad\bdl\bli\bin\bne\bes\bs () const;\n+void r\bre\bes\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_d\bde\bea\bad\bdl\bli\bin\bne\be (piece_index_t index) const;\n This function sets or resets the deadline associated with a specific piece\n index (index). libtorrent will attempt to download this entire piece before the\n deadline expires. This is not necessarily possible, but pieces with a more\n recent deadline will always be prioritized over pieces with a deadline further\n ahead in time. The deadline (and flags) of a piece can be changed by calling\n this function again.\n If the piece is already downloaded when this call is made, nothing happens,\n@@ -10318,18 +10754,18 @@\n same effect as calling _\br_\be_\ba_\bd_\b__\bp_\bi_\be_\bc_\be_\b(_\b) for index.\n deadline is the number of milliseconds until this piece should be completed.\n reset_piece_deadline removes the deadline from the piece. If it hasn't already\n been downloaded, it will no longer be considered a priority.\n clear_piece_deadlines() removes deadlines on all pieces in the torrent. As if\n _\br_\be_\bs_\be_\bt_\b__\bp_\bi_\be_\bc_\be_\b__\bd_\be_\ba_\bd_\bl_\bi_\bn_\be_\b(_\b) was called on all pieces.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* p\bpo\bos\bst\bt_\b_f\bfi\bil\ble\be_\b_p\bpr\bro\bog\bgr\bre\bes\bss\bs(\b()\b) f\bfi\bil\ble\be_\b_p\bpr\bro\bog\bgr\bre\bes\bss\bs(\b()\b) *\b**\b**\b**\b**\b*\n-void p\bpo\bos\bst\bt_\b_f\bfi\bil\ble\be_\b_p\bpr\bro\bog\bgr\bre\bes\bss\bs (file_progress_flags_t flags) const;\n+*\b**\b**\b**\b**\b* f\bfi\bil\ble\be_\b_p\bpr\bro\bog\bgr\bre\bes\bss\bs(\b()\b) p\bpo\bos\bst\bt_\b_f\bfi\bil\ble\be_\b_p\bpr\bro\bog\bgr\bre\bes\bss\bs(\b()\b) *\b**\b**\b**\b**\b*\n std::vector f\bfi\bil\ble\be_\b_p\bpr\bro\bog\bgr\bre\bes\bss\bs (file_progress_flags_t flags = {})\n const;\n+void p\bpo\bos\bst\bt_\b_f\bfi\bil\ble\be_\b_p\bpr\bro\bog\bgr\bre\bes\bss\bs (file_progress_flags_t flags) const;\n void f\bfi\bil\ble\be_\b_p\bpr\bro\bog\bgr\bre\bes\bss\bs (std::vector& progress, file_progress_flags_t\n flags = {}) const;\n This function fills in the supplied vector, or returns a vector, with the\n number of bytes downloaded of each file in this torrent. The progress values\n are ordered the same as the files in the _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo.\n This operation is not very cheap. Its complexity is O\bO(\b(n\bn +\b+ m\bmj\bj)\b). Where n\bn is the\n number of files, m\bm is the number of currently downloading pieces and j\bj is the\n@@ -10352,19 +10788,19 @@\n See _\bo_\bp_\be_\bn_\b__\bf_\bi_\bl_\be_\b__\bs_\bt_\ba_\bt_\be\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* c\bcl\ble\bea\bar\br_\b_e\ber\brr\bro\bor\br(\b()\b) *\b**\b**\b**\b**\b*\n void c\bcl\ble\bea\bar\br_\b_e\ber\brr\bro\bor\br () const;\n If the torrent is in an error state (i.e. torrent_status::error is non-empty),\n this will clear the error and start the torrent again.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* p\bpo\bos\bst\bt_\b_t\btr\bra\bac\bck\bke\ber\brs\bs(\b()\b) a\bad\bdd\bd_\b_t\btr\bra\bac\bck\bke\ber\br(\b()\b) r\bre\bep\bpl\bla\bac\bce\be_\b_t\btr\bra\bac\bck\bke\ber\brs\bs(\b()\b) t\btr\bra\bac\bck\bke\ber\brs\bs(\b()\b) *\b**\b**\b**\b**\b*\n+*\b**\b**\b**\b**\b* p\bpo\bos\bst\bt_\b_t\btr\bra\bac\bck\bke\ber\brs\bs(\b()\b) r\bre\bep\bpl\bla\bac\bce\be_\b_t\btr\bra\bac\bck\bke\ber\brs\bs(\b()\b) t\btr\bra\bac\bck\bke\ber\brs\bs(\b()\b) a\bad\bdd\bd_\b_t\btr\bra\bac\bck\bke\ber\br(\b()\b) *\b**\b**\b**\b**\b*\n void p\bpo\bos\bst\bt_\b_t\btr\bra\bac\bck\bke\ber\brs\bs () const;\n+std::vector t\btr\bra\bac\bck\bke\ber\brs\bs () const;\n void a\bad\bdd\bd_\b_t\btr\bra\bac\bck\bke\ber\br (announce_entry const&) const;\n void r\bre\bep\bpl\bla\bac\bce\be_\b_t\btr\bra\bac\bck\bke\ber\brs\bs (std::vector const&) const;\n-std::vector t\btr\bra\bac\bck\bke\ber\brs\bs () const;\n trackers() returns the list of trackers for this torrent. The announce _\be_\bn_\bt_\br_\by\n contains both a string url which specify the announce url for the tracker as\n well as an _\bi_\bn_\bt tier, which is specifies the order in which this tracker is\n tried. If you want libtorrent to use another list of trackers for this torrent,\n you can use replace_trackers() which takes a list of the same form as the one\n returned from trackers() and will replace it. If you want an immediate effect,\n you have to call _\bf_\bo_\br_\bc_\be_\b__\br_\be_\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b(_\b). See _\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\be_\bn_\bt_\br_\by.\n@@ -10373,30 +10809,30 @@\n add_tracker() will look if the specified tracker is already in the set. If it\n is, it doesn't do anything. If it's not in the current set of trackers, it will\n insert it in the tier specified in the _\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\be_\bn_\bt_\br_\by.\n The updated set of trackers will be saved in the resume data, and when a\n torrent is started with resume data, the trackers from the resume data will\n replace the original ones.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_u\bur\brl\bl_\b_s\bse\bee\bed\bd(\b()\b) u\bur\brl\bl_\b_s\bse\bee\bed\bds\bs(\b()\b) r\bre\bem\bmo\bov\bve\be_\b_u\bur\brl\bl_\b_s\bse\bee\bed\bd(\b()\b) *\b**\b**\b**\b**\b*\n+*\b**\b**\b**\b**\b* u\bur\brl\bl_\b_s\bse\bee\bed\bds\bs(\b()\b) r\bre\bem\bmo\bov\bve\be_\b_u\bur\brl\bl_\b_s\bse\bee\bed\bd(\b()\b) a\bad\bdd\bd_\b_u\bur\brl\bl_\b_s\bse\bee\bed\bd(\b()\b) *\b**\b**\b**\b**\b*\n std::set u\bur\brl\bl_\b_s\bse\bee\bed\bds\bs () const;\n void r\bre\bem\bmo\bov\bve\be_\b_u\bur\brl\bl_\b_s\bse\bee\bed\bd (std::string const& url) const;\n void a\bad\bdd\bd_\b_u\bur\brl\bl_\b_s\bse\bee\bed\bd (std::string const& url) const;\n add_url_seed() adds another url to the torrent's list of url seeds. If the\n given url already exists in that list, the call has no effect. The torrent will\n connect to the server and try to download pieces from it, unless it's paused,\n queued, checking or seeding. remove_url_seed() removes the given url if it\n exists already. url_seeds() return a set of the url seeds currently in this\n torrent. Note that URLs that fails may be removed automatically from the list.\n See _\bh_\bt_\bt_\bp_\b _\bs_\be_\be_\bd_\bi_\bn_\bg for more information.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* h\bht\btt\btp\bp_\b_s\bse\bee\bed\bds\bs(\b()\b) a\bad\bdd\bd_\b_h\bht\btt\btp\bp_\b_s\bse\bee\bed\bd(\b()\b) r\bre\bem\bmo\bov\bve\be_\b_h\bht\btt\btp\bp_\b_s\bse\bee\bed\bd(\b()\b) *\b**\b**\b**\b**\b*\n-std::set h\bht\btt\btp\bp_\b_s\bse\bee\bed\bds\bs () const;\n+*\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_h\bht\btt\btp\bp_\b_s\bse\bee\bed\bd(\b()\b) h\bht\btt\btp\bp_\b_s\bse\bee\bed\bds\bs(\b()\b) r\bre\bem\bmo\bov\bve\be_\b_h\bht\btt\btp\bp_\b_s\bse\bee\bed\bd(\b()\b) *\b**\b**\b**\b**\b*\n void a\bad\bdd\bd_\b_h\bht\btt\btp\bp_\b_s\bse\bee\bed\bd (std::string const& url) const;\n void r\bre\bem\bmo\bov\bve\be_\b_h\bht\btt\btp\bp_\b_s\bse\bee\bed\bd (std::string const& url) const;\n+std::set h\bht\btt\btp\bp_\b_s\bse\bee\bed\bds\bs () const;\n These functions are identical as the *_url_seed() variants, but they operate on\n _\bB_\bE_\bP_\b _\b1_\b7 web seeds instead of _\bB_\bE_\bP_\b _\b1_\b9.\n See _\bh_\bt_\bt_\bp_\b _\bs_\be_\be_\bd_\bi_\bn_\bg for more information.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_e\bex\bxt\bte\ben\bns\bsi\bio\bon\bn(\b()\b) *\b**\b**\b**\b**\b*\n void a\bad\bdd\bd_\b_e\bex\bxt\bte\ben\bns\bsi\bio\bon\bn (\n std::function(torrent_handle const&,\n@@ -10427,15 +10863,15 @@\n and false afterward.\n Clients should only use _\bi_\bs_\b__\bv_\ba_\bl_\bi_\bd_\b(_\b) to determine if the result of session::\n find_torrent() was successful.\n Unlike other member functions which return a value, _\bi_\bs_\b__\bv_\ba_\bl_\bi_\bd_\b(_\b) completes\n immediately, without blocking on a result from the network thread. Also unlike\n other functions, it never throws the system_error exception.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* r\bre\bes\bsu\bum\bme\be(\b()\b) p\bpa\bau\bus\bse\be(\b()\b) *\b**\b**\b**\b**\b*\n+*\b**\b**\b**\b**\b* p\bpa\bau\bus\bse\be(\b()\b) r\bre\bes\bsu\bum\bme\be(\b()\b) *\b**\b**\b**\b**\b*\n void r\bre\bes\bsu\bum\bme\be () const;\n void p\bpa\bau\bus\bse\be (pause_flags_t flags = {}) const;\n pause(), and resume() will disconnect all peers and reconnect all peers\n respectively. When a torrent is paused, it will however remember all share\n ratios to all peers and remember all potential (not connected) peers. Torrents\n may be paused automatically if there is a file error (e.g. disk full) or\n something similar. See _\bf_\bi_\bl_\be_\b__\be_\br_\br_\bo_\br_\b__\ba_\bl_\be_\br_\bt.\n@@ -10444,19 +10880,19 @@\n for the torrent_status::paused flag.\n Note\n Torrents that are auto-managed may be automatically resumed again. It does not\n make sense to pause an auto-managed torrent without making it not auto-managed\n first. Torrents are auto-managed by default when added to the _\bs_\be_\bs_\bs_\bi_\bo_\bn. For more\n information, see _\bq_\bu_\be_\bu_\bi_\bn_\bg.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* f\bfl\bla\bag\bgs\bs(\b()\b) u\bun\bns\bse\bet\bt_\b_f\bfl\bla\bag\bgs\bs(\b()\b) s\bse\bet\bt_\b_f\bfl\bla\bag\bgs\bs(\b()\b) *\b**\b**\b**\b**\b*\n-void s\bse\bet\bt_\b_f\bfl\bla\bag\bgs\bs (torrent_flags_t flags, torrent_flags_t mask) const;\n+*\b**\b**\b**\b**\b* u\bun\bns\bse\bet\bt_\b_f\bfl\bla\bag\bgs\bs(\b()\b) s\bse\bet\bt_\b_f\bfl\bla\bag\bgs\bs(\b()\b) f\bfl\bla\bag\bgs\bs(\b()\b) *\b**\b**\b**\b**\b*\n torrent_flags_t f\bfl\bla\bag\bgs\bs () const;\n-void s\bse\bet\bt_\b_f\bfl\bla\bag\bgs\bs (torrent_flags_t flags) const;\n void u\bun\bns\bse\bet\bt_\b_f\bfl\bla\bag\bgs\bs (torrent_flags_t flags) const;\n+void s\bse\bet\bt_\b_f\bfl\bla\bag\bgs\bs (torrent_flags_t flags) const;\n+void s\bse\bet\bt_\b_f\bfl\bla\bag\bgs\bs (torrent_flags_t flags, torrent_flags_t mask) const;\n sets and gets the torrent state flags. See _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bl_\ba_\bg_\bs_\b__\bt. The set_flags\n overload that take a mask will affect all flags part of the mask, and set their\n values to what the flags argument is set to. This allows clearing and setting\n flags in a single function call. The set_flags overload that just takes flags,\n sets all the specified flags and leave any other flags unchanged. unset_flags\n clears the specified flags, while leaving any other flags unchanged.\n Theseed_modeflag is special, it can only be cleared once the torrent has been\n@@ -10580,20 +11016,20 @@\n thread. A way to avoid blocking is to instead call _\bs_\ba_\bv_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b) directly,\n specifying the conditions under which resume data should be saved.\n Note\n A torrent's resume data is considered saved as soon as the\n _\bs_\ba_\bv_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b__\ba_\bl_\be_\br_\bt is posted. It is important to make sure this _\ba_\bl_\be_\br_\bt is\n received and handled in order for this function to be meaningful.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn_\b_b\bbo\bot\btt\bto\bom\bm(\b()\b) q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn_\b_t\bto\bop\bp(\b()\b) q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn_\b_d\bdo\bow\bwn\bn(\b()\b)\n-q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn(\b()\b) q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn_\b_u\bup\bp(\b()\b) *\b**\b**\b**\b**\b*\n+*\b**\b**\b**\b**\b* q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn(\b()\b) q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn_\b_b\bbo\bot\btt\bto\bom\bm(\b()\b) q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn_\b_t\bto\bop\bp(\b()\b)\n+q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn_\b_d\bdo\bow\bwn\bn(\b()\b) q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn_\b_u\bup\bp(\b()\b) *\b**\b**\b**\b**\b*\n void q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn_\b_u\bup\bp () const;\n+queue_position_t q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn () const;\n void q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn_\b_d\bdo\bow\bwn\bn () const;\n void q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn_\b_b\bbo\bot\btt\bto\bom\bm () const;\n-queue_position_t q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn () const;\n void q\bqu\bue\beu\bue\be_\b_p\bpo\bos\bsi\bit\bti\bio\bon\bn_\b_t\bto\bop\bp () const;\n Every torrent that is added is assigned a queue position exactly one greater\n than the greatest queue position of all existing torrents. Torrents that are\n being seeded have -1 as their queue position, since they're no longer in line\n to be downloaded.\n When a torrent is removed or turns into a seed, all torrents with greater queue\n positions have their positions decreased to fill in the space in the sequence.\n@@ -10638,16 +11074,16 @@\n suspend connecting to any peers until it has one. It's typically desirable to\n resume the torrent after setting the SSL certificate.\n If you receive a _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bn_\be_\be_\bd_\b__\bc_\be_\br_\bt_\b__\ba_\bl_\be_\br_\bt, you need to call this to provide a\n valid cert. If you don't have a cert you won't be allowed to connect to any\n peers.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be_\b_w\bwi\bit\bth\bh_\b_h\bha\bas\bsh\bhe\bes\bs(\b()\b) t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be(\b()\b) *\b**\b**\b**\b**\b*\n-std::shared_ptr t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be () const;\n std::shared_ptr t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be_\b_w\bwi\bit\bth\bh_\b_h\bha\bas\bsh\bhe\bes\bs () const;\n+std::shared_ptr t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be () const;\n _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bi_\bl_\be_\b(_\b) returns a pointer to the _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo object associated with\n this torrent. The _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo object may be a copy of the internal object. If\n the torrent doesn't have metadata, the pointer will not be initialized (i.e. a\n nullptr). The torrent may be in a state without metadata only if it was started\n without a .torrent file, e.g. by being added by magnet link.\n Note that the _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo object returned here may be a different instance\n than the one added to the _\bs_\be_\bs_\bs_\bi_\bo_\bn, with different attributes like piece layers,\n@@ -10674,32 +11110,32 @@\n *\b**\b**\b**\b**\b* p\bpi\bie\bec\bce\be_\b_l\bla\bay\bye\ber\brs\bs(\b()\b) *\b**\b**\b**\b**\b*\n std::vector> p\bpi\bie\bec\bce\be_\b_l\bla\bay\bye\ber\brs\bs () const;\n returns the piece layers for all files in the torrent. If this is a v1 torrent\n (and doesn't have any piece layers) it returns an empty vector. This is a\n blocking call that will synchronize with the libtorrent network thread.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* p\bpo\bos\bst\bt_\b_p\bpi\bie\bec\bce\be_\b_a\bav\bva\bai\bil\bla\bab\bbi\bil\bli\bit\bty\by(\b()\b) p\bpi\bie\bec\bce\be_\b_a\bav\bva\bai\bil\bla\bab\bbi\bil\bli\bit\bty\by(\b()\b) *\b**\b**\b**\b**\b*\n-void p\bpi\bie\bec\bce\be_\b_a\bav\bva\bai\bil\bla\bab\bbi\bil\bli\bit\bty\by (std::vector& avail) const;\n void p\bpo\bos\bst\bt_\b_p\bpi\bie\bec\bce\be_\b_a\bav\bva\bai\bil\bla\bab\bbi\bil\bli\bit\bty\by () const;\n+void p\bpi\bie\bec\bce\be_\b_a\bav\bva\bai\bil\bla\bab\bbi\bil\bli\bit\bty\by (std::vector& avail) const;\n The piece availability is the number of peers that we are connected that has\n advertised having a particular piece. This is the information that libtorrent\n uses in order to prefer picking rare pieces.\n post_piece_availability() will trigger a _\bp_\bi_\be_\bc_\be_\b__\ba_\bv_\ba_\bi_\bl_\ba_\bb_\bi_\bl_\bi_\bt_\by_\b__\ba_\bl_\be_\br_\bt to be posted.\n piece_availability() fills the specified std::vector with the availability\n for each piece in this torrent. libtorrent does not keep track of availability\n for seeds, so if the torrent is seeding the availability for all pieces is\n reported as 0.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* p\bpr\bri\bio\bor\bri\bit\bti\biz\bze\be_\b_p\bpi\bie\bec\bce\bes\bs(\b()\b) p\bpi\bie\bec\bce\be_\b_p\bpr\bri\bio\bor\bri\bit\bty\by(\b()\b) g\bge\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_p\bpr\bri\bio\bor\bri\bit\bti\bie\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n-void p\bpr\bri\bio\bor\bri\bit\bti\biz\bze\be_\b_p\bpi\bie\bec\bce\bes\bs (std::vector const& pieces) const;\n-download_priority_t p\bpi\bie\bec\bce\be_\b_p\bpr\bri\bio\bor\bri\bit\bty\by (piece_index_t index) const;\n+*\b**\b**\b**\b**\b* g\bge\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_p\bpr\bri\bio\bor\bri\bit\bti\bie\bes\bs(\b()\b) p\bpi\bie\bec\bce\be_\b_p\bpr\bri\bio\bor\bri\bit\bty\by(\b()\b) p\bpr\bri\bio\bor\bri\bit\bti\biz\bze\be_\b_p\bpi\bie\bec\bce\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n std::vector g\bge\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_p\bpr\bri\bio\bor\bri\bit\bti\bie\bes\bs () const;\n-void p\bpi\bie\bec\bce\be_\b_p\bpr\bri\bio\bor\bri\bit\bty\by (piece_index_t index, download_priority_t priority) const;\n+void p\bpr\bri\bio\bor\bri\bit\bti\biz\bze\be_\b_p\bpi\bie\bec\bce\bes\bs (std::vector const& pieces) const;\n void p\bpr\bri\bio\bor\bri\bit\bti\biz\bze\be_\b_p\bpi\bie\bec\bce\bes\bs (std::vector> const& pieces) const;\n+download_priority_t p\bpi\bie\bec\bce\be_\b_p\bpr\bri\bio\bor\bri\bit\bty\by (piece_index_t index) const;\n+void p\bpi\bie\bec\bce\be_\b_p\bpr\bri\bio\bor\bri\bit\bty\by (piece_index_t index, download_priority_t priority) const;\n These functions are used to set and get the priority of individual pieces. By\n default all pieces have priority 4. That means that the random rarest first\n algorithm is effectively active for all pieces. You may however change the\n priority of individual pieces. There are 8 priority levels. 0 means not to\n download the piece at all. Otherwise, lower priority values means less likely\n to be picked. Piece priority takes precedence over piece availability. Every\n piece with priority 7 will be attempted to be picked before a priority 6 piece\n@@ -10719,18 +11155,18 @@\n where the piece index or priority is out of range, are not allowed.\n get_piece_priorities returns a vector with one element for each piece in the\n torrent. Each element is the current priority of that piece.\n It's possible to cancel the effect of f\bfi\bil\ble\be priorities by setting the priorities\n for the affected pieces. Care has to be taken when mixing usage of file- and\n piece priorities.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* g\bge\bet\bt_\b_f\bfi\bil\ble\be_\b_p\bpr\bri\bio\bor\bri\bit\bti\bie\bes\bs(\b()\b) f\bfi\bil\ble\be_\b_p\bpr\bri\bio\bor\bri\bit\bty\by(\b()\b) p\bpr\bri\bio\bor\bri\bit\bti\biz\bze\be_\b_f\bfi\bil\ble\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n+*\b**\b**\b**\b**\b* f\bfi\bil\ble\be_\b_p\bpr\bri\bio\bor\bri\bit\bty\by(\b()\b) p\bpr\bri\bio\bor\bri\bit\bti\biz\bze\be_\b_f\bfi\bil\ble\bes\bs(\b()\b) g\bge\bet\bt_\b_f\bfi\bil\ble\be_\b_p\bpr\bri\bio\bor\bri\bit\bti\bie\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n std::vector g\bge\bet\bt_\b_f\bfi\bil\ble\be_\b_p\bpr\bri\bio\bor\bri\bit\bti\bie\bes\bs () const;\n-void p\bpr\bri\bio\bor\bri\bit\bti\biz\bze\be_\b_f\bfi\bil\ble\bes\bs (std::vector const& files) const;\n void f\bfi\bil\ble\be_\b_p\bpr\bri\bio\bor\bri\bit\bty\by (file_index_t index, download_priority_t priority) const;\n+void p\bpr\bri\bio\bor\bri\bit\bti\biz\bze\be_\b_f\bfi\bil\ble\bes\bs (std::vector const& files) const;\n download_priority_t f\bfi\bil\ble\be_\b_p\bpr\bri\bio\bor\bri\bit\bty\by (file_index_t index) const;\n index must be in the range [0, number_of_files).\n file_priority() queries or sets the priority of file index.\n prioritize_files() takes a vector that has at as many elements as there are\n files in the torrent. Each _\be_\bn_\bt_\br_\by is the priority of that file. The function\n sets the priorities of all the pieces in the torrent based on the vector.\n get_file_priorities() returns a vector with the priorities of all files.\n@@ -10750,15 +11186,15 @@\n When combining file- and piece priorities, the resume file will record both.\n When loading the resume data, the file priorities will be applied first, then\n the piece priorities.\n Moving data from a file into the part file is currently not supported. If a\n file has its priority set to 0 a\baf\bft\bte\ber\br it has already been created, it will not\n be moved into the partfile.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* f\bfo\bor\brc\bce\be_\b_r\bre\bea\ban\bnn\bno\bou\bun\bnc\bce\be(\b()\b) f\bfo\bor\brc\bce\be_\b_l\bls\bsd\bd_\b_a\ban\bnn\bno\bou\bun\bnc\bce\be(\b()\b) f\bfo\bor\brc\bce\be_\b_d\bdh\bht\bt_\b_a\ban\bnn\bno\bou\bun\bnc\bce\be(\b()\b) *\b**\b**\b**\b**\b*\n+*\b**\b**\b**\b**\b* f\bfo\bor\brc\bce\be_\b_l\bls\bsd\bd_\b_a\ban\bnn\bno\bou\bun\bnc\bce\be(\b()\b) f\bfo\bor\brc\bce\be_\b_d\bdh\bht\bt_\b_a\ban\bnn\bno\bou\bun\bnc\bce\be(\b()\b) f\bfo\bor\brc\bce\be_\b_r\bre\bea\ban\bnn\bno\bou\bun\bnc\bce\be(\b()\b) *\b**\b**\b**\b**\b*\n void f\bfo\bor\brc\bce\be_\b_l\bls\bsd\bd_\b_a\ban\bnn\bno\bou\bun\bnc\bce\be () const;\n void f\bfo\bor\brc\bce\be_\b_d\bdh\bht\bt_\b_a\ban\bnn\bno\bou\bun\bnc\bce\be () const;\n void f\bfo\bor\brc\bce\be_\b_r\bre\bea\ban\bnn\bno\bou\bun\bnc\bce\be (int seconds = 0, int idx = -1, reannounce_flags_t = {})\n const;\n force_reannounce() will force this torrent to do another tracker request, to\n receive new peers. The seconds argument specifies how many seconds from now to\n issue the tracker announces.\n@@ -10780,20 +11216,20 @@\n A scrape request queries the tracker for statistics such as total number of\n incomplete peers, complete peers, number of downloads etc.\n This request will specifically update the num_complete and num_incomplete\n fields in the _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bs_\bt_\ba_\bt_\bu_\bs struct once it completes. When it completes, it\n will generate a _\bs_\bc_\br_\ba_\bp_\be_\b__\br_\be_\bp_\bl_\by_\b__\ba_\bl_\be_\br_\bt. If it fails, it will generate a\n _\bs_\bc_\br_\ba_\bp_\be_\b__\bf_\ba_\bi_\bl_\be_\bd_\b__\ba_\bl_\be_\br_\bt.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* u\bup\bpl\blo\boa\bad\bd_\b_l\bli\bim\bmi\bit\bt(\b()\b) s\bse\bet\bt_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_l\bli\bim\bmi\bit\bt(\b()\b) s\bse\bet\bt_\b_u\bup\bpl\blo\boa\bad\bd_\b_l\bli\bim\bmi\bit\bt(\b()\b) d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_l\bli\bim\bmi\bit\bt(\b()\b)\n+*\b**\b**\b**\b**\b* s\bse\bet\bt_\b_u\bup\bpl\blo\boa\bad\bd_\b_l\bli\bim\bmi\bit\bt(\b()\b) u\bup\bpl\blo\boa\bad\bd_\b_l\bli\bim\bmi\bit\bt(\b()\b) s\bse\bet\bt_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_l\bli\bim\bmi\bit\bt(\b()\b) d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_l\bli\bim\bmi\bit\bt(\b()\b)\n *\b**\b**\b**\b**\b*\n-void s\bse\bet\bt_\b_u\bup\bpl\blo\boa\bad\bd_\b_l\bli\bim\bmi\bit\bt (int limit) const;\n int u\bup\bpl\blo\boa\bad\bd_\b_l\bli\bim\bmi\bit\bt () const;\n int d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_l\bli\bim\bmi\bit\bt () const;\n void s\bse\bet\bt_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_l\bli\bim\bmi\bit\bt (int limit) const;\n+void s\bse\bet\bt_\b_u\bup\bpl\blo\boa\bad\bd_\b_l\bli\bim\bmi\bit\bt (int limit) const;\n set_upload_limit will limit the upload bandwidth used by this particular\n torrent to the limit you set. It is given as the number of bytes per second the\n torrent is allowed to upload. set_download_limit works the same way but for\n download bandwidth instead of upload bandwidth. Note that setting a higher\n limit on a torrent then the global limit (settings_pack::upload_rate_limit)\n will not override the global rate limit. The torrent can never upload more than\n the global rate limit.\n@@ -10817,25 +11253,25 @@\n *\b**\b**\b**\b**\b* c\bcl\ble\bea\bar\br_\b_p\bpe\bee\ber\brs\bs(\b()\b) *\b**\b**\b**\b**\b*\n void c\bcl\ble\bea\bar\br_\b_p\bpe\bee\ber\brs\bs ();\n This will disconnect all peers and clear the peer list for this torrent. New\n peers will have to be acquired before resuming, from trackers, DHT or local\n service discovery, for example.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* s\bse\bet\bt_\b_m\bma\bax\bx_\b_u\bup\bpl\blo\boa\bad\bds\bs(\b()\b) m\bma\bax\bx_\b_u\bup\bpl\blo\boa\bad\bds\bs(\b()\b) *\b**\b**\b**\b**\b*\n-int m\bma\bax\bx_\b_u\bup\bpl\blo\boa\bad\bds\bs () const;\n void s\bse\bet\bt_\b_m\bma\bax\bx_\b_u\bup\bpl\blo\boa\bad\bds\bs (int max_uploads) const;\n+int m\bma\bax\bx_\b_u\bup\bpl\blo\boa\bad\bds\bs () const;\n set_max_uploads() sets the maximum number of peers that's unchoked at the same\n time on this torrent. If you set this to -1, there will be no limit. This\n defaults to infinite. The primary setting controlling this is the global\n unchoke slots limit, set by unchoke_slots_limit in _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk.\n max_uploads() returns the current settings.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* s\bse\bet\bt_\b_m\bma\bax\bx_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bns\bs(\b()\b) m\bma\bax\bx_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bns\bs(\b()\b) *\b**\b**\b**\b**\b*\n-void s\bse\bet\bt_\b_m\bma\bax\bx_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bns\bs (int max_connections) const;\n+*\b**\b**\b**\b**\b* m\bma\bax\bx_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bns\bs(\b()\b) s\bse\bet\bt_\b_m\bma\bax\bx_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bns\bs(\b()\b) *\b**\b**\b**\b**\b*\n int m\bma\bax\bx_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bns\bs () const;\n+void s\bse\bet\bt_\b_m\bma\bax\bx_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bns\bs (int max_connections) const;\n set_max_connections() sets the maximum number of connection this torrent will\n open. If all connections are used up, incoming connections may be refused or\n poor connections may be closed. This must be at least 2. The default is\n unlimited number of connections. If -1 is given to the function, it means\n unlimited. There is also a global limit of the number of connections, set by\n connections_limit in _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk.\n max_connections() returns the current settings.\n@@ -10886,23 +11322,23 @@\n *\b**\b**\b**\b**\b* r\bre\ben\bna\bam\bme\be_\b_f\bfi\bil\ble\be(\b()\b) *\b**\b**\b**\b**\b*\n void r\bre\ben\bna\bam\bme\be_\b_f\bfi\bil\ble\be (file_index_t index, std::string const& new_name) const;\n Renames the file with the given index asynchronously. The rename operation is\n complete when either a _\bf_\bi_\bl_\be_\b__\br_\be_\bn_\ba_\bm_\be_\bd_\b__\ba_\bl_\be_\br_\bt or _\bf_\bi_\bl_\be_\b__\br_\be_\bn_\ba_\bm_\be_\b__\bf_\ba_\bi_\bl_\be_\bd_\b__\ba_\bl_\be_\br_\bt is\n posted.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bhe\bes\bs(\b()\b) i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh(\b()\b) *\b**\b**\b**\b**\b*\n-sha1_hash i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh () const;\n info_hash_t i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bhe\bes\bs () const;\n+sha1_hash i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh () const;\n returns the info-hash(es) of the torrent. If this handle is to a torrent that\n hasn't loaded yet (for instance by being added) by a URL, the returned value is\n undefined. The info_hash() returns the SHA-1 info-hash for v1 torrents and a\n truncated hash for v2 torrents. For the full v2 info-hash, use info_hashes()\n instead.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* o\bop\bpe\ber\bra\bat\bto\bor\br!\b!=\b=(\b()\b) o\bop\bpe\ber\bra\bat\bto\bor\br=\b==\b=(\b()\b) o\bop\bpe\ber\bra\bat\bto\bor\br<\b<(\b()\b) *\b**\b**\b**\b**\b*\n+*\b**\b**\b**\b**\b* o\bop\bpe\ber\bra\bat\bto\bor\br!\b!=\b=(\b()\b) o\bop\bpe\ber\bra\bat\bto\bor\br<\b<(\b()\b) o\bop\bpe\ber\bra\bat\bto\bor\br=\b==\b=(\b()\b) *\b**\b**\b**\b**\b*\n bool o\bop\bpe\ber\bra\bat\bto\bor\br!\b!=\b= (const torrent_handle& h) const;\n bool o\bop\bpe\ber\bra\bat\bto\bor\br<\b< (const torrent_handle& h) const;\n bool o\bop\bpe\ber\bra\bat\bto\bor\br=\b==\b= (const torrent_handle& h) const;\n comparison operators. The order of the torrents is unspecified but stable.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* i\bid\bd(\b()\b) *\b**\b**\b**\b**\b*\n std::uint32_t i\bid\bd () const;\n@@ -11038,1115 +11474,679 @@\n by the tracker. If this flag is set, it will be ignored and the tracker\n is announced immediately.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* h\bha\bas\bsh\bh_\b_v\bva\bal\blu\bue\be(\b()\b) *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be_\b._\bh_\bp_\bp\"\n std::size_t h\bha\bas\bsh\bh_\b_v\bva\bal\blu\bue\be (torrent_handle const& h);\n for std::hash (and to support using this type in unordered_map etc.)\n+Bencoding is a common representation in bittorrent used for dictionary, list,\n+_\bi_\bn_\bt and string hierarchies. It's used to encode .torrent files and some\n+messages in the network protocol. libtorrent also uses it to store settings,\n+resume data and other _\bs_\be_\bs_\bs_\bi_\bo_\bn state.\n+Strings in bencoded structures do not necessarily represent text. Strings are\n+raw byte buffers of a certain length. If a string is meant to be interpreted as\n+text, it is required to be UTF-8 encoded. See _\bB_\bE_\bP_\b _\b3.\n+The function for decoding bencoded data _\bb_\bd_\be_\bc_\bo_\bd_\be_\b(_\b), returning a _\bb_\bd_\be_\bc_\bo_\bd_\be_\b__\bn_\bo_\bd_\be.\n+This function builds a tree that points back into the original buffer. The\n+returned _\bb_\bd_\be_\bc_\bo_\bd_\be_\b__\bn_\bo_\bd_\be will not be valid once the buffer it was parsed out of is\n+discarded.\n+It's possible to construct an _\be_\bn_\bt_\br_\by from a _\bb_\bd_\be_\bc_\bo_\bd_\be_\b__\bn_\bo_\bd_\be, if a structure needs\n+to be altered and re-encoded.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* w\bwe\beb\bb_\b_s\bse\bee\bed\bd_\b_e\ben\bnt\btr\bry\by *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b._\bh_\bp_\bp\"\n-the _\bw_\be_\bb_\b__\bs_\be_\be_\bd_\b__\be_\bn_\bt_\br_\by holds information about a web seed (also known as URL seed\n-or HTTP seed). It is essentially a URL with some state associated with it. For\n-more information, see _\bB_\bE_\bP_\b _\b1_\b7 and _\bB_\bE_\bP_\b _\b1_\b9.\n-struct web_seed_entry\n+*\b**\b**\b**\b**\b**\b* e\ben\bnt\btr\bry\by *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\be_\bn_\bt_\br_\by_\b._\bh_\bp_\bp\"\n+The entry class represents one node in a bencoded hierarchy. It works as a\n+variant type, it can be either a list, a dictionary (std::map), an integer or a\n+string.\n+class entry\n {\n- bool o\bop\bpe\ber\bra\bat\bto\bor\br=\b==\b= (web_seed_entry const& e) const;\n- bool o\bop\bpe\ber\bra\bat\bto\bor\br<\b< (web_seed_entry const& e) const;\n+ data_type t\bty\byp\bpe\be () const;\n+ e\ben\bnt\btr\bry\by (dictionary_type);\n+ e\ben\bnt\btr\bry\by (list_type);\n+ e\ben\bnt\btr\bry\by (preformatted_type);\n+ e\ben\bnt\btr\bry\by (span);\n+ e\ben\bnt\btr\bry\by (integer_type);\n+ e\ben\bnt\btr\bry\by (U v);\n+ e\ben\bnt\btr\bry\by (data_type t);\n+ e\ben\bnt\btr\bry\by (bdecode_node const& n);\n+ entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (entry&&) & noexcept;\n+ entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (entry const&) &;\n+ entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (dictionary_type) &;\n+ entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (span) &;\n+ entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (integer_type) &;\n+ entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (preformatted_type) &;\n+ entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (bdecode_node const&) &;\n+ entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (list_type) &;\n+ entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (U v) &;\n+ preformatted_type const& p\bpr\bre\bef\bfo\bor\brm\bma\bat\btt\bte\bed\bd () const;\n+ string_type const& s\bst\btr\bri\bin\bng\bg () const;\n+ dictionary_type const& d\bdi\bic\bct\bt () const;\n+ dictionary_type& d\bdi\bic\bct\bt ();\n+ string_type& s\bst\btr\bri\bin\bng\bg ();\n+ preformatted_type& p\bpr\bre\bef\bfo\bor\brm\bma\bat\btt\bte\bed\bd ();\n+ integer_type& i\bin\bnt\bte\beg\bge\ber\br ();\n+ list_type const& l\bli\bis\bst\bt () const;\n+ list_type& l\bli\bis\bst\bt ();\n+ integer_type const& i\bin\bnt\bte\beg\bge\ber\br () const;\n+ void s\bsw\bwa\bap\bp (entry& e);\n+ entry& o\bop\bpe\ber\bra\bat\bto\bor\br[\b[]\b] (string_view key);\n+ entry const& o\bop\bpe\ber\bra\bat\bto\bor\br[\b[]\b] (string_view key) const;\n+ entry* f\bfi\bin\bnd\bd_\b_k\bke\bey\by (string_view key);\n+ entry const* f\bfi\bin\bnd\bd_\b_k\bke\bey\by (string_view key) const;\n+ std::string t\bto\bo_\b_s\bst\btr\bri\bin\bng\bg (bool single_line = false) const;\n \n- enum type_t\n+ enum data_type\n {\n- url_seed,\n- http_seed,\n+ int_t,\n+ string_t,\n+ list_t,\n+ dictionary_t,\n+ undefined_t,\n+ preformatted_t,\n };\n-\n- std::string url;\n- std::string auth;\n- headers_t extra_headers;\n- std::uint8_t type;\n };\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* o\bop\bpe\ber\bra\bat\bto\bor\br=\b==\b=(\b()\b) *\b**\b**\b**\b**\b*\n-bool o\bop\bpe\ber\bra\bat\bto\bor\br=\b==\b= (web_seed_entry const& e) const;\n-URL and type comparison\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* o\bop\bpe\ber\bra\bat\bto\bor\br<\b<(\b()\b) *\b**\b**\b**\b**\b*\n-bool o\bop\bpe\ber\bra\bat\bto\bor\br<\b< (web_seed_entry const& e) const;\n-URL and type less-than comparison\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* e\ben\bnu\bum\bm t\bty\byp\bpe\be_\b_t\bt *\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b._\bh_\bp_\bp\"\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n-|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn|\n-|_\bu_\br_\bl_\b__\bs_\be_\be_\bd_\b _\b|_\b0_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bh_\bt_\bt_\bp_\b__\bs_\be_\be_\bd_\b|_\b1_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+*\b**\b**\b**\b**\b* t\bty\byp\bpe\be(\b()\b) *\b**\b**\b**\b**\b*\n+data_type t\bty\byp\bpe\be () const;\n+returns the concrete type of the _\be_\bn_\bt_\br_\by\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- url\n- The URL of the web seed\n+*\b**\b**\b**\b**\b* e\ben\bnt\btr\bry\by(\b()\b) *\b**\b**\b**\b**\b*\n+e\ben\bnt\btr\bry\by (dictionary_type);\n+e\ben\bnt\btr\bry\by (list_type);\n+e\ben\bnt\btr\bry\by (preformatted_type);\n+e\ben\bnt\btr\bry\by (span);\n+e\ben\bnt\btr\bry\by (integer_type);\n+constructors directly from a specific type. The content of the argument is\n+copied into the newly constructed _\be_\bn_\bt_\br_\by\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- auth\n- Optional authentication. If this is set, it's passed in as HTTP basic\n- auth to the web seed. The format is: username:password.\n+*\b**\b**\b**\b**\b* e\ben\bnt\btr\bry\by(\b()\b) *\b**\b**\b**\b**\b*\n+e\ben\bnt\btr\bry\by (data_type t);\n+construct an empty _\be_\bn_\bt_\br_\by of the specified type. see _\bd_\ba_\bt_\ba_\b__\bt_\by_\bp_\be enum.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- extra_headers\n- Any extra HTTP headers that need to be passed to the web seed\n+*\b**\b**\b**\b**\b* e\ben\bnt\btr\bry\by(\b()\b) *\b**\b**\b**\b**\b*\n+e\ben\bnt\btr\bry\by (bdecode_node const& n);\n+construct from _\bb_\bd_\be_\bc_\bo_\bd_\be_\b__\bn_\bo_\bd_\be parsed form (see _\bb_\bd_\be_\bc_\bo_\bd_\be_\b(_\b))\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- type\n- The type of web seed (see _\bt_\by_\bp_\be_\b__\bt)\n+*\b**\b**\b**\b**\b* o\bop\bpe\ber\bra\bat\bto\bor\br=\b=(\b()\b) *\b**\b**\b**\b**\b*\n+entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (entry&&) & noexcept;\n+entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (entry const&) &;\n+entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (dictionary_type) &;\n+entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (span) &;\n+entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (integer_type) &;\n+entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (preformatted_type) &;\n+entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (bdecode_node const&) &;\n+entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (list_type) &;\n+copies the structure of the right hand side into this _\be_\bn_\bt_\br_\by.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* l\blo\boa\bad\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_l\bli\bim\bmi\bit\bts\bs *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b._\bh_\bp_\bp\"\n-this object holds configuration options for limits to use when loading\n-torrents. They are meant to prevent loading potentially malicious torrents that\n-cause excessive memory allocations.\n-struct load_torrent_limits\n+*\b**\b**\b**\b**\b* d\bdi\bic\bct\bt(\b()\b) s\bst\btr\bri\bin\bng\bg(\b()\b) i\bin\bnt\bte\beg\bge\ber\br(\b()\b) l\bli\bis\bst\bt(\b()\b) p\bpr\bre\bef\bfo\bor\brm\bma\bat\btt\bte\bed\bd(\b()\b) *\b**\b**\b**\b**\b*\n+preformatted_type const& p\bpr\bre\bef\bfo\bor\brm\bma\bat\btt\bte\bed\bd () const;\n+string_type const& s\bst\btr\bri\bin\bng\bg () const;\n+dictionary_type const& d\bdi\bic\bct\bt () const;\n+dictionary_type& d\bdi\bic\bct\bt ();\n+string_type& s\bst\btr\bri\bin\bng\bg ();\n+preformatted_type& p\bpr\bre\bef\bfo\bor\brm\bma\bat\btt\bte\bed\bd ();\n+integer_type& i\bin\bnt\bte\beg\bge\ber\br ();\n+list_type const& l\bli\bis\bst\bt () const;\n+list_type& l\bli\bis\bst\bt ();\n+integer_type const& i\bin\bnt\bte\beg\bge\ber\br () const;\n+The integer(), string(), list() and dict() functions are accessors that return\n+the respective type. If the entry object isn't of the type you request, the\n+accessor will throw system_error. You can ask an entry for its type through the\n+type() function.\n+If you want to create an entry you give it the type you want it to have in its\n+constructor, and then use one of the non-const accessors to get a reference\n+which you then can assign the value you want it to have.\n+The typical code to get info from a torrent file will then look like this:\n+entry torrent_file;\n+// ...\n+\n+// throws if this is not a dictionary\n+entry::dictionary_type const& dict = torrent_file.dict();\n+entry::dictionary_type::const_iterator i;\n+i = dict.find(\"announce\");\n+if (i != dict.end())\n {\n- int m\bma\bax\bx_\b_b\bbu\buf\bff\bfe\ber\br_\b_s\bsi\biz\bze\be = 10000000;\n- int m\bma\bax\bx_\b_p\bpi\bie\bec\bce\bes\bs = 0x200000;\n- int m\bma\bax\bx_\b_d\bde\bec\bco\bod\bde\be_\b_d\bde\bep\bpt\bth\bh = 100;\n- int m\bma\bax\bx_\b_d\bde\bec\bco\bod\bde\be_\b_t\bto\bok\bke\ben\bns\bs = 3000000;\n-};\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- max_buffer_size\n- the max size of a .torrent file to load into RAM\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- max_pieces\n- the max number of pieces allowed in the torrent\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- max_decode_depth\n- the max recursion depth in the bdecoded structure\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- max_decode_tokens\n- the max number of bdecode tokens\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b._\bh_\bp_\bp\"\n-the _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo class holds the information found in a .torrent file.\n-class torrent_info\n+ std::string tracker_url = i->second.string();\n+ std::cout << tracker_url << \"\\n\";\n+}\n+The following code is equivalent, but a little bit shorter:\n+entry torrent_file;\n+// ...\n+\n+// throws if this is not a dictionary\n+if (entry* i = torrent_file.find_key(\"announce\"))\n {\n- t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (char const* buffer, int size);\n- t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (std::string const& filename, error_code& ec);\n- explicit t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (span buffer, from_span_t);\n- t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (span buffer, load_torrent_limits const& cfg,\n-from_span_t);\n- t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (std::string const& filename, load_torrent_limits const& cfg);\n- t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (torrent_info const& t);\n- explicit t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (bdecode_node const& torrent_file);\n- explicit t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (std::string const& filename);\n- t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (bdecode_node const& torrent_file, error_code& ec);\n- explicit t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (info_hash_t const& info_hash);\n- t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (span buffer, error_code& ec, from_span_t);\n- t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (bdecode_node const& torrent_file, load_torrent_limits const&\n-cfg);\n- t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (char const* buffer, int size, error_code& ec);\n- ~\b~t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo ();\n- file_storage const& o\bor\bri\big\bg_\b_f\bfi\bil\ble\bes\bs () const;\n- file_storage const& f\bfi\bil\ble\bes\bs () const;\n- void r\bre\ben\bna\bam\bme\be_\b_f\bfi\bil\ble\be (file_index_t index, std::string const& new_filename);\n- void r\bre\bem\bma\bap\bp_\b_f\bfi\bil\ble\bes\bs (file_storage const& f);\n- void a\bad\bdd\bd_\b_t\btr\bra\bac\bck\bke\ber\br (std::string const& url, int tier\n- , announce_entry::tracker_source source);\n- std::vector const& t\btr\bra\bac\bck\bke\ber\brs\bs () const;\n- void a\bad\bdd\bd_\b_t\btr\bra\bac\bck\bke\ber\br (std::string const& url, int tier = 0);\n- void c\bcl\ble\bea\bar\br_\b_t\btr\bra\bac\bck\bke\ber\brs\bs ();\n- std::vector s\bsi\bim\bmi\bil\bla\bar\br_\b_t\bto\bor\brr\bre\ben\bnt\bts\bs () const;\n- std::vector c\bco\bol\bll\ble\bec\bct\bti\bio\bon\bns\bs () const;\n- void a\bad\bdd\bd_\b_u\bur\brl\bl_\b_s\bse\bee\bed\bd (std::string const& url\n- , std::string const& ext_auth = std::string()\n- , web_seed_entry::headers_t const& ext_headers = web_seed_entry::\n-headers_t());\n- std::vector const& w\bwe\beb\bb_\b_s\bse\bee\bed\bds\bs () const;\n- void a\bad\bdd\bd_\b_h\bht\btt\btp\bp_\b_s\bse\bee\bed\bd (std::string const& url\n- , std::string const& extern_auth = std::string()\n- , web_seed_entry::headers_t const& extra_headers = web_seed_entry::\n-headers_t());\n- void s\bse\bet\bt_\b_w\bwe\beb\bb_\b_s\bse\bee\bed\bds\bs (std::vector seeds);\n- std::int64_t t\bto\bot\bta\bal\bl_\b_s\bsi\biz\bze\be () const;\n- int n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs () const;\n- int p\bpi\bie\bec\bce\be_\b_l\ble\ben\bng\bgt\bth\bh () const;\n- int b\bbl\blo\boc\bck\bks\bs_\b_p\bpe\ber\br_\b_p\bpi\bie\bec\bce\be () const;\n- piece_index_t l\bla\bas\bst\bt_\b_p\bpi\bie\bec\bce\be () const;\n- index_range p\bpi\bie\bec\bce\be_\b_r\bra\ban\bng\bge\be () const;\n- piece_index_t e\ben\bnd\bd_\b_p\bpi\bie\bec\bce\be () const;\n- info_hash_t const& i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bhe\bes\bs () const;\n- sha1_hash i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh () const noexcept;\n- bool v\bv1\b1 () const;\n- bool v\bv2\b2 () const;\n- int n\bnu\bum\bm_\b_f\bfi\bil\ble\bes\bs () const;\n- std::vector m\bma\bap\bp_\b_b\bbl\blo\boc\bck\bk (piece_index_t const piece\n- , std::int64_t offset, int size) const;\n- peer_request m\bma\bap\bp_\b_f\bfi\bil\ble\be (file_index_t const file, std::int64_t offset, int\n-size) const;\n- string_view s\bss\bsl\bl_\b_c\bce\ber\brt\bt () const;\n- bool i\bis\bs_\b_v\bva\bal\bli\bid\bd () const;\n- bool p\bpr\bri\biv\bv () const;\n- bool i\bis\bs_\b_i\bi2\b2p\bp () const;\n- int p\bpi\bie\bec\bce\be_\b_s\bsi\biz\bze\be (piece_index_t index) const;\n- char const* h\bha\bas\bsh\bh_\b_f\bfo\bor\br_\b_p\bpi\bie\bec\bce\be_\b_p\bpt\btr\br (piece_index_t const index) const;\n- sha1_hash h\bha\bas\bsh\bh_\b_f\bfo\bor\br_\b_p\bpi\bie\bec\bce\be (piece_index_t index) const;\n- bool i\bis\bs_\b_l\blo\boa\bad\bde\bed\bd () const;\n- const std::string& n\bna\bam\bme\be () const;\n- std::time_t c\bcr\bre\bea\bat\bti\bio\bon\bn_\b_d\bda\bat\bte\be () const;\n- const std::string& c\bcr\bre\bea\bat\bto\bor\br () const;\n- const std::string& c\bco\bom\bmm\bme\ben\bnt\bt () const;\n- std::vector> const& n\bno\bod\bde\bes\bs () const;\n- void a\bad\bdd\bd_\b_n\bno\bod\bde\be (std::pair const& node);\n- bool p\bpa\bar\brs\bse\be_\b_i\bin\bnf\bfo\bo_\b_s\bse\bec\bct\bti\bio\bon\bn (bdecode_node const& info, error_code& ec, int\n-max_pieces);\n- bdecode_node i\bin\bnf\bfo\bo (char const* key) const;\n- span i\bin\bnf\bfo\bo_\b_s\bse\bec\bct\bti\bio\bon\bn () const;\n- span p\bpi\bie\bec\bce\be_\b_l\bla\bay\bye\ber\br (file_index_t) const;\n- void f\bfr\bre\bee\be_\b_p\bpi\bie\bec\bce\be_\b_l\bla\bay\bye\ber\brs\bs ();\n-};\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo(\b()\b) *\b**\b**\b**\b**\b*\n-t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (char const* buffer, int size);\n-t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (std::string const& filename, error_code& ec);\n-explicit t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (span buffer, from_span_t);\n-t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (span buffer, load_torrent_limits const& cfg,\n-from_span_t);\n-t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (std::string const& filename, load_torrent_limits const& cfg);\n-t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (torrent_info const& t);\n-explicit t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (bdecode_node const& torrent_file);\n-explicit t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (std::string const& filename);\n-t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (bdecode_node const& torrent_file, error_code& ec);\n-explicit t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (info_hash_t const& info_hash);\n-t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (span buffer, error_code& ec, from_span_t);\n-t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (bdecode_node const& torrent_file, load_torrent_limits const&\n-cfg);\n-t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (char const* buffer, int size, error_code& ec);\n-The constructor that takes an info-hash will initialize the info-hash to the\n-given value, but leave all other fields empty. This is used internally when\n-downloading torrents without the metadata. The metadata will be created by\n-libtorrent as soon as it has been downloaded from the swarm.\n-The constructor that takes a _\bb_\bd_\be_\bc_\bo_\bd_\be_\b__\bn_\bo_\bd_\be will create a _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo object\n-from the information found in the given torrent_file. The _\bb_\bd_\be_\bc_\bo_\bd_\be_\b__\bn_\bo_\bd_\be\n-represents a tree node in an bencoded file. To load an ordinary .torrent file\n-into a _\bb_\bd_\be_\bc_\bo_\bd_\be_\b__\bn_\bo_\bd_\be, use _\bb_\bd_\be_\bc_\bo_\bd_\be_\b(_\b).\n-The version that takes a buffer pointer and a size will decode it as a .torrent\n-file and initialize the _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo object for you.\n-The version that takes a filename will simply load the torrent file and decode\n-it inside the constructor, for convenience. This might not be the most suitable\n-for applications that want to be able to report detailed errors on what might\n-go wrong.\n-There is an upper limit on the size of the torrent file that will be loaded by\n-the overload taking a filename. If it's important that even very large torrent\n-files are loaded, use one of the other overloads.\n-The overloads that takes an error_code const& never throws if an error occur,\n-they will simply set the error code to describe what went wrong and not fully\n-initialize the _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo object. The overloads that do not take the extra\n-error_code parameter will always throw if an error occurs. These overloads are\n-not available when building without exception support.\n-The overload that takes a span also needs an extra parameter of type\n-from_span_t to disambiguate the std::string overload for string literals. There\n-is an object in the libtorrent namespace of this type called from_span.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* ~\b~t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo(\b()\b) *\b**\b**\b**\b**\b*\n-~\b~t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo ();\n-frees all storage associated with this _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo object\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* o\bor\bri\big\bg_\b_f\bfi\bil\ble\bes\bs(\b()\b) f\bfi\bil\ble\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n-file_storage const& o\bor\bri\big\bg_\b_f\bfi\bil\ble\bes\bs () const;\n-file_storage const& f\bfi\bil\ble\bes\bs () const;\n-The _\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be object contains the information on how to map the pieces to\n-files. It is separated from the _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo object because when creating\n-torrents a storage object needs to be created without having a torrent file.\n-When renaming files in a storage, the storage needs to make its own copy of the\n-_\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be in order to make its mapping differ from the one in the torrent\n-file.\n-orig_files() returns the original (unmodified) file storage for this torrent.\n-This is used by the web server connection, which needs to request files with\n-the original names. Filename may be changed using torrent_info::rename_file().\n-For more information on the _\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be object, see the separate document on\n-how to create torrents.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* r\bre\ben\bna\bam\bme\be_\b_f\bfi\bil\ble\be(\b()\b) *\b**\b**\b**\b**\b*\n-void r\bre\ben\bna\bam\bme\be_\b_f\bfi\bil\ble\be (file_index_t index, std::string const& new_filename);\n-Renames the file with the specified index to the new name. The new filename is\n-reflected by the file_storage returned by files() but not by the one returned\n-by orig_files().\n-If you want to rename the base name of the torrent (for a multi file torrent),\n-you can copy the file_storage (see _\bf_\bi_\bl_\be_\bs_\b(_\b) and _\bo_\br_\bi_\bg_\b__\bf_\bi_\bl_\be_\bs_\b(_\b) ), change the name,\n-and then use _\br_\be_\bm_\ba_\bp_\b__\bf_\bi_\bl_\be_\bs_\b(_\b).\n-The new_filename can both be a relative path, in which case the file name is\n-relative to the save_path of the torrent. If the new_filename is an absolute\n-path (i.e. is_complete(new_filename) == true), then the file is detached from\n-the save_path of the torrent. In this case the file is not moved when\n-_\bm_\bo_\bv_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b(_\b) is invoked.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* r\bre\bem\bma\bap\bp_\b_f\bfi\bil\ble\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n-void r\bre\bem\bma\bap\bp_\b_f\bfi\bil\ble\bes\bs (file_storage const& f);\n-Warning\n-Usingremap_files()is discouraged as it's incompatible with v2 torrents. This is\n-because the piece boundaries and piece hashes in v2 torrents are intimately\n-tied to the file boundaries. Instead, just rename individual files, or\n-implement a custom _\bd_\bi_\bs_\bk_\b__\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be to customize how to store files.\n-Remaps the file storage to a new file layout. This can be used to, for\n-instance, download all data in a torrent to a single file, or to a number of\n-fixed size sector aligned files, regardless of the number and sizes of the\n-files in the torrent.\n-The new specified file_storage must have the exact same size as the current\n-one.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* c\bcl\ble\bea\bar\br_\b_t\btr\bra\bac\bck\bke\ber\brs\bs(\b()\b) a\bad\bdd\bd_\b_t\btr\bra\bac\bck\bke\ber\br(\b()\b) t\btr\bra\bac\bck\bke\ber\brs\bs(\b()\b) *\b**\b**\b**\b**\b*\n-void a\bad\bdd\bd_\b_t\btr\bra\bac\bck\bke\ber\br (std::string const& url, int tier\n- , announce_entry::tracker_source source);\n-std::vector const& t\btr\bra\bac\bck\bke\ber\brs\bs () const;\n-void a\bad\bdd\bd_\b_t\btr\bra\bac\bck\bke\ber\br (std::string const& url, int tier = 0);\n-void c\bcl\ble\bea\bar\br_\b_t\btr\bra\bac\bck\bke\ber\brs\bs ();\n-add_tracker() adds a tracker to the announce-list. The tier determines the\n-order in which the trackers are to be tried. The trackers() function will\n-return a sorted vector of _\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\be_\bn_\bt_\br_\by. Each announce _\be_\bn_\bt_\br_\by contains a\n-string, which is the tracker url, and a tier index. The tier index is the high-\n-level priority. No matter which trackers that works or not, the ones with lower\n-tier will always be tried before the one with higher tier number. For more\n-information, see _\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\be_\bn_\bt_\br_\by.\n-trackers() returns all entries from announce-list.\n-clear_trackers() removes all trackers from announce-list.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* c\bco\bol\bll\ble\bec\bct\bti\bio\bon\bns\bs(\b()\b) s\bsi\bim\bmi\bil\bla\bar\br_\b_t\bto\bor\brr\bre\ben\bnt\bts\bs(\b()\b) *\b**\b**\b**\b**\b*\n-std::vector s\bsi\bim\bmi\bil\bla\bar\br_\b_t\bto\bor\brr\bre\ben\bnt\bts\bs () const;\n-std::vector c\bco\bol\bll\ble\bec\bct\bti\bio\bon\bns\bs () const;\n-These two functions are related to _\bB_\bE_\bP_\b _\b3_\b8 (mutable torrents). The vectors\n-returned from these correspond to the \"similar\" and \"collections\" keys in the\n-.torrent file. Both info-hashes and collections from within the info-dict and\n-from outside of it are included.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_u\bur\brl\bl_\b_s\bse\bee\bed\bd(\b()\b) s\bse\bet\bt_\b_w\bwe\beb\bb_\b_s\bse\bee\bed\bds\bs(\b()\b) w\bwe\beb\bb_\b_s\bse\bee\bed\bds\bs(\b()\b) a\bad\bdd\bd_\b_h\bht\btt\btp\bp_\b_s\bse\bee\bed\bd(\b()\b) *\b**\b**\b**\b**\b*\n-void a\bad\bdd\bd_\b_u\bur\brl\bl_\b_s\bse\bee\bed\bd (std::string const& url\n- , std::string const& ext_auth = std::string()\n- , web_seed_entry::headers_t const& ext_headers = web_seed_entry::\n-headers_t());\n-std::vector const& w\bwe\beb\bb_\b_s\bse\bee\bed\bds\bs () const;\n-void a\bad\bdd\bd_\b_h\bht\btt\btp\bp_\b_s\bse\bee\bed\bd (std::string const& url\n- , std::string const& extern_auth = std::string()\n- , web_seed_entry::headers_t const& extra_headers = web_seed_entry::\n-headers_t());\n-void s\bse\bet\bt_\b_w\bwe\beb\bb_\b_s\bse\bee\bed\bds\bs (std::vector seeds);\n-web_seeds() returns all url seeds and http seeds in the torrent. Each _\be_\bn_\bt_\br_\by is\n-a web_seed_entry and may refer to either a url seed or http seed.\n-add_url_seed() and add_http_seed() adds one url to the list of url/http seeds.\n-set_web_seeds() replaces all web seeds with the ones specified in the seeds\n-vector.\n-The extern_auth argument can be used for other authorization schemes than basic\n-HTTP authorization. If set, it will override any username and password found in\n-the URL itself. The string will be sent as the HTTP authorization header's\n-value (without specifying \"Basic\").\n-The extra_headers argument defaults to an empty list, but can be used to insert\n-custom HTTP headers in the requests to a specific web seed.\n-See _\bh_\bt_\bt_\bp_\b _\bs_\be_\be_\bd_\bi_\bn_\bg for more information.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* t\bto\bot\bta\bal\bl_\b_s\bsi\biz\bze\be(\b()\b) *\b**\b**\b**\b**\b*\n-std::int64_t t\bto\bot\bta\bal\bl_\b_s\bsi\biz\bze\be () const;\n-total_size() returns the total number of bytes the torrent-file represents.\n-Note that this is the number of pieces times the piece size (modulo the last\n-piece possibly being smaller). With pad files, the total size will be larger\n-than the sum of all (regular) file sizes.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs(\b()\b) p\bpi\bie\bec\bce\be_\b_l\ble\ben\bng\bgt\bth\bh(\b()\b) *\b**\b**\b**\b**\b*\n-int n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs () const;\n-int p\bpi\bie\bec\bce\be_\b_l\ble\ben\bng\bgt\bth\bh () const;\n-piece_length() and num_pieces() returns the number of byte for each piece and\n-the total number of pieces, respectively. The difference between piece_size()\n-and piece_length() is that piece_size() takes the piece index as argument and\n-gives you the exact size of that piece. It will always be the same as\n-piece_length() except in the case of the last piece, which may be smaller.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* b\bbl\blo\boc\bck\bks\bs_\b_p\bpe\ber\br_\b_p\bpi\bie\bec\bce\be(\b()\b) *\b**\b**\b**\b**\b*\n-int b\bbl\blo\boc\bck\bks\bs_\b_p\bpe\ber\br_\b_p\bpi\bie\bec\bce\be () const;\n-returns the number of blocks there are in the typical piece. There may be fewer\n-in the last piece)\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* l\bla\bas\bst\bt_\b_p\bpi\bie\bec\bce\be(\b()\b) e\ben\bnd\bd_\b_p\bpi\bie\bec\bce\be(\b()\b) p\bpi\bie\bec\bce\be_\b_r\bra\ban\bng\bge\be(\b()\b) *\b**\b**\b**\b**\b*\n-piece_index_t l\bla\bas\bst\bt_\b_p\bpi\bie\bec\bce\be () const;\n-index_range p\bpi\bie\bec\bce\be_\b_r\bra\ban\bng\bge\be () const;\n-piece_index_t e\ben\bnd\bd_\b_p\bpi\bie\bec\bce\be () const;\n-last_piece() returns the index to the last piece in the torrent and end_piece()\n-returns the index to the one-past-end piece in the torrent piece_range()\n-returns an implementation-defined type that can be used as the container in a\n-range-for loop. Where the values are the indices of all pieces in the\n-_\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bhe\bes\bs(\b()\b) i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh(\b()\b) *\b**\b**\b**\b**\b*\n-info_hash_t const& i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bhe\bes\bs () const;\n-sha1_hash i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh () const noexcept;\n-returns the info-hash of the torrent. For BitTorrent v2 support, use\n-info_hashes() to get an object that may hold both a v1 and v2 info-hash\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* v\bv1\b1(\b()\b) v\bv2\b2(\b()\b) *\b**\b**\b**\b**\b*\n-bool v\bv1\b1 () const;\n-bool v\bv2\b2 () const;\n-returns whether this torrent has v1 and/or v2 metadata, respectively. Hybrid\n-torrents have both. These are shortcuts for info_hashes().has_v1() and\n-info_hashes().has_v2() calls.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* n\bnu\bum\bm_\b_f\bfi\bil\ble\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n-int n\bnu\bum\bm_\b_f\bfi\bil\ble\bes\bs () const;\n-If you need index-access to files you can use the num_files() along with the\n-file_path(), file_size()-family of functions to access files using indices.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* m\bma\bap\bp_\b_b\bbl\blo\boc\bck\bk(\b()\b) *\b**\b**\b**\b**\b*\n-std::vector m\bma\bap\bp_\b_b\bbl\blo\boc\bck\bk (piece_index_t const piece\n- , std::int64_t offset, int size) const;\n-This function will map a piece index, a byte offset within that piece and a\n-size (in bytes) into the corresponding files with offsets where that data for\n-that piece is supposed to be stored. See _\bf_\bi_\bl_\be_\b__\bs_\bl_\bi_\bc_\be.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* m\bma\bap\bp_\b_f\bfi\bil\ble\be(\b()\b) *\b**\b**\b**\b**\b*\n-peer_request m\bma\bap\bp_\b_f\bfi\bil\ble\be (file_index_t const file, std::int64_t offset, int size)\n-const;\n-This function will map a range in a specific file into a range in the torrent.\n-The file_offset parameter is the offset in the file, given in bytes, where 0 is\n-the start of the file. See _\bp_\be_\be_\br_\b__\br_\be_\bq_\bu_\be_\bs_\bt.\n-The input range is assumed to be valid within the torrent. file_offset + size\n-is not allowed to be greater than the file size. file_index must refer to a\n-valid file, i.e. it cannot be >= num_files().\n+ std::string tracker_url = i->string();\n+ std::cout << tracker_url << \"\\n\";\n+}\n+To make it easier to extract information from a torrent file, the class\n+_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo exists.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* s\bss\bsl\bl_\b_c\bce\ber\brt\bt(\b()\b) *\b**\b**\b**\b**\b*\n-string_view s\bss\bsl\bl_\b_c\bce\ber\brt\bt () const;\n-Returns the SSL root certificate for the torrent, if it is an SSL torrent.\n-Otherwise returns an empty string. The certificate is the public certificate in\n-x509 format.\n+*\b**\b**\b**\b**\b* s\bsw\bwa\bap\bp(\b()\b) *\b**\b**\b**\b**\b*\n+void s\bsw\bwa\bap\bp (entry& e);\n+swaps the content of t\bth\bhi\bis\bs with e.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* i\bis\bs_\b_v\bva\bal\bli\bid\bd(\b()\b) *\b**\b**\b**\b**\b*\n-bool i\bis\bs_\b_v\bva\bal\bli\bid\bd () const;\n-returns true if this _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo object has a torrent loaded. This is\n-primarily used to determine if a magnet link has had its metadata resolved yet\n-or not.\n+*\b**\b**\b**\b**\b* o\bop\bpe\ber\bra\bat\bto\bor\br[\b[]\b](\b()\b) *\b**\b**\b**\b**\b*\n+entry& o\bop\bpe\ber\bra\bat\bto\bor\br[\b[]\b] (string_view key);\n+entry const& o\bop\bpe\ber\bra\bat\bto\bor\br[\b[]\b] (string_view key) const;\n+All of these functions requires the _\be_\bn_\bt_\br_\by to be a dictionary, if it isn't they\n+will throw system_error.\n+The non-const versions of the operator[] will return a reference to either the\n+existing element at the given key or, if there is no element with the given\n+key, a reference to a newly inserted element at that key.\n+The const version of operator[] will only return a reference to an existing\n+element at the given key. If the key is not found, it will throw system_error.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* p\bpr\bri\biv\bv(\b()\b) *\b**\b**\b**\b**\b*\n-bool p\bpr\bri\biv\bv () const;\n-returns true if this torrent is private. i.e., the client should not advertise\n-itself on the trackerless network (the Kademlia DHT) for this torrent.\n+*\b**\b**\b**\b**\b* f\bfi\bin\bnd\bd_\b_k\bke\bey\by(\b()\b) *\b**\b**\b**\b**\b*\n+entry* f\bfi\bin\bnd\bd_\b_k\bke\bey\by (string_view key);\n+entry const* f\bfi\bin\bnd\bd_\b_k\bke\bey\by (string_view key) const;\n+These functions requires the _\be_\bn_\bt_\br_\by to be a dictionary, if it isn't they will\n+throw system_error.\n+They will look for an element at the given key in the dictionary, if the\n+element cannot be found, they will return nullptr. If an element with the given\n+key is found, the return a pointer to it.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* i\bis\bs_\b_i\bi2\b2p\bp(\b()\b) *\b**\b**\b**\b**\b*\n-bool i\bis\bs_\b_i\bi2\b2p\bp () const;\n-returns true if this is an i2p torrent. This is determined by whether or not it\n-has a tracker whose URL domain name ends with \".i2p\". i2p torrents disable the\n-DHT and local peer discovery as well as talking to peers over anything other\n-than the i2p network.\n+*\b**\b**\b**\b**\b* t\bto\bo_\b_s\bst\btr\bri\bin\bng\bg(\b()\b) *\b**\b**\b**\b**\b*\n+std::string t\bto\bo_\b_s\bst\btr\bri\bin\bng\bg (bool single_line = false) const;\n+returns a pretty-printed string representation of the bencoded structure, with\n+JSON-style syntax\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* p\bpi\bie\bec\bce\be_\b_s\bsi\biz\bze\be(\b()\b) *\b**\b**\b**\b**\b*\n-int p\bpi\bie\bec\bce\be_\b_s\bsi\biz\bze\be (piece_index_t index) const;\n-returns the piece size of file with index. This will be the same as\n-_\bp_\bi_\be_\bc_\be_\b__\bl_\be_\bn_\bg_\bt_\bh_\b(_\b), except for the last piece, which may be shorter.\n+*\b**\b**\b**\b**\b* e\ben\bnu\bum\bm d\bda\bat\bta\ba_\b_t\bty\byp\bpe\be *\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\be_\bn_\bt_\br_\by_\b._\bh_\bp_\bp\"\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n+|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn|\n+|_\bi_\bn_\bt_\b__\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b0_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bs_\bt_\br_\bi_\bn_\bg_\b__\bt_\b _\b _\b _\b _\b _\b _\b|_\b1_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bl_\bi_\bs_\bt_\b__\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b2_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bd_\bi_\bc_\bt_\bi_\bo_\bn_\ba_\br_\by_\b__\bt_\b _\b _\b|_\b3_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bu_\bn_\bd_\be_\bf_\bi_\bn_\be_\bd_\b__\bt_\b _\b _\b _\b|_\b4_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bp_\br_\be_\bf_\bo_\br_\bm_\ba_\bt_\bt_\be_\bd_\b__\bt_\b|_\b5_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* h\bha\bas\bsh\bh_\b_f\bfo\bor\br_\b_p\bpi\bie\bec\bce\be_\b_p\bpt\btr\br(\b()\b) h\bha\bas\bsh\bh_\b_f\bfo\bor\br_\b_p\bpi\bie\bec\bce\be(\b()\b) *\b**\b**\b**\b**\b*\n-char const* h\bha\bas\bsh\bh_\b_f\bfo\bor\br_\b_p\bpi\bie\bec\bce\be_\b_p\bpt\btr\br (piece_index_t const index) const;\n-sha1_hash h\bha\bas\bsh\bh_\b_f\bfo\bor\br_\b_p\bpi\bie\bec\bce\be (piece_index_t index) const;\n-hash_for_piece() takes a piece-index and returns the 20-bytes sha1-hash for\n-that piece and info_hash() returns the 20-bytes sha1-hash for the info-section\n-of the torrent file. hash_for_piece_ptr() returns a pointer to the 20 byte sha1\n-digest for the piece. Note that the string is not 0-terminated.\n+*\b**\b**\b**\b**\b**\b* b\bbe\ben\bnc\bco\bod\bde\be(\b()\b) *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bb_\be_\bn_\bc_\bo_\bd_\be_\b._\bh_\bp_\bp\"\n+template int b\bbe\ben\bnc\bco\bod\bde\be (OutIt out, const entry& e);\n+This function will encode data to bencoded form.\n+The _\be_\bn_\bt_\br_\by class is the internal representation of the bencoded data and it can\n+be used to retrieve information, an _\be_\bn_\bt_\br_\by can also be build by the program and\n+given to bencode() to encode it into the OutIt iterator.\n+OutIt is an _\bO_\bu_\bt_\bp_\bu_\bt_\bI_\bt_\be_\br_\ba_\bt_\bo_\br. It's a template and usually instantiated as\n+_\bo_\bs_\bt_\br_\be_\ba_\bm_\b__\bi_\bt_\be_\br_\ba_\bt_\bo_\br or _\bb_\ba_\bc_\bk_\b__\bi_\bn_\bs_\be_\br_\bt_\b__\bi_\bt_\be_\br_\ba_\bt_\bo_\br. This function assumes the value_type\n+of the iterator is a char. In order to encode _\be_\bn_\bt_\br_\by e into a buffer, do:\n+std::vector buf;\n+bencode(std::back_inserter(buf), e);\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* n\bna\bam\bme\be(\b()\b) *\b**\b**\b**\b**\b*\n-const std::string& n\bna\bam\bme\be () const;\n-name() returns the name of the torrent. name contains UTF-8 encoded string.\n+*\b**\b**\b**\b**\b**\b* o\bop\bpe\ber\bra\bat\bto\bor\br<\b<<\b<(\b()\b) *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\be_\bn_\bt_\br_\by_\b._\bh_\bp_\bp\"\n+inline std::ostream& o\bop\bpe\ber\bra\bat\bto\bor\br<\b<<\b< (std::ostream& os, const entry& e);\n+prints the bencoded structure to the ostream as a JSON-style structure.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* c\bcr\bre\bea\bat\bti\bio\bon\bn_\b_d\bda\bat\bte\be(\b()\b) *\b**\b**\b**\b**\b*\n-std::time_t c\bcr\bre\bea\bat\bti\bio\bon\bn_\b_d\bda\bat\bte\be () const;\n-creation_date() returns the creation date of the torrent as time_t (_\bp_\bo_\bs_\bi_\bx\n-_\bt_\bi_\bm_\be). If there's no time stamp in the torrent file, 0 is returned. .. posix\n-time: _\bh_\bt_\bt_\bp_\b:_\b/_\b/_\bw_\bw_\bw_\b._\bo_\bp_\be_\bn_\bg_\br_\bo_\bu_\bp_\b._\bo_\br_\bg_\b/_\bo_\bn_\bl_\bi_\bn_\be_\bp_\bu_\bb_\bs_\b/_\b0_\b0_\b9_\b6_\b9_\b5_\b3_\b9_\b9_\b/_\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn_\bs_\b/_\bt_\bi_\bm_\be_\b._\bh_\bt_\bm_\bl\n+*\b**\b**\b**\b**\b**\b* i\bip\bp_\b_f\bfi\bil\blt\bte\ber\br *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bi_\bp_\b__\bf_\bi_\bl_\bt_\be_\br_\b._\bh_\bp_\bp\"\n+The ip_filter class is a set of rules that uniquely categorizes all ip\n+addresses as allowed or disallowed. The default constructor creates a single\n+rule that allows all addresses (0.0.0.0 - 255.255.255.255 for the IPv4 range,\n+and the equivalent range covering all addresses for the IPv6 range).\n+A default constructed _\bi_\bp_\b__\bf_\bi_\bl_\bt_\be_\br does not filter any address.\n+struct ip_filter\n+{\n+ i\bip\bp_\b_f\bfi\bil\blt\bte\ber\br (ip_filter&&);\n+ ip_filter& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (ip_filter const&);\n+ i\bip\bp_\b_f\bfi\bil\blt\bte\ber\br (ip_filter const&);\n+ ip_filter& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (ip_filter&&);\n+ i\bip\bp_\b_f\bfi\bil\blt\bte\ber\br ();\n+ ~\b~i\bip\bp_\b_f\bfi\bil\blt\bte\ber\br ();\n+ bool e\bem\bmp\bpt\bty\by () const;\n+ void a\bad\bdd\bd_\b_r\bru\bul\ble\be (address const& first, address const& last, std::uint32_t\n+flags);\n+ std::uint32_t a\bac\bcc\bce\bes\bss\bs (address const& addr) const;\n+ filter_tuple_t e\bex\bxp\bpo\bor\brt\bt_\b_f\bfi\bil\blt\bte\ber\br () const;\n+\n+ enum access_flags\n+ {\n+ blocked,\n+ };\n+};\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* c\bcr\bre\bea\bat\bto\bor\br(\b()\b) *\b**\b**\b**\b**\b*\n-const std::string& c\bcr\bre\bea\bat\bto\bor\br () const;\n-creator() returns the creator string in the torrent. If there is no creator\n-string it will return an empty string.\n+*\b**\b**\b**\b**\b* e\bem\bmp\bpt\bty\by(\b()\b) *\b**\b**\b**\b**\b*\n+bool e\bem\bmp\bpt\bty\by () const;\n+returns true if the filter does not contain any rules\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* c\bco\bom\bmm\bme\ben\bnt\bt(\b()\b) *\b**\b**\b**\b**\b*\n-const std::string& c\bco\bom\bmm\bme\ben\bnt\bt () const;\n-comment() returns the comment associated with the torrent. If there's no\n-comment, it will return an empty string. comment contains UTF-8 encoded string.\n+*\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_r\bru\bul\ble\be(\b()\b) *\b**\b**\b**\b**\b*\n+void a\bad\bdd\bd_\b_r\bru\bul\ble\be (address const& first, address const& last, std::uint32_t flags);\n+Adds a rule to the filter. first and last defines a range of ip addresses that\n+will be marked with the given flags. The flags can currently be 0, which means\n+allowed, or ip_filter::blocked, which means disallowed.\n+precondition: first.is_v4() == last.is_v4() && first.is_v6() == last.is_v6()\n+postcondition: access(x) == flags for every x in the range [first, last]\n+This means that in a case of overlapping ranges, the last one applied takes\n+precedence.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* n\bno\bod\bde\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n-std::vector> const& n\bno\bod\bde\bes\bs () const;\n-If this torrent contains any DHT nodes, they are put in this vector in their\n-original form (host name and port number).\n+*\b**\b**\b**\b**\b* a\bac\bcc\bce\bes\bss\bs(\b()\b) *\b**\b**\b**\b**\b*\n+std::uint32_t a\bac\bcc\bce\bes\bss\bs (address const& addr) const;\n+Returns the access permissions for the given address (addr). The permission can\n+currently be 0 or ip_filter::blocked. The complexity of this operation is O(log\n+n), where n is the minimum number of non-overlapping ranges to describe the\n+current filter.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_n\bno\bod\bde\be(\b()\b) *\b**\b**\b**\b**\b*\n-void a\bad\bdd\bd_\b_n\bno\bod\bde\be (std::pair const& node);\n-This is used when creating torrent. Use this to add a known DHT node. It may be\n-used, by the client, to bootstrap into the DHT network.\n+*\b**\b**\b**\b**\b* e\bex\bxp\bpo\bor\brt\bt_\b_f\bfi\bil\blt\bte\ber\br(\b()\b) *\b**\b**\b**\b**\b*\n+filter_tuple_t e\bex\bxp\bpo\bor\brt\bt_\b_f\bfi\bil\blt\bte\ber\br () const;\n+This function will return the current state of the filter in the minimum number\n+of ranges possible. They are sorted from ranges in low addresses to high\n+addresses. Each _\be_\bn_\bt_\br_\by in the returned vector is a range with the access control\n+specified in its flags field.\n+The return value is a tuple containing two range-lists. One for IPv4 addresses\n+and one for IPv6 addresses.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* p\bpa\bar\brs\bse\be_\b_i\bin\bnf\bfo\bo_\b_s\bse\bec\bct\bti\bio\bon\bn(\b()\b) *\b**\b**\b**\b**\b*\n-bool p\bpa\bar\brs\bse\be_\b_i\bin\bnf\bfo\bo_\b_s\bse\bec\bct\bti\bio\bon\bn (bdecode_node const& info, error_code& ec, int\n-max_pieces);\n-populates the _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo by providing just the info-dict buffer. This is used\n-when loading a torrent from a magnet link for instance, where we only have the\n-info-dict. The _\bb_\bd_\be_\bc_\bo_\bd_\be_\b__\bn_\bo_\bd_\be e points to a parsed info-dictionary. ec returns an\n-error code if something fails (typically if the info dictionary is malformed).\n-Themax_piecesparameter allows limiting the amount of memory dedicated to\n-loading the torrent, and fails for torrents that exceed the limit. To load\n-large torrents, this limit may also need to be raised in _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk_\b:_\b:\n-_\bm_\ba_\bx_\b__\bp_\bi_\be_\bc_\be_\b__\bc_\bo_\bu_\bn_\bt and in calls to _\br_\be_\ba_\bd_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b).\n+*\b**\b**\b**\b**\b* e\ben\bnu\bum\bm a\bac\bcc\bce\bes\bss\bs_\b_f\bfl\bla\bag\bgs\bs *\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bi_\bp_\b__\bf_\bi_\bl_\bt_\be_\br_\b._\bh_\bp_\bp\"\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n+|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|blocked|1 |indicates that IPs in this range should not be connected to nor|\n+|_\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\ba_\bc_\bc_\be_\bp_\bt_\be_\bd_\b _\ba_\bs_\b _\bi_\bn_\bc_\bo_\bm_\bi_\bn_\bg_\b _\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* i\bin\bnf\bfo\bo(\b()\b) *\b**\b**\b**\b**\b*\n-bdecode_node i\bin\bnf\bfo\bo (char const* key) const;\n-This function looks up keys from the info-dictionary of the loaded torrent\n-file. It can be used to access extension values put in the .torrent file. If\n-the specified key cannot be found, it returns nullptr.\n+*\b**\b**\b**\b**\b**\b* p\bpo\bor\brt\bt_\b_f\bfi\bil\blt\bte\ber\br *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bi_\bp_\b__\bf_\bi_\bl_\bt_\be_\br_\b._\bh_\bp_\bp\"\n+the port filter maps non-overlapping port ranges to flags. This is primarily\n+used to indicate whether a range of ports should be connected to or not. The\n+default is to have the full port range (0-65535) set to flag 0.\n+class port_filter\n+{\n+ p\bpo\bor\brt\bt_\b_f\bfi\bil\blt\bte\ber\br ();\n+ port_filter& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (port_filter const&);\n+ p\bpo\bor\brt\bt_\b_f\bfi\bil\blt\bte\ber\br (port_filter const&);\n+ p\bpo\bor\brt\bt_\b_f\bfi\bil\blt\bte\ber\br (port_filter&&);\n+ port_filter& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (port_filter&&);\n+ ~\b~p\bpo\bor\brt\bt_\b_f\bfi\bil\blt\bte\ber\br ();\n+ void a\bad\bdd\bd_\b_r\bru\bul\ble\be (std::uint16_t first, std::uint16_t last, std::uint32_t\n+flags);\n+ std::uint32_t a\bac\bcc\bce\bes\bss\bs (std::uint16_t port) const;\n+\n+ enum access_flags\n+ {\n+ blocked,\n+ };\n+};\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* i\bin\bnf\bfo\bo_\b_s\bse\bec\bct\bti\bio\bon\bn(\b()\b) *\b**\b**\b**\b**\b*\n-span i\bin\bnf\bfo\bo_\b_s\bse\bec\bct\bti\bio\bon\bn () const;\n-returns a the raw info section of the torrent file. The underlying buffer is\n-still owned by the _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo object\n+*\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_r\bru\bul\ble\be(\b()\b) *\b**\b**\b**\b**\b*\n+void a\bad\bdd\bd_\b_r\bru\bul\ble\be (std::uint16_t first, std::uint16_t last, std::uint32_t flags);\n+set the flags for the specified port range (first, last) to flags overwriting\n+any existing rule for those ports. The range is inclusive, i.e. the port last\n+also has the flag set on it.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* p\bpi\bie\bec\bce\be_\b_l\bla\bay\bye\ber\br(\b()\b) *\b**\b**\b**\b**\b*\n-span p\bpi\bie\bec\bce\be_\b_l\bla\bay\bye\ber\br (file_index_t) const;\n-return the bytes of the piece layer hashes for the specified file. If the file\n-doesn't have a piece layer, an empty span is returned. The span size is\n-divisible by 32, the size of a SHA-256 hash. If the size of the file is smaller\n-than or equal to the piece size, the files \"root hash\" is the hash of the file\n-and is not saved separately in the \"piece layers\" field, but this function\n-still returns the root hash of the file in that case.\n+*\b**\b**\b**\b**\b* a\bac\bcc\bce\bes\bss\bs(\b()\b) *\b**\b**\b**\b**\b*\n+std::uint32_t a\bac\bcc\bce\bes\bss\bs (std::uint16_t port) const;\n+test the specified port (port) for whether it is blocked or not. The returned\n+value is the flags set for this port. see _\ba_\bc_\bc_\be_\bs_\bs_\b__\bf_\bl_\ba_\bg_\bs.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* f\bfr\bre\bee\be_\b_p\bpi\bie\bec\bce\be_\b_l\bla\bay\bye\ber\brs\bs(\b()\b) *\b**\b**\b**\b**\b*\n-void f\bfr\bre\bee\be_\b_p\bpi\bie\bec\bce\be_\b_l\bla\bay\bye\ber\brs\bs ();\n-clears the piece layers from the _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo. This is done by the _\bs_\be_\bs_\bs_\bi_\bo_\bn when\n-a torrent is added, to avoid storing it twice. The piece layer (or other hashes\n-part of the merkle tree) are stored in the internal torrent object.\n-libtorrent has a _\bp_\bl_\bu_\bg_\bi_\bn interface for implementing extensions to the protocol.\n-These can be general extensions for transferring metadata or peer exchange\n-extensions, or it could be used to provide a way to customize the protocol to\n-fit a particular (closed) network.\n-In short, the _\bp_\bl_\bu_\bg_\bi_\bn interface makes it possible to:\n- * register extension messages (sent in the extension handshake), see\n- _\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\bs.\n- * add data and parse data from the extension handshake.\n- * send extension messages and standard bittorrent messages.\n- * override or block the handling of standard bittorrent messages.\n- * save and restore state via the _\bs_\be_\bs_\bs_\bi_\bo_\bn state\n- * see all alerts that are posted\n-*\b**\b**\b**\b**\b**\b* a\ba w\bwo\bor\brd\bd o\bof\bf c\bca\bau\but\bti\bio\bon\bn *\b**\b**\b**\b**\b**\b*\n-Writing your own _\bp_\bl_\bu_\bg_\bi_\bn is a very easy way to introduce serious bugs such as\n-dead locks and race conditions. Since a _\bp_\bl_\bu_\bg_\bi_\bn has access to internal\n-structures it is also quite easy to sabotage libtorrent's operation.\n-All the callbacks are always called from the libtorrent network thread. In case\n-portions of your _\bp_\bl_\bu_\bg_\bi_\bn are called from other threads, typically the main\n-thread, you cannot use any of the member functions on the internal structures\n-in libtorrent, since those require being called from the libtorrent network\n-thread . Furthermore, you also need to synchronize your own shared data within\n-the _\bp_\bl_\bu_\bg_\bi_\bn, to make sure it is not accessed at the same time from the\n-libtorrent thread (through a callback). If you need to send out a message from\n-another thread, it is advised to use an internal queue, and do the actual\n-sending in tick().\n-Since the _\bp_\bl_\bu_\bg_\bi_\bn interface gives you easy access to internal structures, it is\n-not supported as a stable API. Plugins should be considered specific to a\n-specific version of libtorrent. Although, in practice the internals mostly\n-don't change that dramatically.\n-*\b**\b**\b**\b**\b**\b* p\bpl\blu\bug\bgi\bin\bn-\b-i\bin\bnt\bte\ber\brf\bfa\bac\bce\be *\b**\b**\b**\b**\b**\b*\n-The _\bp_\bl_\bu_\bg_\bi_\bn interface consists of three base classes that the _\bp_\bl_\bu_\bg_\bi_\bn may\n-implement. These are called _\bp_\bl_\bu_\bg_\bi_\bn, _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\bl_\bu_\bg_\bi_\bn and _\bp_\be_\be_\br_\b__\bp_\bl_\bu_\bg_\bi_\bn. They are\n-found in the header.\n-These plugins are instantiated for each _\bs_\be_\bs_\bs_\bi_\bo_\bn, torrent and possibly each\n-peer, respectively.\n-For plugins that only need per torrent state, it is enough to only implement\n-torrent_plugin and pass a constructor function or function object to session::\n-add_extension() or torrent_handle::add_extension() (if the torrent has already\n-been started and you want to hook in the extension at run-time).\n-The signature of the function is:\n-std::shared_ptr (*)(torrent_handle const&, client_data_t);\n-The second argument is the userdata passed to session::add_torrent() or\n-torrent_handle::add_extension().\n-The function should return a std::shared_ptr which may or may\n-not be 0. If it is a nullptr, the extension is simply ignored for this torrent.\n-If it is a valid pointer (to a class inheriting torrent_plugin), it will be\n-associated with this torrent and callbacks will be made on torrent events.\n-For more elaborate plugins which require _\bs_\be_\bs_\bs_\bi_\bo_\bn wide state, you would\n-implement plugin, construct an object (in a std::shared_ptr) and pass it in to\n-session::add_extension().\n-*\b**\b**\b**\b**\b**\b* c\bcu\bus\bst\bto\bom\bm a\bal\ble\ber\brt\bts\bs *\b**\b**\b**\b**\b**\b*\n-Since plugins are running within internal libtorrent threads, one convenient\n-way to communicate with the client is to post custom alerts.\n-The expected interface of any _\ba_\bl_\be_\br_\bt, apart from deriving from the _\ba_\bl_\be_\br_\bt base\n-class, looks like this:\n-static const int alert_type = <\b\b>;\n-virtual int type() const { return alert_type; }\n-\n-virtual std::string message() const;\n-\n-static const alert_category_t static_category = <\b\b>;\n-virtual alert_category_t category() const { return static_category; }\n-\n-virtual char const* what() const { return <\b\b>; }\n-The alert_type is used for the type-checking in alert_cast. It must not collide\n-with any other _\ba_\bl_\be_\br_\bt. The built-in alerts in libtorrent will not use _\ba_\bl_\be_\br_\bt type\n-IDs greater than user_alert_id. When defining your own _\ba_\bl_\be_\br_\bt, make sure it's\n-greater than this constant.\n-type() is the run-time equivalence of the alert_type.\n-The message() virtual function is expected to construct a useful string\n-representation of the _\ba_\bl_\be_\br_\bt and the event or data it represents. Something\n-convenient to put in a log file for instance.\n-clone() is used internally to copy alerts. The suggested implementation of\n-simply allocating a new instance as a copy of *this is all that's expected.\n-The static category is required for checking whether or not the category for a\n-specific _\ba_\bl_\be_\br_\bt is enabled or not, without instantiating the _\ba_\bl_\be_\br_\bt. The category\n-virtual function is the run-time equivalence.\n-The what() virtual function may simply be a string literal of the class name of\n-your _\ba_\bl_\be_\br_\bt.\n-For more information, see the _\ba_\bl_\be_\br_\bt_\b _\bs_\be_\bc_\bt_\bi_\bo_\bn.\n+*\b**\b**\b**\b**\b* e\ben\bnu\bum\bm a\bac\bcc\bce\bes\bss\bs_\b_f\bfl\bla\bag\bgs\bs *\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bi_\bp_\b__\bf_\bi_\bl_\bt_\be_\br_\b._\bh_\bp_\bp\"\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n+|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|blocked|1 |this flag indicates that destination ports in the range should|\n+|_\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bn_\bo_\bt_\b _\bb_\be_\b _\bc_\bo_\bn_\bn_\be_\bc_\bt_\be_\bd_\b _\bt_\bo_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* p\bpl\blu\bug\bgi\bin\bn *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\bs_\b._\bh_\bp_\bp\"\n-this is the base class for a _\bs_\be_\bs_\bs_\bi_\bo_\bn _\bp_\bl_\bu_\bg_\bi_\bn. One primary feature is that it is\n-notified of all torrents that are added to the _\bs_\be_\bs_\bs_\bi_\bo_\bn, and can add its own\n-torrent_plugins.\n-struct plugin\n+*\b**\b**\b**\b**\b**\b* b\bbi\bit\btf\bfi\bie\bel\bld\bd *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd_\b._\bh_\bp_\bp\"\n+The _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd type stores any number of bits as a _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd in a heap allocated\n+array.\n+struct bitfield\n {\n- virtual feature_flags_t i\bim\bmp\bpl\ble\bem\bme\ben\bnt\bte\bed\bd_\b_f\bfe\bea\bat\btu\bur\bre\bes\bs ();\n- virtual std::shared_ptr n\bne\bew\bw_\b_t\bto\bor\brr\bre\ben\bnt\bt (torrent_handle const&,\n-client_data_t);\n- virtual void a\bad\bdd\bde\bed\bd (session_handle const&);\n- virtual void a\bab\bbo\bor\brt\bt ();\n- virtual bool o\bon\bn_\b_d\bdh\bht\bt_\b_r\bre\beq\bqu\bue\bes\bst\bt (string_view /\b/*\b* q\bqu\bue\ber\bry\by *\b*/\b/\n- , udp::endpoint const& /\b/*\b* s\bso\bou\bur\brc\bce\be *\b*/\b/, bdecode_node const& /\b/*\b* m\bme\bes\bss\bsa\bag\bge\be *\b*/\b/\n- , entry& /\b/*\b* r\bre\bes\bsp\bpo\bon\bns\bse\be *\b*/\b/);\n- virtual void o\bon\bn_\b_a\bal\ble\ber\brt\bt (alert const*);\n- virtual bool o\bon\bn_\b_u\bun\bnk\bkn\bno\bow\bwn\bn_\b_t\bto\bor\brr\bre\ben\bnt\bt (info_hash_t const& /\b/*\b* i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh *\b*/\b/\n- , peer_connection_handle const& /\b/*\b* p\bpc\bc *\b*/\b/, add_torrent_params& /\b/*\b* p\bp *\b*/\b/);\n- virtual void o\bon\bn_\b_t\bti\bic\bck\bk ();\n- virtual uint64_t g\bge\bet\bt_\b_u\bun\bnc\bch\bho\bok\bke\be_\b_p\bpr\bri\bio\bor\bri\bit\bty\by (peer_connection_handle const& /\b/*\b* p\bpe\bee\ber\br\n-*\b*/\b/);\n- virtual std::map s\bsa\bav\bve\be_\b_s\bst\bta\bat\bte\be () const;\n- virtual void l\blo\boa\bad\bd_\b_s\bst\bta\bat\bte\be (std::map const&);\n-\n- static constexpr feature_flags_t o\bop\bpt\bti\bim\bmi\bis\bst\bti\bic\bc_\b_u\bun\bnc\bch\bho\bok\bke\be_\b_f\bfe\bea\bat\btu\bur\bre\be = 1_bit;\n- static constexpr feature_flags_t t\bti\bic\bck\bk_\b_f\bfe\bea\bat\btu\bur\bre\be = 2_bit;\n- static constexpr feature_flags_t d\bdh\bht\bt_\b_r\bre\beq\bqu\bue\bes\bst\bt_\b_f\bfe\bea\bat\btu\bur\bre\be = 3_bit;\n- static constexpr feature_flags_t a\bal\ble\ber\brt\bt_\b_f\bfe\bea\bat\btu\bur\bre\be = 4_bit;\n- static constexpr feature_flags_t u\bun\bnk\bkn\bno\bow\bwn\bn_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfe\bea\bat\btu\bur\bre\be = 5_bit;\n+ b\bbi\bit\btf\bfi\bie\bel\bld\bd (bitfield&& rhs) noexcept = default;\n+ explicit b\bbi\bit\btf\bfi\bie\bel\bld\bd (int bits);\n+ b\bbi\bit\btf\bfi\bie\bel\bld\bd (int bits, bool val);\n+ b\bbi\bit\btf\bfi\bie\bel\bld\bd (char const* b, int bits);\n+ b\bbi\bit\btf\bfi\bie\bel\bld\bd () noexcept = default;\n+ b\bbi\bit\btf\bfi\bie\bel\bld\bd (bitfield const& rhs);\n+ void a\bas\bss\bsi\big\bgn\bn (char const* b, int const bits);\n+ bool g\bge\bet\bt_\b_b\bbi\bit\bt (int index) const noexcept;\n+ bool o\bop\bpe\ber\bra\bat\bto\bor\br[\b[]\b] (int index) const noexcept;\n+ void s\bse\bet\bt_\b_b\bbi\bit\bt (int index) noexcept;\n+ void c\bcl\ble\bea\bar\br_\b_b\bbi\bit\bt (int index) noexcept;\n+ bool a\bal\bll\bl_\b_s\bse\bet\bt () const noexcept;\n+ bool n\bno\bon\bne\be_\b_s\bse\bet\bt () const noexcept;\n+ int s\bsi\biz\bze\be () const noexcept;\n+ int n\bnu\bum\bm_\b_w\bwo\bor\brd\bds\bs () const noexcept;\n+ int n\bnu\bum\bm_\b_b\bby\byt\bte\bes\bs () const noexcept;\n+ bool e\bem\bmp\bpt\bty\by () const noexcept;\n+ char const* d\bda\bat\bta\ba () const noexcept;\n+ char* d\bda\bat\bta\ba () noexcept;\n+ void s\bsw\bwa\bap\bp (bitfield& rhs) noexcept;\n+ int c\bco\bou\bun\bnt\bt () const noexcept;\n+ int f\bfi\bin\bnd\bd_\b_f\bfi\bir\brs\bst\bt_\b_s\bse\bet\bt () const noexcept;\n+ int f\bfi\bin\bnd\bd_\b_l\bla\bas\bst\bt_\b_c\bcl\ble\bea\bar\br () const noexcept;\n+ bool o\bop\bpe\ber\bra\bat\bto\bor\br=\b==\b= (lt::bitfield const& rhs) const;\n };\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* i\bim\bmp\bpl\ble\bem\bme\ben\bnt\bte\bed\bd_\b_f\bfe\bea\bat\btu\bur\bre\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n-virtual feature_flags_t i\bim\bmp\bpl\ble\bem\bme\ben\bnt\bte\bed\bd_\b_f\bfe\bea\bat\btu\bur\bre\bes\bs ();\n-This function is expected to return a bitmask indicating which features this\n-_\bp_\bl_\bu_\bg_\bi_\bn implements. Some callbacks on this object may not be called unless the\n-corresponding feature flag is returned here. Note that callbacks may still be\n-called even if the corresponding feature is not specified in the return value\n-here. See feature_flags_t for possible flags to return.\n+*\b**\b**\b**\b**\b* b\bbi\bit\btf\bfi\bie\bel\bld\bd(\b()\b) *\b**\b**\b**\b**\b*\n+b\bbi\bit\btf\bfi\bie\bel\bld\bd (bitfield&& rhs) noexcept = default;\n+explicit b\bbi\bit\btf\bfi\bie\bel\bld\bd (int bits);\n+b\bbi\bit\btf\bfi\bie\bel\bld\bd (int bits, bool val);\n+b\bbi\bit\btf\bfi\bie\bel\bld\bd (char const* b, int bits);\n+b\bbi\bit\btf\bfi\bie\bel\bld\bd () noexcept = default;\n+b\bbi\bit\btf\bfi\bie\bel\bld\bd (bitfield const& rhs);\n+constructs a new _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd. The default constructor creates an empty _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd.\n+bits is the size of the _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd (specified in bits). val is the value to\n+initialize the bits to. If not specified all bits are initialized to 0.\n+The constructor taking a pointer b and bits copies a _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd from the\n+specified buffer, and bits number of bits (rounded up to the nearest byte\n+boundary).\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* n\bne\bew\bw_\b_t\bto\bor\brr\bre\ben\bnt\bt(\b()\b) *\b**\b**\b**\b**\b*\n-virtual std::shared_ptr n\bne\bew\bw_\b_t\bto\bor\brr\bre\ben\bnt\bt (torrent_handle const&,\n-client_data_t);\n-this is called by the _\bs_\be_\bs_\bs_\bi_\bo_\bn every time a new torrent is added. The torrent*\n-points to the internal torrent object created for the new torrent. The\n-_\bc_\bl_\bi_\be_\bn_\bt_\b__\bd_\ba_\bt_\ba_\b__\bt is the userdata pointer as passed in via _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs.\n-If the _\bp_\bl_\bu_\bg_\bi_\bn returns a _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\bl_\bu_\bg_\bi_\bn instance, it will be added to the new\n-torrent. Otherwise, return an empty shared_ptr to a _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\bl_\bu_\bg_\bi_\bn (the\n-default).\n+*\b**\b**\b**\b**\b* a\bas\bss\bsi\big\bgn\bn(\b()\b) *\b**\b**\b**\b**\b*\n+void a\bas\bss\bsi\big\bgn\bn (char const* b, int const bits);\n+copy _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd from buffer b of bits number of bits, rounded up to the nearest\n+byte boundary.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* a\bad\bdd\bde\bed\bd(\b()\b) *\b**\b**\b**\b**\b*\n-virtual void a\bad\bdd\bde\bed\bd (session_handle const&);\n-called when _\bp_\bl_\bu_\bg_\bi_\bn is added to a _\bs_\be_\bs_\bs_\bi_\bo_\bn\n+*\b**\b**\b**\b**\b* g\bge\bet\bt_\b_b\bbi\bit\bt(\b()\b) o\bop\bpe\ber\bra\bat\bto\bor\br[\b[]\b](\b()\b) *\b**\b**\b**\b**\b*\n+bool g\bge\bet\bt_\b_b\bbi\bit\bt (int index) const noexcept;\n+bool o\bop\bpe\ber\bra\bat\bto\bor\br[\b[]\b] (int index) const noexcept;\n+query bit at index. Returns true if bit is 1, otherwise false.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* a\bab\bbo\bor\brt\bt(\b()\b) *\b**\b**\b**\b**\b*\n-virtual void a\bab\bbo\bor\brt\bt ();\n-called when the _\bs_\be_\bs_\bs_\bi_\bo_\bn is aborted the _\bp_\bl_\bu_\bg_\bi_\bn should perform any cleanup\n-necessary to allow the session's destruction (e.g. cancel outstanding async\n-operations)\n+*\b**\b**\b**\b**\b* s\bse\bet\bt_\b_b\bbi\bit\bt(\b()\b) c\bcl\ble\bea\bar\br_\b_b\bbi\bit\bt(\b()\b) *\b**\b**\b**\b**\b*\n+void s\bse\bet\bt_\b_b\bbi\bit\bt (int index) noexcept;\n+void c\bcl\ble\bea\bar\br_\b_b\bbi\bit\bt (int index) noexcept;\n+set bit at index to 0 (clear_bit) or 1 (set_bit).\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* o\bon\bn_\b_d\bdh\bht\bt_\b_r\bre\beq\bqu\bue\bes\bst\bt(\b()\b) *\b**\b**\b**\b**\b*\n-virtual bool o\bon\bn_\b_d\bdh\bht\bt_\b_r\bre\beq\bqu\bue\bes\bst\bt (string_view /\b/*\b* q\bqu\bue\ber\bry\by *\b*/\b/\n- , udp::endpoint const& /\b/*\b* s\bso\bou\bur\brc\bce\be *\b*/\b/, bdecode_node const& /\b/*\b* m\bme\bes\bss\bsa\bag\bge\be *\b*/\b/\n- , entry& /\b/*\b* r\bre\bes\bsp\bpo\bon\bns\bse\be *\b*/\b/);\n-called when a dht request is received. If your _\bp_\bl_\bu_\bg_\bi_\bn expects this to be\n-called, make sure to include the flag dht_request_feature in the return value\n-from _\bi_\bm_\bp_\bl_\be_\bm_\be_\bn_\bt_\be_\bd_\b__\bf_\be_\ba_\bt_\bu_\br_\be_\bs_\b(_\b).\n+*\b**\b**\b**\b**\b* a\bal\bll\bl_\b_s\bse\bet\bt(\b()\b) *\b**\b**\b**\b**\b*\n+bool a\bal\bll\bl_\b_s\bse\bet\bt () const noexcept;\n+returns true if all bits in the _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd are set\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* o\bon\bn_\b_a\bal\ble\ber\brt\bt(\b()\b) *\b**\b**\b**\b**\b*\n-virtual void o\bon\bn_\b_a\bal\ble\ber\brt\bt (alert const*);\n-called when an _\ba_\bl_\be_\br_\bt is posted alerts that are filtered are not posted. If your\n-_\bp_\bl_\bu_\bg_\bi_\bn expects this to be called, make sure to include the flag alert_feature\n-in the return value from _\bi_\bm_\bp_\bl_\be_\bm_\be_\bn_\bt_\be_\bd_\b__\bf_\be_\ba_\bt_\bu_\br_\be_\bs_\b(_\b).\n+*\b**\b**\b**\b**\b* n\bno\bon\bne\be_\b_s\bse\bet\bt(\b()\b) *\b**\b**\b**\b**\b*\n+bool n\bno\bon\bne\be_\b_s\bse\bet\bt () const noexcept;\n+returns true if no bit in the _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd is set\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* o\bon\bn_\b_u\bun\bnk\bkn\bno\bow\bwn\bn_\b_t\bto\bor\brr\bre\ben\bnt\bt(\b()\b) *\b**\b**\b**\b**\b*\n-virtual bool o\bon\bn_\b_u\bun\bnk\bkn\bno\bow\bwn\bn_\b_t\bto\bor\brr\bre\ben\bnt\bt (info_hash_t const& /\b/*\b* i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh *\b*/\b/\n- , peer_connection_handle const& /\b/*\b* p\bpc\bc *\b*/\b/, add_torrent_params& /\b/*\b* p\bp *\b*/\b/);\n-return true if the _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs should be added\n+*\b**\b**\b**\b**\b* s\bsi\biz\bze\be(\b()\b) *\b**\b**\b**\b**\b*\n+int s\bsi\biz\bze\be () const noexcept;\n+returns the size of the _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd in bits.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* o\bon\bn_\b_t\bti\bic\bck\bk(\b()\b) *\b**\b**\b**\b**\b*\n-virtual void o\bon\bn_\b_t\bti\bic\bck\bk ();\n-called once per second. If your _\bp_\bl_\bu_\bg_\bi_\bn expects this to be called, make sure to\n-include the flag tick_feature in the return value from _\bi_\bm_\bp_\bl_\be_\bm_\be_\bn_\bt_\be_\bd_\b__\bf_\be_\ba_\bt_\bu_\br_\be_\bs_\b(_\b).\n+*\b**\b**\b**\b**\b* n\bnu\bum\bm_\b_w\bwo\bor\brd\bds\bs(\b()\b) *\b**\b**\b**\b**\b*\n+int n\bnu\bum\bm_\b_w\bwo\bor\brd\bds\bs () const noexcept;\n+returns the number of 32 bit words are needed to represent all bits in this\n+_\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* g\bge\bet\bt_\b_u\bun\bnc\bch\bho\bok\bke\be_\b_p\bpr\bri\bio\bor\bri\bit\bty\by(\b()\b) *\b**\b**\b**\b**\b*\n-virtual uint64_t g\bge\bet\bt_\b_u\bun\bnc\bch\bho\bok\bke\be_\b_p\bpr\bri\bio\bor\bri\bit\bty\by (peer_connection_handle const& /\b/*\b* p\bpe\bee\ber\br *\b*/\b/\n-);\n-called when choosing peers to optimistically unchoke. The return value\n-indicates the peer's priority for unchoking. Lower return values correspond to\n-higher priority. Priorities above 2^63-1 are reserved. If your _\bp_\bl_\bu_\bg_\bi_\bn has no\n-priority to assign a peer it should return 2^64-1. If your _\bp_\bl_\bu_\bg_\bi_\bn expects this\n-to be called, make sure to include the flag optimistic_unchoke_feature in the\n-return value from _\bi_\bm_\bp_\bl_\be_\bm_\be_\bn_\bt_\be_\bd_\b__\bf_\be_\ba_\bt_\bu_\br_\be_\bs_\b(_\b). If multiple plugins implement this\n-function the lowest return value (i.e. the highest priority) is used.\n+*\b**\b**\b**\b**\b* n\bnu\bum\bm_\b_b\bby\byt\bte\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n+int n\bnu\bum\bm_\b_b\bby\byt\bte\bes\bs () const noexcept;\n+returns the number of bytes needed to represent all bits in this _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* l\blo\boa\bad\bd_\b_s\bst\bta\bat\bte\be(\b()\b) *\b**\b**\b**\b**\b*\n-virtual void l\blo\boa\bad\bd_\b_s\bst\bta\bat\bte\be (std::map const&);\n-called on startup while loading settings state from the _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs\n+*\b**\b**\b**\b**\b* e\bem\bmp\bpt\bty\by(\b()\b) *\b**\b**\b**\b**\b*\n+bool e\bem\bmp\bpt\bty\by () const noexcept;\n+returns true if the _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd has zero size.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- optimistic_unchoke_feature\n- include this bit if your _\bp_\bl_\bu_\bg_\bi_\bn needs to alter the order of the\n- optimistic unchoke of peers. i.e. have the on_optimistic_unchoke()\n- callback be called.\n+*\b**\b**\b**\b**\b* d\bda\bat\bta\ba(\b()\b) *\b**\b**\b**\b**\b*\n+char const* d\bda\bat\bta\ba () const noexcept;\n+char* d\bda\bat\bta\ba () noexcept;\n+returns a pointer to the internal buffer of the _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd, or nullptr if it's\n+empty.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- tick_feature\n- include this bit if your _\bp_\bl_\bu_\bg_\bi_\bn needs to have _\bo_\bn_\b__\bt_\bi_\bc_\bk_\b(_\b) called\n+*\b**\b**\b**\b**\b* s\bsw\bwa\bap\bp(\b()\b) *\b**\b**\b**\b**\b*\n+void s\bsw\bwa\bap\bp (bitfield& rhs) noexcept;\n+swaps the bit-fields two variables refer to\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- dht_request_feature\n- include this bit if your _\bp_\bl_\bu_\bg_\bi_\bn needs to have _\bo_\bn_\b__\bd_\bh_\bt_\b__\br_\be_\bq_\bu_\be_\bs_\bt_\b(_\b) called\n+*\b**\b**\b**\b**\b* c\bco\bou\bun\bnt\bt(\b()\b) *\b**\b**\b**\b**\b*\n+int c\bco\bou\bun\bnt\bt () const noexcept;\n+count the number of bits in the _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd that are set to 1.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- alert_feature\n- include this bit if your _\bp_\bl_\bu_\bg_\bi_\bn needs to have _\bo_\bn_\b__\ba_\bl_\be_\br_\bt_\b(_\b) called\n+*\b**\b**\b**\b**\b* f\bfi\bin\bnd\bd_\b_f\bfi\bir\brs\bst\bt_\b_s\bse\bet\bt(\b()\b) *\b**\b**\b**\b**\b*\n+int f\bfi\bin\bnd\bd_\b_f\bfi\bir\brs\bst\bt_\b_s\bse\bet\bt () const noexcept;\n+returns the index of the first set bit in the _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd, i.e. 1 bit.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- unknown_torrent_feature\n- include this bit if your _\bp_\bl_\bu_\bg_\bi_\bn needs to have _\bo_\bn_\b__\bu_\bn_\bk_\bn_\bo_\bw_\bn_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b) called\n- even if there is no active torrent in the _\bs_\be_\bs_\bs_\bi_\bo_\bn\n+*\b**\b**\b**\b**\b* f\bfi\bin\bnd\bd_\b_l\bla\bas\bst\bt_\b_c\bcl\ble\bea\bar\br(\b()\b) *\b**\b**\b**\b**\b*\n+int f\bfi\bin\bnd\bd_\b_l\bla\bas\bst\bt_\b_c\bcl\ble\bea\bar\br () const noexcept;\n+returns the index to the last cleared bit in the _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd, i.e. 0 bit.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* t\bto\bor\brr\bre\ben\bnt\bt_\b_p\bpl\blu\bug\bgi\bin\bn *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\bs_\b._\bh_\bp_\bp\"\n-Torrent plugins are associated with a single torrent and have a number of\n-functions called at certain events. Many of its functions have the ability to\n-change or override the default libtorrent behavior.\n-struct torrent_plugin\n+*\b**\b**\b**\b**\b**\b* h\bha\bas\bsh\bhe\ber\br *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bh_\ba_\bs_\bh_\be_\br_\b._\bh_\bp_\bp\"\n+this is a SHA-1 hash class.\n+You use it by first instantiating it, then call update() to feed it with data.\n+i.e. you don't have to keep the entire buffer of which you want to create the\n+hash in memory. You can feed the _\bh_\ba_\bs_\bh_\be_\br parts of it at a time. When You have\n+fed the _\bh_\ba_\bs_\bh_\be_\br with all the data, you call final() and it will return the sha1-\n+hash of the data.\n+The constructor that takes a char const* and an integer will construct the sha1\n+context and feed it the data passed in.\n+If you want to reuse the _\bh_\ba_\bs_\bh_\be_\br object once you have created a hash, you have\n+to call reset() to reinitialize it.\n+The built-in software version of sha1-algorithm was implemented by Steve Reid\n+and released as public domain. For more info, see src/sha1.cpp.\n+class hasher\n {\n- virtual std::shared_ptr n\bne\bew\bw_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn (peer_connection_handle\n-const&);\n- virtual void o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_p\bpa\bas\bss\bs (piece_index_t);\n- virtual void o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_f\bfa\bai\bil\ble\bed\bd (piece_index_t);\n- virtual void t\bti\bic\bck\bk ();\n- virtual bool o\bon\bn_\b_r\bre\bes\bsu\bum\bme\be ();\n- virtual bool o\bon\bn_\b_p\bpa\bau\bus\bse\be ();\n- virtual void o\bon\bn_\b_f\bfi\bil\ble\bes\bs_\b_c\bch\bhe\bec\bck\bke\bed\bd ();\n- virtual void o\bon\bn_\b_s\bst\bta\bat\bte\be (torrent_status::state_t);\n- virtual void o\bon\bn_\b_a\bad\bdd\bd_\b_p\bpe\bee\ber\br (tcp::endpoint const&,\n- peer_source_flags_t, add_peer_flags_t);\n-\n- static constexpr add_peer_flags_t f\bfi\bir\brs\bst\bt_\b_t\bti\bim\bme\be = 1_bit;\n- static constexpr add_peer_flags_t f\bfi\bil\blt\bte\ber\bre\bed\bd = 2_bit;\n+ h\bha\bas\bsh\bhe\ber\br ();\n+ h\bha\bas\bsh\bhe\ber\br (char const* data, int len);\n+ hasher& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (hasher const&) &;\n+ h\bha\bas\bsh\bhe\ber\br (hasher const&);\n+ explicit h\bha\bas\bsh\bhe\ber\br (span data);\n+ hasher& u\bup\bpd\bda\bat\bte\be (span data);\n+ hasher& u\bup\bpd\bda\bat\bte\be (char const* data, int len);\n+ sha1_hash f\bfi\bin\bna\bal\bl ();\n+ void r\bre\bes\bse\bet\bt ();\n };\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* n\bne\bew\bw_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn(\b()\b) *\b**\b**\b**\b**\b*\n-virtual std::shared_ptr n\bne\bew\bw_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn (peer_connection_handle\n-const&);\n-This function is called each time a new peer is connected to the torrent. You\n-may choose to ignore this by just returning a default constructed shared_ptr\n-(in which case you don't need to override this member function).\n-If you need an extension to the peer connection (which most plugins do) you are\n-supposed to return an instance of your _\bp_\be_\be_\br_\b__\bp_\bl_\bu_\bg_\bi_\bn class. Which in turn will\n-have its hook functions called on event specific to that peer.\n-The peer_connection_handle will be valid as long as the shared_ptr is being\n-held by the torrent object. So, it is generally a good idea to not keep a\n-shared_ptr to your own _\bp_\be_\be_\br_\b__\bp_\bl_\bu_\bg_\bi_\bn. If you want to keep references to it, use\n-weak_ptr.\n-If this function throws an exception, the connection will be closed.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_p\bpa\bas\bss\bs(\b()\b) o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_f\bfa\bai\bil\ble\bed\bd(\b()\b) *\b**\b**\b**\b**\b*\n-virtual void o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_p\bpa\bas\bss\bs (piece_index_t);\n-virtual void o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_f\bfa\bai\bil\ble\bed\bd (piece_index_t);\n-These hooks are called when a piece passes the hash check or fails the hash\n-check, respectively. The index is the piece index that was downloaded. It is\n-possible to access the list of peers that participated in sending the piece\n-through the torrent and the piece_picker.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* t\bti\bic\bck\bk(\b()\b) *\b**\b**\b**\b**\b*\n-virtual void t\bti\bic\bck\bk ();\n-This hook is called approximately once per second. It is a way of making it\n-easy for plugins to do timed events, for sending messages or whatever.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* o\bon\bn_\b_p\bpa\bau\bus\bse\be(\b()\b) o\bon\bn_\b_r\bre\bes\bsu\bum\bme\be(\b()\b) *\b**\b**\b**\b**\b*\n-virtual bool o\bon\bn_\b_r\bre\bes\bsu\bum\bme\be ();\n-virtual bool o\bon\bn_\b_p\bpa\bau\bus\bse\be ();\n-These hooks are called when the torrent is paused and resumed respectively. The\n-return value indicates if the event was handled. A return value of true\n-indicates that it was handled, and no other _\bp_\bl_\bu_\bg_\bi_\bn after this one will have\n-this hook function called, and the standard handler will also not be invoked.\n-So, returning true effectively overrides the standard behavior of pause or\n-resume.\n-Note that if you call pause() or resume() on the torrent from your handler it\n-will recurse back into your handler, so in order to invoke the standard\n-handler, you have to keep your own state on whether you want standard behavior\n-or overridden behavior.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* o\bon\bn_\b_f\bfi\bil\ble\bes\bs_\b_c\bch\bhe\bec\bck\bke\bed\bd(\b()\b) *\b**\b**\b**\b**\b*\n-virtual void o\bon\bn_\b_f\bfi\bil\ble\bes\bs_\b_c\bch\bhe\bec\bck\bke\bed\bd ();\n-This function is called when the initial files of the torrent have been\n-checked. If there are no files to check, this function is called immediately.\n-i.e. This function is always called when the torrent is in a state where it can\n-start downloading.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* o\bon\bn_\b_s\bst\bta\bat\bte\be(\b()\b) *\b**\b**\b**\b**\b*\n-virtual void o\bon\bn_\b_s\bst\bta\bat\bte\be (torrent_status::state_t);\n-called when the torrent changes state the state is one of _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bs_\bt_\ba_\bt_\bu_\bs_\b:_\b:\n-_\bs_\bt_\ba_\bt_\be_\b__\bt enum members\n+*\b**\b**\b**\b**\b* h\bha\bas\bsh\bhe\ber\br(\b()\b) o\bop\bpe\ber\bra\bat\bto\bor\br=\b=(\b()\b) *\b**\b**\b**\b**\b*\n+h\bha\bas\bsh\bhe\ber\br (char const* data, int len);\n+hasher& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (hasher const&) &;\n+h\bha\bas\bsh\bhe\ber\br (hasher const&);\n+explicit h\bha\bas\bsh\bhe\ber\br (span data);\n+this is the same as default constructing followed by a call to update(data,\n+len).\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* o\bon\bn_\b_a\bad\bdd\bd_\b_p\bpe\bee\ber\br(\b()\b) *\b**\b**\b**\b**\b*\n-virtual void o\bon\bn_\b_a\bad\bdd\bd_\b_p\bpe\bee\ber\br (tcp::endpoint const&,\n- peer_source_flags_t, add_peer_flags_t);\n-called every time a new peer is added to the peer list. This is before the peer\n-is connected to. For flags, see torrent_plugin::flags_t. The source argument\n-refers to the source where we learned about this peer from. It's a bitmask,\n-because many sources may have told us about the same peer. For peer source\n-flags, see peer_info::peer_source_flags.\n+*\b**\b**\b**\b**\b* u\bup\bpd\bda\bat\bte\be(\b()\b) *\b**\b**\b**\b**\b*\n+hasher& u\bup\bpd\bda\bat\bte\be (span data);\n+hasher& u\bup\bpd\bda\bat\bte\be (char const* data, int len);\n+append the following bytes to what is being hashed\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- first_time\n- this is the first time we see this peer\n+*\b**\b**\b**\b**\b* f\bfi\bin\bna\bal\bl(\b()\b) *\b**\b**\b**\b**\b*\n+sha1_hash f\bfi\bin\bna\bal\bl ();\n+returns the SHA-1 digest of the buffers previously passed to _\bu_\bp_\bd_\ba_\bt_\be_\b(_\b) and the\n+_\bh_\ba_\bs_\bh_\be_\br constructor.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- filtered\n- this peer was not added because it was filtered by the IP filter\n+*\b**\b**\b**\b**\b* r\bre\bes\bse\bet\bt(\b()\b) *\b**\b**\b**\b**\b*\n+void r\bre\bes\bse\bet\bt ();\n+restore the _\bh_\ba_\bs_\bh_\be_\br state to be as if the _\bh_\ba_\bs_\bh_\be_\br has just been default\n+constructed.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* p\bpe\bee\ber\br_\b_p\bpl\blu\bug\bgi\bin\bn *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\bs_\b._\bh_\bp_\bp\"\n-peer plugins are associated with a specific peer. A peer could be both a\n-regular bittorrent peer (bt_peer_connection) or one of the web seed connections\n-(web_peer_connection or http_seed_connection). In order to only attach to\n-certain peers, make your torrent_plugin::new_connection only return a _\bp_\bl_\bu_\bg_\bi_\bn\n-for certain peer connection types\n-struct peer_plugin\n+*\b**\b**\b**\b**\b**\b* h\bha\bas\bsh\bhe\ber\br2\b25\b56\b6 *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bh_\ba_\bs_\bh_\be_\br_\b._\bh_\bp_\bp\"\n+class hasher256\n {\n- virtual string_view t\bty\byp\bpe\be () const;\n- virtual void a\bad\bdd\bd_\b_h\bha\ban\bnd\bds\bsh\bha\bak\bke\be (entry&);\n- virtual void o\bon\bn_\b_d\bdi\bis\bsc\bco\bon\bnn\bne\bec\bct\bt (error_code const&);\n- virtual void o\bon\bn_\b_c\bco\bon\bnn\bne\bec\bct\bte\bed\bd ();\n- virtual bool o\bon\bn_\b_h\bha\ban\bnd\bds\bsh\bha\bak\bke\be (span);\n- virtual bool o\bon\bn_\b_e\bex\bxt\bte\ben\bns\bsi\bio\bon\bn_\b_h\bha\ban\bnd\bds\bsh\bha\bak\bke\be (bdecode_node const&);\n- virtual bool o\bon\bn_\b_r\bre\beq\bqu\bue\bes\bst\bt (peer_request const&);\n- virtual bool o\bon\bn_\b_h\bha\bav\bve\be_\b_n\bno\bon\bne\be ();\n- virtual bool o\bon\bn_\b_h\bha\bav\bve\be_\b_a\bal\bll\bl ();\n- virtual bool o\bon\bn_\b_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd ();\n- virtual bool o\bon\bn_\b_c\bch\bho\bok\bke\be ();\n- virtual bool o\bon\bn_\b_u\bun\bnc\bch\bho\bok\bke\be ();\n- virtual bool o\bon\bn_\b_b\bbi\bit\btf\bfi\bie\bel\bld\bd (bitfield const& /\b/*\b*b\bbi\bit\btf\bfi\bie\bel\bld\bd*\b*/\b/);\n- virtual bool o\bon\bn_\b_n\bno\bot\bt_\b_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd ();\n- virtual bool o\bon\bn_\b_d\bdo\bon\bnt\bt_\b_h\bha\bav\bve\be (piece_index_t);\n- virtual bool o\bon\bn_\b_h\bha\bav\bve\be (piece_index_t);\n- virtual bool o\bon\bn_\b_a\bal\bll\blo\bow\bwe\bed\bd_\b_f\bfa\bas\bst\bt (piece_index_t);\n- virtual bool o\bon\bn_\b_p\bpi\bie\bec\bce\be (peer_request const& /\b/*\b*p\bpi\bie\bec\bce\be*\b*/\b/\n- , span /\b/*\b*b\bbu\buf\bf*\b*/\b/);\n- virtual bool o\bon\bn_\b_s\bsu\bug\bgg\bge\bes\bst\bt (piece_index_t);\n- virtual bool o\bon\bn_\b_c\bca\ban\bnc\bce\bel\bl (peer_request const&);\n- virtual bool o\bon\bn_\b_r\bre\bej\bje\bec\bct\bt (peer_request const&);\n- virtual void s\bse\ben\bnt\bt_\b_h\bha\bav\bve\be_\b_a\bal\bll\bl ();\n- virtual void s\bse\ben\bnt\bt_\b_r\bre\beq\bqu\bue\bes\bst\bt (peer_request const&);\n- virtual void s\bse\ben\bnt\bt_\b_c\bch\bho\bok\bke\be ();\n- virtual void s\bse\ben\bnt\bt_\b_s\bsu\bug\bgg\bge\bes\bst\bt (piece_index_t);\n- virtual void s\bse\ben\bnt\bt_\b_a\bal\bll\blo\bow\bw_\b_f\bfa\bas\bst\bt (piece_index_t);\n- virtual void s\bse\ben\bnt\bt_\b_r\bre\bej\bje\bec\bct\bt_\b_r\bre\beq\bqu\bue\bes\bst\bt (peer_request const&);\n- virtual void s\bse\ben\bnt\bt_\b_c\bca\ban\bnc\bce\bel\bl (peer_request const&);\n- virtual void s\bse\ben\bnt\bt_\b_h\bha\bav\bve\be_\b_n\bno\bon\bne\be ();\n- virtual void s\bse\ben\bnt\bt_\b_h\bha\bav\bve\be (piece_index_t);\n- virtual void s\bse\ben\bnt\bt_\b_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd ();\n- virtual void s\bse\ben\bnt\bt_\b_u\bun\bnc\bch\bho\bok\bke\be ();\n- virtual void s\bse\ben\bnt\bt_\b_p\bpi\bie\bec\bce\be (peer_request const&);\n- virtual void s\bse\ben\bnt\bt_\b_n\bno\bot\bt_\b_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd ();\n- virtual void s\bse\ben\bnt\bt_\b_p\bpa\bay\byl\blo\boa\bad\bd (int /\b/*\b* b\bby\byt\bte\bes\bs *\b*/\b/);\n- virtual bool c\bca\ban\bn_\b_d\bdi\bis\bsc\bco\bon\bnn\bne\bec\bct\bt (error_code const& /\b/*\b*e\bec\bc*\b*/\b/);\n- virtual bool o\bon\bn_\b_e\bex\bxt\bte\ben\bnd\bde\bed\bd (int /\b/*\b*l\ble\ben\bng\bgt\bth\bh*\b*/\b/, int /\b/*\b*m\bms\bsg\bg*\b*/\b/,\n- span /\b/*\b*b\bbo\bod\bdy\by*\b*/\b/);\n- virtual bool o\bon\bn_\b_u\bun\bnk\bkn\bno\bow\bwn\bn_\b_m\bme\bes\bss\bsa\bag\bge\be (int /\b/*\b*l\ble\ben\bng\bgt\bth\bh*\b*/\b/, int /\b/*\b*m\bms\bsg\bg*\b*/\b/,\n- span /\b/*\b*b\bbo\bod\bdy\by*\b*/\b/);\n- virtual void o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_p\bpa\bas\bss\bs (piece_index_t);\n- virtual void o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_f\bfa\bai\bil\ble\bed\bd (piece_index_t);\n- virtual void t\bti\bic\bck\bk ();\n- virtual bool w\bwr\bri\bit\bte\be_\b_r\bre\beq\bqu\bue\bes\bst\bt (peer_request const&);\n+ h\bha\bas\bsh\bhe\ber\br2\b25\b56\b6 ();\n+ explicit h\bha\bas\bsh\bhe\ber\br2\b25\b56\b6 (span data);\n+ h\bha\bas\bsh\bhe\ber\br2\b25\b56\b6 (char const* data, int len);\n+ hasher256& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (hasher256 const&) &;\n+ h\bha\bas\bsh\bhe\ber\br2\b25\b56\b6 (hasher256 const&);\n+ hasher256& u\bup\bpd\bda\bat\bte\be (char const* data, int len);\n+ hasher256& u\bup\bpd\bda\bat\bte\be (span data);\n+ sha256_hash f\bfi\bin\bna\bal\bl ();\n+ void r\bre\bes\bse\bet\bt ();\n+ ~\b~h\bha\bas\bsh\bhe\ber\br2\b25\b56\b6 ();\n };\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* t\bty\byp\bpe\be(\b()\b) *\b**\b**\b**\b**\b*\n-virtual string_view t\bty\byp\bpe\be () const;\n-This function is expected to return the name of the _\bp_\bl_\bu_\bg_\bi_\bn.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* a\bad\bdd\bd_\b_h\bha\ban\bnd\bds\bsh\bha\bak\bke\be(\b()\b) *\b**\b**\b**\b**\b*\n-virtual void a\bad\bdd\bd_\b_h\bha\ban\bnd\bds\bsh\bha\bak\bke\be (entry&);\n-can add entries to the extension handshake this is not called for web seeds\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* o\bon\bn_\b_d\bdi\bis\bsc\bco\bon\bnn\bne\bec\bct\bt(\b()\b) *\b**\b**\b**\b**\b*\n-virtual void o\bon\bn_\b_d\bdi\bis\bsc\bco\bon\bnn\bne\bec\bct\bt (error_code const&);\n-called when the peer is being disconnected.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* o\bon\bn_\b_c\bco\bon\bnn\bne\bec\bct\bte\bed\bd(\b()\b) *\b**\b**\b**\b**\b*\n-virtual void o\bon\bn_\b_c\bco\bon\bnn\bne\bec\bct\bte\bed\bd ();\n-called when the peer is successfully connected. Note that incoming connections\n-will have been connected by the time the peer _\bp_\bl_\bu_\bg_\bi_\bn is attached to it, and\n-won't have this hook called.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* o\bon\bn_\b_h\bha\ban\bnd\bds\bsh\bha\bak\bke\be(\b()\b) *\b**\b**\b**\b**\b*\n-virtual bool o\bon\bn_\b_h\bha\ban\bnd\bds\bsh\bha\bak\bke\be (span);\n-this is called when the initial bittorrent handshake is received. Returning\n-false means that the other end doesn't support this extension and will remove\n-it from the list of plugins. this is not called for web seeds\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* o\bon\bn_\b_e\bex\bxt\bte\ben\bns\bsi\bio\bon\bn_\b_h\bha\ban\bnd\bds\bsh\bha\bak\bke\be(\b()\b) *\b**\b**\b**\b**\b*\n-virtual bool o\bon\bn_\b_e\bex\bxt\bte\ben\bns\bsi\bio\bon\bn_\b_h\bha\ban\bnd\bds\bsh\bha\bak\bke\be (bdecode_node const&);\n-called when the extension handshake from the other end is received if this\n-returns false, it means that this extension isn't supported by this peer. It\n-will result in this _\bp_\be_\be_\br_\b__\bp_\bl_\bu_\bg_\bi_\bn being removed from the peer_connection and\n-destructed. this is not called for web seeds\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* o\bon\bn_\b_n\bno\bot\bt_\b_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd(\b()\b) o\bon\bn_\b_c\bch\bho\bok\bke\be(\b()\b) o\bon\bn_\b_u\bun\bnc\bch\bho\bok\bke\be(\b()\b) o\bon\bn_\b_d\bdo\bon\bnt\bt_\b_h\bha\bav\bve\be(\b()\b)\n-o\bon\bn_\b_a\bal\bll\blo\bow\bwe\bed\bd_\b_f\bfa\bas\bst\bt(\b()\b) o\bon\bn_\b_h\bha\bav\bve\be_\b_a\bal\bll\bl(\b()\b) o\bon\bn_\b_h\bha\bav\bve\be(\b()\b) o\bon\bn_\b_b\bbi\bit\btf\bfi\bie\bel\bld\bd(\b()\b) o\bon\bn_\b_r\bre\beq\bqu\bue\bes\bst\bt(\b()\b)\n-o\bon\bn_\b_h\bha\bav\bve\be_\b_n\bno\bon\bne\be(\b()\b) o\bon\bn_\b_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd(\b()\b) *\b**\b**\b**\b**\b*\n-virtual bool o\bon\bn_\b_r\bre\beq\bqu\bue\bes\bst\bt (peer_request const&);\n-virtual bool o\bon\bn_\b_h\bha\bav\bve\be_\b_n\bno\bon\bne\be ();\n-virtual bool o\bon\bn_\b_h\bha\bav\bve\be_\b_a\bal\bll\bl ();\n-virtual bool o\bon\bn_\b_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd ();\n-virtual bool o\bon\bn_\b_c\bch\bho\bok\bke\be ();\n-virtual bool o\bon\bn_\b_u\bun\bnc\bch\bho\bok\bke\be ();\n-virtual bool o\bon\bn_\b_b\bbi\bit\btf\bfi\bie\bel\bld\bd (bitfield const& /\b/*\b*b\bbi\bit\btf\bfi\bie\bel\bld\bd*\b*/\b/);\n-virtual bool o\bon\bn_\b_n\bno\bot\bt_\b_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd ();\n-virtual bool o\bon\bn_\b_d\bdo\bon\bnt\bt_\b_h\bha\bav\bve\be (piece_index_t);\n-virtual bool o\bon\bn_\b_h\bha\bav\bve\be (piece_index_t);\n-virtual bool o\bon\bn_\b_a\bal\bll\blo\bow\bwe\bed\bd_\b_f\bfa\bas\bst\bt (piece_index_t);\n-returning true from any of the message handlers indicates that the _\bp_\bl_\bu_\bg_\bi_\bn has\n-handled the message. it will break the _\bp_\bl_\bu_\bg_\bi_\bn chain traversing and not let\n-anyone else handle the message, including the default handler.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* o\bon\bn_\b_p\bpi\bie\bec\bce\be(\b()\b) *\b**\b**\b**\b**\b*\n-virtual bool o\bon\bn_\b_p\bpi\bie\bec\bce\be (peer_request const& /\b/*\b*p\bpi\bie\bec\bce\be*\b*/\b/\n- , span /\b/*\b*b\bbu\buf\bf*\b*/\b/);\n-This function is called when the peer connection is receiving a piece. buf\n-points (non-owning pointer) to the data in an internal immutable disk buffer.\n-The length of the data is specified in the length member of the piece\n-parameter. returns true to indicate that the piece is handled and the rest of\n-the logic should be ignored.\n+*\b**\b**\b**\b**\b* o\bop\bpe\ber\bra\bat\bto\bor\br=\b=(\b()\b) h\bha\bas\bsh\bhe\ber\br2\b25\b56\b6(\b()\b) *\b**\b**\b**\b**\b*\n+explicit h\bha\bas\bsh\bhe\ber\br2\b25\b56\b6 (span data);\n+h\bha\bas\bsh\bhe\ber\br2\b25\b56\b6 (char const* data, int len);\n+hasher256& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (hasher256 const&) &;\n+h\bha\bas\bsh\bhe\ber\br2\b25\b56\b6 (hasher256 const&);\n+this is the same as default constructing followed by a call to update(data,\n+len).\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* s\bse\ben\bnt\bt_\b_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd(\b()\b) s\bse\ben\bnt\bt_\b_u\bun\bnc\bch\bho\bok\bke\be(\b()\b) s\bse\ben\bnt\bt_\b_h\bha\bav\bve\be(\b()\b) s\bse\ben\bnt\bt_\b_p\bpi\bie\bec\bce\be(\b()\b)\n-s\bse\ben\bnt\bt_\b_n\bno\bot\bt_\b_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd(\b()\b) *\b**\b**\b**\b**\b*\n-virtual void s\bse\ben\bnt\bt_\b_h\bha\bav\bve\be (piece_index_t);\n-virtual void s\bse\ben\bnt\bt_\b_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd ();\n-virtual void s\bse\ben\bnt\bt_\b_u\bun\bnc\bch\bho\bok\bke\be ();\n-virtual void s\bse\ben\bnt\bt_\b_p\bpi\bie\bec\bce\be (peer_request const&);\n-virtual void s\bse\ben\bnt\bt_\b_n\bno\bot\bt_\b_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd ();\n-called after a choke message has been sent to the peer\n+*\b**\b**\b**\b**\b* u\bup\bpd\bda\bat\bte\be(\b()\b) *\b**\b**\b**\b**\b*\n+hasher256& u\bup\bpd\bda\bat\bte\be (char const* data, int len);\n+hasher256& u\bup\bpd\bda\bat\bte\be (span data);\n+append the following bytes to what is being hashed\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* s\bse\ben\bnt\bt_\b_p\bpa\bay\byl\blo\boa\bad\bd(\b()\b) *\b**\b**\b**\b**\b*\n-virtual void s\bse\ben\bnt\bt_\b_p\bpa\bay\byl\blo\boa\bad\bd (int /\b/*\b* b\bby\byt\bte\bes\bs *\b*/\b/);\n-called after piece data has been sent to the peer this can be used for stats\n-book keeping\n+*\b**\b**\b**\b**\b* f\bfi\bin\bna\bal\bl(\b()\b) *\b**\b**\b**\b**\b*\n+sha256_hash f\bfi\bin\bna\bal\bl ();\n+returns the SHA-1 digest of the buffers previously passed to _\bu_\bp_\bd_\ba_\bt_\be_\b(_\b) and the\n+_\bh_\ba_\bs_\bh_\be_\br constructor.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* c\bca\ban\bn_\b_d\bdi\bis\bsc\bco\bon\bnn\bne\bec\bct\bt(\b()\b) *\b**\b**\b**\b**\b*\n-virtual bool c\bca\ban\bn_\b_d\bdi\bis\bsc\bco\bon\bnn\bne\bec\bct\bt (error_code const& /\b/*\b*e\bec\bc*\b*/\b/);\n-called when libtorrent think this peer should be disconnected. if the _\bp_\bl_\bu_\bg_\bi_\bn\n-returns false, the peer will not be disconnected.\n+*\b**\b**\b**\b**\b* r\bre\bes\bse\bet\bt(\b()\b) *\b**\b**\b**\b**\b*\n+void r\bre\bes\bse\bet\bt ();\n+restore the _\bh_\ba_\bs_\bh_\be_\br state to be as if the _\bh_\ba_\bs_\bh_\be_\br has just been default\n+constructed.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* o\bon\bn_\b_e\bex\bxt\bte\ben\bnd\bde\bed\bd(\b()\b) *\b**\b**\b**\b**\b*\n-virtual bool o\bon\bn_\b_e\bex\bxt\bte\ben\bnd\bde\bed\bd (int /\b/*\b*l\ble\ben\bng\bgt\bth\bh*\b*/\b/, int /\b/*\b*m\bms\bsg\bg*\b*/\b/,\n- span /\b/*\b*b\bbo\bod\bdy\by*\b*/\b/);\n-called when an extended message is received. If returning true, the message is\n-not processed by any other _\bp_\bl_\bu_\bg_\bi_\bn and if false is returned the next _\bp_\bl_\bu_\bg_\bi_\bn in\n-the chain will receive it to be able to handle it. This is not called for web\n-seeds. thus function may be called more than once per incoming message, but\n-only the last of the calls will the body size equal the length. i.e. Every time\n-another fragment of the message is received, this function will be called,\n-until finally the whole message has been received. The purpose of this is to\n-allow early disconnects for invalid messages and for reporting progress of\n-receiving large messages.\n+*\b**\b**\b**\b**\b**\b* p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_t\bty\byp\bpe\be_\b_f\bfi\bil\blt\bte\ber\br *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b__\bt_\by_\bp_\be_\b__\bf_\bi_\bl_\bt_\be_\br_\b._\bh_\bp_\bp\"\n+peer_class_type_filter is a simple container for rules for adding and\n+subtracting peer-classes from peers. It is applied a\baf\bft\bte\ber\br the peer class filter\n+is applied (which is based on the peer's IP address).\n+struct peer_class_type_filter\n+{\n+ void a\bad\bdd\bd (socket_type_t const st, peer_class_t const peer_class);\n+ void r\bre\bem\bmo\bov\bve\be (socket_type_t const st, peer_class_t const peer_class);\n+ void d\bdi\bis\bsa\bal\bll\blo\bow\bw (socket_type_t const st, peer_class_t const peer_class);\n+ void a\bal\bll\blo\bow\bw (socket_type_t const st, peer_class_t const peer_class);\n+ std::uint32_t a\bap\bpp\bpl\bly\by (socket_type_t const st, std::uint32_t peer_class_mask);\n+ friend bool o\bop\bpe\ber\bra\bat\bto\bor\br=\b==\b= (peer_class_type_filter const& lhs\n+ , peer_class_type_filter const& rhs);\n+\n+ enum socket_type_t\n+ {\n+ tcp_socket,\n+ utp_socket,\n+ ssl_tcp_socket,\n+ ssl_utp_socket,\n+ i2p_socket,\n+ num_socket_types,\n+ };\n+};\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* o\bon\bn_\b_u\bun\bnk\bkn\bno\bow\bwn\bn_\b_m\bme\bes\bss\bsa\bag\bge\be(\b()\b) *\b**\b**\b**\b**\b*\n-virtual bool o\bon\bn_\b_u\bun\bnk\bkn\bno\bow\bwn\bn_\b_m\bme\bes\bss\bsa\bag\bge\be (int /\b/*\b*l\ble\ben\bng\bgt\bth\bh*\b*/\b/, int /\b/*\b*m\bms\bsg\bg*\b*/\b/,\n- span /\b/*\b*b\bbo\bod\bdy\by*\b*/\b/);\n-this is not called for web seeds\n+*\b**\b**\b**\b**\b* r\bre\bem\bmo\bov\bve\be(\b()\b) a\bad\bdd\bd(\b()\b) *\b**\b**\b**\b**\b*\n+void a\bad\bdd\bd (socket_type_t const st, peer_class_t const peer_class);\n+void r\bre\bem\bmo\bov\bve\be (socket_type_t const st, peer_class_t const peer_class);\n+add() and remove() adds and removes a peer class to be added to new peers based\n+on socket type.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_p\bpa\bas\bss\bs(\b()\b) o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_f\bfa\bai\bil\ble\bed\bd(\b()\b) *\b**\b**\b**\b**\b*\n-virtual void o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_p\bpa\bas\bss\bs (piece_index_t);\n-virtual void o\bon\bn_\b_p\bpi\bie\bec\bce\be_\b_f\bfa\bai\bil\ble\bed\bd (piece_index_t);\n-called when a piece that this peer participated in either fails or passes the\n-hash_check\n+*\b**\b**\b**\b**\b* a\bal\bll\blo\bow\bw(\b()\b) d\bdi\bis\bsa\bal\bll\blo\bow\bw(\b()\b) *\b**\b**\b**\b**\b*\n+void d\bdi\bis\bsa\bal\bll\blo\bow\bw (socket_type_t const st, peer_class_t const peer_class);\n+void a\bal\bll\blo\bow\bw (socket_type_t const st, peer_class_t const peer_class);\n+disallow() and allow() adds and removes a peer class to be removed from new\n+peers based on socket type.\n+The peer_class argument cannot be greater than 31. The bitmasks representing\n+peer classes in the peer_class_type_filter are 32 bits.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* t\bti\bic\bck\bk(\b()\b) *\b**\b**\b**\b**\b*\n-virtual void t\bti\bic\bck\bk ();\n-called approximately once every second\n+*\b**\b**\b**\b**\b* a\bap\bpp\bpl\bly\by(\b()\b) *\b**\b**\b**\b**\b*\n+std::uint32_t a\bap\bpp\bpl\bly\by (socket_type_t const st, std::uint32_t peer_class_mask);\n+takes a bitmask of peer classes and returns a new bitmask of peer classes after\n+the rules have been applied, based on the socket type argument (st).\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* w\bwr\bri\bit\bte\be_\b_r\bre\beq\bqu\bue\bes\bst\bt(\b()\b) *\b**\b**\b**\b**\b*\n-virtual bool w\bwr\bri\bit\bte\be_\b_r\bre\beq\bqu\bue\bes\bst\bt (peer_request const&);\n-called each time a request message is to be sent. If true is returned, the\n-original request message won't be sent and no other _\bp_\bl_\bu_\bg_\bi_\bn will have this\n-function called.\n+*\b**\b**\b**\b**\b* e\ben\bnu\bum\bm s\bso\boc\bck\bke\bet\bt_\b_t\bty\byp\bpe\be_\b_t\bt *\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b__\bt_\by_\bp_\be_\b__\bf_\bi_\bl_\bt_\be_\br_\b._\bh_\bp_\bp\"\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n+|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|tcp_socket |0 |these match the socket types from socket_type.hpp|\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bs_\bh_\bi_\bf_\bt_\be_\bd_\b _\bo_\bn_\be_\b _\bd_\bo_\bw_\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bu_\bt_\bp_\b__\bs_\bo_\bc_\bk_\be_\bt_\b _\b _\b _\b _\b _\b _\b|_\b1_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bs_\bs_\bl_\b__\bt_\bc_\bp_\b__\bs_\bo_\bc_\bk_\be_\bt_\b _\b _\b|_\b2_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bs_\bs_\bl_\b__\bu_\bt_\bp_\b__\bs_\bo_\bc_\bk_\be_\bt_\b _\b _\b|_\b3_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bi_\b2_\bp_\b__\bs_\bo_\bc_\bk_\be_\bt_\b _\b _\b _\b _\b _\b _\b|_\b4_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bn_\bu_\bm_\b__\bs_\bo_\bc_\bk_\be_\bt_\b__\bt_\by_\bp_\be_\bs_\b|_\b5_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* c\bcr\bry\byp\bpt\bto\bo_\b_p\bpl\blu\bug\bgi\bin\bn *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\bs_\b._\bh_\bp_\bp\"\n-struct crypto_plugin\n+*\b**\b**\b**\b**\b**\b* p\bpe\bee\ber\br_\b_c\bcl\bla\bas\bss\bs_\b_i\bin\bnf\bfo\bo *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b._\bh_\bp_\bp\"\n+holds settings for a peer class. Used in _\bs_\be_\bt_\b__\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b(_\b) and _\bg_\be_\bt_\b__\bp_\be_\be_\br_\b__\bc_\bl_\ba_\bs_\bs_\b(_\b)\n+calls.\n+struct peer_class_info\n {\n- virtual void s\bse\bet\bt_\b_o\bou\but\btg\bgo\boi\bin\bng\bg_\b_k\bke\bey\by (span key) = 0;\n- virtual void s\bse\bet\bt_\b_i\bin\bnc\bco\bom\bmi\bin\bng\bg_\b_k\bke\bey\by (span key) = 0;\n- e\ben\bnc\bcr\bry\byp\bpt\bt (span> /\b/*\b*s\bse\ben\bnd\bd_\b_v\bve\bec\bc*\b*/\b/) = 0;\n- virtual std::tuple d\bde\bec\bcr\bry\byp\bpt\bt (span> /\b/*\b*r\bre\bec\bce\bei\biv\bve\be_\b_v\bve\bec\bc*\b*/\b/\n-) = 0;\n+ bool ignore_unchoke_slots;\n+ int connection_limit_factor;\n+ std::string label;\n+ int upload_limit;\n+ int download_limit;\n+ int upload_priority;\n+ int download_priority;\n };\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* d\bde\bec\bcr\bry\byp\bpt\bt(\b()\b) *\b**\b**\b**\b**\b*\n-virtual std::tuple d\bde\bec\bcr\bry\byp\bpt\bt (span> /\b/*\b*r\bre\bec\bce\bei\biv\bve\be_\b_v\bve\bec\bc*\b*/\b/) =\n-0;\n-decrypt the provided buffers. returns is a tuple representing the values\n-(consume, produce, packet_size)\n-consume is set to the number of bytes which should be trimmed from the head of\n-the buffers, default is 0\n-produce is set to the number of bytes of payload which are now ready to be sent\n-to the upper layer. default is the number of bytes passed in receive_vec\n-packet_size is set to the minimum number of bytes which must be read to advance\n-the next step of decryption. default is 0\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* p\bpe\bee\ber\br_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn_\b_h\bha\ban\bnd\bdl\ble\be *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bp_\be_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b__\bh_\ba_\bn_\bd_\bl_\be_\b._\bh_\bp_\bp\"\n-the _\bp_\be_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b__\bh_\ba_\bn_\bd_\bl_\be class provides a handle to the internal peer\n-connection object, to be used by plugins. This is a low level interface that\n-may not be stable across libtorrent versions\n-struct peer_connection_handle\n-{\n- explicit p\bpe\bee\ber\br_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn_\b_h\bha\ban\bnd\bdl\ble\be (std::weak_ptr impl);\n- connection_type t\bty\byp\bpe\be () const;\n- void a\bad\bdd\bd_\b_e\bex\bxt\bte\ben\bns\bsi\bio\bon\bn (std::shared_ptr);\n- peer_plugin const* f\bfi\bin\bnd\bd_\b_p\bpl\blu\bug\bgi\bin\bn (string_view type) const;\n- bool i\bis\bs_\b_s\bse\bee\bed\bd () const;\n- bool u\bup\bpl\blo\boa\bad\bd_\b_o\bon\bnl\bly\by () const;\n- bool h\bha\bas\bs_\b_p\bpi\bie\bec\bce\be (piece_index_t i) const;\n- peer_id const& p\bpi\bid\bd () const;\n- bool i\bis\bs_\b_c\bch\bho\bok\bke\bed\bd () const;\n- bool i\bis\bs_\b_i\bin\bnt\bte\ber\bre\bes\bst\bti\bin\bng\bg () const;\n- bool i\bis\bs_\b_p\bpe\bee\ber\br_\b_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd () const;\n- bool h\bha\bas\bs_\b_p\bpe\bee\ber\br_\b_c\bch\bho\bok\bke\bed\bd () const;\n- void c\bch\bho\bok\bke\be_\b_t\bth\bhi\bis\bs_\b_p\bpe\bee\ber\br ();\n- void m\bma\bay\byb\bbe\be_\b_u\bun\bnc\bch\bho\bok\bke\be_\b_t\bth\bhi\bis\bs_\b_p\bpe\bee\ber\br ();\n- void g\bge\bet\bt_\b_p\bpe\bee\ber\br_\b_i\bin\bnf\bfo\bo (peer_info& p) const;\n- torrent_handle a\bas\bss\bso\boc\bci\bia\bat\bte\bed\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt () const;\n- _\bt_\bc_\bp_\b:_\b:_\be_\bn_\bd_\bp_\bo_\bi_\bn_\bt const& r\bre\bem\bmo\bot\bte\be () const;\n- _\bt_\bc_\bp_\b:_\b:_\be_\bn_\bd_\bp_\bo_\bi_\bn_\bt l\blo\boc\bca\bal\bl_\b_e\ben\bnd\bdp\bpo\boi\bin\bnt\bt () const;\n- bool i\bis\bs_\b_c\bco\bon\bnn\bne\bec\bct\bti\bin\bng\bg () const;\n- bool i\bis\bs_\b_d\bdi\bis\bsc\bco\bon\bnn\bne\bec\bct\bti\bin\bng\bg () const;\n- void d\bdi\bis\bsc\bco\bon\bnn\bne\bec\bct\bt (error_code const& ec, operation_t op\n- , disconnect_severity_t = peer_connection_interface::normal);\n- bool i\bis\bs_\b_o\bou\but\btg\bgo\boi\bin\bng\bg () const;\n- bool i\big\bgn\bno\bor\bre\be_\b_u\bun\bnc\bch\bho\bok\bke\be_\b_s\bsl\blo\bot\bts\bs () const;\n- bool o\bon\bn_\b_l\blo\boc\bca\bal\bl_\b_n\bne\bet\btw\bwo\bor\brk\bk () const;\n- bool f\bfa\bai\bil\ble\bed\bd () const;\n- void p\bpe\bee\ber\br_\b_l\blo\bog\bg (peer_log_alert::direction_t direction\n- , char const* event, char const* fmt = \"\", ...) const TORRENT_FORMAT\n-(4,5);\n- bool s\bsh\bho\bou\bul\bld\bd_\b_l\blo\bog\bg (peer_log_alert::direction_t direction) const;\n- bool c\bca\ban\bn_\b_d\bdi\bis\bsc\bco\bon\bnn\bne\bec\bct\bt (error_code const& ec) const;\n- bool h\bha\bas\bs_\b_m\bme\bet\bta\bad\bda\bat\bta\ba () const;\n- bool i\bin\bn_\b_h\bha\ban\bnd\bds\bsh\bha\bak\bke\be () const;\n- void s\bse\ben\bnd\bd_\b_b\bbu\buf\bff\bfe\ber\br (char const* begin, int size);\n- time_point t\bti\bim\bme\be_\b_o\bof\bf_\b_l\bla\bas\bst\bt_\b_u\bun\bnc\bch\bho\bok\bke\be () const;\n- std::time_t l\bla\bas\bst\bt_\b_s\bse\bee\ben\bn_\b_c\bco\bom\bmp\bpl\ble\bet\bte\be () const;\n- bool o\bop\bpe\ber\bra\bat\bto\bor\br<\b< (peer_connection_handle const& o) const;\n- bool o\bop\bpe\ber\bra\bat\bto\bor\br!\b!=\b= (peer_connection_handle const& o) const;\n- bool o\bop\bpe\ber\bra\bat\bto\bor\br=\b==\b= (peer_connection_handle const& o) const;\n- std::shared_ptr n\bna\bat\bti\biv\bve\be_\b_h\bha\ban\bnd\bdl\ble\be () const;\n-};\n+ ignore_unchoke_slots\n+ ignore_unchoke_slots determines whether peers should always unchoke a\n+ peer, regardless of the choking algorithm, or if it should honor the\n+ unchoke slot limits. It's used for local peers by default. If a\ban\bny\by of the\n+ peer classes a peer belongs to has this set to true, that peer will be\n+ unchoked at all times.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* b\bbt\bt_\b_p\bpe\bee\ber\br_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn_\b_h\bha\ban\bnd\bdl\ble\be *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bp_\be_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b__\bh_\ba_\bn_\bd_\bl_\be_\b._\bh_\bp_\bp\"\n-The _\bb_\bt_\b__\bp_\be_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b__\bh_\ba_\bn_\bd_\bl_\be provides a handle to the internal bittorrent peer\n-connection object to plugins. It's low level and may not be a stable API across\n-libtorrent versions.\n-struct bt_peer_connection_handle : peer_connection_handle\n-{\n- explicit b\bbt\bt_\b_p\bpe\bee\ber\br_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn_\b_h\bha\ban\bnd\bdl\ble\be (peer_connection_handle pc);\n- bool s\bsu\bup\bpp\bpo\bor\brt\bt_\b_e\bex\bxt\bte\ben\bns\bsi\bio\bon\bns\bs () const;\n- bool p\bpa\bac\bck\bke\bet\bt_\b_f\bfi\bin\bni\bis\bsh\bhe\bed\bd () const;\n- bool s\bsu\bup\bpp\bpo\bor\brt\bts\bs_\b_e\ben\bnc\bcr\bry\byp\bpt\bti\bio\bon\bn () const;\n- void s\bsw\bwi\bit\btc\bch\bh_\b_r\bre\bec\bcv\bv_\b_c\bcr\bry\byp\bpt\bto\bo (std::shared_ptr crypto);\n- void s\bsw\bwi\bit\btc\bch\bh_\b_s\bse\ben\bnd\bd_\b_c\bcr\bry\byp\bpt\bto\bo (std::shared_ptr crypto);\n- std::shared_ptr n\bna\bat\bti\biv\bve\be_\b_h\bha\ban\bnd\bdl\ble\be () const;\n-};\n+ connection_limit_factor\n+ adjusts the connection limit (global and per torrent) that applies to\n+ this peer class. By default, local peers are allowed to exceed the normal\n+ connection limit for instance. This is specified as a percent factor. 100\n+ makes the peer class apply normally to the limit. 200 means as long as\n+ there are fewer connections than twice the limit, we accept this peer.\n+ This factor applies both to the global connection limit and the per-\n+ torrent limit. Note that if not used carefully one peer class can\n+ potentially completely starve out all other over time.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* c\bcr\bre\bea\bat\bte\be_\b_u\but\bt_\b_p\bpe\bex\bx_\b_p\bpl\blu\bug\bgi\bin\bn(\b()\b) *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\bs_\b/_\bu_\bt_\b__\bp_\be_\bx_\b._\bh_\bp_\bp\"\n-std::shared_ptr c\bcr\bre\bea\bat\bte\be_\b_u\but\bt_\b_p\bpe\bex\bx_\b_p\bpl\blu\bug\bgi\bin\bn (torrent_handle const&,\n-client_data_t);\n-constructor function for the ut_pex extension. The ut_pex extension allows\n-peers to gossip about their connections, allowing the swarm stay well connected\n-and peers aware of more peers in the swarm. This extension is enabled by\n-default unless explicitly disabled in the _\bs_\be_\bs_\bs_\bi_\bo_\bn constructor.\n-This can either be passed in the add_torrent_params::extensions field, or via\n-_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be_\b:_\b:_\ba_\bd_\bd_\b__\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\b(_\b).\n+ label\n+ not used by libtorrent. It's intended as a potentially user-facing\n+ identifier of this peer class.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* c\bcr\bre\bea\bat\bte\be_\b_u\but\bt_\b_m\bme\bet\bta\bad\bda\bat\bta\ba_\b_p\bpl\blu\bug\bgi\bin\bn(\b()\b) *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\bs_\b/_\bu_\bt_\b__\bm_\be_\bt_\ba_\bd_\ba_\bt_\ba_\b._\bh_\bp_\bp\"\n-std::shared_ptr c\bcr\bre\bea\bat\bte\be_\b_u\but\bt_\b_m\bme\bet\bta\bad\bda\bat\bta\ba_\b_p\bpl\blu\bug\bgi\bin\bn (torrent_handle\n-const&, client_data_t);\n-constructor function for the ut_metadata extension. The ut_metadata extension\n-allows peers to request the .torrent file (or more specifically the info-\n-dictionary of the .torrent file) from each other. This is the main building\n-block in making magnet links work. This extension is enabled by default unless\n-explicitly disabled in the _\bs_\be_\bs_\bs_\bi_\bo_\bn constructor.\n-This can either be passed in the add_torrent_params::extensions field, or via\n-_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be_\b:_\b:_\ba_\bd_\bd_\b__\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\b(_\b).\n+ upload_limit download_limit\n+ transfer rates limits for the whole peer class. They are specified in\n+ bytes per second and apply to the sum of all peers that are members of\n+ this class.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* c\bcr\bre\bea\bat\bte\be_\b_s\bsm\bma\bar\brt\bt_\b_b\bba\ban\bn_\b_p\bpl\blu\bug\bgi\bin\bn(\b()\b) *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\bs_\b/_\bs_\bm_\ba_\br_\bt_\b__\bb_\ba_\bn_\b._\bh_\bp_\bp\"\n-std::shared_ptr c\bcr\bre\bea\bat\bte\be_\b_s\bsm\bma\bar\brt\bt_\b_b\bba\ban\bn_\b_p\bpl\blu\bug\bgi\bin\bn (torrent_handle const&,\n-client_data_t);\n-constructor function for the smart ban extension. The extension keeps track of\n-the data peers have sent us for failing pieces and once the piece completes and\n-passes the hash check bans the peers that turned out to have sent corrupt data.\n-This function can either be passed in the add_torrent_params::extensions field,\n-or via _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be_\b:_\b:_\ba_\bd_\bd_\b__\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\b(_\b).\n+ upload_priority download_priority\n+ relative priorities used by the bandwidth allocator in the rate limiter.\n+ If no rate limits are in use, the priority is not used either. Priorities\n+ start at 1 (0 is not a valid priority) and may not exceed 255.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* s\bst\bto\bor\bra\bag\bge\be_\b_e\ber\brr\bro\bor\br *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\be_\br_\br_\bo_\br_\b__\bc_\bo_\bd_\be_\b._\bh_\bp_\bp\"\n used by storage to return errors also includes which underlying file the error\n happened on\n struct storage_error\n {\n explicit operator b\bbo\boo\bol\bl () const;\n- file_index_t f\bfi\bil\ble\be () const;\n void f\bfi\bil\ble\be (file_index_t f);\n+ file_index_t f\bfi\bil\ble\be () const;\n \n error_code ec;\n operation_t operation;\n };\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* b\bbo\boo\bol\bl(\b()\b) *\b**\b**\b**\b**\b*\n explicit operator b\bbo\boo\bol\bl () const;\n explicitly converts to true if this object represents an error, and false if it\n does not.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* f\bfi\bil\ble\be(\b()\b) *\b**\b**\b**\b**\b*\n-file_index_t f\bfi\bil\ble\be () const;\n void f\bfi\bil\ble\be (file_index_t f);\n+file_index_t f\bfi\bil\ble\be () const;\n set and query the index (in the torrent) of the file this error occurred on.\n This may also have special values defined in _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bs_\bt_\ba_\bt_\bu_\bs.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n ec\n the error that occurred\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n operation\n A code from _\bo_\bp_\be_\br_\ba_\bt_\bi_\bo_\bn_\b__\bt enum, indicating what kind of operation failed.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* p\bpc\bcp\bp_\b_c\bca\bat\bte\beg\bgo\bor\bry\by(\b()\b) *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bn_\ba_\bt_\bp_\bm_\bp_\b._\bh_\bp_\bp\"\n boost::system::error_category& p\bpc\bcp\bp_\b_c\bca\bat\bte\beg\bgo\bor\bry\by ();\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* b\bbd\bde\bec\bco\bod\bde\be_\b_c\bca\bat\bte\beg\bgo\bor\bry\by(\b()\b) *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bb_\bd_\be_\bc_\bo_\bd_\be_\b._\bh_\bp_\bp\"\n+boost::system::error_category& b\bbd\bde\bec\bco\bod\bde\be_\b_c\bca\bat\bte\beg\bgo\bor\bry\by ();\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* g\bgz\bzi\bip\bp_\b_c\bca\bat\bte\beg\bgo\bor\bry\by(\b()\b) *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bg_\bz_\bi_\bp_\b._\bh_\bp_\bp\"\n boost::system::error_category& g\bgz\bzi\bip\bp_\b_c\bca\bat\bte\beg\bgo\bor\bry\by ();\n get the error_category for zip errors\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* b\bbd\bde\bec\bco\bod\bde\be_\b_c\bca\bat\bte\beg\bgo\bor\bry\by(\b()\b) *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bb_\bd_\be_\bc_\bo_\bd_\be_\b._\bh_\bp_\bp\"\n-boost::system::error_category& b\bbd\bde\bec\bco\bod\bde\be_\b_c\bca\bat\bte\beg\bgo\bor\bry\by ();\n+*\b**\b**\b**\b**\b**\b* s\bso\boc\bck\bks\bs_\b_c\bca\bat\bte\beg\bgo\bor\bry\by(\b()\b) *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\bo_\bc_\bk_\bs_\b5_\b__\bs_\bt_\br_\be_\ba_\bm_\b._\bh_\bp_\bp\"\n+boost::system::error_category& s\bso\boc\bck\bks\bs_\b_c\bca\bat\bte\beg\bgo\bor\bry\by ();\n+returns the error_category for SOCKS5 errors\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* u\bup\bpn\bnp\bp_\b_c\bca\bat\bte\beg\bgo\bor\bry\by(\b()\b) *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bu_\bp_\bn_\bp_\b._\bh_\bp_\bp\"\n boost::system::error_category& u\bup\bpn\bnp\bp_\b_c\bca\bat\bte\beg\bgo\bor\bry\by ();\n the boost.system error category for UPnP errors\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* i\bi2\b2p\bp_\b_c\bca\bat\bte\beg\bgo\bor\bry\by(\b()\b) *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bi_\b2_\bp_\b__\bs_\bt_\br_\be_\ba_\bm_\b._\bh_\bp_\bp\"\n boost::system::error_category& i\bi2\b2p\bp_\b_c\bca\bat\bte\beg\bgo\bor\bry\by ();\n returns the error category for I2P errors\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* s\bso\boc\bck\bks\bs_\b_c\bca\bat\bte\beg\bgo\bor\bry\by(\b()\b) *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\bo_\bc_\bk_\bs_\b5_\b__\bs_\bt_\br_\be_\ba_\bm_\b._\bh_\bp_\bp\"\n-boost::system::error_category& s\bso\boc\bck\bks\bs_\b_c\bca\bat\bte\beg\bgo\bor\bry\by ();\n-returns the error_category for SOCKS5 errors\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt_\b_c\bca\bat\bte\beg\bgo\bor\bry\by(\b()\b) *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\be_\br_\br_\bo_\br_\b__\bc_\bo_\bd_\be_\b._\bh_\bp_\bp\"\n boost::system::error_category& l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt_\b_c\bca\bat\bte\beg\bgo\bor\bry\by ();\n return the instance of the libtorrent_error_category which maps libtorrent\n error codes to human readable error messages.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* h\bht\btt\btp\bp_\b_c\bca\bat\bte\beg\bgo\bor\bry\by(\b()\b) *\b**\b**\b**\b**\b**\b*\n@@ -12170,14 +12170,29 @@\n |_\bp_\bc_\bp_\b__\bu_\bn_\bs_\bu_\bp_\bp_\b__\bp_\br_\bo_\bt_\bo_\bc_\bo_\bl_\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b9_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |_\bp_\bc_\bp_\b__\bu_\bs_\be_\br_\b__\be_\bx_\b__\bq_\bu_\bo_\bt_\ba_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b0_\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |_\bp_\bc_\bp_\b__\bc_\ba_\bn_\bn_\bo_\bt_\b__\bp_\br_\bo_\bv_\bi_\bd_\be_\b__\be_\bx_\bt_\be_\br_\bn_\ba_\bl_\b|_\b1_\b1_\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |_\bp_\bc_\bp_\b__\ba_\bd_\bd_\br_\be_\bs_\bs_\b__\bm_\bi_\bs_\bm_\ba_\bt_\bc_\bh_\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b2_\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |_\bp_\bc_\bp_\b__\be_\bx_\bc_\be_\bs_\bs_\bi_\bv_\be_\b__\br_\be_\bm_\bo_\bt_\be_\b__\bp_\be_\be_\br_\bs_\b _\b|_\b1_\b3_\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* e\ben\bnu\bum\bm e\ber\brr\bro\bor\br_\b_c\bco\bod\bde\be_\b_e\ben\bnu\bum\bm *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bb_\bd_\be_\bc_\bo_\bd_\be_\b._\bh_\bp_\bp\"\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n+|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bn_\bo_\b__\be_\br_\br_\bo_\br_\b _\b _\b _\b _\b _\b _\b|_\b0_\b _\b _\b _\b _\b|_\bN_\bo_\bt_\b _\ba_\bn_\b _\be_\br_\br_\bo_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\be_\bx_\bp_\be_\bc_\bt_\be_\bd_\b__\bd_\bi_\bg_\bi_\bt_\b|_\b1_\b _\b _\b _\b _\b|_\be_\bx_\bp_\be_\bc_\bt_\be_\bd_\b _\bd_\bi_\bg_\bi_\bt_\b _\bi_\bn_\b _\bb_\be_\bn_\bc_\bo_\bd_\be_\bd_\b _\bs_\bt_\br_\bi_\bn_\bg_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\be_\bx_\bp_\be_\bc_\bt_\be_\bd_\b__\bc_\bo_\bl_\bo_\bn_\b|_\b2_\b _\b _\b _\b _\b|_\be_\bx_\bp_\be_\bc_\bt_\be_\bd_\b _\bc_\bo_\bl_\bo_\bn_\b _\bi_\bn_\b _\bb_\be_\bn_\bc_\bo_\bd_\be_\bd_\b _\bs_\bt_\br_\bi_\bn_\bg_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bu_\bn_\be_\bx_\bp_\be_\bc_\bt_\be_\bd_\b__\be_\bo_\bf_\b|_\b3_\b _\b _\b _\b _\b|_\bu_\bn_\be_\bx_\bp_\be_\bc_\bt_\be_\bd_\b _\be_\bn_\bd_\b _\bo_\bf_\b _\bf_\bi_\bl_\be_\b _\bi_\bn_\b _\bb_\be_\bn_\bc_\bo_\bd_\be_\bd_\b _\bs_\bt_\br_\bi_\bn_\bg_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|expected_value|4 |expected value (list, dict, _\bi_\bn_\bt or string) in bencoded|\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bs_\bt_\br_\bi_\bn_\bg_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bd_\be_\bp_\bt_\bh_\b__\be_\bx_\bc_\be_\be_\bd_\be_\bd_\b|_\b5_\b _\b _\b _\b _\b|_\bb_\be_\bn_\bc_\bo_\bd_\be_\bd_\b _\br_\be_\bc_\bu_\br_\bs_\bi_\bo_\bn_\b _\bd_\be_\bp_\bt_\bh_\b _\bl_\bi_\bm_\bi_\bt_\b _\be_\bx_\bc_\be_\be_\bd_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bl_\bi_\bm_\bi_\bt_\b__\be_\bx_\bc_\be_\be_\bd_\be_\bd_\b|_\b6_\b _\b _\b _\b _\b|_\bb_\be_\bn_\bc_\bo_\bd_\be_\bd_\b _\bi_\bt_\be_\bm_\b _\bc_\bo_\bu_\bn_\bt_\b _\bl_\bi_\bm_\bi_\bt_\b _\be_\bx_\bc_\be_\be_\bd_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bo_\bv_\be_\br_\bf_\bl_\bo_\bw_\b _\b _\b _\b _\b _\b _\b|_\b7_\b _\b _\b _\b _\b|_\bi_\bn_\bt_\be_\bg_\be_\br_\b _\bo_\bv_\be_\br_\bf_\bl_\bo_\bw_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\be_\br_\br_\bo_\br_\b__\bc_\bo_\bd_\be_\b__\bm_\ba_\bx_\b|_\b8_\b _\b _\b _\b _\b|_\bt_\bh_\be_\b _\bn_\bu_\bm_\bb_\be_\br_\b _\bo_\bf_\b _\be_\br_\br_\bo_\br_\b _\bc_\bo_\bd_\be_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* e\ben\bnu\bum\bm e\ber\brr\bro\bor\br_\b_c\bco\bod\bde\be_\b_e\ben\bnu\bum\bm *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bg_\bz_\bi_\bp_\b._\bh_\bp_\bp\"\n _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n |_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |_\bn_\bo_\b__\be_\br_\br_\bo_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b0_\b _\b _\b _\b _\b|_\bN_\bo_\bt_\b _\ba_\bn_\b _\be_\br_\br_\bo_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |invalid_gzip_header |1 |the supplied gzip buffer has |\n |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bi_\bn_\bv_\ba_\bl_\bi_\bd_\b _\bh_\be_\ba_\bd_\be_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n | | |the gzip buffer would inflate to |\n@@ -12206,28 +12221,29 @@\n |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bc_\bo_\bd_\be_\b _\bi_\bn_\b _\bf_\bi_\bx_\be_\bd_\b _\bo_\br_\b _\bd_\by_\bn_\ba_\bm_\bi_\bc_\b _\bb_\bl_\bo_\bc_\bk_\b _\b _\b _\b _\b |\n |distance_too_far_back_in_block |14 |distance is too far back in fixed |\n |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bo_\br_\b _\bd_\by_\bn_\ba_\bm_\bi_\bc_\b _\bb_\bl_\bo_\bc_\bk_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |unknown_gzip_error |15 |an unknown error occurred during |\n |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bg_\bz_\bi_\bp_\b _\bi_\bn_\bf_\bl_\ba_\bt_\bi_\bo_\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |_\be_\br_\br_\bo_\br_\b__\bc_\bo_\bd_\be_\b__\bm_\ba_\bx_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b6_\b _\b _\b _\b|_\bt_\bh_\be_\b _\bn_\bu_\bm_\bb_\be_\br_\b _\bo_\bf_\b _\be_\br_\br_\bo_\br_\b _\bc_\bo_\bd_\be_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* e\ben\bnu\bum\bm e\ber\brr\bro\bor\br_\b_c\bco\bod\bde\be_\b_e\ben\bnu\bum\bm *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bb_\bd_\be_\bc_\bo_\bd_\be_\b._\bh_\bp_\bp\"\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n-|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bn_\bo_\b__\be_\br_\br_\bo_\br_\b _\b _\b _\b _\b _\b _\b|_\b0_\b _\b _\b _\b _\b|_\bN_\bo_\bt_\b _\ba_\bn_\b _\be_\br_\br_\bo_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\be_\bx_\bp_\be_\bc_\bt_\be_\bd_\b__\bd_\bi_\bg_\bi_\bt_\b|_\b1_\b _\b _\b _\b _\b|_\be_\bx_\bp_\be_\bc_\bt_\be_\bd_\b _\bd_\bi_\bg_\bi_\bt_\b _\bi_\bn_\b _\bb_\be_\bn_\bc_\bo_\bd_\be_\bd_\b _\bs_\bt_\br_\bi_\bn_\bg_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\be_\bx_\bp_\be_\bc_\bt_\be_\bd_\b__\bc_\bo_\bl_\bo_\bn_\b|_\b2_\b _\b _\b _\b _\b|_\be_\bx_\bp_\be_\bc_\bt_\be_\bd_\b _\bc_\bo_\bl_\bo_\bn_\b _\bi_\bn_\b _\bb_\be_\bn_\bc_\bo_\bd_\be_\bd_\b _\bs_\bt_\br_\bi_\bn_\bg_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bu_\bn_\be_\bx_\bp_\be_\bc_\bt_\be_\bd_\b__\be_\bo_\bf_\b|_\b3_\b _\b _\b _\b _\b|_\bu_\bn_\be_\bx_\bp_\be_\bc_\bt_\be_\bd_\b _\be_\bn_\bd_\b _\bo_\bf_\b _\bf_\bi_\bl_\be_\b _\bi_\bn_\b _\bb_\be_\bn_\bc_\bo_\bd_\be_\bd_\b _\bs_\bt_\br_\bi_\bn_\bg_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|expected_value|4 |expected value (list, dict, _\bi_\bn_\bt or string) in bencoded|\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bs_\bt_\br_\bi_\bn_\bg_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bd_\be_\bp_\bt_\bh_\b__\be_\bx_\bc_\be_\be_\bd_\be_\bd_\b|_\b5_\b _\b _\b _\b _\b|_\bb_\be_\bn_\bc_\bo_\bd_\be_\bd_\b _\br_\be_\bc_\bu_\br_\bs_\bi_\bo_\bn_\b _\bd_\be_\bp_\bt_\bh_\b _\bl_\bi_\bm_\bi_\bt_\b _\be_\bx_\bc_\be_\be_\bd_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bl_\bi_\bm_\bi_\bt_\b__\be_\bx_\bc_\be_\be_\bd_\be_\bd_\b|_\b6_\b _\b _\b _\b _\b|_\bb_\be_\bn_\bc_\bo_\bd_\be_\bd_\b _\bi_\bt_\be_\bm_\b _\bc_\bo_\bu_\bn_\bt_\b _\bl_\bi_\bm_\bi_\bt_\b _\be_\bx_\bc_\be_\be_\bd_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bo_\bv_\be_\br_\bf_\bl_\bo_\bw_\b _\b _\b _\b _\b _\b _\b|_\b7_\b _\b _\b _\b _\b|_\bi_\bn_\bt_\be_\bg_\be_\br_\b _\bo_\bv_\be_\br_\bf_\bl_\bo_\bw_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\be_\br_\br_\bo_\br_\b__\bc_\bo_\bd_\be_\b__\bm_\ba_\bx_\b|_\b8_\b _\b _\b _\b _\b|_\bt_\bh_\be_\b _\bn_\bu_\bm_\bb_\be_\br_\b _\bo_\bf_\b _\be_\br_\br_\bo_\br_\b _\bc_\bo_\bd_\be_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+*\b**\b**\b**\b**\b**\b* e\ben\bnu\bum\bm s\bso\boc\bck\bks\bs_\b_e\ber\brr\bro\bor\br_\b_c\bco\bod\bde\be *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\bo_\bc_\bk_\bs_\b5_\b__\bs_\bt_\br_\be_\ba_\bm_\b._\bh_\bp_\bp\"\n+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n+|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn|\n+|_\bn_\bo_\b__\be_\br_\br_\bo_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b0_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bu_\bn_\bs_\bu_\bp_\bp_\bo_\br_\bt_\be_\bd_\b__\bv_\be_\br_\bs_\bi_\bo_\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bu_\bn_\bs_\bu_\bp_\bp_\bo_\br_\bt_\be_\bd_\b__\ba_\bu_\bt_\bh_\be_\bn_\bt_\bi_\bc_\ba_\bt_\bi_\bo_\bn_\b__\bm_\be_\bt_\bh_\bo_\bd_\b _\b|_\b2_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bu_\bn_\bs_\bu_\bp_\bp_\bo_\br_\bt_\be_\bd_\b__\ba_\bu_\bt_\bh_\be_\bn_\bt_\bi_\bc_\ba_\bt_\bi_\bo_\bn_\b__\bv_\be_\br_\bs_\bi_\bo_\bn_\b|_\b3_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\ba_\bu_\bt_\bh_\be_\bn_\bt_\bi_\bc_\ba_\bt_\bi_\bo_\bn_\b__\be_\br_\br_\bo_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b4_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bu_\bs_\be_\br_\bn_\ba_\bm_\be_\b__\br_\be_\bq_\bu_\bi_\br_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b5_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bg_\be_\bn_\be_\br_\ba_\bl_\b__\bf_\ba_\bi_\bl_\bu_\br_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b6_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bc_\bo_\bm_\bm_\ba_\bn_\bd_\b__\bn_\bo_\bt_\b__\bs_\bu_\bp_\bp_\bo_\br_\bt_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b7_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bn_\bo_\b__\bi_\bd_\be_\bn_\bt_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b8_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bi_\bd_\be_\bn_\bt_\bd_\b__\be_\br_\br_\bo_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b9_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bn_\bu_\bm_\b__\be_\br_\br_\bo_\br_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b0_\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* e\ben\bnu\bum\bm e\ber\brr\bro\bor\br_\b_c\bco\bod\bde\be_\b_e\ben\bnu\bum\bm *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bu_\bp_\bn_\bp_\b._\bh_\bp_\bp\"\n _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n |_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |_\bn_\bo_\b__\be_\br_\br_\bo_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b0_\b _\b _\b _\b _\b|_\bN_\bo_\b _\be_\br_\br_\bo_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |invalid_argument |402 |One of the arguments in the request |\n@@ -12265,30 +12281,14 @@\n |_\bi_\bn_\bv_\ba_\bl_\bi_\bd_\b__\bk_\be_\by_\b _\b _\b _\b _\b|_\b4_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |_\bi_\bn_\bv_\ba_\bl_\bi_\bd_\b__\bi_\bd_\b _\b _\b _\b _\b _\b|_\b5_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |_\bt_\bi_\bm_\be_\bo_\bu_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b6_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |_\bk_\be_\by_\b__\bn_\bo_\bt_\b__\bf_\bo_\bu_\bn_\bd_\b _\b _\b|_\b7_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |_\bd_\bu_\bp_\bl_\bi_\bc_\ba_\bt_\be_\bd_\b__\bi_\bd_\b _\b _\b|_\b8_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |_\bn_\bu_\bm_\b__\be_\br_\br_\bo_\br_\bs_\b _\b _\b _\b _\b _\b|_\b9_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* e\ben\bnu\bum\bm s\bso\boc\bck\bks\bs_\b_e\ber\brr\bro\bor\br_\b_c\bco\bod\bde\be *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bs_\bo_\bc_\bk_\bs_\b5_\b__\bs_\bt_\br_\be_\ba_\bm_\b._\bh_\bp_\bp\"\n- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n-|_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn|\n-|_\bn_\bo_\b__\be_\br_\br_\bo_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b0_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bu_\bn_\bs_\bu_\bp_\bp_\bo_\br_\bt_\be_\bd_\b__\bv_\be_\br_\bs_\bi_\bo_\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bu_\bn_\bs_\bu_\bp_\bp_\bo_\br_\bt_\be_\bd_\b__\ba_\bu_\bt_\bh_\be_\bn_\bt_\bi_\bc_\ba_\bt_\bi_\bo_\bn_\b__\bm_\be_\bt_\bh_\bo_\bd_\b _\b|_\b2_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bu_\bn_\bs_\bu_\bp_\bp_\bo_\br_\bt_\be_\bd_\b__\ba_\bu_\bt_\bh_\be_\bn_\bt_\bi_\bc_\ba_\bt_\bi_\bo_\bn_\b__\bv_\be_\br_\bs_\bi_\bo_\bn_\b|_\b3_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\ba_\bu_\bt_\bh_\be_\bn_\bt_\bi_\bc_\ba_\bt_\bi_\bo_\bn_\b__\be_\br_\br_\bo_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b4_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bu_\bs_\be_\br_\bn_\ba_\bm_\be_\b__\br_\be_\bq_\bu_\bi_\br_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b5_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bg_\be_\bn_\be_\br_\ba_\bl_\b__\bf_\ba_\bi_\bl_\bu_\br_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b6_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bc_\bo_\bm_\bm_\ba_\bn_\bd_\b__\bn_\bo_\bt_\b__\bs_\bu_\bp_\bp_\bo_\br_\bt_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b7_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bn_\bo_\b__\bi_\bd_\be_\bn_\bt_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b8_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bi_\bd_\be_\bn_\bt_\bd_\b__\be_\br_\br_\bo_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b9_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bn_\bu_\bm_\b__\be_\br_\br_\bo_\br_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b0_\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* e\ben\bnu\bum\bm e\ber\brr\bro\bor\br_\b_c\bco\bod\bde\be_\b_e\ben\bnu\bum\bm *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\be_\br_\br_\bo_\br_\b__\bc_\bo_\bd_\be_\b._\bh_\bp_\bp\"\n _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b \n |_\bn\bn_\ba\ba_\bm\bm_\be\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bv\bv_\ba\ba_\bl\bl_\bu\bu_\be\be_\b|_\bd\bd_\be\be_\bs\bs_\bc\bc_\br\br_\bi\bi_\bp\bp_\bt\bt_\bi\bi_\bo\bo_\bn\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |_\bn_\bo_\b__\be_\br_\br_\bo_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b0_\b _\b _\b _\b _\b|_\bN_\bo_\bt_\b _\ba_\bn_\b _\be_\br_\br_\bo_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |file_collision |1 |Two torrents has files which end |\n |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bu_\bp_\b _\bo_\bv_\be_\br_\bw_\br_\bi_\bt_\bi_\bn_\bg_\b _\be_\ba_\bc_\bh_\b _\bo_\bt_\bh_\be_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b |\n@@ -12876,81 +12876,58 @@\n For implementers: Use this functions for expire peers or items or any other\n storage cleanup.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b* c\bco\bou\bun\bnt\bte\ber\brs\bs(\b()\b) *\b**\b**\b**\b**\b*\n virtual dht_storage_counters c\bco\bou\bun\bnt\bte\ber\brs\bs () const = 0;\n return stats _\bc_\bo_\bu_\bn_\bt_\be_\br_\bs for the store\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* d\bdh\bht\bt_\b_d\bde\bef\bfa\bau\bul\blt\bt_\b_s\bst\bto\bor\bra\bag\bge\be_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br(\b()\b) *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bk_\ba_\bd_\be_\bm_\bl_\bi_\ba_\b/_\bd_\bh_\bt_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b._\bh_\bp_\bp\"\n-std::unique_ptr d\bdh\bht\bt_\b_d\bde\bef\bfa\bau\bul\blt\bt_\b_s\bst\bto\bor\bra\bag\bge\be_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br (\n- settings_interface const& settings);\n-constructor for the default DHT storage. The DHT storage is responsible for\n-maintaining peers and mutable and immutable items announced and stored/put to\n-the DHT node.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* s\bsi\big\bgn\bn_\b_m\bmu\but\bta\bab\bbl\ble\be_\b_i\bit\bte\bem\bm(\b()\b) *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bk_\ba_\bd_\be_\bm_\bl_\bi_\ba_\b/_\bi_\bt_\be_\bm_\b._\bh_\bp_\bp\"\n signature s\bsi\big\bgn\bn_\b_m\bmu\but\bta\bab\bbl\ble\be_\b_i\bit\bte\bem\bm (\n span v\n , span salt\n , sequence_number seq\n , public_key const& pk\n , secret_key const& sk);\n given a byte range v and an optional byte range salt, a sequence number, public\n key pk (must be 32 bytes) and a secret key sk (must be 64 bytes), this function\n produces a signature which is written into a 64 byte buffer pointed to by sig.\n The caller is responsible for allocating the destination buffer that's passed\n in as the sig argument. Typically it would be allocated on the stack.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* d\bdh\bht\bt_\b_d\bde\bef\bfa\bau\bul\blt\bt_\b_s\bst\bto\bor\bra\bag\bge\be_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br(\b()\b) *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bk_\ba_\bd_\be_\bm_\bl_\bi_\ba_\b/_\bd_\bh_\bt_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b._\bh_\bp_\bp\"\n+std::unique_ptr d\bdh\bht\bt_\b_d\bde\bef\bfa\bau\bul\blt\bt_\b_s\bst\bto\bor\bra\bag\bge\be_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br (\n+ settings_interface const& settings);\n+constructor for the default DHT storage. The DHT storage is responsible for\n+maintaining peers and mutable and immutable items announced and stored/put to\n+the DHT node.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_f\bfl\bla\bag\bgs\bs_\b_t\bt *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bk_\ba_\bd_\be_\bm_\bl_\bi_\ba_\b/_\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\bf_\bl_\ba_\bg_\bs_\b._\bh_\bp_\bp\"\n seed\n announce to DHT as a seed\n implied_port\n announce to DHT with the implied-port flag set. This tells the network to\n use your source UDP port as your listen port, rather than the one\n specified in the message. This may improve the chances of traversing NATs\n when using uTP.\n ssl_torrent\n Specify the port number for the SSL listen socket in the DHT announce.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* w\bwr\bri\bit\bte\be_\b_r\bre\bes\bsu\bum\bme\be_\b_d\bda\bat\bta\ba(\b()\b) w\bwr\bri\bit\bte\be_\b_r\bre\bes\bsu\bum\bme\be_\b_d\bda\bat\bta\ba_\b_b\bbu\buf\bf(\b()\b) *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bw_\br_\bi_\bt_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b._\bh_\bp_\bp\"\n-entry w\bwr\bri\bit\bte\be_\b_r\bre\bes\bsu\bum\bme\be_\b_d\bda\bat\bta\ba (add_torrent_params const& atp);\n-std::vector w\bwr\bri\bit\bte\be_\b_r\bre\bes\bsu\bum\bme\be_\b_d\bda\bat\bta\ba_\b_b\bbu\buf\bf (add_torrent_params const& atp);\n-this function turns the resume data in an add_torrent_params object into a\n-bencoded structure\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b**\b* w\bwr\bri\bit\bte\be_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be(\b()\b) w\bwr\bri\bit\bte\be_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be_\b_b\bbu\buf\bf(\b()\b) *\b**\b**\b**\b**\b**\b*\n-Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bw_\br_\bi_\bt_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b._\bh_\bp_\bp\"\n-entry w\bwr\bri\bit\bte\be_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be (add_torrent_params const& atp, write_torrent_flags_t\n-flags);\n-entry w\bwr\bri\bit\bte\be_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be (add_torrent_params const& atp);\n-std::vector w\bwr\bri\bit\bte\be_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be_\b_b\bbu\buf\bf (add_torrent_params const& atp\n- , write_torrent_flags_t flags);\n-writes only the fields to create a .torrent file. This function may fail with a\n-std::system_error exception if:\n- * The _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs object passed to this function does not contain\n- the info dictionary (the ti field)\n- * The piece layers are not complete for all files that need them\n-The write_torrent_file_buf() overload returns the torrent file in bencoded\n-buffer form. This overload may be faster at the expense of lost flexibility to\n-add custom fields.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* r\bre\bea\bad\bd_\b_r\bre\bes\bsu\bum\bme\be_\b_d\bda\bat\bta\ba(\b()\b) *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\br_\be_\ba_\bd_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b._\bh_\bp_\bp\"\n+add_torrent_params r\bre\bea\bad\bd_\b_r\bre\bes\bsu\bum\bme\be_\b_d\bda\bat\bta\ba (span buffer\n+ , load_torrent_limits const& cfg = {});\n add_torrent_params r\bre\bea\bad\bd_\b_r\bre\bes\bsu\bum\bme\be_\b_d\bda\bat\bta\ba (bdecode_node const& rd\n , int piece_limit = 0x200000);\n-add_torrent_params r\bre\bea\bad\bd_\b_r\bre\bes\bsu\bum\bme\be_\b_d\bda\bat\bta\ba (bdecode_node const& rd\n- , error_code& ec, int piece_limit = 0x200000);\n add_torrent_params r\bre\bea\bad\bd_\b_r\bre\bes\bsu\bum\bme\be_\b_d\bda\bat\bta\ba (span buffer\n , error_code& ec, load_torrent_limits const& cfg = {});\n-add_torrent_params r\bre\bea\bad\bd_\b_r\bre\bes\bsu\bum\bme\be_\b_d\bda\bat\bta\ba (span buffer\n- , load_torrent_limits const& cfg = {});\n+add_torrent_params r\bre\bea\bad\bd_\b_r\bre\bes\bsu\bum\bme\be_\b_d\bda\bat\bta\ba (bdecode_node const& rd\n+ , error_code& ec, int piece_limit = 0x200000);\n these functions are used to parse resume data and populate the appropriate\n fields in an _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs object. This object can then be used to add the\n actual _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo object to and pass to session::add_torrent() or session::\n async_add_torrent().\n If the client wants to override any field that was loaded from the resume data,\n e.g. save_path, those fields must be changed after loading resume data but\n before adding the torrent.\n@@ -12958,14 +12935,37 @@\n the torrent that may be loaded as part of the resume data, if it contains an\n info field. The overloads that take a flat buffer are instead configured with\n limits on torrent sizes via load_torrent limits.\n In order to support large torrents, it may also be necessary to raise the\n _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk_\b:_\b:_\bm_\ba_\bx_\b__\bp_\bi_\be_\bc_\be_\b__\bc_\bo_\bu_\bn_\bt setting and pass a higher limit to calls to\n _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b:_\b:_\bp_\ba_\br_\bs_\be_\b__\bi_\bn_\bf_\bo_\b__\bs_\be_\bc_\bt_\bi_\bo_\bn_\b(_\b).\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* w\bwr\bri\bit\bte\be_\b_r\bre\bes\bsu\bum\bme\be_\b_d\bda\bat\bta\ba(\b()\b) w\bwr\bri\bit\bte\be_\b_r\bre\bes\bsu\bum\bme\be_\b_d\bda\bat\bta\ba_\b_b\bbu\buf\bf(\b()\b) *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bw_\br_\bi_\bt_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b._\bh_\bp_\bp\"\n+std::vector w\bwr\bri\bit\bte\be_\b_r\bre\bes\bsu\bum\bme\be_\b_d\bda\bat\bta\ba_\b_b\bbu\buf\bf (add_torrent_params const& atp);\n+entry w\bwr\bri\bit\bte\be_\b_r\bre\bes\bsu\bum\bme\be_\b_d\bda\bat\bta\ba (add_torrent_params const& atp);\n+this function turns the resume data in an add_torrent_params object into a\n+bencoded structure\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b**\b* w\bwr\bri\bit\bte\be_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be_\b_b\bbu\buf\bf(\b()\b) w\bwr\bri\bit\bte\be_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be(\b()\b) *\b**\b**\b**\b**\b**\b*\n+Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bw_\br_\bi_\bt_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b._\bh_\bp_\bp\"\n+entry w\bwr\bri\bit\bte\be_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be (add_torrent_params const& atp);\n+entry w\bwr\bri\bit\bte\be_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be (add_torrent_params const& atp, write_torrent_flags_t\n+flags);\n+std::vector w\bwr\bri\bit\bte\be_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be_\b_b\bbu\buf\bf (add_torrent_params const& atp\n+ , write_torrent_flags_t flags);\n+writes only the fields to create a .torrent file. This function may fail with a\n+std::system_error exception if:\n+ * The _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs object passed to this function does not contain\n+ the info dictionary (the ti field)\n+ * The piece layers are not complete for all files that need them\n+The write_torrent_file_buf() overload returns the torrent file in bencoded\n+buffer form. This overload may be faster at the expense of lost flexibility to\n+add custom fields.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n *\b**\b**\b**\b**\b**\b* w\bwr\bri\bit\bte\be_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfl\bla\bag\bgs\bs_\b_t\bt *\b**\b**\b**\b**\b**\b*\n Declared in \"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\bw_\br_\bi_\bt_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b._\bh_\bp_\bp\"\n allow_missing_piece_layer\n this makes _\bw_\br_\bi_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bi_\bl_\be_\b(_\b) not fail when attempting to write a v2\n torrent file that does not have all the piece layers\n no_http_seeds\n don't include http seeds in the torrent file, even if some are present in\n"}]}, {"source1": "./usr/share/doc/libtorrent-rasterbar-doc/html/todo.html", "source2": "./usr/share/doc/libtorrent-rasterbar-doc/html/todo.html", "unified_diff": "@@ -459,15 +459,306 @@\n \tauto o = rpc.allocate_observer<null_observer>(std::move(algo), source, node_id());\n #if TORRENT_USE_ASSERTS\n \to->m_in_constructor = false;\n #endif\n \to->flags |= observer::flag_queried;\n \trpc.invoke(req, source, o);\n \n-
    relevance 3../src/web_peer_connection.cpp:199this should be an optional, piece index -1 should not be allowed

    this should be an optional, piece index -1 should\n+

    relevance 3../src/torrent.cpp:419we could probably get away with just saving a few fields here

    we could probably get away with just saving a few fields here

    ../src/torrent.cpp:419

    \t\t// --- V2 HASHES ---\n+\n+\t\tif (m_torrent_file->is_valid() && m_torrent_file->info_hashes().has_v2())\n+\t\t{\n+\t\t\tif (!p.merkle_trees.empty())\n+\t\t\t\tload_merkle_trees(\n+\t\t\t\t\tstd::move(p.merkle_trees)\n+\t\t\t\t\t, std::move(p.merkle_tree_mask)\n+\t\t\t\t\t, std::move(p.verified_leaf_hashes));\n+\n+\t\t\t// we really don't want to store extra copies of the trees\n+\t\t\tTORRENT_ASSERT(p.merkle_trees.empty());\n+\t\t}\n+\n+\t\tif (valid_metadata())\n+\t\t{\n+\t\t\tinc_stats_counter(counters::num_total_pieces_added\n+\t\t\t\t, m_torrent_file->num_pieces());\n+\t\t}\n+\n+
    \t\tm_add_torrent_params = std::make_unique<add_torrent_params>(std::move(p));\n+
    \t}\n+\n+\tvoid torrent::load_merkle_trees(\n+\t\taux::vector<std::vector<sha256_hash>, file_index_t> trees_import\n+\t\t, aux::vector<std::vector<bool>, file_index_t> mask\n+\t\t, aux::vector<std::vector<bool>, file_index_t> verified)\n+\t{\n+\t\tauto const& fs = m_torrent_file->orig_files();\n+\n+\t\tstd::vector<bool> const empty_verified;\n+\t\tfor (file_index_t i{0}; i < fs.end_file(); ++i)\n+\t\t{\n+\t\t\tif (fs.pad_file_at(i) || fs.file_size(i) == 0)\n+\t\t\t\tcontinue;\n+\n+\t\t\tif (i >= trees_import.end_index()) break;\n+\t\t\tstd::vector<bool> const& verified_bitmask = (i >= verified.end_index()) ? empty_verified : verified[i];\n+\t\t\tif (i < mask.end_index() && !mask[i].empty())\n+\t\t\t{\n+\t\t\t\tmask[i].resize(m_merkle_trees[i].size(), false);\n+\t\t\t\tm_merkle_trees[i].load_sparse_tree(trees_import[i], mask[i], verified_bitmask);\n+\t\t\t}\n+\t\t\telse\n+\t\t\t{\n+\t\t\t\tm_merkle_trees[i].load_tree(trees_import[i], verified_bitmask);\n+\t\t\t}\n+\t\t}\n+\t}\n+\n+\tvoid torrent::inc_stats_counter(int c, int value)\n+
    relevance 3../src/torrent.cpp:715assert there are no outstanding async operations on this torrent

    assert there are no outstanding async operations on this\n+torrent

    ../src/torrent.cpp:715

    #endif\n+\n+\t\tif (!m_ses.dht()) return false;\n+\t\tif (m_torrent_file->is_valid() && !m_files_checked) return false;\n+\t\tif (!m_announce_to_dht) return false;\n+\t\tif (m_paused) return false;\n+\n+\t\t// don't announce private torrents\n+\t\tif (m_torrent_file->is_valid() && m_torrent_file->priv()) return false;\n+\t\tif (m_trackers.empty()) return true;\n+\t\tif (!settings().get_bool(settings_pack::use_dht_as_fallback)) return true;\n+\n+\t\treturn std::none_of(m_trackers.begin(), m_trackers.end()\n+\t\t\t, [](aux::announce_entry const& tr) { return bool(tr.verified); });\n+\t}\n+\n+#endif\n+\n+\ttorrent::~torrent()\n+\t{\n+
    \n+
    #if TORRENT_USE_ASSERTS\n+\t\tfor (torrent_list_index_t i{}; i != m_links.end_index(); ++i)\n+\t\t{\n+\t\t\tif (!m_links[i].in_list()) continue;\n+\t\t\tm_links[i].unlink(m_ses.torrent_list(i), i);\n+\t\t}\n+#endif\n+\n+\t\t// The invariant can't be maintained here, since the torrent\n+\t\t// is being destructed, all weak references to it have been\n+\t\t// reset, which means that all its peers already have an\n+\t\t// invalidated torrent pointer (so it cannot be verified to be correct)\n+\n+\t\t// i.e. the invariant can only be maintained if all connections have\n+\t\t// been closed by the time the torrent is destructed. And they are\n+\t\t// supposed to be closed. So we can still do the invariant check.\n+\n+\t\t// however, the torrent object may be destructed from the main\n+\t\t// thread when shutting down, if the disk cache has references to it.\n+\t\t// this means that the invariant check that this is called from the\n+\t\t// network thread cannot be maintained\n+\n+\t\tTORRENT_ASSERT(m_peer_class == peer_class_t{0});\n+\t\tTORRENT_ASSERT(m_connections.empty());\n+\t\t// just in case, make sure the session accounting is kept right\n+\t\tfor (auto p : m_connections)\n+\t\t\tm_ses.close_connection(p);\n+\t}\n+\n+\tvoid torrent::read_piece(piece_index_t const piece)\n+
    relevance 3../src/torrent.cpp:1331there's some duplication between this function and peer_connection::incoming_piece(). is there a way to merge something?

    there's some duplication between this function and\n+peer_connection::incoming_piece(). is there a way to merge something?

    ../src/torrent.cpp:1331

    \t\tpiece_index_t m_piece;\n+\t\tbool m_armed = true;\n+\t};\n+\n+\tvoid torrent::add_piece_async(piece_index_t const piece\n+\t\t, std::vector<char> data, add_piece_flags_t const flags)\n+\t{\n+\t\tTORRENT_ASSERT(is_single_thread());\n+\n+\t\t// make sure the piece index is correct\n+\t\tif (piece >= torrent_file().end_piece())\n+\t\t\treturn;\n+\n+\t\t// make sure the piece size is correct\n+\t\tif (data.size() != std::size_t(m_torrent_file->piece_size(piece)))\n+\t\t\treturn;\n+\n+\t\tadd_piece(piece, data.data(), flags);\n+\t}\n+\n+
    \tvoid torrent::add_piece(piece_index_t const piece, char const* data\n+
    \t\t, add_piece_flags_t const flags)\n+\t{\n+\t\tTORRENT_ASSERT(is_single_thread());\n+\n+\t\t// make sure the piece index is correct\n+\t\tif (piece >= torrent_file().end_piece())\n+\t\t\treturn;\n+\n+\t\tint const piece_size = m_torrent_file->piece_size(piece);\n+\t\tint const blocks_in_piece = (piece_size + block_size() - 1) / block_size();\n+\n+\t\tif (m_deleted) return;\n+\n+\t\t// avoid crash trying to access the picker when there is none\n+\t\tif (m_have_all && !has_picker()) return;\n+\n+\t\t// we don't support clobbering the piece picker while checking the\n+\t\t// files. We may end up having the same piece multiple times\n+\t\tTORRENT_ASSERT_PRECOND(state() != torrent_status::checking_files\n+\t\t\t&& state() != torrent_status::checking_resume_data);\n+\t\tif (state() == torrent_status::checking_files\n+\t\t\t|| state() == torrent_status::checking_resume_data)\n+\t\t\treturn;\n+\n+\t\tneed_picker();\n+\n+\t\tif (picker().have_piece(piece)\n+\t\t\t&& !(flags & torrent_handle::overwrite_existing))\n+\t\t\treturn;\n+\n+
    relevance 3../src/torrent.cpp:3966this could probably be pulled out into a free function

    this could probably be pulled out into a free function

    ../src/torrent.cpp:3966

    \tstd::int64_t calc_bytes(file_storage const& fs, piece_count const& pc)\n+\t{\n+\t\t// it's an impossible combination to have 0 pieces, but still have one of them be the last piece\n+\t\tTORRENT_ASSERT(!(pc.num_pieces == 0 && pc.last_piece == true));\n+\n+\t\t// if we have 0 pieces, we can't have any pad blocks either\n+\t\tTORRENT_ASSERT(!(pc.num_pieces == 0 && pc.pad_bytes > 0));\n+\n+\t\t// if we have all pieces, we must also have the last one\n+\t\tTORRENT_ASSERT(!(pc.num_pieces == fs.num_pieces() && pc.last_piece == false));\n+\n+\t\t// every block should not be a pad block\n+\t\tTORRENT_ASSERT(pc.pad_bytes <= std::int64_t(pc.num_pieces) * fs.piece_length());\n+\n+\t\treturn std::int64_t(pc.num_pieces) * fs.piece_length()\n+\t\t\t- (pc.last_piece ? fs.piece_length() - fs.piece_size(fs.last_piece()) : 0)\n+\t\t\t- std::int64_t(pc.pad_bytes);\n+\t}\n+\n+\t// fills in total_wanted, total_wanted_done and total_done\n+
    \tvoid torrent::bytes_done(torrent_status& st, status_flags_t const flags) const\n+
    \t{\n+\t\tINVARIANT_CHECK;\n+\n+\t\tst.total_done = 0;\n+\t\tst.total_wanted_done = 0;\n+\t\tst.total_wanted = m_size_on_disk;\n+\n+\t\tTORRENT_ASSERT(st.total_wanted <= m_torrent_file->total_size());\n+\t\tTORRENT_ASSERT(st.total_wanted >= 0);\n+\n+\t\tTORRENT_ASSERT(!valid_metadata() || m_torrent_file->num_pieces() > 0);\n+\t\tif (!valid_metadata()) return;\n+\n+\t\tif (m_seed_mode || is_seed())\n+\t\t{\n+\t\t\t// once we're a seed and remove the piece picker, we stop tracking\n+\t\t\t// piece- and file priority. We consider everything as being\n+\t\t\t// \"wanted\"\n+\t\t\tst.total_done = m_torrent_file->total_size() - m_padding_bytes;\n+\t\t\tst.total_wanted_done = m_size_on_disk;\n+\t\t\tst.total_wanted = m_size_on_disk;\n+\t\t\tTORRENT_ASSERT(st.total_wanted <= st.total_done);\n+\t\t\tTORRENT_ASSERT(st.total_wanted_done <= st.total_wanted);\n+\t\t\tTORRENT_ASSERT(st.total_done <= m_torrent_file->total_size());\n+\t\t\treturn;\n+\t\t}\n+\t\telse if (!has_picker())\n+\t\t{\n+\t\t\tst.total_done = 0;\n+\t\t\tst.total_wanted_done = 0;\n+
    relevance 3../src/torrent.cpp:4905should this alert have an error code in it?

    should this alert have an error code in it?

    ../src/torrent.cpp:4905

    \t\ton_remove_peers();\n+\t\tTORRENT_ASSERT(m_connections.empty());\n+\n+\t\t// post a message to the main thread to destruct\n+\t\t// the torrent object from there\n+\t\tif (m_storage)\n+\t\t{\n+\t\t\ttry {\n+\t\t\t\tm_ses.disk_thread().async_stop_torrent(m_storage\n+\t\t\t\t\t, std::bind(&torrent::on_torrent_aborted, shared_from_this()));\n+\t\t\t}\n+\t\t\tcatch (std::exception const& e)\n+\t\t\t{\n+\t\t\t\tTORRENT_UNUSED(e);\n+\t\t\t\tm_storage.reset();\n+#ifndef TORRENT_DISABLE_LOGGING\n+\t\t\t\tdebug_log(\"Failed to flush disk cache: %s\", e.what());\n+#endif\n+\t\t\t\t// clients may rely on this alert to be posted, so it's probably a\n+\t\t\t\t// good idea to post it here, even though we failed\n+
    \t\t\t\tif (alerts().should_post<cache_flushed_alert>())\n+
    \t\t\t\t\talerts().emplace_alert<cache_flushed_alert>(get_handle());\n+\t\t\t}\n+\t\t\tm_ses.deferred_submit_jobs();\n+\t\t}\n+\t\telse\n+\t\t{\n+\t\t\tif (alerts().should_post<cache_flushed_alert>())\n+\t\t\t\talerts().emplace_alert<cache_flushed_alert>(get_handle());\n+\t\t\talerts().emplace_alert<torrent_removed_alert>(get_handle()\n+\t\t\t\t, info_hash(), get_userdata());\n+\t\t}\n+\n+
    relevance 3../src/torrent.cpp:4975this should return optional<>. piece index -1 should not be allowed

    this should return optional<>. piece index -1 should not be\n+allowed

    ../src/torrent.cpp:4975

    \t}\n+\n+#ifndef TORRENT_DISABLE_SUPERSEEDING\n+\tvoid torrent::set_super_seeding(bool const on)\n+\t{\n+\t\tif (on == m_super_seeding) return;\n+\n+\t\tm_super_seeding = on;\n+\t\tset_need_save_resume(torrent_handle::if_state_changed);\n+\t\tstate_updated();\n+\n+\t\tif (m_super_seeding) return;\n+\n+\t\t// disable super seeding for all peers\n+\t\tfor (auto pc : *this)\n+\t\t{\n+\t\t\tpc->superseed_piece(piece_index_t(-1), piece_index_t(-1));\n+\t\t}\n+\t}\n+\n+
    \tpiece_index_t torrent::get_piece_to_super_seed(typed_bitfield<piece_index_t> const& bits)\n+
    \t{\n+\t\t// return a piece with low availability that is not in\n+\t\t// the bitfield and that is not currently being super\n+\t\t// seeded by any peer\n+\t\tTORRENT_ASSERT(m_super_seeding);\n+\n+\t\t// do a linear search from the first piece\n+\t\tint min_availability = 9999;\n+\t\tstd::vector<piece_index_t> avail_vec;\n+\t\tfor (auto const i : m_torrent_file->piece_range())\n+\t\t{\n+\t\t\tif (bits[i]) continue;\n+\n+\t\t\tint availability = 0;\n+\t\t\tfor (auto pc : *this)\n+\t\t\t{\n+\t\t\t\tif (pc->super_seeded_piece(i))\n+\t\t\t\t{\n+\t\t\t\t\t// avoid super-seeding the same piece to more than one\n+\t\t\t\t\t// peer if we can avoid it. Do this by artificially\n+\t\t\t\t\t// increase the availability\n+\t\t\t\t\tavailability = 999;\n+\t\t\t\t\tbreak;\n+\t\t\t\t}\n+\t\t\t\tif (pc->has_piece(i)) ++availability;\n+\t\t\t}\n+\t\t\tif (availability > min_availability) continue;\n+\t\t\tif (availability == min_availability)\n+\t\t\t{\n+\t\t\t\tavail_vec.push_back(i);\n+
    relevance 3../src/web_peer_connection.cpp:199this should be an optional, piece index -1 should not be allowed

    this should be an optional, piece index -1 should\n not be allowed

    ../src/web_peer_connection.cpp:199

    \n \t\t\tauto const range = aux::file_piece_range_inclusive(fs, i);\n \t\t\tfor (piece_index_t k = std::get<0>(range); k < std::get<1>(range); ++k)\n \t\t\t\thave.clear_bit(k);\n \t\t}\n \t\tt->set_seed(peer_info_struct(), false);\n \t\tif (have.none_set())\n@@ -511,15 +802,15 @@\n #endif\n \n \t\t// prevent the peer from trying to send anything more\n \t\tm_send_buffer.clear();\n \n \t\t// when the web server closed our write-end of the socket (i.e. its\n \t\t// read-end), if it's an HTTP 1.0 server. we will stop sending more\n-
    relevance 3../src/web_peer_connection.cpp:419do we really need a special case here? wouldn't the multi-file case handle single file torrents correctly too?

    do we really need a special case here? wouldn't the multi-file\n+

    relevance 3../src/web_peer_connection.cpp:419do we really need a special case here? wouldn't the multi-file case handle single file torrents correctly too?

    do we really need a special case here? wouldn't the multi-file\n case handle single file torrents correctly too?

    ../src/web_peer_connection.cpp:419

    \t\tsize -= pr.length;\n \t}\n \n #ifndef TORRENT_DISABLE_LOGGING\n \tpeer_log(peer_log_alert::outgoing_message, \"REQUESTING\", \"(piece: %d start: %d) - (piece: %d end: %d)\"\n \t\t, static_cast<int>(r.piece), r.start\n \t\t, static_cast<int>(pr.piece), pr.start + pr.length);\n@@ -563,15 +854,15 @@\n \t{\n \t\tstd::vector<file_slice> files = info.orig_files().map_block(req.piece, req.start\n \t\t\t, req.length);\n \n \t\tfor (auto const &f : files)\n \t\t{\n \t\t\tfile_request_t file_req;\n-
    relevance 3../src/web_peer_connection.cpp:504file_index_t should not allow negative values

    file_index_t should not allow negative values

    ../src/web_peer_connection.cpp:504

    \t\t\t\t\t// with the correct slashes. Don't encode it again\n+
    relevance 3../src/web_peer_connection.cpp:504file_index_t should not allow negative values

    file_index_t should not allow negative values

    ../src/web_peer_connection.cpp:504

    \t\t\t\t\t// with the correct slashes. Don't encode it again\n \t\t\t\t\trequest += m_path;\n \t\t\t\t}\n \n \t\t\t\trequest += escape_file_path(info.orig_files(), f.file_index);\n \t\t\t}\n \t\t\trequest += \" HTTP/1.1\\r\\n\";\n \t\t\tadd_headers(request, m_settings, using_proxy);\n@@ -614,15 +905,15 @@\n \t{\n \t\tstd::string const& server_version = p.header(\"server\");\n \t\tif (!server_version.empty())\n \t\t\treturn server_version;\n \t\treturn host;\n \t}\n \n-
    relevance 3../src/web_peer_connection.cpp:695this could be made more efficient for the case when we use an HTTP proxy. Then we wouldn't need to add new web seeds to the torrent, we could just make the redirect table contain full URLs.

    this could be made more efficient for the case when we use an\n+

    relevance 3../src/web_peer_connection.cpp:695this could be made more efficient for the case when we use an HTTP proxy. Then we wouldn't need to add new web seeds to the torrent, we could just make the redirect table contain full URLs.

    this could be made more efficient for the case when we use an\n HTTP proxy. Then we wouldn't need to add new web seeds to the torrent,\n we could just make the redirect table contain full URLs.

    ../src/web_peer_connection.cpp:695

    \tbool const single_file_request = !m_path.empty()\n \t\t&& m_path[m_path.size() - 1] != '/';\n \n \t// when SSRF mitigation is enabled, a web seed on the internet (is_global())\n \t// is not allowed to redirect to a server on the local network, so we set\n \t// the no_local_ips flag\n@@ -667,15 +958,15 @@\n \t\tweb->have_files.resize(t->torrent_file().num_files(), false);\n \n \t\t// the new web seed we're adding only has this file for now\n \t\t// we may add more files later\n \t\tweb->redirects[file_index] = redirect_path;\n \t\tif (web->have_files.get_bit(file_index) == false)\n \t\t{\n-
    relevance 3../src/session_impl.cpp:1142closing the udp sockets here means that the uTP connections cannot be closed gracefully

    closing the udp sockets here means that\n+

    relevance 3../src/session_impl.cpp:1142closing the udp sockets here means that the uTP connections cannot be closed gracefully

    closing the udp sockets here means that\n the uTP connections cannot be closed gracefully

    ../src/session_impl.cpp:1142

    #ifndef TORRENT_DISABLE_LOGGING\n \t\tsession_log(\" aborting all connections (%d)\", int(m_connections.size()));\n #endif\n \t\t// abort all connections\n \t\tfor (auto i = m_connections.begin(); i != m_connections.end();)\n \t\t{\n \t\t\tpeer_connection* p = (*i).get();\n@@ -719,15 +1010,15 @@\n \n \t\t// it's OK to detach the threads here. The disk_io_thread\n \t\t// has an internal counter and won't release the network\n \t\t// thread until they're all dead (via m_work).\n \t\tm_disk_thread->abort(false);\n \n \t\t// now it's OK for the network thread to exit\n-
    relevance 3../src/session_impl.cpp:1638the logic in this if-block should be factored out into a separate function. At least most of it

    the logic in this if-block should be factored out into a\n+

    relevance 3../src/session_impl.cpp:1638the logic in this if-block should be factored out into a separate function. At least most of it

    the logic in this if-block should be factored out into a\n separate function. At least most of it

    ../src/session_impl.cpp:1638

    \t\t\t\t, (lep.flags & listen_socket_t::local_network) ? \"local-network \" : \"\"\n \t\t\t\t, (lep.flags & listen_socket_t::accept_incoming) ? \"accept-incoming \" : \"no-incoming \"\n \t\t\t\t, (lep.flags & listen_socket_t::was_expanded) ? \"expanded-ip \" : \"\"\n \t\t\t\t, (lep.flags & listen_socket_t::proxy) ? \"proxy \" : \"\");\n \t\t}\n #endif\n \n@@ -771,15 +1062,15 @@\n \t\t\t\terror_code err;\n \t\t\t\tret->sock->set_option(exclusive_address_use(true), err);\n #ifndef TORRENT_DISABLE_LOGGING\n \t\t\t\tif (err && should_log())\n \t\t\t\t{\n \t\t\t\t\tsession_log(\"failed enable exclusive address use on listen socket: %s\"\n \t\t\t\t\t\t, err.message().c_str());\n-
    relevance 3../src/session_impl.cpp:2606it would be neat if the utp socket manager would handle ICMP errors too

    it would be neat if the utp socket manager would\n+

    relevance 3../src/session_impl.cpp:2606it would be neat if the utp socket manager would handle ICMP errors too

    it would be neat if the utp socket manager would\n handle ICMP errors too

    ../src/session_impl.cpp:2606

    \n \t\tstd::shared_ptr<session_udp_socket> s = socket.lock();\n \t\tif (!s) return;\n \n \t\tstruct utp_socket_manager& mgr =\n #ifdef TORRENT_SSL_PEERS\n \t\t\tssl == transport::ssl ? m_ssl_utp_socket_manager :\n@@ -823,15 +1114,15 @@\n \t\t\t\t\t// if it wasn't a uTP packet, try the other users of the UDP\n \t\t\t\t\t// socket\n \t\t\t\t\tbool handled = false;\n #ifndef TORRENT_DISABLE_DHT\n \t\t\t\t\tauto listen_socket = ls.lock();\n \t\t\t\t\tif (m_dht && buf.size() > 20\n \t\t\t\t\t\t&& buf.front() == 'd'\n-
    relevance 3../src/session_impl.cpp:4155it would probably make sense to have a separate list of peers that are eligible for optimistic unchoke, similar to the torrents perhaps this could even iterate over the pool allocators of torrent_peer objects. It could probably be done in a single pass and collect the n best candidates. maybe just a queue of peers would make even more sense, just pick the next peer in the queue for unchoking. It would be O(1).

    it would probably make sense to have a separate list of peers\n+

    relevance 3../src/session_impl.cpp:4155it would probably make sense to have a separate list of peers that are eligible for optimistic unchoke, similar to the torrents perhaps this could even iterate over the pool allocators of torrent_peer objects. It could probably be done in a single pass and collect the n best candidates. maybe just a queue of peers would make even more sense, just pick the next peer in the queue for unchoking. It would be O(1).

    it would probably make sense to have a separate list of peers\n that are eligible for optimistic unchoke, similar to the torrents\n perhaps this could even iterate over the pool allocators of\n torrent_peer objects. It could probably be done in a single pass and\n collect the n best candidates. maybe just a queue of peers would make\n even more sense, just pick the next peer in the queue for unchoking. It\n would be O(1).

    ../src/session_impl.cpp:4155

    \t}\n \n@@ -865,15 +1156,15 @@\n \t\t\t{\n \t\t\t\tprev_opt_unchoke.push_back(pi);\n \t\t\t}\n \n \t\t\ttorrent const* t = p->associated_torrent().lock().get();\n \t\t\tif (!t) continue;\n \n-
    relevance 3../src/session_impl.cpp:4178peers should know whether their torrent is paused or not, instead of having to ask it over and over again

    peers should know whether their torrent is paused or not,\n+

    relevance 3../src/session_impl.cpp:4178peers should know whether their torrent is paused or not, instead of having to ask it over and over again

    peers should know whether their torrent is paused or not,\n instead of having to ask it over and over again

    ../src/session_impl.cpp:4178

    \t\t// collect the currently optimistically unchoked peers here, so we can\n \t\t// choke them when we've found new optimistic unchoke candidates.\n \t\tstd::vector<torrent_peer*> prev_opt_unchoke;\n \n \t\tfor (auto& i : m_connections)\n \t\t{\n \t\t\tpeer_connection* const p = i.get();\n@@ -917,15 +1208,15 @@\n \t\tstd::partial_sort(opt_unchoke.begin()\n \t\t\t, opt_unchoke.begin() + num_opt_unchoke\n \t\t\t, opt_unchoke.end()\n #ifndef TORRENT_DISABLE_EXTENSIONS\n \t\t\t, last_optimistic_unchoke_cmp(m_ses_extensions[plugins_optimistic_unchoke_idx])\n #else\n \t\t\t, last_optimistic_unchoke_cmp()\n-
    relevance 3../src/session_impl.cpp:4424there should be a pre-calculated list of all peers eligible for unchoking

    there should be a pre-calculated list of all peers eligible for\n+

    relevance 3../src/session_impl.cpp:4424there should be a pre-calculated list of all peers eligible for unchoking

    there should be a pre-calculated list of all peers eligible for\n unchoking

    ../src/session_impl.cpp:4424

    \t}\n \n \tvoid session_impl::recalculate_unchoke_slots()\n \t{\n \t\tTORRENT_ASSERT(is_single_thread());\n \n \t\ttime_point const now = aux::time_now();\n@@ -969,15 +1260,15 @@\n \t\t\t\t\tp->reset_choke_counters();\n \t\t\t\t\tcontinue;\n \t\t\t\t}\n \t\t\t\tif (pi && pi->optimistically_unchoked)\n \t\t\t\t{\n \t\t\t\t\tm_stats_counters.inc_stats_counter(counters::num_peers_up_unchoked_optimistic, -1);\n \t\t\t\t\tpi->optimistically_unchoked = false;\n-
    relevance 3../src/session_impl.cpp:6136use public_key here instead of std::array

    use public_key here instead of std::array

    ../src/session_impl.cpp:6136

    \n+
    relevance 3../src/session_impl.cpp:6136use public_key here instead of std::array

    use public_key here instead of std::array

    ../src/session_impl.cpp:6136

    \n \tvoid session_impl::dht_get_immutable_item(sha1_hash const& target)\n \t{\n \t\tif (!m_dht) return;\n \t\tm_dht->get_item(target, std::bind(&session_impl::get_immutable_callback\n \t\t\t, this, target, _1));\n \t}\n \n@@ -1020,305 +1311,14 @@\n \t\t\t\talerts.emplace_alert<dht_put_alert>(pk.bytes, sig.bytes\n \t\t\t\t\t, std::move(salt), seq.value, num);\n \t\t\t}\n \t\t}\n \n \t\tvoid put_mutable_callback(dht::item& i\n \t\t\t, std::function<void(entry&, std::array<char, 64>&\n-
    relevance 3../src/torrent.cpp:419we could probably get away with just saving a few fields here

    we could probably get away with just saving a few fields here

    ../src/torrent.cpp:419

    \t\t// --- V2 HASHES ---\n-\n-\t\tif (m_torrent_file->is_valid() && m_torrent_file->info_hashes().has_v2())\n-\t\t{\n-\t\t\tif (!p.merkle_trees.empty())\n-\t\t\t\tload_merkle_trees(\n-\t\t\t\t\tstd::move(p.merkle_trees)\n-\t\t\t\t\t, std::move(p.merkle_tree_mask)\n-\t\t\t\t\t, std::move(p.verified_leaf_hashes));\n-\n-\t\t\t// we really don't want to store extra copies of the trees\n-\t\t\tTORRENT_ASSERT(p.merkle_trees.empty());\n-\t\t}\n-\n-\t\tif (valid_metadata())\n-\t\t{\n-\t\t\tinc_stats_counter(counters::num_total_pieces_added\n-\t\t\t\t, m_torrent_file->num_pieces());\n-\t\t}\n-\n-
    \t\tm_add_torrent_params = std::make_unique<add_torrent_params>(std::move(p));\n-
    \t}\n-\n-\tvoid torrent::load_merkle_trees(\n-\t\taux::vector<std::vector<sha256_hash>, file_index_t> trees_import\n-\t\t, aux::vector<std::vector<bool>, file_index_t> mask\n-\t\t, aux::vector<std::vector<bool>, file_index_t> verified)\n-\t{\n-\t\tauto const& fs = m_torrent_file->orig_files();\n-\n-\t\tstd::vector<bool> const empty_verified;\n-\t\tfor (file_index_t i{0}; i < fs.end_file(); ++i)\n-\t\t{\n-\t\t\tif (fs.pad_file_at(i) || fs.file_size(i) == 0)\n-\t\t\t\tcontinue;\n-\n-\t\t\tif (i >= trees_import.end_index()) break;\n-\t\t\tstd::vector<bool> const& verified_bitmask = (i >= verified.end_index()) ? empty_verified : verified[i];\n-\t\t\tif (i < mask.end_index() && !mask[i].empty())\n-\t\t\t{\n-\t\t\t\tmask[i].resize(m_merkle_trees[i].size(), false);\n-\t\t\t\tm_merkle_trees[i].load_sparse_tree(trees_import[i], mask[i], verified_bitmask);\n-\t\t\t}\n-\t\t\telse\n-\t\t\t{\n-\t\t\t\tm_merkle_trees[i].load_tree(trees_import[i], verified_bitmask);\n-\t\t\t}\n-\t\t}\n-\t}\n-\n-\tvoid torrent::inc_stats_counter(int c, int value)\n-
    relevance 3../src/torrent.cpp:715assert there are no outstanding async operations on this torrent

    assert there are no outstanding async operations on this\n-torrent

    ../src/torrent.cpp:715

    #endif\n-\n-\t\tif (!m_ses.dht()) return false;\n-\t\tif (m_torrent_file->is_valid() && !m_files_checked) return false;\n-\t\tif (!m_announce_to_dht) return false;\n-\t\tif (m_paused) return false;\n-\n-\t\t// don't announce private torrents\n-\t\tif (m_torrent_file->is_valid() && m_torrent_file->priv()) return false;\n-\t\tif (m_trackers.empty()) return true;\n-\t\tif (!settings().get_bool(settings_pack::use_dht_as_fallback)) return true;\n-\n-\t\treturn std::none_of(m_trackers.begin(), m_trackers.end()\n-\t\t\t, [](aux::announce_entry const& tr) { return bool(tr.verified); });\n-\t}\n-\n-#endif\n-\n-\ttorrent::~torrent()\n-\t{\n-
    \n-
    #if TORRENT_USE_ASSERTS\n-\t\tfor (torrent_list_index_t i{}; i != m_links.end_index(); ++i)\n-\t\t{\n-\t\t\tif (!m_links[i].in_list()) continue;\n-\t\t\tm_links[i].unlink(m_ses.torrent_list(i), i);\n-\t\t}\n-#endif\n-\n-\t\t// The invariant can't be maintained here, since the torrent\n-\t\t// is being destructed, all weak references to it have been\n-\t\t// reset, which means that all its peers already have an\n-\t\t// invalidated torrent pointer (so it cannot be verified to be correct)\n-\n-\t\t// i.e. the invariant can only be maintained if all connections have\n-\t\t// been closed by the time the torrent is destructed. And they are\n-\t\t// supposed to be closed. So we can still do the invariant check.\n-\n-\t\t// however, the torrent object may be destructed from the main\n-\t\t// thread when shutting down, if the disk cache has references to it.\n-\t\t// this means that the invariant check that this is called from the\n-\t\t// network thread cannot be maintained\n-\n-\t\tTORRENT_ASSERT(m_peer_class == peer_class_t{0});\n-\t\tTORRENT_ASSERT(m_connections.empty());\n-\t\t// just in case, make sure the session accounting is kept right\n-\t\tfor (auto p : m_connections)\n-\t\t\tm_ses.close_connection(p);\n-\t}\n-\n-\tvoid torrent::read_piece(piece_index_t const piece)\n-
    relevance 3../src/torrent.cpp:1331there's some duplication between this function and peer_connection::incoming_piece(). is there a way to merge something?

    there's some duplication between this function and\n-peer_connection::incoming_piece(). is there a way to merge something?

    ../src/torrent.cpp:1331

    \t\tpiece_index_t m_piece;\n-\t\tbool m_armed = true;\n-\t};\n-\n-\tvoid torrent::add_piece_async(piece_index_t const piece\n-\t\t, std::vector<char> data, add_piece_flags_t const flags)\n-\t{\n-\t\tTORRENT_ASSERT(is_single_thread());\n-\n-\t\t// make sure the piece index is correct\n-\t\tif (piece >= torrent_file().end_piece())\n-\t\t\treturn;\n-\n-\t\t// make sure the piece size is correct\n-\t\tif (data.size() != std::size_t(m_torrent_file->piece_size(piece)))\n-\t\t\treturn;\n-\n-\t\tadd_piece(piece, data.data(), flags);\n-\t}\n-\n-
    \tvoid torrent::add_piece(piece_index_t const piece, char const* data\n-
    \t\t, add_piece_flags_t const flags)\n-\t{\n-\t\tTORRENT_ASSERT(is_single_thread());\n-\n-\t\t// make sure the piece index is correct\n-\t\tif (piece >= torrent_file().end_piece())\n-\t\t\treturn;\n-\n-\t\tint const piece_size = m_torrent_file->piece_size(piece);\n-\t\tint const blocks_in_piece = (piece_size + block_size() - 1) / block_size();\n-\n-\t\tif (m_deleted) return;\n-\n-\t\t// avoid crash trying to access the picker when there is none\n-\t\tif (m_have_all && !has_picker()) return;\n-\n-\t\t// we don't support clobbering the piece picker while checking the\n-\t\t// files. We may end up having the same piece multiple times\n-\t\tTORRENT_ASSERT_PRECOND(state() != torrent_status::checking_files\n-\t\t\t&& state() != torrent_status::checking_resume_data);\n-\t\tif (state() == torrent_status::checking_files\n-\t\t\t|| state() == torrent_status::checking_resume_data)\n-\t\t\treturn;\n-\n-\t\tneed_picker();\n-\n-\t\tif (picker().have_piece(piece)\n-\t\t\t&& !(flags & torrent_handle::overwrite_existing))\n-\t\t\treturn;\n-\n-
    relevance 3../src/torrent.cpp:3966this could probably be pulled out into a free function

    this could probably be pulled out into a free function

    ../src/torrent.cpp:3966

    \tstd::int64_t calc_bytes(file_storage const& fs, piece_count const& pc)\n-\t{\n-\t\t// it's an impossible combination to have 0 pieces, but still have one of them be the last piece\n-\t\tTORRENT_ASSERT(!(pc.num_pieces == 0 && pc.last_piece == true));\n-\n-\t\t// if we have 0 pieces, we can't have any pad blocks either\n-\t\tTORRENT_ASSERT(!(pc.num_pieces == 0 && pc.pad_bytes > 0));\n-\n-\t\t// if we have all pieces, we must also have the last one\n-\t\tTORRENT_ASSERT(!(pc.num_pieces == fs.num_pieces() && pc.last_piece == false));\n-\n-\t\t// every block should not be a pad block\n-\t\tTORRENT_ASSERT(pc.pad_bytes <= std::int64_t(pc.num_pieces) * fs.piece_length());\n-\n-\t\treturn std::int64_t(pc.num_pieces) * fs.piece_length()\n-\t\t\t- (pc.last_piece ? fs.piece_length() - fs.piece_size(fs.last_piece()) : 0)\n-\t\t\t- std::int64_t(pc.pad_bytes);\n-\t}\n-\n-\t// fills in total_wanted, total_wanted_done and total_done\n-
    \tvoid torrent::bytes_done(torrent_status& st, status_flags_t const flags) const\n-
    \t{\n-\t\tINVARIANT_CHECK;\n-\n-\t\tst.total_done = 0;\n-\t\tst.total_wanted_done = 0;\n-\t\tst.total_wanted = m_size_on_disk;\n-\n-\t\tTORRENT_ASSERT(st.total_wanted <= m_torrent_file->total_size());\n-\t\tTORRENT_ASSERT(st.total_wanted >= 0);\n-\n-\t\tTORRENT_ASSERT(!valid_metadata() || m_torrent_file->num_pieces() > 0);\n-\t\tif (!valid_metadata()) return;\n-\n-\t\tif (m_seed_mode || is_seed())\n-\t\t{\n-\t\t\t// once we're a seed and remove the piece picker, we stop tracking\n-\t\t\t// piece- and file priority. We consider everything as being\n-\t\t\t// \"wanted\"\n-\t\t\tst.total_done = m_torrent_file->total_size() - m_padding_bytes;\n-\t\t\tst.total_wanted_done = m_size_on_disk;\n-\t\t\tst.total_wanted = m_size_on_disk;\n-\t\t\tTORRENT_ASSERT(st.total_wanted <= st.total_done);\n-\t\t\tTORRENT_ASSERT(st.total_wanted_done <= st.total_wanted);\n-\t\t\tTORRENT_ASSERT(st.total_done <= m_torrent_file->total_size());\n-\t\t\treturn;\n-\t\t}\n-\t\telse if (!has_picker())\n-\t\t{\n-\t\t\tst.total_done = 0;\n-\t\t\tst.total_wanted_done = 0;\n-
    relevance 3../src/torrent.cpp:4905should this alert have an error code in it?

    should this alert have an error code in it?

    ../src/torrent.cpp:4905

    \t\ton_remove_peers();\n-\t\tTORRENT_ASSERT(m_connections.empty());\n-\n-\t\t// post a message to the main thread to destruct\n-\t\t// the torrent object from there\n-\t\tif (m_storage)\n-\t\t{\n-\t\t\ttry {\n-\t\t\t\tm_ses.disk_thread().async_stop_torrent(m_storage\n-\t\t\t\t\t, std::bind(&torrent::on_torrent_aborted, shared_from_this()));\n-\t\t\t}\n-\t\t\tcatch (std::exception const& e)\n-\t\t\t{\n-\t\t\t\tTORRENT_UNUSED(e);\n-\t\t\t\tm_storage.reset();\n-#ifndef TORRENT_DISABLE_LOGGING\n-\t\t\t\tdebug_log(\"Failed to flush disk cache: %s\", e.what());\n-#endif\n-\t\t\t\t// clients may rely on this alert to be posted, so it's probably a\n-\t\t\t\t// good idea to post it here, even though we failed\n-
    \t\t\t\tif (alerts().should_post<cache_flushed_alert>())\n-
    \t\t\t\t\talerts().emplace_alert<cache_flushed_alert>(get_handle());\n-\t\t\t}\n-\t\t\tm_ses.deferred_submit_jobs();\n-\t\t}\n-\t\telse\n-\t\t{\n-\t\t\tif (alerts().should_post<cache_flushed_alert>())\n-\t\t\t\talerts().emplace_alert<cache_flushed_alert>(get_handle());\n-\t\t\talerts().emplace_alert<torrent_removed_alert>(get_handle()\n-\t\t\t\t, info_hash(), get_userdata());\n-\t\t}\n-\n-
    relevance 3../src/torrent.cpp:4975this should return optional<>. piece index -1 should not be allowed

    this should return optional<>. piece index -1 should not be\n-allowed

    ../src/torrent.cpp:4975

    \t}\n-\n-#ifndef TORRENT_DISABLE_SUPERSEEDING\n-\tvoid torrent::set_super_seeding(bool const on)\n-\t{\n-\t\tif (on == m_super_seeding) return;\n-\n-\t\tm_super_seeding = on;\n-\t\tset_need_save_resume(torrent_handle::if_state_changed);\n-\t\tstate_updated();\n-\n-\t\tif (m_super_seeding) return;\n-\n-\t\t// disable super seeding for all peers\n-\t\tfor (auto pc : *this)\n-\t\t{\n-\t\t\tpc->superseed_piece(piece_index_t(-1), piece_index_t(-1));\n-\t\t}\n-\t}\n-\n-
    \tpiece_index_t torrent::get_piece_to_super_seed(typed_bitfield<piece_index_t> const& bits)\n-
    \t{\n-\t\t// return a piece with low availability that is not in\n-\t\t// the bitfield and that is not currently being super\n-\t\t// seeded by any peer\n-\t\tTORRENT_ASSERT(m_super_seeding);\n-\n-\t\t// do a linear search from the first piece\n-\t\tint min_availability = 9999;\n-\t\tstd::vector<piece_index_t> avail_vec;\n-\t\tfor (auto const i : m_torrent_file->piece_range())\n-\t\t{\n-\t\t\tif (bits[i]) continue;\n-\n-\t\t\tint availability = 0;\n-\t\t\tfor (auto pc : *this)\n-\t\t\t{\n-\t\t\t\tif (pc->super_seeded_piece(i))\n-\t\t\t\t{\n-\t\t\t\t\t// avoid super-seeding the same piece to more than one\n-\t\t\t\t\t// peer if we can avoid it. Do this by artificially\n-\t\t\t\t\t// increase the availability\n-\t\t\t\t\tavailability = 999;\n-\t\t\t\t\tbreak;\n-\t\t\t\t}\n-\t\t\t\tif (pc->has_piece(i)) ++availability;\n-\t\t\t}\n-\t\t\tif (availability > min_availability) continue;\n-\t\t\tif (availability == min_availability)\n-\t\t\t{\n-\t\t\t\tavail_vec.push_back(i);\n
    relevance 3../src/session_handle.cpp:691expose the sequence_number, public_key, secret_key and signature types to the client

    expose the sequence_number, public_key, secret_key and signature\n types to the client

    ../src/session_handle.cpp:691

    \tvoid session_handle::dht_get_item(sha1_hash const& target)\n \t{\n #ifndef TORRENT_DISABLE_DHT\n \t\tasync_call(&session_impl::dht_get_immutable_item, target);\n #else\n \t\tTORRENT_UNUSED(target);\n@@ -1605,15 +1605,66 @@\n \t}\n \telse\n \t{\n \t\tflags &= ~flag_ipv6_address;\n \t\tm_addr.v4 = ep.address().to_v4().to_bytes();\n \t}\n }\n-
    relevance 3../include/libtorrent/stat.hpp:257everything but payload counters and rates could probably be removed from here

    everything but payload counters and rates could probably be\n+

    relevance 3../include/libtorrent/pe_crypto.hpp:72dh_key_exchange should probably move into its own file

    dh_key_exchange should probably move into its own file

    ../include/libtorrent/pe_crypto.hpp:72

    \n+#include <list>\n+#include <array>\n+#include <cstdint>\n+\n+namespace libtorrent {\n+\n+\tnamespace mp = boost::multiprecision;\n+\n+\tusing key_t = mp::number<mp::cpp_int_backend<768, 768, mp::unsigned_magnitude, mp::unchecked, void>>;\n+\n+\tTORRENT_EXTRA_EXPORT std::array<char, 96> export_key(key_t const& k);\n+\n+\t// RC4 state from libtomcrypt\n+\tstruct rc4 {\n+\t\tint x;\n+\t\tint y;\n+\t\taux::array<std::uint8_t, 256> buf;\n+\t};\n+\n+
    \tclass TORRENT_EXTRA_EXPORT dh_key_exchange\n+
    \t{\n+\tpublic:\n+\t\tdh_key_exchange();\n+\n+\t\t// Get local public key\n+\t\tkey_t const& get_local_key() const { return m_dh_local_key; }\n+\n+\t\t// read remote_pubkey, generate and store shared secret in\n+\t\t// m_dh_shared_secret.\n+\t\tvoid compute_secret(std::uint8_t const* remote_pubkey);\n+\t\tvoid compute_secret(key_t const& remote_pubkey);\n+\n+\t\tkey_t const& get_secret() const { return m_dh_shared_secret; }\n+\n+\t\tsha1_hash const& get_hash_xor_mask() const { return m_xor_mask; }\n+\n+\tprivate:\n+\n+\t\tkey_t m_dh_local_key;\n+\t\tkey_t m_dh_local_secret;\n+\t\tkey_t m_dh_shared_secret;\n+\t\tsha1_hash m_xor_mask;\n+\t};\n+\n+\tstruct TORRENT_EXTRA_EXPORT encryption_handler\n+\t{\n+\t\tstd::tuple<int, span<span<char const>>>\n+\t\tencrypt(span<span<char>> iovec);\n+\n+\t\tint decrypt(aux::crypto_receive_buffer& recv_buffer\n+
    relevance 3../include/libtorrent/stat.hpp:257everything but payload counters and rates could probably be removed from here

    everything but payload counters and rates could probably be\n removed from here

    ../include/libtorrent/stat.hpp:257

    \t\t// peer_connection is opened and have some previous\n \t\t// transfers from earlier connections.\n \t\tvoid add_stat(std::int64_t downloaded, std::int64_t uploaded)\n \t\t{\n \t\t\tm_stat[download_payload].offset(downloaded);\n \t\t\tm_stat[upload_payload].offset(uploaded);\n \t\t}\n@@ -1655,170 +1706,15 @@\n \n \t\tstat_channel m_stat[num_channels];\n \t};\n \n }\n \n #endif // TORRENT_STAT_HPP_INCLUDED\n-
    relevance 3../include/libtorrent/torrent.hpp:1423factor out predictive pieces and all operations on it into a separate class (to use as member here instead)

    factor out predictive pieces and all operations on it into a\n-separate class (to use as member here instead)

    ../include/libtorrent/torrent.hpp:1423

    #endif\n-\n-\t\tstd::string m_trackerid;\n-#if TORRENT_ABI_VERSION == 1\n-\t\t// deprecated in 1.1\n-\t\tstd::string m_username;\n-\t\tstd::string m_password;\n-#endif\n-\n-\t\tstd::string m_save_path;\n-\n-#ifndef TORRENT_DISABLE_PREDICTIVE_PIECES\n-\t\t// this is a list of all pieces that we have announced\n-\t\t// as having, without actually having yet. If we receive\n-\t\t// a request for a piece in this list, we need to hold off\n-\t\t// on responding until we have completed the piece and\n-\t\t// verified its hash. If the hash fails, send reject to\n-\t\t// peers with outstanding requests, and dont_have to other\n-\t\t// peers. This vector is ordered, to make lookups fast.\n-\n-
    \t\tstd::vector<piece_index_t> m_predictive_pieces;\n-
    #endif\n-\n-\t\t// v2 merkle tree for each file\n-\t\taux::vector<aux::merkle_tree, file_index_t> m_merkle_trees;\n-\n-\t\t// the performance counters of this session\n-\t\tcounters& m_stats_counters;\n-\n-\t\t// each bit represents a piece. a set bit means\n-\t\t// the piece has had its hash verified. This\n-\t\t// is only used in seed mode (when m_seed_mode\n-\t\t// is true)\n-\t\ttyped_bitfield<piece_index_t> m_verified;\n-\n-\t\t// this means there is an outstanding, async, operation\n-\t\t// to verify each piece that has a 1\n-\t\ttyped_bitfield<piece_index_t> m_verifying;\n-\n-\t\t// set if there's an error on this torrent\n-\t\terror_code m_error;\n-\n-\t\t// used if there is any resume data. Some of the information from the\n-\t\t// add_torrent_params struct are needed later in the torrent object's life\n-\t\t// cycle, and not in the constructor. So we need to save if away here\n-\t\tstd::unique_ptr<add_torrent_params> m_add_torrent_params;\n-\n-\t\t// if the torrent is started without metadata, it may\n-\t\t// still be given a name until the metadata is received\n-\t\t// once the metadata is received this field will no\n-\t\t// longer be used and will be reset\n-
    relevance 3../include/libtorrent/torrent.hpp:1483factor out the links (as well as update_list() to a separate class that torrent can inherit)

    factor out the links (as well as update_list() to a separate\n-class that torrent can inherit)

    ../include/libtorrent/torrent.hpp:1483

    \n-\t\t// this was the last time _we_ saw a seed in this swarm\n-\t\tstd::time_t m_last_seen_complete = 0;\n-\n-\t\t// this is the time last any of our peers saw a seed\n-\t\t// in this swarm\n-\t\tstd::time_t m_swarm_last_seen_complete = 0;\n-\n-\t\t// keep a copy if the info-hash here, so it can be accessed from multiple\n-\t\t// threads, and be cheap to access from the client\n-\t\tinfo_hash_t m_info_hash;\n-\n-\tpublic:\n-\t\t// these are the lists this torrent belongs to. For more\n-\t\t// details about each list, see session_impl.hpp. Each list\n-\t\t// represents a group this torrent belongs to and makes it\n-\t\t// efficient to enumerate only torrents belonging to a specific\n-\t\t// group. Such as torrents that want peer connections or want\n-\t\t// to be ticked etc.\n-\n-
    \t\taux::array<link, aux::session_interface::num_torrent_lists, torrent_list_index_t>\n-
    \t\t\tm_links;\n-\n-\tprivate:\n-\n-\t\t// m_num_verified = m_verified.count()\n-\t\tstd::uint32_t m_num_verified = 0;\n-\n-\t\t// if this torrent is running, this was the time\n-\t\t// when it was started. This is used to have a\n-\t\t// bias towards keeping seeding torrents that\n-\t\t// recently was started, to avoid oscillation\n-\t\t// this is specified at a second granularity\n-\t\ttime_point32 m_started = aux::time_now32();\n-\n-\t\t// if we're a seed, this is the timestamp of when we became one\n-\t\ttime_point32 m_became_seed = aux::time_now32();\n-\n-\t\t// if we're finished, this is the timestamp of when we finished\n-\t\ttime_point32 m_became_finished = aux::time_now32();\n-\n-\t\t// when checking, this is the first piece we have not\n-\t\t// issued a hash job for\n-\t\tpiece_index_t m_checking_piece{0};\n-\n-\t\t// the number of pieces we completed the check of\n-\t\tpiece_index_t m_num_checked_pieces{0};\n-\n-\t\t// if the error occurred on a file, this is the index of that file\n-\t\t// there are a few special cases, when this is negative. See\n-\t\t// set_error()\n-
    relevance 3../include/libtorrent/enum_net.hpp:164use string_view for device_name

    use string_view for device_name

    ../include/libtorrent/enum_net.hpp:164

    \t// return nullopt.\n-\tTORRENT_EXTRA_EXPORT boost::optional<address> get_gateway(\n-\t\tip_interface const& iface, span<ip_route const> routes);\n-\n-\t// returns whether there is a route to the specified device for for any global\n-\t// internet address of the specified address family.\n-\tTORRENT_EXTRA_EXPORT bool has_internet_route(string_view device, int family\n-\t\t, span<ip_route const> routes);\n-\n-\t// returns whether there are *any* routes to the internet in the routing\n-\t// table. This can be used to determine if the routing table is fully\n-\t// populated or not.\n-\tTORRENT_EXTRA_EXPORT bool has_any_internet_route(span<ip_route const> routes);\n-\n-\t// attempt to bind socket to the device with the specified name. For systems\n-\t// that don't support SO_BINDTODEVICE the socket will be bound to one of the\n-\t// IP addresses of the specified device. In this case it is necessary to\n-\t// verify the local endpoint of the socket once the connection is established.\n-\t// the returned address is the ip the socket was bound to (or address_v4::any()\n-\t// in case SO_BINDTODEVICE succeeded and we don't need to verify it).\n-
    \ttemplate <class Socket>\n-
    \taddress bind_socket_to_device(io_context& ios, Socket& sock\n-\t\t, tcp const& protocol\n-\t\t, char const* device_name, int port, error_code& ec)\n-\t{\n-\t\ttcp::endpoint bind_ep(address_v4::any(), std::uint16_t(port));\n-\n-\t\taddress ip = make_address(device_name, ec);\n-\t\tif (!ec)\n-\t\t{\n-\t\t\t// this is to cover the case where \"0.0.0.0\" is considered any IPv4 or\n-\t\t\t// IPv6 address. If we're asking to be bound to an IPv6 address and\n-\t\t\t// providing 0.0.0.0 as the device, turn it into \"::\"\n-\t\t\tif (ip == address_v4::any() && protocol == boost::asio::ip::tcp::v6())\n-\t\t\t\tip = address_v6::any();\n-\t\t\tbind_ep.address(ip);\n-\t\t\t// it appears to be an IP. Just bind to that address\n-\t\t\tsock.bind(bind_ep, ec);\n-\t\t\treturn bind_ep.address();\n-\t\t}\n-\n-\t\tec.clear();\n-\n-#if TORRENT_HAS_BINDTODEVICE\n-\t\t// try to use SO_BINDTODEVICE here, if that exists. If it fails,\n-\t\t// fall back to the mechanism we have below\n-\t\taux::bind_device(sock, device_name, ec);\n-\t\tif (ec)\n-#endif\n-\t\t{\n-\t\t\tec.clear();\n-
    relevance 3../include/libtorrent/torrent_handle.hpp:535unify url_seed and http_seed with just web_seed, using the web_seed_entry.

    unify url_seed and http_seed with just web_seed, using the\n+

    relevance 3../include/libtorrent/torrent_handle.hpp:535unify url_seed and http_seed with just web_seed, using the web_seed_entry.

    unify url_seed and http_seed with just web_seed, using the\n web_seed_entry.

    ../include/libtorrent/torrent_handle.hpp:535

    \t\t// one returned from ``trackers()`` and will replace it. If you want an\n \t\t// immediate effect, you have to call force_reannounce(). See\n \t\t// announce_entry.\n \t\t//\n \t\t// ``post_trackers()`` is the asynchronous version of ``trackers()``. It\n \t\t// will trigger a tracker_list_alert to be posted.\n \t\t//\n@@ -1862,15 +1758,15 @@\n \t\t// a function that will be called from within libtorrent's context\n \t\t// passing in the internal torrent object and the specified userdata\n \t\t// pointer. The function is expected to return a shared pointer to\n \t\t// a torrent_plugin instance.\n \t\tvoid add_extension(\n \t\t\tstd::function<std::shared_ptr<torrent_plugin>(torrent_handle const&, client_data_t)> const& ext\n \t\t\t, client_data_t userdata = client_data_t{});\n-
    relevance 3../include/libtorrent/web_peer_connection.hpp:119if we make this be a disk_buffer_holder instead we would save a copy use allocate_disk_receive_buffer and release_disk_receive_buffer

    if we make this be a disk_buffer_holder instead\n+

    relevance 3../include/libtorrent/web_peer_connection.hpp:119if we make this be a disk_buffer_holder instead we would save a copy use allocate_disk_receive_buffer and release_disk_receive_buffer

    if we make this be a disk_buffer_holder instead\n we would save a copy\n use allocate_disk_receive_buffer and release_disk_receive_buffer

    ../include/libtorrent/web_peer_connection.hpp:119

    \t\tpiece_block_progress downloading_piece_progress() const override;\n \n \t\tvoid handle_padfile();\n \n \t\t// this has one entry per http-request\n \t\t// (might be more than the bt requests)\n@@ -1910,65 +1806,169 @@\n \t\t// the number of responses we've received so far on\n \t\t// this connection\n \t\tint m_num_responses;\n \t};\n }\n \n #endif // TORRENT_WEB_PEER_CONNECTION_HPP_INCLUDED\n-
    relevance 3../include/libtorrent/pe_crypto.hpp:72dh_key_exchange should probably move into its own file

    dh_key_exchange should probably move into its own file

    ../include/libtorrent/pe_crypto.hpp:72

    \n-#include <list>\n-#include <array>\n-#include <cstdint>\n+
    relevance 3../include/libtorrent/enum_net.hpp:164use string_view for device_name

    use string_view for device_name

    ../include/libtorrent/enum_net.hpp:164

    \t// return nullopt.\n+\tTORRENT_EXTRA_EXPORT boost::optional<address> get_gateway(\n+\t\tip_interface const& iface, span<ip_route const> routes);\n \n-namespace libtorrent {\n+\t// returns whether there is a route to the specified device for for any global\n+\t// internet address of the specified address family.\n+\tTORRENT_EXTRA_EXPORT bool has_internet_route(string_view device, int family\n+\t\t, span<ip_route const> routes);\n \n-\tnamespace mp = boost::multiprecision;\n+\t// returns whether there are *any* routes to the internet in the routing\n+\t// table. This can be used to determine if the routing table is fully\n+\t// populated or not.\n+\tTORRENT_EXTRA_EXPORT bool has_any_internet_route(span<ip_route const> routes);\n \n-\tusing key_t = mp::number<mp::cpp_int_backend<768, 768, mp::unsigned_magnitude, mp::unchecked, void>>;\n+\t// attempt to bind socket to the device with the specified name. For systems\n+\t// that don't support SO_BINDTODEVICE the socket will be bound to one of the\n+\t// IP addresses of the specified device. In this case it is necessary to\n+\t// verify the local endpoint of the socket once the connection is established.\n+\t// the returned address is the ip the socket was bound to (or address_v4::any()\n+\t// in case SO_BINDTODEVICE succeeded and we don't need to verify it).\n+
    \ttemplate <class Socket>\n+
    \taddress bind_socket_to_device(io_context& ios, Socket& sock\n+\t\t, tcp const& protocol\n+\t\t, char const* device_name, int port, error_code& ec)\n+\t{\n+\t\ttcp::endpoint bind_ep(address_v4::any(), std::uint16_t(port));\n \n-\tTORRENT_EXTRA_EXPORT std::array<char, 96> export_key(key_t const& k);\n+\t\taddress ip = make_address(device_name, ec);\n+\t\tif (!ec)\n+\t\t{\n+\t\t\t// this is to cover the case where \"0.0.0.0\" is considered any IPv4 or\n+\t\t\t// IPv6 address. If we're asking to be bound to an IPv6 address and\n+\t\t\t// providing 0.0.0.0 as the device, turn it into \"::\"\n+\t\t\tif (ip == address_v4::any() && protocol == boost::asio::ip::tcp::v6())\n+\t\t\t\tip = address_v6::any();\n+\t\t\tbind_ep.address(ip);\n+\t\t\t// it appears to be an IP. Just bind to that address\n+\t\t\tsock.bind(bind_ep, ec);\n+\t\t\treturn bind_ep.address();\n+\t\t}\n \n-\t// RC4 state from libtomcrypt\n-\tstruct rc4 {\n-\t\tint x;\n-\t\tint y;\n-\t\taux::array<std::uint8_t, 256> buf;\n-\t};\n+\t\tec.clear();\n \n-
    \tclass TORRENT_EXTRA_EXPORT dh_key_exchange\n-
    \t{\n-\tpublic:\n-\t\tdh_key_exchange();\n+#if TORRENT_HAS_BINDTODEVICE\n+\t\t// try to use SO_BINDTODEVICE here, if that exists. If it fails,\n+\t\t// fall back to the mechanism we have below\n+\t\taux::bind_device(sock, device_name, ec);\n+\t\tif (ec)\n+#endif\n+\t\t{\n+\t\t\tec.clear();\n+
    relevance 3../include/libtorrent/torrent.hpp:1423factor out predictive pieces and all operations on it into a separate class (to use as member here instead)

    factor out predictive pieces and all operations on it into a\n+separate class (to use as member here instead)

    ../include/libtorrent/torrent.hpp:1423

    #endif\n \n-\t\t// Get local public key\n-\t\tkey_t const& get_local_key() const { return m_dh_local_key; }\n+\t\tstd::string m_trackerid;\n+#if TORRENT_ABI_VERSION == 1\n+\t\t// deprecated in 1.1\n+\t\tstd::string m_username;\n+\t\tstd::string m_password;\n+#endif\n \n-\t\t// read remote_pubkey, generate and store shared secret in\n-\t\t// m_dh_shared_secret.\n-\t\tvoid compute_secret(std::uint8_t const* remote_pubkey);\n-\t\tvoid compute_secret(key_t const& remote_pubkey);\n+\t\tstd::string m_save_path;\n \n-\t\tkey_t const& get_secret() const { return m_dh_shared_secret; }\n+#ifndef TORRENT_DISABLE_PREDICTIVE_PIECES\n+\t\t// this is a list of all pieces that we have announced\n+\t\t// as having, without actually having yet. If we receive\n+\t\t// a request for a piece in this list, we need to hold off\n+\t\t// on responding until we have completed the piece and\n+\t\t// verified its hash. If the hash fails, send reject to\n+\t\t// peers with outstanding requests, and dont_have to other\n+\t\t// peers. This vector is ordered, to make lookups fast.\n \n-\t\tsha1_hash const& get_hash_xor_mask() const { return m_xor_mask; }\n+
    \t\tstd::vector<piece_index_t> m_predictive_pieces;\n+
    #endif\n+\n+\t\t// v2 merkle tree for each file\n+\t\taux::vector<aux::merkle_tree, file_index_t> m_merkle_trees;\n+\n+\t\t// the performance counters of this session\n+\t\tcounters& m_stats_counters;\n+\n+\t\t// each bit represents a piece. a set bit means\n+\t\t// the piece has had its hash verified. This\n+\t\t// is only used in seed mode (when m_seed_mode\n+\t\t// is true)\n+\t\ttyped_bitfield<piece_index_t> m_verified;\n+\n+\t\t// this means there is an outstanding, async, operation\n+\t\t// to verify each piece that has a 1\n+\t\ttyped_bitfield<piece_index_t> m_verifying;\n+\n+\t\t// set if there's an error on this torrent\n+\t\terror_code m_error;\n+\n+\t\t// used if there is any resume data. Some of the information from the\n+\t\t// add_torrent_params struct are needed later in the torrent object's life\n+\t\t// cycle, and not in the constructor. So we need to save if away here\n+\t\tstd::unique_ptr<add_torrent_params> m_add_torrent_params;\n+\n+\t\t// if the torrent is started without metadata, it may\n+\t\t// still be given a name until the metadata is received\n+\t\t// once the metadata is received this field will no\n+\t\t// longer be used and will be reset\n+
    relevance 3../include/libtorrent/torrent.hpp:1483factor out the links (as well as update_list() to a separate class that torrent can inherit)

    factor out the links (as well as update_list() to a separate\n+class that torrent can inherit)

    ../include/libtorrent/torrent.hpp:1483

    \n+\t\t// this was the last time _we_ saw a seed in this swarm\n+\t\tstd::time_t m_last_seen_complete = 0;\n+\n+\t\t// this is the time last any of our peers saw a seed\n+\t\t// in this swarm\n+\t\tstd::time_t m_swarm_last_seen_complete = 0;\n+\n+\t\t// keep a copy if the info-hash here, so it can be accessed from multiple\n+\t\t// threads, and be cheap to access from the client\n+\t\tinfo_hash_t m_info_hash;\n+\n+\tpublic:\n+\t\t// these are the lists this torrent belongs to. For more\n+\t\t// details about each list, see session_impl.hpp. Each list\n+\t\t// represents a group this torrent belongs to and makes it\n+\t\t// efficient to enumerate only torrents belonging to a specific\n+\t\t// group. Such as torrents that want peer connections or want\n+\t\t// to be ticked etc.\n+\n+
    \t\taux::array<link, aux::session_interface::num_torrent_lists, torrent_list_index_t>\n+
    \t\t\tm_links;\n \n \tprivate:\n \n-\t\tkey_t m_dh_local_key;\n-\t\tkey_t m_dh_local_secret;\n-\t\tkey_t m_dh_shared_secret;\n-\t\tsha1_hash m_xor_mask;\n-\t};\n+\t\t// m_num_verified = m_verified.count()\n+\t\tstd::uint32_t m_num_verified = 0;\n \n-\tstruct TORRENT_EXTRA_EXPORT encryption_handler\n-\t{\n-\t\tstd::tuple<int, span<span<char const>>>\n-\t\tencrypt(span<span<char>> iovec);\n+\t\t// if this torrent is running, this was the time\n+\t\t// when it was started. This is used to have a\n+\t\t// bias towards keeping seeding torrents that\n+\t\t// recently was started, to avoid oscillation\n+\t\t// this is specified at a second granularity\n+\t\ttime_point32 m_started = aux::time_now32();\n \n-\t\tint decrypt(aux::crypto_receive_buffer& recv_buffer\n+\t\t// if we're a seed, this is the timestamp of when we became one\n+\t\ttime_point32 m_became_seed = aux::time_now32();\n+\n+\t\t// if we're finished, this is the timestamp of when we finished\n+\t\ttime_point32 m_became_finished = aux::time_now32();\n+\n+\t\t// when checking, this is the first piece we have not\n+\t\t// issued a hash job for\n+\t\tpiece_index_t m_checking_piece{0};\n+\n+\t\t// the number of pieces we completed the check of\n+\t\tpiece_index_t m_num_checked_pieces{0};\n+\n+\t\t// if the error occurred on a file, this is the index of that file\n+\t\t// there are a few special cases, when this is negative. See\n+\t\t// set_error()\n
    relevance 3../include/libtorrent/kademlia/routing_table.hpp:153to improve memory locality and scanning performance, turn the routing table into a single vector with boundaries for the nodes instead. Perhaps replacement nodes should be in a separate vector.

    to improve memory locality and scanning performance, turn the\n routing table into a single vector with boundaries for the nodes instead.\n Perhaps replacement nodes should be in a separate vector.

    ../include/libtorrent/kademlia/routing_table.hpp:153

    // * Nodes are not marked as being stale, they keep a counter\n // \tthat tells how many times in a row they have failed. When\n // \ta new node is to be inserted, the node that has failed\n // \tthe most times is replaced. If none of the nodes in the\n // \tbucket has failed, then it is put in the replacement\n@@ -2066,16 +2066,67 @@\n \n \t// deletes the files on fs from save_path according to options. Options may\n \t// opt to only delete the partfile\n \tTORRENT_EXTRA_EXPORT void\n \tdelete_files(file_storage const& fs, std::string const& save_path\n \t\t, std::string const& part_file_name, remove_flags_t options, storage_error& ec);\n \n-
    relevance 2../test/test_piece_picker.cpp:2870test picking with partial pieces and other peers present so that both backup_pieces and backup_pieces2 are used

    test picking with partial pieces and other peers present so that both\n-backup_pieces and backup_pieces2 are used

    ../test/test_piece_picker.cpp:2870

    relevance 2../test/test_dht.cpp:1642test num_global_nodes

    test num_global_nodes

    ../test/test_dht.cpp:1642

    relevance 2../test/test_dht.cpp:1643test need_refresh

    test need_refresh

    ../test/test_dht.cpp:1643

    \n+
    relevance 2../test/test_storage.cpp:769split this test up into smaller parts

    split this test up into smaller parts

    ../test/test_storage.cpp:769

    \tio->submit_jobs();\n+\tios.restart();\n+\trun_until(ios, done);\n+\n+\tTEST_EQUAL(oversized, bool(flags & test_oversized));\n+\n+\tfor (auto const i : info->piece_range())\n+\t{\n+\t\tdone = false;\n+\t\tio->async_hash(st, i, {}\n+\t\t\t, disk_interface::sequential_access | disk_interface::volatile_read | disk_interface::v1_hash\n+\t\t\t, std::bind(&on_piece_checked, _1, _2, _3, &done));\n+\t\tio->submit_jobs();\n+\t\tios.restart();\n+\t\trun_until(ios, done);\n+\t}\n+\n+\tio->abort(true);\n+}\n+\n+
    template <typename StorageType>\n+
    void run_test()\n+{\n+\tstd::string const test_path = current_working_directory();\n+\tstd::cout << \"\\n=== \" << test_path << \" ===\\n\" << std::endl;\n+\n+\tstd::shared_ptr<torrent_info> info;\n+\n+\tstd::vector<char> piece0 = new_piece(piece_size);\n+\tstd::vector<char> piece1 = new_piece(piece_size);\n+\tstd::vector<char> piece2 = new_piece(piece_size);\n+\tstd::vector<char> piece3 = new_piece(piece_size);\n+\n+\tdelete_dirs(\"temp_storage\");\n+\n+\tfile_storage fs;\n+\tfs.add_file(\"temp_storage/test1.tmp\", 17);\n+\tfs.add_file(\"temp_storage/test2.tmp\", 612);\n+\tfs.add_file(\"temp_storage/test3.tmp\", 0);\n+\tfs.add_file(\"temp_storage/test4.tmp\", 0);\n+\tfs.add_file(\"temp_storage/test5.tmp\", 3253);\n+\tfs.add_file(\"temp_storage/test6.tmp\", 841);\n+\tint const last_file_size = 4 * int(piece_size) - int(fs.total_size());\n+\tfs.add_file(\"temp_storage/test7.tmp\", last_file_size);\n+\n+\t// File layout\n+\t// +-+--+++-------+-------+----------------------------------------------------------------------------------------+\n+\t// |1| 2||| file5 | file6 | file7 |\n+\t// +-+--+++-------+-------+----------------------------------------------------------------------------------------+\n+\t// | | | | |\n+\t// | piece 0 | piece 1 | piece 2 | piece 3 |\n+
    relevance 2../test/test_piece_picker.cpp:2870test picking with partial pieces and other peers present so that both backup_pieces and backup_pieces2 are used

    test picking with partial pieces and other peers present so that both\n+backup_pieces and backup_pieces2 are used

    ../test/test_piece_picker.cpp:2870

    relevance 2../test/test_dht.cpp:1642test num_global_nodes

    test num_global_nodes

    ../test/test_dht.cpp:1642

    relevance 2../test/test_dht.cpp:1643test need_refresh

    test need_refresh

    ../test/test_dht.cpp:1643

    \n \ts.set_bool(settings_pack::dht_restrict_routing_ips, false);\n \n \t{\n \t\tauto const ep = rand_udp_ep(rand_addr);\n \t\tauto const id = generate_id_impl(ep.address(), 2);\n \t\ttable.node_seen(id, ep, 10);\n \t}\n@@ -2118,15 +2169,15 @@\n \t\tstd::vector<node_entry> temp = table.find_node(id, {}, bucket_size * 2);\n \t\tTEST_EQUAL(int(temp.size()), std::min(bucket_size * 2, int(nodes.size())));\n \n \t\tstd::sort(nodes.begin(), nodes.end(), std::bind(&compare_ref\n \t\t\t\t, std::bind(&node_entry::id, _1)\n \t\t\t\t, std::bind(&node_entry::id, _2), id));\n \n-
    relevance 2../test/test_dht.cpp:2828split this up into smaller test cases

    split this up into smaller test cases

    ../test/test_dht.cpp:2828

    \n+
    relevance 2../test/test_dht.cpp:2828split this up into smaller test cases

    split this up into smaller test cases

    ../test/test_dht.cpp:2828

    \n \tTEST_EQUAL(aux::to_hex(sig.bytes)\n \t\t, \"6834284b6b24c3204eb2fea824d82f88883a3d95e8b4a21b8c0ded553d17d17d\"\n \t\t\"df9a8a7104b1258f30bed3787e6cb896fca78c58f8e03b5f18f14951a87d9a08\");\n \n \tsha1_hash target_id = item_target_id(test_salt, pk);\n \tTEST_EQUAL(aux::to_hex(target_id), \"411eba73b6f087ca51a3795d9c8c938d365e32c1\");\n }\n@@ -2169,224 +2220,427 @@\n \tbool ret = verify_message(ent, msg_desc, msg_keys, error_string);\n \tTEST_CHECK(ret);\n \tTEST_CHECK(msg_keys[0]);\n \tif (msg_keys[0]) TEST_EQUAL(msg_keys[0].string_value(), \"test\");\n \tTEST_CHECK(msg_keys[1]);\n \tTEST_CHECK(msg_keys[2]);\n \tif (msg_keys[2]) TEST_EQUAL(msg_keys[2].string_value(), \"test2\");\n-
    relevance 2../test/test_storage.cpp:769split this test up into smaller parts

    split this test up into smaller parts

    ../test/test_storage.cpp:769

    \tio->submit_jobs();\n-\tios.restart();\n-\trun_until(ios, done);\n+
    relevance 2../src/upnp.cpp:106use boost::asio::ip::network instead of netmask

    use boost::asio::ip::network instead of netmask

    ../src/upnp.cpp:106

    \n+static error_code ignore_error;\n \n-\tTEST_EQUAL(oversized, bool(flags & test_oversized));\n+upnp::rootdevice::rootdevice() = default;\n \n-\tfor (auto const i : info->piece_range())\n-\t{\n-\t\tdone = false;\n-\t\tio->async_hash(st, i, {}\n-\t\t\t, disk_interface::sequential_access | disk_interface::volatile_read | disk_interface::v1_hash\n-\t\t\t, std::bind(&on_piece_checked, _1, _2, _3, &done));\n-\t\tio->submit_jobs();\n-\t\tios.restart();\n-\t\trun_until(ios, done);\n-\t}\n+#if TORRENT_USE_ASSERTS\n+upnp::rootdevice::~rootdevice()\n+{\n+\tTORRENT_ASSERT(magic == 1337);\n+\tmagic = 0;\n+}\n+#else\n+upnp::rootdevice::~rootdevice() = default;\n+#endif\n \n-\tio->abort(true);\n+upnp::rootdevice::rootdevice(rootdevice const&) = default;\n+upnp::rootdevice& upnp::rootdevice::operator=(rootdevice const&) & = default;\n+upnp::rootdevice::rootdevice(rootdevice&&) noexcept = default;\n+upnp::rootdevice& upnp::rootdevice::operator=(rootdevice&&) & = default;\n+\n+
    upnp::upnp(io_context& ios\n+
    \t, aux::session_settings const& settings\n+\t, aux::portmap_callback& cb\n+\t, address_v4 const listen_address\n+\t, address_v4 const netmask\n+\t, std::string listen_device\n+\t, listen_socket_handle ls)\n+\t: m_settings(settings)\n+\t, m_callback(cb)\n+\t, m_io_service(ios)\n+\t, m_resolver(ios)\n+\t, m_multicast(ios)\n+\t, m_unicast(ios)\n+\t, m_broadcast_timer(ios)\n+\t, m_refresh_timer(ios)\n+\t, m_map_timer(ios)\n+\t, m_listen_address(listen_address)\n+\t, m_netmask(netmask)\n+\t, m_device(std::move(listen_device))\n+#if TORRENT_USE_SSL\n+\t, m_ssl_ctx(ssl::context::sslv23_client)\n+#endif\n+\t, m_listen_handle(std::move(ls))\n+{\n+#if TORRENT_USE_SSL\n+\tm_ssl_ctx.set_verify_mode(ssl::context::verify_none);\n+#endif\n }\n \n-
    template <typename StorageType>\n-
    void run_test()\n+void upnp::start()\n {\n-\tstd::string const test_path = current_working_directory();\n-\tstd::cout << \"\\n=== \" << test_path << \" ===\\n\" << std::endl;\n+
    relevance 2../src/instantiate_connection.cpp:44peer_connection and tracker_connection should probably be flags

    peer_connection and tracker_connection should probably be flags

    ../src/instantiate_connection.cpp:44

    ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n+POSSIBILITY OF SUCH DAMAGE.\n \n-\tstd::shared_ptr<torrent_info> info;\n+*/\n \n-\tstd::vector<char> piece0 = new_piece(piece_size);\n-\tstd::vector<char> piece1 = new_piece(piece_size);\n-\tstd::vector<char> piece2 = new_piece(piece_size);\n-\tstd::vector<char> piece3 = new_piece(piece_size);\n+#include \"libtorrent/socket.hpp\"\n+#include \"libtorrent/aux_/socket_type.hpp\"\n+#include \"libtorrent/aux_/utp_socket_manager.hpp\"\n+#include \"libtorrent/aux_/instantiate_connection.hpp\"\n+#include \"libtorrent/aux_/utp_stream.hpp\"\n+#include \"libtorrent/ssl_stream.hpp\"\n \n-\tdelete_dirs(\"temp_storage\");\n+namespace libtorrent { namespace aux {\n \n-\tfile_storage fs;\n-\tfs.add_file(\"temp_storage/test1.tmp\", 17);\n-\tfs.add_file(\"temp_storage/test2.tmp\", 612);\n-\tfs.add_file(\"temp_storage/test3.tmp\", 0);\n-\tfs.add_file(\"temp_storage/test4.tmp\", 0);\n-\tfs.add_file(\"temp_storage/test5.tmp\", 3253);\n-\tfs.add_file(\"temp_storage/test6.tmp\", 841);\n-\tint const last_file_size = 4 * int(piece_size) - int(fs.total_size());\n-\tfs.add_file(\"temp_storage/test7.tmp\", last_file_size);\n+
    \taux::socket_type instantiate_connection(io_context& ios\n+
    \t\t, aux::proxy_settings const& ps\n+\t\t, void* ssl_context\n+\t\t, utp_socket_manager* sm\n+\t\t, bool peer_connection\n+\t\t, bool tracker_connection)\n+\t{\n+#if !TORRENT_USE_SSL\n+\t\tTORRENT_UNUSED(ssl_context);\n+#endif\n \n-\t// File layout\n-\t// +-+--+++-------+-------+----------------------------------------------------------------------------------------+\n-\t// |1| 2||| file5 | file6 | file7 |\n-\t// +-+--+++-------+-------+----------------------------------------------------------------------------------------+\n-\t// | | | | |\n-\t// | piece 0 | piece 1 | piece 2 | piece 3 |\n-
    relevance 2../src/web_peer_connection.cpp:626just make this peer not have the pieces associated with the file we just requested. Only when it doesn't have any of the file do the following pad files will make it complicated

    just make this peer not have the pieces\n-associated with the file we just requested. Only\n-when it doesn't have any of the file do the following\n-pad files will make it complicated

    ../src/web_peer_connection.cpp:626

    \n-\tpeer_connection::received_invalid_data(index, single_peer);\n+\t\tif (sm)\n+\t\t{\n+#if TORRENT_USE_SSL\n+\t\t\tif (ssl_context)\n+\t\t\t{\n+\t\t\t\tssl_stream<utp_stream> s(ios, *static_cast<ssl::context*>(ssl_context));\n+\t\t\t\ts.next_layer().set_impl(sm->new_utp_socket(&s.next_layer()));\n+\t\t\t\treturn socket_type(std::move(s));\n+\t\t\t}\n+\t\t\telse\n+#endif\n+\t\t\t{\n+\t\t\t\tutp_stream s(ios);\n+\t\t\t\ts.set_impl(sm->new_utp_socket(&s));\n+\t\t\t\treturn socket_type(std::move(s));\n+\t\t\t}\n+\t\t}\n+#if TORRENT_USE_I2P\n+\t\telse if (ps.type == settings_pack::i2p_proxy)\n+\t\t{\n+
    relevance 2../src/path.cpp:429test this on a FAT volume to see what error we get!

    test this on a FAT volume to see what error we get!

    ../src/path.cpp:429

    \t\t\t// it's possible CreateHardLink will copy the file internally too,\n+\t\t\t// if the filesystem does not support it.\n+\t\t\tec.assign(GetLastError(), system_category());\n+\t\t\treturn;\n+\t\t}\n \n-\t// if we don't think we have any of the files, allow banning the web seed\n-\tif (num_have_pieces() == 0) return true;\n+\t\t// fall back to making a copy\n+#endif\n+#else\n+\t\t// assume posix's link() function exists\n+\t\tint ret = ::link(n_exist.c_str(), n_link.c_str());\n \n-\t// don't disconnect, we won't request anything from this file again\n-\treturn false;\n-}\n+\t\tif (ret == 0)\n+\t\t{\n+\t\t\tec.clear();\n+\t\t\treturn;\n+\t\t}\n \n-void web_peer_connection::on_receive_padfile()\n-{\n-\thandle_padfile();\n-}\n+\t\t// most errors are passed through, except for the ones that indicate that\n+\t\t// hard links are not supported and require a copy.\n+
    \t\tif (errno != EMLINK\n+
    \t\t\t&& errno != EXDEV\n+#ifdef TORRENT_BEOS\n+\t\t\t// haiku returns EPERM when the filesystem doesn't support hard link\n+\t\t\t&& errno != EPERM\n+#endif\n+\t\t\t)\n+\t\t{\n+\t\t\t// some error happened, report up to the caller\n+\t\t\tec.assign(errno, system_category());\n+\t\t\treturn;\n+\t\t}\n \n-void web_peer_connection::handle_error(int const bytes_left)\n-{\n-\tstd::shared_ptr<torrent> t = associated_torrent().lock();\n-\tTORRENT_ASSERT(t);\n+\t\t// fall back to making a copy\n \n-
    \n-
    \t// temporarily unavailable, retry later\n-\tt->retry_web_seed(this, m_parser.header_duration(\"retry-after\"));\n-\tif (t->alerts().should_post<url_seed_alert>())\n-\t{\n-\t\tstd::string const error_msg = to_string(m_parser.status_code()).data()\n-\t\t\t+ (\" \" + m_parser.message());\n-\t\tt->alerts().emplace_alert<url_seed_alert>(t->get_handle(), m_url\n-\t\t\t, error_msg);\n+#endif\n+\n+\t\t// if we get here, we should copy the file\n+\t\tstorage_error se;\n+\t\taux::copy_file(file, link, se);\n+\t\tec = se.ec;\n \t}\n-\treceived_bytes(0, bytes_left);\n-\tdisconnect(error_code(m_parser.status_code(), http_category()), operation_t::bittorrent, failure);\n-}\n \n-void web_peer_connection::disable(error_code const& ec)\n-{\n-\t// we should not try this server again.\n-\tm_web->disabled = true;\n-\tdisconnect(ec, operation_t::bittorrent, peer_error);\n-\tif (m_web->ephemeral)\n+\tbool is_directory(std::string const& f, error_code& ec)\n \t{\n-\t\tstd::shared_ptr<torrent> t = associated_torrent().lock();\n-\t\tTORRENT_ASSERT(t);\n-\t\tt->remove_web_seed_conn(this);\n+\t\tec.clear();\n+\t\terror_code e;\n+\t\tfile_status s;\n+\t\tstat_file(f, &s, e);\n+\t\tif (!e && s.mode & file_status::directory) return true;\n+\t\tec = e;\n+
    relevance 2../src/torrent.cpp:504post alert

    post alert

    ../src/torrent.cpp:504

    \t\tif (m_current_gauge_state != no_gauge_state)\n+\t\t\tinc_stats_counter(m_current_gauge_state + counters::num_checking_torrents, -1);\n+\t\tif (new_gauge_state != no_gauge_state)\n+\t\t\tinc_stats_counter(new_gauge_state + counters::num_checking_torrents, 1);\n+\n+\t\tTORRENT_ASSERT(new_gauge_state >= 0);\n+\t\tTORRENT_ASSERT(new_gauge_state <= no_gauge_state);\n+\t\tm_current_gauge_state = static_cast<std::uint32_t>(new_gauge_state);\n \t}\n-\tm_web = nullptr;\n-\tTORRENT_ASSERT(is_disconnecting());\n-}\n \n-void web_peer_connection::handle_redirect(int const bytes_left)\n-{\n-
    relevance 2../src/udp_tracker_connection.cpp:81support authentication here. tracker_req().auth

    support authentication here. tracker_req().auth

    ../src/udp_tracker_connection.cpp:81

    \t\tudp_tracker_connection::m_connection_cache;\n+\tvoid torrent::leave_seed_mode(seed_mode_t const checking)\n+\t{\n+\t\tif (!m_seed_mode) return;\n \n-\tstd::mutex udp_tracker_connection::m_cache_mutex;\n+\t\tif (checking == seed_mode_t::check_files)\n+\t\t{\n+\t\t\t// this means the user promised we had all the\n+\t\t\t// files, but it turned out we didn't. This is\n+\t\t\t// an error.\n \n-\tudp_tracker_connection::udp_tracker_connection(\n-\t\tio_context& ios\n-\t\t, tracker_manager& man\n-\t\t, tracker_request const& req\n-\t\t, std::weak_ptr<request_callback> c)\n-\t\t: tracker_connection(man, req, ios, std::move(c))\n-\t\t, m_transaction_id(0)\n-\t\t, m_attempts(0)\n-\t\t, m_state(action_t::error)\n-\t\t, m_abort(false)\n-\t{\n-\t\tupdate_transaction_id();\n+
    \n+
    #ifndef TORRENT_DISABLE_LOGGING\n+\t\t\tdebug_log(\"*** FAILED SEED MODE, rechecking\");\n+#endif\n+\t\t}\n+\n+#ifndef TORRENT_DISABLE_LOGGING\n+\t\tdebug_log(\"*** LEAVING SEED MODE (%s)\"\n+\t\t\t, checking == seed_mode_t::skip_checking ? \"as seed\" : \"as non-seed\");\n+#endif\n+\t\tm_seed_mode = false;\n+\t\t// seed is false if we turned out not\n+\t\t// to be a seed after all\n+\t\tif (checking == seed_mode_t::check_files\n+\t\t\t&& state() != torrent_status::checking_resume_data)\n+\t\t{\n+\t\t\tm_have_all = false;\n+\t\t\tset_state(torrent_status::downloading);\n+\t\t\tforce_recheck();\n+\t\t}\n+\t\tm_num_verified = 0;\n+\t\tm_verified.clear();\n+\t\tm_verifying.clear();\n+\n+\t\tset_need_save_resume(torrent_handle::if_state_changed);\n \t}\n \n-\tvoid udp_tracker_connection::start()\n+\tvoid torrent::verified(piece_index_t const piece)\n \t{\n-
    \t\tstd::string hostname;\n-
    \t\tstd::string protocol;\n-\t\tint port;\n-\t\terror_code ec;\n+\t\tTORRENT_ASSERT(!m_verified.get_bit(piece));\n+\t\t++m_num_verified;\n+
    relevance 2../src/torrent.cpp:1852add a unit test where we don't have metadata, connect to a peer that sends a bitfield that's too large, then we get the metadata

    add a unit test where we don't have metadata, connect to a peer\n+that sends a bitfield that's too large, then we get the metadata

    ../src/torrent.cpp:1852

    \t\t\tfor (auto const& f : m_add_torrent_params->renamed_files)\n+\t\t\t{\n+\t\t\t\tif (f.first < file_index_t(0) || f.first >= fs.end_file()) continue;\n+\t\t\t\tm_torrent_file->rename_file(file_index_t(f.first), f.second);\n+\t\t\t}\n+\t\t}\n \n-\t\tstd::tie(protocol, std::ignore, hostname, port, std::ignore)\n-\t\t\t= parse_url_components(tracker_req().url, ec);\n-\t\tif (port == -1) port = protocol == \"http\" ? 80 : 443;\n+\t\tconstruct_storage();\n \n-\t\tif (ec)\n+#ifndef TORRENT_DISABLE_SHARE_MODE\n+\t\tif (m_share_mode && valid_metadata())\n \t\t{\n-\t\t\ttracker_connection::fail(ec, operation_t::parse_address);\n-\t\t\treturn;\n+\t\t\t// in share mode, all pieces have their priorities initialized to 0\n+\t\t\tm_file_priority.clear();\n+\t\t\tm_file_priority.resize(m_torrent_file->num_files(), dont_download);\n \t\t}\n+#endif\n \n-\t\taux::session_settings const& settings = m_man.settings();\n-\n-\t\tint const proxy_type = settings.get_int(settings_pack::proxy_type);\n+\t\t// it's important to initialize the peers early, because this is what will\n+\t\t// fix up their have-bitmasks to have the correct size\n+
    \t\tif (!m_connections_initialized)\n+
    \t\t{\n+\t\t\tm_connections_initialized = true;\n+\t\t\t// all peer connections have to initialize themselves now that the metadata\n+\t\t\t// is available\n+\t\t\t// copy the peer list since peers may disconnect and invalidate\n+\t\t\t// m_connections as we initialize them\n+\t\t\tfor (auto c : m_connections)\n+\t\t\t{\n+\t\t\t\tauto pc = c->self();\n+\t\t\t\tif (pc->is_disconnecting()) continue;\n+\t\t\t\tpc->on_metadata_impl();\n+\t\t\t\tif (pc->is_disconnecting()) continue;\n+\t\t\t\tpc->init();\n+\t\t\t}\n+\t\t}\n \n-\t\tif (settings.get_bool(settings_pack::proxy_hostnames)\n-\t\t\t&& (proxy_type == settings_pack::socks5\n-\t\t\t\t|| proxy_type == settings_pack::socks5_pw))\n+\t\t// in case file priorities were passed in via the add_torrent_params\n+\t\t// and also in the case of share mode, we need to update the priorities\n+\t\t// this has to be applied before piece priority\n+\t\tif (!m_file_priority.empty())\n \t\t{\n-\t\t\tm_hostname = hostname;\n-\t\t\tm_target.port(std::uint16_t(port));\n-\t\t\tstart_announce();\n+\t\t\t// m_file_priority was loaded from the resume data, this doesn't\n+\t\t\t// alter any state that needs to be saved in the resume data\n+\t\t\tauto const ns = m_need_save_resume_data;\n+\t\t\tupdate_piece_priorities(m_file_priority);\n+\t\t\tm_need_save_resume_data = ns;\n \t\t}\n-\t\telse\n+\n+\t\tif (m_add_torrent_params)\n \t\t{\n-\t\t\tusing namespace std::placeholders;\n-\t\t\tADD_OUTSTANDING_ASYNC(\"udp_tracker_connection::name_lookup\");\n-
    relevance 2../src/peer_list.cpp:539it would be nice if there was a way to iterate over these torrent_peer objects in the order they are allocated in the pool instead. It would probably be more efficient

    it would be nice if there was a way to iterate over these\n-torrent_peer objects in the order they are allocated in the pool\n-instead. It would probably be more efficient

    ../src/peer_list.cpp:539

    \t\t, int session_time, torrent_state* state)\n-\t{\n-\t\tTORRENT_ASSERT(is_single_thread());\n-\t\tINVARIANT_CHECK;\n+
    relevance 2../src/torrent.cpp:4492use chrono type for time duration

    use chrono type for time duration

    ../src/torrent.cpp:4492

    \t\t}\n \n-\t\tconst int candidate_count = 10;\n-\t\tpeers.reserve(candidate_count);\n+\t\tm_picker->piece_passed(index);\n+\t\tupdate_gauge();\n+\t\twe_have(index);\n \n-\t\tint erase_candidate = -1;\n+#ifndef TORRENT_DISABLE_LOGGING\n+\t\tif (should_log())\n+\t\t\tdebug_log(\"we_have(%d) (num_have: %d)\", int(index), num_have());\n+#endif\n+#ifndef TORRENT_DISABLE_STREAMING\n+\t\tremove_time_critical_piece(index, true);\n+#endif\n+\t}\n \n-\t\tif (bool(m_finished) != state->is_finished)\n-\t\t\trecalculate_connect_candidates(state);\n+#ifndef TORRENT_DISABLE_PREDICTIVE_PIECES\n+\t// we believe we will complete this piece very soon\n+\t// announce it to peers ahead of time to eliminate the\n+\t// round-trip times involved in announcing it, requesting it\n+\t// and sending it\n+
    \tvoid torrent::predicted_have_piece(piece_index_t const index, int const milliseconds)\n+
    \t{\n+\t\tauto const i = std::lower_bound(m_predictive_pieces.begin()\n+\t\t\t, m_predictive_pieces.end(), index);\n+\t\tif (i != m_predictive_pieces.end() && *i == index) return;\n \n-\t\texternal_ip const& external = state->ip;\n-\t\tint external_port = state->port;\n+\t\tfor (auto p : m_connections)\n+\t\t{\n+\t\t\tTORRENT_INCREMENT(m_iterating_connections);\n+#ifndef TORRENT_DISABLE_LOGGING\n+\t\t\tp->peer_log(peer_log_alert::outgoing, \"PREDICTIVE_HAVE\", \"piece: %d expected in %d ms\"\n+\t\t\t\t, static_cast<int>(index), milliseconds);\n+#else\n+\t\t\tTORRENT_UNUSED(milliseconds);\n+#endif\n+\t\t\tp->announce_piece(index);\n+\t\t}\n \n-\t\tif (m_round_robin >= int(m_peers.size())) m_round_robin = 0;\n+\t\tm_predictive_pieces.insert(i, index);\n+\t}\n+#endif\n \n-\t\tint max_peerlist_size = state->max_peerlist_size;\n+\t// blocks may contain the block indices of the blocks that failed (if this is\n+\t// a v2 torrent).\n+\tvoid torrent::piece_failed(piece_index_t const index, std::vector<int> blocks)\n+\t{\n+\t\t// if the last piece fails the peer connection will still\n+\t\t// think that it has received all of it until this function\n+\t\t// resets the download queue. So, we cannot do the\n+\t\t// invariant check here since it assumes:\n+\t\t// (total_done == m_torrent_file->total_size()) => is_seed()\n+
    relevance 2../src/torrent.cpp:4919abort lookups this torrent has made via the session host resolver interface

    abort lookups this torrent has made via the\n+session host resolver interface

    ../src/torrent.cpp:4919

    \t\t\t\tTORRENT_UNUSED(e);\n+\t\t\t\tm_storage.reset();\n+#ifndef TORRENT_DISABLE_LOGGING\n+\t\t\t\tdebug_log(\"Failed to flush disk cache: %s\", e.what());\n+#endif\n+\t\t\t\t// clients may rely on this alert to be posted, so it's probably a\n+\t\t\t\t// good idea to post it here, even though we failed\n+\t\t\t\tif (alerts().should_post<cache_flushed_alert>())\n+\t\t\t\t\talerts().emplace_alert<cache_flushed_alert>(get_handle());\n+\t\t\t}\n+\t\t\tm_ses.deferred_submit_jobs();\n+\t\t}\n+\t\telse\n+\t\t{\n+\t\t\tif (alerts().should_post<cache_flushed_alert>())\n+\t\t\t\talerts().emplace_alert<cache_flushed_alert>(get_handle());\n+\t\t\talerts().emplace_alert<torrent_removed_alert>(get_handle()\n+\t\t\t\t, info_hash(), get_userdata());\n+\t\t}\n \n-
    \t\tfor (int iterations = std::min(int(m_peers.size()), 300);\n-
    \t\t\titerations > 0; --iterations)\n+
    \n+
    \t\tif (!m_apply_ip_filter)\n \t\t{\n-\t\t\t++state->loop_counter;\n+\t\t\tinc_stats_counter(counters::non_filter_torrents, -1);\n+\t\t\tm_apply_ip_filter = true;\n+\t\t}\n \n-\t\t\tif (m_round_robin >= int(m_peers.size())) m_round_robin = 0;\n+\t\tm_paused = false;\n+\t\tm_auto_managed = false;\n+\t\tupdate_state_list();\n+\t\tfor (torrent_list_index_t i{}; i != m_links.end_index(); ++i)\n+\t\t{\n+\t\t\tif (!m_links[i].in_list()) continue;\n+\t\t\tm_links[i].unlink(m_ses.torrent_list(i), i);\n+\t\t}\n+\t\t// don't re-add this torrent to the state-update list\n+\t\tm_state_subscription = false;\n+\t}\n \n-\t\t\ttorrent_peer& pe = *m_peers[m_round_robin];\n-\t\t\tTORRENT_ASSERT(pe.in_use);\n-\t\t\tint current = m_round_robin;\n+\t// this is called when we're destructing non-gracefully. i.e. we're _just_\n+\t// destructing everything.\n+\tvoid torrent::panic()\n+\t{\n+\t\tm_storage.reset();\n+\t\t// if there are any other peers allocated still, we need to clear them\n+\t\t// now. They can't be cleared later because the allocator will already\n+\t\t// have been destructed\n+\t\tif (m_peer_list) m_peer_list->clear();\n+\t\tm_connections.clear();\n+\t\tm_outgoing_pids.clear();\n+\t\tm_peers_to_disconnect.clear();\n+
    relevance 2../src/torrent.cpp:8032if peer is a really good peer, maybe we shouldn't disconnect it perhaps this logic should be disabled if we have too many idle peers (with some definition of idle)

    if peer is a really good peer, maybe we shouldn't disconnect it\n+perhaps this logic should be disabled if we have too many idle peers\n+(with some definition of idle)

    ../src/torrent.cpp:8032

    \n+\t\tm_peers_to_disconnect.reserve(m_connections.size() + 1);\n+\t\tm_connections.reserve(m_connections.size() + 1);\n \n-\t\t\t// if the number of peers is growing large\n-\t\t\t// we need to start weeding.\n+#if TORRENT_USE_ASSERTS\n+\t\terror_code ec;\n+\t\tTORRENT_ASSERT(p->remote() == p->get_socket().remote_endpoint(ec) || ec);\n+#endif\n \n-\t\t\tif (int(m_peers.size()) >= max_peerlist_size * 0.95\n-\t\t\t\t&& max_peerlist_size > 0)\n+\t\tTORRENT_ASSERT(p->peer_info_struct() != nullptr);\n+\n+\t\t// we need to do this after we've added the peer to the peer_list\n+\t\t// since that's when the peer is assigned its peer_info object,\n+\t\t// which holds the rank\n+\t\tif (maybe_replace_peer)\n+\t\t{\n+\t\t\t// now, find the lowest rank peer and disconnect that\n+\t\t\t// if it's lower rank than the incoming connection\n+\t\t\tpeer_connection* peer = find_lowest_ranking_peer();\n+\n+
    \t\t\tif (peer != nullptr && peer->peer_rank() < p->peer_rank())\n+
    \t\t\t{\n+#ifndef TORRENT_DISABLE_LOGGING\n+\t\t\t\tif (should_log())\n+\t\t\t\t{\n+\t\t\t\t\tdebug_log(\"CLOSING CONNECTION \\\"%s\\\" peer list full (low peer rank) \"\n+\t\t\t\t\t\t\"connections: %d limit: %d\"\n+\t\t\t\t\t\t, print_endpoint(peer->remote()).c_str()\n+\t\t\t\t\t\t, num_peers()\n+\t\t\t\t\t\t, m_max_connections);\n+\t\t\t\t}\n+#endif\n+\t\t\t\tpeer->disconnect(errors::too_many_connections, operation_t::bittorrent);\n+\t\t\t\tp->peer_disconnected_other();\n+\t\t\t}\n+\t\t\telse\n \t\t\t{\n-\t\t\t\tif (is_erase_candidate(pe)\n-\t\t\t\t\t&& (erase_candidate == -1\n-\t\t\t\t\t\t|| !compare_peer_erase(*m_peers[erase_candidate], pe)))\n+#ifndef TORRENT_DISABLE_LOGGING\n+\t\t\t\tif (should_log())\n \t\t\t\t{\n-\t\t\t\t\tif (should_erase_immediately(pe))\n-\t\t\t\t\t{\n-\t\t\t\t\t\tif (erase_candidate > current) --erase_candidate;\n-\t\t\t\t\t\terase_peer(m_peers.begin() + current, state);\n-\t\t\t\t\t\tcontinue;\n-\t\t\t\t\t}\n-\t\t\t\t\telse\n-\t\t\t\t\t{\n-\t\t\t\t\t\terase_candidate = current;\n-\t\t\t\t\t}\n-
    relevance 2../src/storage_utils.cpp:294technically, this is where the transaction of moving the files is completed. This is where the new save_path should be committed. If there is an error in the code below, that should not prevent the new save path to be set. Maybe it would make sense to make the save_path an in-out parameter

    technically, this is where the transaction of moving the files\n+\t\t\t\t\tdebug_log(\"CLOSING CONNECTION \\\"%s\\\" peer list full (low peer rank) \"\n+\t\t\t\t\t\t\"connections: %d limit: %d\"\n+\t\t\t\t\t\t, print_endpoint(p->remote()).c_str()\n+\t\t\t\t\t\t, num_peers()\n+\t\t\t\t\t\t, m_max_connections);\n+\t\t\t\t}\n+#endif\n+\t\t\t\tp->disconnect(errors::too_many_connections, operation_t::bittorrent);\n+\t\t\t\t// we have to do this here because from the peer's point of view\n+\t\t\t\t// it wasn't really attached to the torrent, but we do need\n+\t\t\t\t// to let peer_list know we're removing it\n+

    relevance 2../src/storage_utils.cpp:294technically, this is where the transaction of moving the files is completed. This is where the new save_path should be committed. If there is an error in the code below, that should not prevent the new save path to be set. Maybe it would make sense to make the save_path an in-out parameter

    technically, this is where the transaction of moving the files\n is completed. This is where the new save_path should be committed. If\n there is an error in the code below, that should not prevent the new\n save path to be set. Maybe it would make sense to make the save_path\n an in-out parameter

    ../src/storage_utils.cpp:294

    \t\t\twhile (--file_index >= file_index_t(0))\n \t\t\t{\n \t\t\t\t// files moved out to absolute paths are not moved\n \t\t\t\tif (f.file_absolute_path(file_index)) continue;\n@@ -2433,15 +2687,15 @@\n \t\t{\n \t\t\terror_code err;\n \t\t\tstd::string subdir = combine_path(save_path, s);\n \n \t\t\twhile (!path_equal(subdir, save_path) && !err)\n \t\t\t{\n \t\t\t\tremove(subdir, err);\n-
    relevance 2../src/storage_utils.cpp:486is this risky? The upper layer will assume we have the whole file. Perhaps we should verify that at least the size of the file is correct

    is this risky? The upper layer will assume we have the\n+

    relevance 2../src/storage_utils.cpp:486is this risky? The upper layer will assume we have the whole file. Perhaps we should verify that at least the size of the file is correct

    is this risky? The upper layer will assume we have the\n whole file. Perhaps we should verify that at least the size\n of the file is correct

    ../src/storage_utils.cpp:486

    \t\t\t\t{\n \t\t\t\t\t// we create directories lazily, so it's possible it hasn't\n \t\t\t\t\t// been created yet. Create the directories now and try\n \t\t\t\t\t// again\n \t\t\t\t\tcreate_directories(parent_path(file_path), err);\n \n@@ -2486,15 +2740,330 @@\n \t\t\t\t// expected location, but is likely to be in a partfile. Just exempt it\n \t\t\t\t// from checking\n \t\t\t\tif (file_index < file_priority.end_index()\n \t\t\t\t\t&& file_priority[file_index] == dont_download\n \t\t\t\t\t&& !(rd.flags & torrent_flags::seed_mode))\n \t\t\t\t\tcontinue;\n \n-
    relevance 2../src/session_impl.cpp:599is there a reason not to move all of this into init()? and just post it to the io_context?

    is there a reason not to move all of this into init()? and just\n+

    relevance 2../src/escape_string.cpp:194this should probably be moved into string_util.cpp

    this should probably be moved into string_util.cpp

    ../src/escape_string.cpp:194

    \t{\n+\t\treturn escape_string_impl(str.data(), int(str.size()), 10);\n+\t}\n+\n+\tbool need_encoding(char const* str, int const len)\n+\t{\n+\t\tfor (int i = 0; i < len; ++i)\n+\t\t{\n+\t\t\tif (std::strchr(unreserved_chars, *str) == nullptr || *str == 0)\n+\t\t\t\treturn true;\n+\t\t\t++str;\n+\t\t}\n+\t\treturn false;\n+\t}\n+\n+\tvoid convert_path_to_posix(std::string& path)\n+\t{\n+\t\tstd::replace(path.begin(), path.end(), '\\\\', '/');\n+\t}\n+\n+
    \tstd::string read_until(char const*& str, char const delim, char const* end)\n+
    \t{\n+\t\tTORRENT_ASSERT(str <= end);\n+\n+\t\tstd::string ret;\n+\t\twhile (str != end && *str != delim)\n+\t\t{\n+\t\t\tret += *str;\n+\t\t\t++str;\n+\t\t}\n+\t\t// skip the delimiter as well\n+\t\twhile (str != end && *str == delim) ++str;\n+\t\treturn ret;\n+\t}\n+\n+\tstd::string maybe_url_encode(std::string const& url)\n+\t{\n+\t\tstd::string protocol, host, auth, path;\n+\t\tint port;\n+\t\terror_code ec;\n+\t\tstd::tie(protocol, auth, host, port, path) = parse_url_components(url, ec);\n+\t\tif (ec) return url;\n+\n+\t\t// first figure out if this url contains unencoded characters\n+\t\tif (!need_encoding(path.c_str(), int(path.size())))\n+\t\t\treturn url;\n+\n+\t\tstd::string msg;\n+\t\tstd::string escaped_path { escape_path(path) };\n+\t\t// reserve enough space so further append will\n+\t\t// only copy values to existing location\n+
    relevance 2../src/piece_picker.cpp:1996make the 2048 limit configurable

    make the 2048 limit configurable

    ../src/piece_picker.cpp:1996

    \t// indicating which path thought the picker we took to arrive at the\n+\t// returned block picks.\n+\tpicker_flags_t piece_picker::pick_pieces(typed_bitfield<piece_index_t> const& pieces\n+\t\t, std::vector<piece_block>& interesting_blocks, int num_blocks\n+\t\t, int prefer_contiguous_blocks, torrent_peer* peer\n+\t\t, picker_options_t options, std::vector<piece_index_t> const& suggested_pieces\n+\t\t, int num_peers\n+\t\t, counters& pc\n+\t\t) const\n+\t{\n+\t\tTORRENT_ASSERT(peer == nullptr || peer->in_use);\n+\t\tpicker_flags_t ret;\n+\n+\t\t// prevent the number of partial pieces to grow indefinitely\n+\t\t// make this scale by the number of peers we have. For large\n+\t\t// scale clients, we would have more peers, and allow a higher\n+\t\t// threshold for the number of partials\n+\t\t// the second condition is to make sure we cap the number of partial\n+\t\t// _bytes_. The larger the pieces are, the fewer partial pieces we want.\n+\t\t// 2048 corresponds to 32 MiB\n+
    \t\tconst int num_partials = int(m_downloads[piece_pos::piece_downloading].size());\n+
    \t\tif (num_partials > num_peers * 3 / 2\n+\t\t\t|| num_partials * blocks_per_piece() > 2048)\n+\t\t{\n+\t\t\t// if we have too many partial pieces, prioritize completing\n+\t\t\t// them. In order for this to have an affect, also disable\n+\t\t\t// prefer whole pieces (otherwise partial pieces would be de-prioritized)\n+\t\t\toptions |= prioritize_partials;\n+\t\t\tprefer_contiguous_blocks = 0;\n+\n+\t\t\tret |= picker_log_alert::partial_ratio;\n+\t\t}\n+\n+\t\tif (prefer_contiguous_blocks) ret |= picker_log_alert::prefer_contiguous;\n+\n+\t\t// only one of rarest_first and sequential can be set.\n+\t\tTORRENT_ASSERT(((options & rarest_first) ? 1 : 0)\n+\t\t\t+ ((options & sequential) ? 1 : 0) <= 1);\n+#ifdef TORRENT_EXPENSIVE_INVARIANT_CHECKS\n+\t\tINVARIANT_CHECK;\n+#endif\n+\t\tTORRENT_ASSERT(num_blocks > 0);\n+\t\tTORRENT_ASSERT(pieces.size() == int(m_piece_map.size()));\n+\n+\t\tTORRENT_ASSERT(!m_priority_boundaries.empty() || m_dirty);\n+\n+\t\t// this will be filled with blocks that we should not request\n+\t\t// unless we can't find num_blocks among the other ones.\n+\t\tstd::vector<piece_block> backup_blocks;\n+\t\tstd::vector<piece_block> backup_blocks2;\n+\t\tstd::vector<piece_index_t> ignored_pieces;\n+
    relevance 2../src/piece_picker.cpp:2594the first_block returned here is the largest free range, not the first-fit range, which would be better

    the first_block returned here is the largest free range, not\n+the first-fit range, which would be better

    ../src/piece_picker.cpp:2594

    \t{\n+\t\tfor (auto const& b : m_block_info)\n+\t\t{\n+\t\t\tTORRENT_ASSERT(b.peer == nullptr || static_cast<torrent_peer*>(b.peer)->in_use);\n+\t\t}\n+\t}\n+#endif\n+\n+\tvoid piece_picker::clear_peer(torrent_peer* peer)\n+\t{\n+\t\tfor (auto& b : m_block_info)\n+\t\t{\n+\t\t\tif (b.peer == peer) b.peer = nullptr;\n+\t\t}\n+\t}\n+\n+\t// the first bool is true if this is the only peer that has requested and downloaded\n+\t// blocks from this piece.\n+\t// the second bool is true if this is the only active peer that is requesting\n+\t// and downloading blocks from this piece. Active means having a connection.\n+
    \tstd::tuple<bool, bool, int, int> piece_picker::requested_from(\n+
    \t\tpiece_picker::downloading_piece const& p\n+\t\t, int const num_blocks_in_piece, torrent_peer* peer) const\n+\t{\n+\t\tbool exclusive = true;\n+\t\tbool exclusive_active = true;\n+\t\tint contiguous_blocks = 0;\n+\t\tint max_contiguous = 0;\n+\t\tint first_block = 0;\n+\t\tint idx = -1;\n+\t\tfor (auto const& info : blocks_for_piece(p))\n+\t\t{\n+\t\t\t++idx;\n+\t\t\tTORRENT_ASSERT(info.peer == nullptr || info.peer->in_use);\n+\t\t\tTORRENT_ASSERT(info.piece_index == p.index);\n+\t\t\tif (info.state == piece_picker::block_info::state_none)\n+\t\t\t{\n+\t\t\t\t++contiguous_blocks;\n+\t\t\t\tcontinue;\n+\t\t\t}\n+\t\t\tif (contiguous_blocks > max_contiguous)\n+\t\t\t{\n+\t\t\t\tmax_contiguous = contiguous_blocks;\n+\t\t\t\tfirst_block = idx - contiguous_blocks;\n+\t\t\t}\n+\t\t\tcontiguous_blocks = 0;\n+\t\t\tif (info.peer != peer)\n+\t\t\t{\n+\t\t\t\texclusive = false;\n+\t\t\t\tif (info.state == piece_picker::block_info::state_requested\n+\t\t\t\t\t&& info.peer != nullptr)\n+
    relevance 2../src/piece_picker.cpp:3478it would be nice if this could be folded into lock_piece() the main distinction is that this also maintains the m_num_have counter and the passed_hash_check member Is there ever a case where we call write failed without also locking the piece? Perhaps write_failed() should imply locking it.

    it would be nice if this could be folded into lock_piece()\n+the main distinction is that this also maintains the m_num_have\n+counter and the passed_hash_check member\n+Is there ever a case where we call write failed without also locking\n+the piece? Perhaps write_failed() should imply locking it.

    ../src/piece_picker.cpp:3478

    \n+\t\tauto const state = m_piece_map[piece].download_queue();\n+\t\tif (state == piece_pos::piece_open) return;\n+\t\tauto const i = find_dl_piece(state, piece);\n+\t\tif (i == m_downloads[state].end()) return;\n+\n+\t\tTORRENT_ASSERT(i->passed_hash_check == false);\n+\t\tif (i->passed_hash_check)\n+\t\t{\n+\t\t\t// it's not clear why this would happen,\n+\t\t\t// but it seems reasonable to not break the\n+\t\t\t// accounting over it.\n+\t\t\ti->passed_hash_check = false;\n+\t\t\taccount_lost(piece);\n+\t\t}\n+\n+\t\t// prevent this piece from being picked until it's restored\n+\t\ti->locked = true;\n+\t}\n+\n+
    \tvoid piece_picker::write_failed(piece_block const block)\n+
    \t{\n+\t\tINVARIANT_CHECK;\n+\n+#if TORRENT_USE_INVARIANT_CHECKS\n+\t\tcheck_piece_state();\n+#endif\n+\n+#ifdef TORRENT_PICKER_LOG\n+\t\tstd::cerr << \"[\" << this << \"] \" << \"write_failed( {\" << block.piece_index << \", \" << block.block_index << \"} )\" << std::endl;\n+#endif\n+\n+\t\tauto const state = m_piece_map[block.piece_index].download_queue();\n+\t\tif (state == piece_pos::piece_open) return;\n+\t\tauto i = find_dl_piece(state, block.piece_index);\n+\t\tif (i == m_downloads[state].end()) return;\n+\n+\t\tauto const binfo = mutable_blocks_for_piece(*i);\n+\t\tblock_info& info = binfo[block.block_index];\n+\t\tTORRENT_ASSERT(&info >= &m_block_info[0]);\n+\t\tTORRENT_ASSERT(&info < &m_block_info[0] + m_block_info.size());\n+\t\tTORRENT_ASSERT(info.piece_index == block.piece_index);\n+\t\tTORRENT_ASSERT(info.state == block_info::state_writing);\n+\t\tTORRENT_ASSERT(info.num_peers == 0);\n+\n+\t\tTORRENT_ASSERT(i->writing > 0);\n+\t\tTORRENT_ASSERT(info.state == block_info::state_writing);\n+\n+\t\tif (info.state == block_info::state_finished) return;\n+\t\tif (info.state == block_info::state_writing) --i->writing;\n+\n+
    relevance 2../src/web_peer_connection.cpp:626just make this peer not have the pieces associated with the file we just requested. Only when it doesn't have any of the file do the following pad files will make it complicated

    just make this peer not have the pieces\n+associated with the file we just requested. Only\n+when it doesn't have any of the file do the following\n+pad files will make it complicated

    ../src/web_peer_connection.cpp:626

    \n+\tpeer_connection::received_invalid_data(index, single_peer);\n+\n+\t// if we don't think we have any of the files, allow banning the web seed\n+\tif (num_have_pieces() == 0) return true;\n+\n+\t// don't disconnect, we won't request anything from this file again\n+\treturn false;\n+}\n+\n+void web_peer_connection::on_receive_padfile()\n+{\n+\thandle_padfile();\n+}\n+\n+void web_peer_connection::handle_error(int const bytes_left)\n+{\n+\tstd::shared_ptr<torrent> t = associated_torrent().lock();\n+\tTORRENT_ASSERT(t);\n+\n+
    \n+
    \t// temporarily unavailable, retry later\n+\tt->retry_web_seed(this, m_parser.header_duration(\"retry-after\"));\n+\tif (t->alerts().should_post<url_seed_alert>())\n+\t{\n+\t\tstd::string const error_msg = to_string(m_parser.status_code()).data()\n+\t\t\t+ (\" \" + m_parser.message());\n+\t\tt->alerts().emplace_alert<url_seed_alert>(t->get_handle(), m_url\n+\t\t\t, error_msg);\n+\t}\n+\treceived_bytes(0, bytes_left);\n+\tdisconnect(error_code(m_parser.status_code(), http_category()), operation_t::bittorrent, failure);\n+}\n+\n+void web_peer_connection::disable(error_code const& ec)\n+{\n+\t// we should not try this server again.\n+\tm_web->disabled = true;\n+\tdisconnect(ec, operation_t::bittorrent, peer_error);\n+\tif (m_web->ephemeral)\n+\t{\n+\t\tstd::shared_ptr<torrent> t = associated_torrent().lock();\n+\t\tTORRENT_ASSERT(t);\n+\t\tt->remove_web_seed_conn(this);\n+\t}\n+\tm_web = nullptr;\n+\tTORRENT_ASSERT(is_disconnecting());\n+}\n+\n+void web_peer_connection::handle_redirect(int const bytes_left)\n+{\n+
    relevance 2../src/http_tracker_connection.cpp:479returning a bool here is redundant. Instead this function should return the peer_entry

    returning a bool here is redundant. Instead this function should\n+return the peer_entry

    ../src/http_tracker_connection.cpp:479

    \t\t{\n+\t\t\tcb->tracker_scrape_response(tracker_req(), resp.complete\n+\t\t\t\t, resp.incomplete, resp.downloaded, resp.downloaders);\n+\t\t}\n+\t\telse\n+\t\t{\n+\t\t\tstd::list<address> ip_list;\n+\t\t\tif (m_tracker_connection)\n+\t\t\t{\n+\t\t\t\tfor (auto const& endp : m_tracker_connection->endpoints())\n+\t\t\t\t{\n+\t\t\t\t\tip_list.push_back(endp.address());\n+\t\t\t\t}\n+\t\t\t}\n+\n+\t\t\tcb->tracker_response(tracker_req(), m_tracker_ip, ip_list, resp);\n+\t\t}\n+\t\tclose();\n+\t}\n+\n+
    \tbool extract_peer_info(bdecode_node const& info, peer_entry& ret, error_code& ec)\n+
    \t{\n+\t\t// extract peer id (if any)\n+\t\tif (info.type() != bdecode_node::dict_t)\n+\t\t{\n+\t\t\tec = errors::invalid_peer_dict;\n+\t\t\treturn false;\n+\t\t}\n+\t\tbdecode_node i = info.dict_find_string(\"peer id\");\n+\t\tif (i && i.string_length() == 20)\n+\t\t{\n+\t\t\tstd::copy(i.string_ptr(), i.string_ptr() + 20, ret.pid.begin());\n+\t\t}\n+\t\telse\n+\t\t{\n+\t\t\t// if there's no peer_id, just initialize it to a bunch of zeroes\n+\t\t\tret.pid.clear();\n+\t\t}\n+\n+\t\t// extract ip\n+\t\ti = info.dict_find_string(\"ip\");\n+\t\tif (!i)\n+\t\t{\n+\t\t\tec = errors::invalid_tracker_response;\n+\t\t\treturn false;\n+\t\t}\n+\t\tret.hostname = i.string_value().to_string();\n+\n+\t\t// extract port\n+\t\ti = info.dict_find_int(\"port\");\n+\t\tif (!i)\n+
    relevance 2../src/session_impl.cpp:599is there a reason not to move all of this into init()? and just post it to the io_context?

    is there a reason not to move all of this into init()? and just\n post it to the io_context?

    ../src/session_impl.cpp:599

    \ttry\n #endif\n \t{\n \t\t(this->*f)(std::forward<Args>(a)...);\n \t}\n #ifndef BOOST_NO_EXCEPTIONS\n \tcatch (system_error const& e) {\n@@ -2521,15 +3090,15 @@\n \t\terror_code ec;\n \t\tm_ssl_ctx.set_default_verify_paths(ec);\n #ifndef TORRENT_DISABLE_LOGGING\n \t\tif (ec) session_log(\"SSL set_default verify_paths failed: %s\", ec.message().c_str());\n \t\tec.clear();\n #endif\n #if defined TORRENT_WINDOWS && defined TORRENT_USE_OPENSSL && !defined TORRENT_WINRT\n-
    relevance 2../src/session_impl.cpp:761the ip filter should probably be saved here too

    the ip filter should probably be saved here too

    ../src/session_impl.cpp:761

    \t\tm_lsd_announce_timer.async_wait([this](error_code const& e) {\n+
    relevance 2../src/session_impl.cpp:761the ip filter should probably be saved here too

    the ip filter should probably be saved here too

    ../src/session_impl.cpp:761

    \t\tm_lsd_announce_timer.async_wait([this](error_code const& e) {\n \t\t\twrap(&session_impl::on_lsd_announce, e); } );\n \n #ifndef TORRENT_DISABLE_LOGGING\n \t\tsession_log(\" done starting session\");\n #endif\n \n \t\t// this applies unchoke settings from m_settings\n@@ -2572,15 +3141,15 @@\n #endif\n \n #ifndef TORRENT_DISABLE_EXTENSIONS\n \t\tfor (auto const& ext : m_ses_extensions[plugins_all_idx])\n \t\t{\n \t\t\text->save_state(*eptr);\n \t\t}\n-
    relevance 2../src/session_impl.cpp:3882make a list for torrents that want to be announced on the DHT so we don't have to loop over all torrents, just to find the ones that want to announce

    make a list for torrents that want to be announced on the DHT so we\n+

    relevance 2../src/session_impl.cpp:3882make a list for torrents that want to be announced on the DHT so we don't have to loop over all torrents, just to find the ones that want to announce

    make a list for torrents that want to be announced on the DHT so we\n don't have to loop over all torrents, just to find the ones that want to announce

    ../src/session_impl.cpp:3882

    \t\tif (!m_dht_torrents.empty())\n \t\t{\n \t\t\tstd::shared_ptr<torrent> t;\n \t\t\tdo\n \t\t\t{\n \t\t\t\tt = m_dht_torrents.front().lock();\n \t\t\t\tm_dht_torrents.pop_front();\n@@ -2624,15 +3193,15 @@\n \n \t\tif (m_next_lsd_torrent >= m_torrents.size())\n \t\t\tm_next_lsd_torrent = 0;\n \t\tm_torrents[m_next_lsd_torrent]->lsd_announce();\n \t\t++m_next_lsd_torrent;\n \t\tif (m_next_lsd_torrent >= m_torrents.size())\n \t\t\tm_next_lsd_torrent = 0;\n-
    relevance 2../src/session_impl.cpp:5515this function should be removed and users need to deal with the more generic case of having multiple listen ports

    this function should be removed and users need to deal with the\n+

    relevance 2../src/session_impl.cpp:5515this function should be removed and users need to deal with the more generic case of having multiple listen ports

    this function should be removed and users need to deal with the\n more generic case of having multiple listen ports

    ../src/session_impl.cpp:5515

    #ifndef TORRENT_DISABLE_LOGGING\n \t\tif (!node_list.empty() && nodes.empty())\n \t\t{\n \t\t\tsession_log(\"ERROR: failed to parse DHT bootstrap list: %s\", node_list.c_str());\n \t\t}\n #endif\n \t\tfor (auto const& n : nodes)\n@@ -2676,15 +3245,15 @@\n \t\tfor (auto const& s : m_listen_sockets)\n \t\t{\n \t\t\tif (!(s->flags & listen_socket_t::accept_incoming)) continue;\n \t\t\tif (s->ssl == transport::plaintext)\n \t\t\t\treturn std::uint16_t(s->tcp_external_port());\n \t\t}\n \t\treturn 0;\n-
    relevance 2../src/session_impl.cpp:5555this function should be removed and users need to deal with the more generic case of having multiple ssl ports

    this function should be removed and users need to deal with the\n+

    relevance 2../src/session_impl.cpp:5555this function should be removed and users need to deal with the more generic case of having multiple ssl ports

    this function should be removed and users need to deal with the\n more generic case of having multiple ssl ports

    ../src/session_impl.cpp:5555

    \t\t\t\treturn 0;\n \n \t\t\treturn std::uint16_t(sock->tcp_external_port());\n \t\t}\n \n #ifdef TORRENT_SSL_PEERS\n \t\tfor (auto const& s : m_listen_sockets)\n@@ -2728,15 +3297,15 @@\n #else\n \t\tTORRENT_UNUSED(sock);\n #endif\n \t\treturn 0;\n \t}\n \n \tint session_impl::get_listen_port(transport const ssl, aux::listen_socket_handle const& s)\n-
    relevance 2../src/session_impl.cpp:6390this should be factored into the udp socket, so we only have the code once

    this should be factored into the udp socket, so we only have the\n+

    relevance 2../src/session_impl.cpp:6390this should be factored into the udp socket, so we only have the code once

    this should be factored into the udp socket, so we only have the\n code once

    ../src/session_impl.cpp:6390

    \t\treturn upload_rate_limit(m_local_peer_class);\n \t}\n \n \tint session_impl::local_download_rate_limit() const\n \t{\n \t\treturn download_rate_limit(m_local_peer_class);\n \t}\n@@ -2780,633 +3349,15 @@\n \n #ifndef TORRENT_DISABLE_LOGGING\n \t\t\t\tif (should_log())\n \t\t\t\t{\n \t\t\t\t\tsession_log(\">>> SET_DSCP [ udp (%s %d) value: %x e: %s ]\"\n \t\t\t\t\t\t, l->udp_sock->sock.local_endpoint().address().to_string().c_str()\n \t\t\t\t\t\t, l->udp_sock->sock.local_port()\n-
    relevance 2../src/escape_string.cpp:194this should probably be moved into string_util.cpp

    this should probably be moved into string_util.cpp

    ../src/escape_string.cpp:194

    \t{\n-\t\treturn escape_string_impl(str.data(), int(str.size()), 10);\n-\t}\n-\n-\tbool need_encoding(char const* str, int const len)\n-\t{\n-\t\tfor (int i = 0; i < len; ++i)\n-\t\t{\n-\t\t\tif (std::strchr(unreserved_chars, *str) == nullptr || *str == 0)\n-\t\t\t\treturn true;\n-\t\t\t++str;\n-\t\t}\n-\t\treturn false;\n-\t}\n-\n-\tvoid convert_path_to_posix(std::string& path)\n-\t{\n-\t\tstd::replace(path.begin(), path.end(), '\\\\', '/');\n-\t}\n-\n-
    \tstd::string read_until(char const*& str, char const delim, char const* end)\n-
    \t{\n-\t\tTORRENT_ASSERT(str <= end);\n-\n-\t\tstd::string ret;\n-\t\twhile (str != end && *str != delim)\n-\t\t{\n-\t\t\tret += *str;\n-\t\t\t++str;\n-\t\t}\n-\t\t// skip the delimiter as well\n-\t\twhile (str != end && *str == delim) ++str;\n-\t\treturn ret;\n-\t}\n-\n-\tstd::string maybe_url_encode(std::string const& url)\n-\t{\n-\t\tstd::string protocol, host, auth, path;\n-\t\tint port;\n-\t\terror_code ec;\n-\t\tstd::tie(protocol, auth, host, port, path) = parse_url_components(url, ec);\n-\t\tif (ec) return url;\n-\n-\t\t// first figure out if this url contains unencoded characters\n-\t\tif (!need_encoding(path.c_str(), int(path.size())))\n-\t\t\treturn url;\n-\n-\t\tstd::string msg;\n-\t\tstd::string escaped_path { escape_path(path) };\n-\t\t// reserve enough space so further append will\n-\t\t// only copy values to existing location\n-
    relevance 2../src/http_tracker_connection.cpp:479returning a bool here is redundant. Instead this function should return the peer_entry

    returning a bool here is redundant. Instead this function should\n-return the peer_entry

    ../src/http_tracker_connection.cpp:479

    \t\t{\n-\t\t\tcb->tracker_scrape_response(tracker_req(), resp.complete\n-\t\t\t\t, resp.incomplete, resp.downloaded, resp.downloaders);\n-\t\t}\n-\t\telse\n-\t\t{\n-\t\t\tstd::list<address> ip_list;\n-\t\t\tif (m_tracker_connection)\n-\t\t\t{\n-\t\t\t\tfor (auto const& endp : m_tracker_connection->endpoints())\n-\t\t\t\t{\n-\t\t\t\t\tip_list.push_back(endp.address());\n-\t\t\t\t}\n-\t\t\t}\n-\n-\t\t\tcb->tracker_response(tracker_req(), m_tracker_ip, ip_list, resp);\n-\t\t}\n-\t\tclose();\n-\t}\n-\n-
    \tbool extract_peer_info(bdecode_node const& info, peer_entry& ret, error_code& ec)\n-
    \t{\n-\t\t// extract peer id (if any)\n-\t\tif (info.type() != bdecode_node::dict_t)\n-\t\t{\n-\t\t\tec = errors::invalid_peer_dict;\n-\t\t\treturn false;\n-\t\t}\n-\t\tbdecode_node i = info.dict_find_string(\"peer id\");\n-\t\tif (i && i.string_length() == 20)\n-\t\t{\n-\t\t\tstd::copy(i.string_ptr(), i.string_ptr() + 20, ret.pid.begin());\n-\t\t}\n-\t\telse\n-\t\t{\n-\t\t\t// if there's no peer_id, just initialize it to a bunch of zeroes\n-\t\t\tret.pid.clear();\n-\t\t}\n-\n-\t\t// extract ip\n-\t\ti = info.dict_find_string(\"ip\");\n-\t\tif (!i)\n-\t\t{\n-\t\t\tec = errors::invalid_tracker_response;\n-\t\t\treturn false;\n-\t\t}\n-\t\tret.hostname = i.string_value().to_string();\n-\n-\t\t// extract port\n-\t\ti = info.dict_find_int(\"port\");\n-\t\tif (!i)\n-
    relevance 2../src/upnp.cpp:106use boost::asio::ip::network instead of netmask

    use boost::asio::ip::network instead of netmask

    ../src/upnp.cpp:106

    \n-static error_code ignore_error;\n-\n-upnp::rootdevice::rootdevice() = default;\n-\n-#if TORRENT_USE_ASSERTS\n-upnp::rootdevice::~rootdevice()\n-{\n-\tTORRENT_ASSERT(magic == 1337);\n-\tmagic = 0;\n-}\n-#else\n-upnp::rootdevice::~rootdevice() = default;\n-#endif\n-\n-upnp::rootdevice::rootdevice(rootdevice const&) = default;\n-upnp::rootdevice& upnp::rootdevice::operator=(rootdevice const&) & = default;\n-upnp::rootdevice::rootdevice(rootdevice&&) noexcept = default;\n-upnp::rootdevice& upnp::rootdevice::operator=(rootdevice&&) & = default;\n-\n-
    upnp::upnp(io_context& ios\n-
    \t, aux::session_settings const& settings\n-\t, aux::portmap_callback& cb\n-\t, address_v4 const listen_address\n-\t, address_v4 const netmask\n-\t, std::string listen_device\n-\t, listen_socket_handle ls)\n-\t: m_settings(settings)\n-\t, m_callback(cb)\n-\t, m_io_service(ios)\n-\t, m_resolver(ios)\n-\t, m_multicast(ios)\n-\t, m_unicast(ios)\n-\t, m_broadcast_timer(ios)\n-\t, m_refresh_timer(ios)\n-\t, m_map_timer(ios)\n-\t, m_listen_address(listen_address)\n-\t, m_netmask(netmask)\n-\t, m_device(std::move(listen_device))\n-#if TORRENT_USE_SSL\n-\t, m_ssl_ctx(ssl::context::sslv23_client)\n-#endif\n-\t, m_listen_handle(std::move(ls))\n-{\n-#if TORRENT_USE_SSL\n-\tm_ssl_ctx.set_verify_mode(ssl::context::verify_none);\n-#endif\n-}\n-\n-void upnp::start()\n-{\n-
    relevance 2../src/instantiate_connection.cpp:44peer_connection and tracker_connection should probably be flags

    peer_connection and tracker_connection should probably be flags

    ../src/instantiate_connection.cpp:44

    ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n-LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n-CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n-POSSIBILITY OF SUCH DAMAGE.\n-\n-*/\n-\n-#include \"libtorrent/socket.hpp\"\n-#include \"libtorrent/aux_/socket_type.hpp\"\n-#include \"libtorrent/aux_/utp_socket_manager.hpp\"\n-#include \"libtorrent/aux_/instantiate_connection.hpp\"\n-#include \"libtorrent/aux_/utp_stream.hpp\"\n-#include \"libtorrent/ssl_stream.hpp\"\n-\n-namespace libtorrent { namespace aux {\n-\n-
    \taux::socket_type instantiate_connection(io_context& ios\n-
    \t\t, aux::proxy_settings const& ps\n-\t\t, void* ssl_context\n-\t\t, utp_socket_manager* sm\n-\t\t, bool peer_connection\n-\t\t, bool tracker_connection)\n-\t{\n-#if !TORRENT_USE_SSL\n-\t\tTORRENT_UNUSED(ssl_context);\n-#endif\n-\n-\t\tif (sm)\n-\t\t{\n-#if TORRENT_USE_SSL\n-\t\t\tif (ssl_context)\n-\t\t\t{\n-\t\t\t\tssl_stream<utp_stream> s(ios, *static_cast<ssl::context*>(ssl_context));\n-\t\t\t\ts.next_layer().set_impl(sm->new_utp_socket(&s.next_layer()));\n-\t\t\t\treturn socket_type(std::move(s));\n-\t\t\t}\n-\t\t\telse\n-#endif\n-\t\t\t{\n-\t\t\t\tutp_stream s(ios);\n-\t\t\t\ts.set_impl(sm->new_utp_socket(&s));\n-\t\t\t\treturn socket_type(std::move(s));\n-\t\t\t}\n-\t\t}\n-#if TORRENT_USE_I2P\n-\t\telse if (ps.type == settings_pack::i2p_proxy)\n-\t\t{\n-
    relevance 2../src/torrent.cpp:504post alert

    post alert

    ../src/torrent.cpp:504

    \t\tif (m_current_gauge_state != no_gauge_state)\n-\t\t\tinc_stats_counter(m_current_gauge_state + counters::num_checking_torrents, -1);\n-\t\tif (new_gauge_state != no_gauge_state)\n-\t\t\tinc_stats_counter(new_gauge_state + counters::num_checking_torrents, 1);\n-\n-\t\tTORRENT_ASSERT(new_gauge_state >= 0);\n-\t\tTORRENT_ASSERT(new_gauge_state <= no_gauge_state);\n-\t\tm_current_gauge_state = static_cast<std::uint32_t>(new_gauge_state);\n-\t}\n-\n-\tvoid torrent::leave_seed_mode(seed_mode_t const checking)\n-\t{\n-\t\tif (!m_seed_mode) return;\n-\n-\t\tif (checking == seed_mode_t::check_files)\n-\t\t{\n-\t\t\t// this means the user promised we had all the\n-\t\t\t// files, but it turned out we didn't. This is\n-\t\t\t// an error.\n-\n-
    \n-
    #ifndef TORRENT_DISABLE_LOGGING\n-\t\t\tdebug_log(\"*** FAILED SEED MODE, rechecking\");\n-#endif\n-\t\t}\n-\n-#ifndef TORRENT_DISABLE_LOGGING\n-\t\tdebug_log(\"*** LEAVING SEED MODE (%s)\"\n-\t\t\t, checking == seed_mode_t::skip_checking ? \"as seed\" : \"as non-seed\");\n-#endif\n-\t\tm_seed_mode = false;\n-\t\t// seed is false if we turned out not\n-\t\t// to be a seed after all\n-\t\tif (checking == seed_mode_t::check_files\n-\t\t\t&& state() != torrent_status::checking_resume_data)\n-\t\t{\n-\t\t\tm_have_all = false;\n-\t\t\tset_state(torrent_status::downloading);\n-\t\t\tforce_recheck();\n-\t\t}\n-\t\tm_num_verified = 0;\n-\t\tm_verified.clear();\n-\t\tm_verifying.clear();\n-\n-\t\tset_need_save_resume(torrent_handle::if_state_changed);\n-\t}\n-\n-\tvoid torrent::verified(piece_index_t const piece)\n-\t{\n-\t\tTORRENT_ASSERT(!m_verified.get_bit(piece));\n-\t\t++m_num_verified;\n-
    relevance 2../src/torrent.cpp:1852add a unit test where we don't have metadata, connect to a peer that sends a bitfield that's too large, then we get the metadata

    add a unit test where we don't have metadata, connect to a peer\n-that sends a bitfield that's too large, then we get the metadata

    ../src/torrent.cpp:1852

    \t\t\tfor (auto const& f : m_add_torrent_params->renamed_files)\n-\t\t\t{\n-\t\t\t\tif (f.first < file_index_t(0) || f.first >= fs.end_file()) continue;\n-\t\t\t\tm_torrent_file->rename_file(file_index_t(f.first), f.second);\n-\t\t\t}\n-\t\t}\n-\n-\t\tconstruct_storage();\n-\n-#ifndef TORRENT_DISABLE_SHARE_MODE\n-\t\tif (m_share_mode && valid_metadata())\n-\t\t{\n-\t\t\t// in share mode, all pieces have their priorities initialized to 0\n-\t\t\tm_file_priority.clear();\n-\t\t\tm_file_priority.resize(m_torrent_file->num_files(), dont_download);\n-\t\t}\n-#endif\n-\n-\t\t// it's important to initialize the peers early, because this is what will\n-\t\t// fix up their have-bitmasks to have the correct size\n-
    \t\tif (!m_connections_initialized)\n-
    \t\t{\n-\t\t\tm_connections_initialized = true;\n-\t\t\t// all peer connections have to initialize themselves now that the metadata\n-\t\t\t// is available\n-\t\t\t// copy the peer list since peers may disconnect and invalidate\n-\t\t\t// m_connections as we initialize them\n-\t\t\tfor (auto c : m_connections)\n-\t\t\t{\n-\t\t\t\tauto pc = c->self();\n-\t\t\t\tif (pc->is_disconnecting()) continue;\n-\t\t\t\tpc->on_metadata_impl();\n-\t\t\t\tif (pc->is_disconnecting()) continue;\n-\t\t\t\tpc->init();\n-\t\t\t}\n-\t\t}\n-\n-\t\t// in case file priorities were passed in via the add_torrent_params\n-\t\t// and also in the case of share mode, we need to update the priorities\n-\t\t// this has to be applied before piece priority\n-\t\tif (!m_file_priority.empty())\n-\t\t{\n-\t\t\t// m_file_priority was loaded from the resume data, this doesn't\n-\t\t\t// alter any state that needs to be saved in the resume data\n-\t\t\tauto const ns = m_need_save_resume_data;\n-\t\t\tupdate_piece_priorities(m_file_priority);\n-\t\t\tm_need_save_resume_data = ns;\n-\t\t}\n-\n-\t\tif (m_add_torrent_params)\n-\t\t{\n-
    relevance 2../src/torrent.cpp:4492use chrono type for time duration

    use chrono type for time duration

    ../src/torrent.cpp:4492

    \t\t}\n-\n-\t\tm_picker->piece_passed(index);\n-\t\tupdate_gauge();\n-\t\twe_have(index);\n-\n-#ifndef TORRENT_DISABLE_LOGGING\n-\t\tif (should_log())\n-\t\t\tdebug_log(\"we_have(%d) (num_have: %d)\", int(index), num_have());\n-#endif\n-#ifndef TORRENT_DISABLE_STREAMING\n-\t\tremove_time_critical_piece(index, true);\n-#endif\n-\t}\n-\n-#ifndef TORRENT_DISABLE_PREDICTIVE_PIECES\n-\t// we believe we will complete this piece very soon\n-\t// announce it to peers ahead of time to eliminate the\n-\t// round-trip times involved in announcing it, requesting it\n-\t// and sending it\n-
    \tvoid torrent::predicted_have_piece(piece_index_t const index, int const milliseconds)\n-
    \t{\n-\t\tauto const i = std::lower_bound(m_predictive_pieces.begin()\n-\t\t\t, m_predictive_pieces.end(), index);\n-\t\tif (i != m_predictive_pieces.end() && *i == index) return;\n-\n-\t\tfor (auto p : m_connections)\n-\t\t{\n-\t\t\tTORRENT_INCREMENT(m_iterating_connections);\n-#ifndef TORRENT_DISABLE_LOGGING\n-\t\t\tp->peer_log(peer_log_alert::outgoing, \"PREDICTIVE_HAVE\", \"piece: %d expected in %d ms\"\n-\t\t\t\t, static_cast<int>(index), milliseconds);\n-#else\n-\t\t\tTORRENT_UNUSED(milliseconds);\n-#endif\n-\t\t\tp->announce_piece(index);\n-\t\t}\n-\n-\t\tm_predictive_pieces.insert(i, index);\n-\t}\n-#endif\n-\n-\t// blocks may contain the block indices of the blocks that failed (if this is\n-\t// a v2 torrent).\n-\tvoid torrent::piece_failed(piece_index_t const index, std::vector<int> blocks)\n-\t{\n-\t\t// if the last piece fails the peer connection will still\n-\t\t// think that it has received all of it until this function\n-\t\t// resets the download queue. So, we cannot do the\n-\t\t// invariant check here since it assumes:\n-\t\t// (total_done == m_torrent_file->total_size()) => is_seed()\n-
    relevance 2../src/torrent.cpp:4919abort lookups this torrent has made via the session host resolver interface

    abort lookups this torrent has made via the\n-session host resolver interface

    ../src/torrent.cpp:4919

    \t\t\t\tTORRENT_UNUSED(e);\n-\t\t\t\tm_storage.reset();\n-#ifndef TORRENT_DISABLE_LOGGING\n-\t\t\t\tdebug_log(\"Failed to flush disk cache: %s\", e.what());\n-#endif\n-\t\t\t\t// clients may rely on this alert to be posted, so it's probably a\n-\t\t\t\t// good idea to post it here, even though we failed\n-\t\t\t\tif (alerts().should_post<cache_flushed_alert>())\n-\t\t\t\t\talerts().emplace_alert<cache_flushed_alert>(get_handle());\n-\t\t\t}\n-\t\t\tm_ses.deferred_submit_jobs();\n-\t\t}\n-\t\telse\n-\t\t{\n-\t\t\tif (alerts().should_post<cache_flushed_alert>())\n-\t\t\t\talerts().emplace_alert<cache_flushed_alert>(get_handle());\n-\t\t\talerts().emplace_alert<torrent_removed_alert>(get_handle()\n-\t\t\t\t, info_hash(), get_userdata());\n-\t\t}\n-\n-
    \n-
    \t\tif (!m_apply_ip_filter)\n-\t\t{\n-\t\t\tinc_stats_counter(counters::non_filter_torrents, -1);\n-\t\t\tm_apply_ip_filter = true;\n-\t\t}\n-\n-\t\tm_paused = false;\n-\t\tm_auto_managed = false;\n-\t\tupdate_state_list();\n-\t\tfor (torrent_list_index_t i{}; i != m_links.end_index(); ++i)\n-\t\t{\n-\t\t\tif (!m_links[i].in_list()) continue;\n-\t\t\tm_links[i].unlink(m_ses.torrent_list(i), i);\n-\t\t}\n-\t\t// don't re-add this torrent to the state-update list\n-\t\tm_state_subscription = false;\n-\t}\n-\n-\t// this is called when we're destructing non-gracefully. i.e. we're _just_\n-\t// destructing everything.\n-\tvoid torrent::panic()\n-\t{\n-\t\tm_storage.reset();\n-\t\t// if there are any other peers allocated still, we need to clear them\n-\t\t// now. They can't be cleared later because the allocator will already\n-\t\t// have been destructed\n-\t\tif (m_peer_list) m_peer_list->clear();\n-\t\tm_connections.clear();\n-\t\tm_outgoing_pids.clear();\n-\t\tm_peers_to_disconnect.clear();\n-
    relevance 2../src/torrent.cpp:8032if peer is a really good peer, maybe we shouldn't disconnect it perhaps this logic should be disabled if we have too many idle peers (with some definition of idle)

    if peer is a really good peer, maybe we shouldn't disconnect it\n-perhaps this logic should be disabled if we have too many idle peers\n-(with some definition of idle)

    ../src/torrent.cpp:8032

    \n-\t\tm_peers_to_disconnect.reserve(m_connections.size() + 1);\n-\t\tm_connections.reserve(m_connections.size() + 1);\n-\n-#if TORRENT_USE_ASSERTS\n-\t\terror_code ec;\n-\t\tTORRENT_ASSERT(p->remote() == p->get_socket().remote_endpoint(ec) || ec);\n-#endif\n-\n-\t\tTORRENT_ASSERT(p->peer_info_struct() != nullptr);\n-\n-\t\t// we need to do this after we've added the peer to the peer_list\n-\t\t// since that's when the peer is assigned its peer_info object,\n-\t\t// which holds the rank\n-\t\tif (maybe_replace_peer)\n-\t\t{\n-\t\t\t// now, find the lowest rank peer and disconnect that\n-\t\t\t// if it's lower rank than the incoming connection\n-\t\t\tpeer_connection* peer = find_lowest_ranking_peer();\n-\n-
    \t\t\tif (peer != nullptr && peer->peer_rank() < p->peer_rank())\n-
    \t\t\t{\n-#ifndef TORRENT_DISABLE_LOGGING\n-\t\t\t\tif (should_log())\n-\t\t\t\t{\n-\t\t\t\t\tdebug_log(\"CLOSING CONNECTION \\\"%s\\\" peer list full (low peer rank) \"\n-\t\t\t\t\t\t\"connections: %d limit: %d\"\n-\t\t\t\t\t\t, print_endpoint(peer->remote()).c_str()\n-\t\t\t\t\t\t, num_peers()\n-\t\t\t\t\t\t, m_max_connections);\n-\t\t\t\t}\n-#endif\n-\t\t\t\tpeer->disconnect(errors::too_many_connections, operation_t::bittorrent);\n-\t\t\t\tp->peer_disconnected_other();\n-\t\t\t}\n-\t\t\telse\n-\t\t\t{\n-#ifndef TORRENT_DISABLE_LOGGING\n-\t\t\t\tif (should_log())\n-\t\t\t\t{\n-\t\t\t\t\tdebug_log(\"CLOSING CONNECTION \\\"%s\\\" peer list full (low peer rank) \"\n-\t\t\t\t\t\t\"connections: %d limit: %d\"\n-\t\t\t\t\t\t, print_endpoint(p->remote()).c_str()\n-\t\t\t\t\t\t, num_peers()\n-\t\t\t\t\t\t, m_max_connections);\n-\t\t\t\t}\n-#endif\n-\t\t\t\tp->disconnect(errors::too_many_connections, operation_t::bittorrent);\n-\t\t\t\t// we have to do this here because from the peer's point of view\n-\t\t\t\t// it wasn't really attached to the torrent, but we do need\n-\t\t\t\t// to let peer_list know we're removing it\n-
    relevance 2../src/bdecode.cpp:826attempt to simplify this implementation by embracing the span

    attempt to simplify this implementation by embracing the span

    ../src/bdecode.cpp:826

    \t}\n-\n-\tbdecode_node bdecode(span<char const> buffer\n-\t\t, error_code& ec, int* error_pos, int depth_limit, int token_limit)\n-\t{\n-\t\tbdecode_node ret;\n-\t\tec.clear();\n-\n-\t\tif (buffer.size() > bdecode_token::max_offset)\n-\t\t{\n-\t\t\tif (error_pos) *error_pos = 0;\n-\t\t\tec = bdecode_errors::limit_exceeded;\n-\t\t\treturn ret;\n-\t\t}\n-\n-\t\t// this is the stack of bdecode_token indices, into m_tokens.\n-\t\t// sp is the stack pointer, as index into the array, stack\n-\t\tint sp = 0;\n-\t\tTORRENT_ALLOCA(stack, stack_frame, depth_limit);\n-\n-
    \t\tchar const* start = buffer.data();\n-
    \t\tchar const* end = start + buffer.size();\n-\t\tchar const* const orig_start = start;\n-\n-\t\tif (start == end)\n-\t\t\tTORRENT_FAIL_BDECODE(bdecode_errors::unexpected_eof);\n-\n-\t\twhile (start <= end)\n-\t\t{\n-\t\t\tif (start >= end) TORRENT_FAIL_BDECODE(bdecode_errors::unexpected_eof);\n-\n-\t\t\tif (sp >= depth_limit)\n-\t\t\t\tTORRENT_FAIL_BDECODE(bdecode_errors::depth_exceeded);\n-\n-\t\t\t--token_limit;\n-\t\t\tif (token_limit < 0)\n-\t\t\t\tTORRENT_FAIL_BDECODE(bdecode_errors::limit_exceeded);\n-\n-\t\t\t// look for a new token\n-\t\t\tchar const t = *start;\n-\n-\t\t\tint const current_frame = sp;\n-\n-\t\t\t// if we're currently parsing a dictionary, assert that\n-\t\t\t// every other node is a string.\n-\t\t\tif (current_frame > 0\n-\t\t\t\t&& ret.m_tokens[stack[current_frame - 1].token].type == bdecode_token::dict)\n-\t\t\t{\n-\t\t\t\tif (stack[current_frame - 1].state == 0)\n-\t\t\t\t{\n-\t\t\t\t\t// the current parent is a dict and we are parsing a key.\n-
    relevance 2../src/path.cpp:429test this on a FAT volume to see what error we get!

    test this on a FAT volume to see what error we get!

    ../src/path.cpp:429

    \t\t\t// it's possible CreateHardLink will copy the file internally too,\n-\t\t\t// if the filesystem does not support it.\n-\t\t\tec.assign(GetLastError(), system_category());\n-\t\t\treturn;\n-\t\t}\n-\n-\t\t// fall back to making a copy\n-#endif\n-#else\n-\t\t// assume posix's link() function exists\n-\t\tint ret = ::link(n_exist.c_str(), n_link.c_str());\n-\n-\t\tif (ret == 0)\n-\t\t{\n-\t\t\tec.clear();\n-\t\t\treturn;\n-\t\t}\n-\n-\t\t// most errors are passed through, except for the ones that indicate that\n-\t\t// hard links are not supported and require a copy.\n-
    \t\tif (errno != EMLINK\n-
    \t\t\t&& errno != EXDEV\n-#ifdef TORRENT_BEOS\n-\t\t\t// haiku returns EPERM when the filesystem doesn't support hard link\n-\t\t\t&& errno != EPERM\n-#endif\n-\t\t\t)\n-\t\t{\n-\t\t\t// some error happened, report up to the caller\n-\t\t\tec.assign(errno, system_category());\n-\t\t\treturn;\n-\t\t}\n-\n-\t\t// fall back to making a copy\n-\n-#endif\n-\n-\t\t// if we get here, we should copy the file\n-\t\tstorage_error se;\n-\t\taux::copy_file(file, link, se);\n-\t\tec = se.ec;\n-\t}\n-\n-\tbool is_directory(std::string const& f, error_code& ec)\n-\t{\n-\t\tec.clear();\n-\t\terror_code e;\n-\t\tfile_status s;\n-\t\tstat_file(f, &s, e);\n-\t\tif (!e && s.mode & file_status::directory) return true;\n-\t\tec = e;\n-
    relevance 2../src/alert.cpp:2021the salt here is allocated on the heap. It would be nice to allocate in the stack_allocator

    the salt here is allocated on the heap. It would be nice to\n-allocate in the stack_allocator

    ../src/alert.cpp:2021

    \t}\n-\n-\tdht_immutable_item_alert::dht_immutable_item_alert(aux::stack_allocator&\n-\t\t, sha1_hash const& t, entry i)\n-\t\t: target(t), item(std::move(i))\n-\t{}\n-\n-\tstd::string dht_immutable_item_alert::message() const\n-\t{\n-#ifdef TORRENT_DISABLE_ALERT_MSG\n-\t\treturn {};\n-#else\n-\t\tchar msg[1050];\n-\t\tstd::snprintf(msg, sizeof(msg), \"DHT immutable item %s [ %s ]\"\n-\t\t\t, aux::to_hex(target).c_str()\n-\t\t\t, item.to_string().c_str());\n-\t\treturn msg;\n-#endif\n-\t}\n-\n-
    \tdht_mutable_item_alert::dht_mutable_item_alert(aux::stack_allocator&\n-
    \t\t, std::array<char, 32> const& k\n-\t\t, std::array<char, 64> const& sig\n-\t\t, std::int64_t sequence\n-\t\t, string_view s\n-\t\t, entry i\n-\t\t, bool a)\n-\t\t: key(k), signature(sig), seq(sequence), salt(s), item(std::move(i)), authoritative(a)\n-\t{}\n-\n-\tstd::string dht_mutable_item_alert::message() const\n-\t{\n-#ifdef TORRENT_DISABLE_ALERT_MSG\n-\t\treturn {};\n-#else\n-\t\tchar msg[1050];\n-\t\tstd::snprintf(msg, sizeof(msg), \"DHT mutable item (key=%s salt=%s seq=%\" PRId64 \" %s) [ %s ]\"\n-\t\t\t, aux::to_hex(key).c_str()\n-\t\t\t, salt.c_str()\n-\t\t\t, seq\n-\t\t\t, authoritative ? \"auth\" : \"non-auth\"\n-\t\t\t, item.to_string().c_str());\n-\t\treturn msg;\n-#endif\n-\t}\n-\n-\tdht_put_alert::dht_put_alert(aux::stack_allocator&, sha1_hash const& t, int n)\n-\t\t: target(t)\n-\t\t, public_key()\n-\t\t, signature()\n-\t\t, salt()\n-
    relevance 2../src/peer_connection.cpp:2562this should probably be based on time instead of number of request messages. For a very high throughput connection, 300 may be a legitimate number of requests to have in flight when getting choked

    this should probably be based on time instead of number\n+

    relevance 2../src/peer_connection.cpp:2562this should probably be based on time instead of number of request messages. For a very high throughput connection, 300 may be a legitimate number of requests to have in flight when getting choked

    this should probably be based on time instead of number\n of request messages. For a very high throughput connection, 300\n may be a legitimate number of requests to have in flight when\n getting choked

    ../src/peer_connection.cpp:2562

    \t\t\t}\n #endif\n \n \t\t\twrite_reject_request(r);\n \t\t\tif (m_num_invalid_requests < std::numeric_limits<decltype(m_num_invalid_requests)>::max())\n@@ -3452,15 +3403,15 @@\n \t\t{\n \t\t\tdisconnect(errors::too_many_requests_when_choked, operation_t::bittorrent, peer_error);\n \t\t\treturn;\n \t\t}\n \n \t\tif (m_choked && fast_idx == -1)\n \t\t{\n-
    relevance 2../src/peer_connection.cpp:3309since we throw away the queue entry once we issue the disk job, this may happen. Instead, we should keep the queue entry around, mark it as having been requested from disk and once the disk job comes back, discard it if it has been cancelled. Maybe even be able to cancel disk jobs?

    since we throw away the queue entry once we issue\n+

    relevance 2../src/peer_connection.cpp:3309since we throw away the queue entry once we issue the disk job, this may happen. Instead, we should keep the queue entry around, mark it as having been requested from disk and once the disk job comes back, discard it if it has been cancelled. Maybe even be able to cancel disk jobs?

    since we throw away the queue entry once we issue\n the disk job, this may happen. Instead, we should keep the\n queue entry around, mark it as having been requested from\n disk and once the disk job comes back, discard it if it has\n been cancelled. Maybe even be able to cancel disk jobs?

    ../src/peer_connection.cpp:3309

    \n #ifndef TORRENT_DISABLE_LOGGING\n \t\tpeer_log(peer_log_alert::incoming_message, \"CANCEL\"\n \t\t\t, \"piece: %d s: %x l: %x\", static_cast<int>(r.piece), r.start, r.length);\n@@ -3507,15 +3458,15 @@\n \n \t// -----------------------------\n \t// --------- HAVE ALL ----------\n \t// -----------------------------\n \n \tvoid peer_connection::incoming_have_all()\n \t{\n-
    relevance 2../src/peer_connection.cpp:4975use a deadline_timer for timeouts. Don't rely on second_tick()! Hook this up to connect timeout as well. This would improve performance because of less work in second_tick(), and might let use remove ticking entirely eventually

    use a deadline_timer for timeouts. Don't rely on second_tick()!\n+

    relevance 2../src/peer_connection.cpp:4975use a deadline_timer for timeouts. Don't rely on second_tick()! Hook this up to connect timeout as well. This would improve performance because of less work in second_tick(), and might let use remove ticking entirely eventually

    use a deadline_timer for timeouts. Don't rely on second_tick()!\n Hook this up to connect timeout as well. This would improve performance\n because of less work in second_tick(), and might let use remove ticking\n entirely eventually

    ../src/peer_connection.cpp:4975

    \t\t\tif (d > seconds(connect_timeout)\n \t\t\t\t&& can_disconnect(errors::timed_out))\n \t\t\t{\n #ifndef TORRENT_DISABLE_LOGGING\n \t\t\t\tpeer_log(peer_log_alert::info, \"CONNECT_FAILED\", \"waited %d seconds\"\n@@ -3561,173 +3512,15 @@\n #endif\n \t\t\tdisconnect(errors::timed_out_no_handshake, operation_t::bittorrent);\n \t\t\treturn;\n \t\t}\n \n \t\t// disconnect peers that we unchoked, but they didn't send a request in\n \t\t// the last 60 seconds, and we haven't been working on servicing a request\n-
    relevance 2../src/piece_picker.cpp:1996make the 2048 limit configurable

    make the 2048 limit configurable

    ../src/piece_picker.cpp:1996

    \t// indicating which path thought the picker we took to arrive at the\n-\t// returned block picks.\n-\tpicker_flags_t piece_picker::pick_pieces(typed_bitfield<piece_index_t> const& pieces\n-\t\t, std::vector<piece_block>& interesting_blocks, int num_blocks\n-\t\t, int prefer_contiguous_blocks, torrent_peer* peer\n-\t\t, picker_options_t options, std::vector<piece_index_t> const& suggested_pieces\n-\t\t, int num_peers\n-\t\t, counters& pc\n-\t\t) const\n-\t{\n-\t\tTORRENT_ASSERT(peer == nullptr || peer->in_use);\n-\t\tpicker_flags_t ret;\n-\n-\t\t// prevent the number of partial pieces to grow indefinitely\n-\t\t// make this scale by the number of peers we have. For large\n-\t\t// scale clients, we would have more peers, and allow a higher\n-\t\t// threshold for the number of partials\n-\t\t// the second condition is to make sure we cap the number of partial\n-\t\t// _bytes_. The larger the pieces are, the fewer partial pieces we want.\n-\t\t// 2048 corresponds to 32 MiB\n-
    \t\tconst int num_partials = int(m_downloads[piece_pos::piece_downloading].size());\n-
    \t\tif (num_partials > num_peers * 3 / 2\n-\t\t\t|| num_partials * blocks_per_piece() > 2048)\n-\t\t{\n-\t\t\t// if we have too many partial pieces, prioritize completing\n-\t\t\t// them. In order for this to have an affect, also disable\n-\t\t\t// prefer whole pieces (otherwise partial pieces would be de-prioritized)\n-\t\t\toptions |= prioritize_partials;\n-\t\t\tprefer_contiguous_blocks = 0;\n-\n-\t\t\tret |= picker_log_alert::partial_ratio;\n-\t\t}\n-\n-\t\tif (prefer_contiguous_blocks) ret |= picker_log_alert::prefer_contiguous;\n-\n-\t\t// only one of rarest_first and sequential can be set.\n-\t\tTORRENT_ASSERT(((options & rarest_first) ? 1 : 0)\n-\t\t\t+ ((options & sequential) ? 1 : 0) <= 1);\n-#ifdef TORRENT_EXPENSIVE_INVARIANT_CHECKS\n-\t\tINVARIANT_CHECK;\n-#endif\n-\t\tTORRENT_ASSERT(num_blocks > 0);\n-\t\tTORRENT_ASSERT(pieces.size() == int(m_piece_map.size()));\n-\n-\t\tTORRENT_ASSERT(!m_priority_boundaries.empty() || m_dirty);\n-\n-\t\t// this will be filled with blocks that we should not request\n-\t\t// unless we can't find num_blocks among the other ones.\n-\t\tstd::vector<piece_block> backup_blocks;\n-\t\tstd::vector<piece_block> backup_blocks2;\n-\t\tstd::vector<piece_index_t> ignored_pieces;\n-
    relevance 2../src/piece_picker.cpp:2594the first_block returned here is the largest free range, not the first-fit range, which would be better

    the first_block returned here is the largest free range, not\n-the first-fit range, which would be better

    ../src/piece_picker.cpp:2594

    \t{\n-\t\tfor (auto const& b : m_block_info)\n-\t\t{\n-\t\t\tTORRENT_ASSERT(b.peer == nullptr || static_cast<torrent_peer*>(b.peer)->in_use);\n-\t\t}\n-\t}\n-#endif\n-\n-\tvoid piece_picker::clear_peer(torrent_peer* peer)\n-\t{\n-\t\tfor (auto& b : m_block_info)\n-\t\t{\n-\t\t\tif (b.peer == peer) b.peer = nullptr;\n-\t\t}\n-\t}\n-\n-\t// the first bool is true if this is the only peer that has requested and downloaded\n-\t// blocks from this piece.\n-\t// the second bool is true if this is the only active peer that is requesting\n-\t// and downloading blocks from this piece. Active means having a connection.\n-
    \tstd::tuple<bool, bool, int, int> piece_picker::requested_from(\n-
    \t\tpiece_picker::downloading_piece const& p\n-\t\t, int const num_blocks_in_piece, torrent_peer* peer) const\n-\t{\n-\t\tbool exclusive = true;\n-\t\tbool exclusive_active = true;\n-\t\tint contiguous_blocks = 0;\n-\t\tint max_contiguous = 0;\n-\t\tint first_block = 0;\n-\t\tint idx = -1;\n-\t\tfor (auto const& info : blocks_for_piece(p))\n-\t\t{\n-\t\t\t++idx;\n-\t\t\tTORRENT_ASSERT(info.peer == nullptr || info.peer->in_use);\n-\t\t\tTORRENT_ASSERT(info.piece_index == p.index);\n-\t\t\tif (info.state == piece_picker::block_info::state_none)\n-\t\t\t{\n-\t\t\t\t++contiguous_blocks;\n-\t\t\t\tcontinue;\n-\t\t\t}\n-\t\t\tif (contiguous_blocks > max_contiguous)\n-\t\t\t{\n-\t\t\t\tmax_contiguous = contiguous_blocks;\n-\t\t\t\tfirst_block = idx - contiguous_blocks;\n-\t\t\t}\n-\t\t\tcontiguous_blocks = 0;\n-\t\t\tif (info.peer != peer)\n-\t\t\t{\n-\t\t\t\texclusive = false;\n-\t\t\t\tif (info.state == piece_picker::block_info::state_requested\n-\t\t\t\t\t&& info.peer != nullptr)\n-
    relevance 2../src/piece_picker.cpp:3478it would be nice if this could be folded into lock_piece() the main distinction is that this also maintains the m_num_have counter and the passed_hash_check member Is there ever a case where we call write failed without also locking the piece? Perhaps write_failed() should imply locking it.

    it would be nice if this could be folded into lock_piece()\n-the main distinction is that this also maintains the m_num_have\n-counter and the passed_hash_check member\n-Is there ever a case where we call write failed without also locking\n-the piece? Perhaps write_failed() should imply locking it.

    ../src/piece_picker.cpp:3478

    \n-\t\tauto const state = m_piece_map[piece].download_queue();\n-\t\tif (state == piece_pos::piece_open) return;\n-\t\tauto const i = find_dl_piece(state, piece);\n-\t\tif (i == m_downloads[state].end()) return;\n-\n-\t\tTORRENT_ASSERT(i->passed_hash_check == false);\n-\t\tif (i->passed_hash_check)\n-\t\t{\n-\t\t\t// it's not clear why this would happen,\n-\t\t\t// but it seems reasonable to not break the\n-\t\t\t// accounting over it.\n-\t\t\ti->passed_hash_check = false;\n-\t\t\taccount_lost(piece);\n-\t\t}\n-\n-\t\t// prevent this piece from being picked until it's restored\n-\t\ti->locked = true;\n-\t}\n-\n-
    \tvoid piece_picker::write_failed(piece_block const block)\n-
    \t{\n-\t\tINVARIANT_CHECK;\n-\n-#if TORRENT_USE_INVARIANT_CHECKS\n-\t\tcheck_piece_state();\n-#endif\n-\n-#ifdef TORRENT_PICKER_LOG\n-\t\tstd::cerr << \"[\" << this << \"] \" << \"write_failed( {\" << block.piece_index << \", \" << block.block_index << \"} )\" << std::endl;\n-#endif\n-\n-\t\tauto const state = m_piece_map[block.piece_index].download_queue();\n-\t\tif (state == piece_pos::piece_open) return;\n-\t\tauto i = find_dl_piece(state, block.piece_index);\n-\t\tif (i == m_downloads[state].end()) return;\n-\n-\t\tauto const binfo = mutable_blocks_for_piece(*i);\n-\t\tblock_info& info = binfo[block.block_index];\n-\t\tTORRENT_ASSERT(&info >= &m_block_info[0]);\n-\t\tTORRENT_ASSERT(&info < &m_block_info[0] + m_block_info.size());\n-\t\tTORRENT_ASSERT(info.piece_index == block.piece_index);\n-\t\tTORRENT_ASSERT(info.state == block_info::state_writing);\n-\t\tTORRENT_ASSERT(info.num_peers == 0);\n-\n-\t\tTORRENT_ASSERT(i->writing > 0);\n-\t\tTORRENT_ASSERT(info.state == block_info::state_writing);\n-\n-\t\tif (info.state == block_info::state_finished) return;\n-\t\tif (info.state == block_info::state_writing) --i->writing;\n-\n-
    relevance 2../src/alert_manager.cpp:80keep a count of the number of threads waiting. Only if it's > 0 notify them

    keep a count of the number of threads waiting. Only if it's\n+

    relevance 2../src/alert_manager.cpp:80keep a count of the number of threads waiting. Only if it's > 0 notify them

    keep a count of the number of threads waiting. Only if it's\n > 0 notify them

    ../src/alert_manager.cpp:80

    \t\t\treturn m_alerts[m_generation].front();\n \n \t\t// this call can be interrupted prematurely by other signals\n \t\tm_condition.wait_for(lock, max_wait);\n \t\tif (!m_alerts[m_generation].empty())\n \t\t\treturn m_alerts[m_generation].front();\n \n@@ -3771,15 +3564,66 @@\n \t\tm_ses_extensions.push_back(std::move(ext));\n \t}\n #endif\n \n \tvoid alert_manager::get_all(std::vector<alert*>& alerts)\n \t{\n \t\tstd::lock_guard<std::recursive_mutex> lock(m_mutex);\n-
    relevance 2../src/tracker_manager.cpp:369implement

    implement

    ../src/tracker_manager.cpp:369

    #ifndef TORRENT_DISABLE_LOGGING\n+
    relevance 2../src/bdecode.cpp:826attempt to simplify this implementation by embracing the span

    attempt to simplify this implementation by embracing the span

    ../src/bdecode.cpp:826

    \t}\n+\n+\tbdecode_node bdecode(span<char const> buffer\n+\t\t, error_code& ec, int* error_pos, int depth_limit, int token_limit)\n+\t{\n+\t\tbdecode_node ret;\n+\t\tec.clear();\n+\n+\t\tif (buffer.size() > bdecode_token::max_offset)\n+\t\t{\n+\t\t\tif (error_pos) *error_pos = 0;\n+\t\t\tec = bdecode_errors::limit_exceeded;\n+\t\t\treturn ret;\n+\t\t}\n+\n+\t\t// this is the stack of bdecode_token indices, into m_tokens.\n+\t\t// sp is the stack pointer, as index into the array, stack\n+\t\tint sp = 0;\n+\t\tTORRENT_ALLOCA(stack, stack_frame, depth_limit);\n+\n+
    \t\tchar const* start = buffer.data();\n+
    \t\tchar const* end = start + buffer.size();\n+\t\tchar const* const orig_start = start;\n+\n+\t\tif (start == end)\n+\t\t\tTORRENT_FAIL_BDECODE(bdecode_errors::unexpected_eof);\n+\n+\t\twhile (start <= end)\n+\t\t{\n+\t\t\tif (start >= end) TORRENT_FAIL_BDECODE(bdecode_errors::unexpected_eof);\n+\n+\t\t\tif (sp >= depth_limit)\n+\t\t\t\tTORRENT_FAIL_BDECODE(bdecode_errors::depth_exceeded);\n+\n+\t\t\t--token_limit;\n+\t\t\tif (token_limit < 0)\n+\t\t\t\tTORRENT_FAIL_BDECODE(bdecode_errors::limit_exceeded);\n+\n+\t\t\t// look for a new token\n+\t\t\tchar const t = *start;\n+\n+\t\t\tint const current_frame = sp;\n+\n+\t\t\t// if we're currently parsing a dictionary, assert that\n+\t\t\t// every other node is a string.\n+\t\t\tif (current_frame > 0\n+\t\t\t\t&& ret.m_tokens[stack[current_frame - 1].token].type == bdecode_token::dict)\n+\t\t\t{\n+\t\t\t\tif (stack[current_frame - 1].state == 0)\n+\t\t\t\t{\n+\t\t\t\t\t// the current parent is a dict and we are parsing a key.\n+
    relevance 2../src/tracker_manager.cpp:369implement

    implement

    ../src/tracker_manager.cpp:369

    #ifndef TORRENT_DISABLE_LOGGING\n \t\t\tif (m_ses.should_log())\n \t\t\t{\n \t\t\t\tm_ses.session_log(\"incoming UDP tracker packet from %s has invalid \"\n \t\t\t\t\t\"transaction ID (%x)\", print_endpoint(ep).c_str()\n \t\t\t\t\t, transaction);\n \t\t\t}\n #endif\n@@ -3822,15 +3666,222 @@\n \t\t\t\t\"transaction ID (%x)\", std::string(hostname).c_str(), int(transaction));\n #endif\n \t\t\treturn false;\n \t\t}\n \n \t\tstd::shared_ptr<udp_tracker_connection> const p = i->second;\n \t\t// on_receive() may remove the tracker connection from the list\n-
    relevance 2../src/kademlia/node.cpp:684it would be nice to have a bias towards node-id prefixes that are missing in the bucket

    it would be nice to have a bias towards node-id prefixes that\n+

    relevance 2../src/alert.cpp:2021the salt here is allocated on the heap. It would be nice to allocate in the stack_allocator

    the salt here is allocated on the heap. It would be nice to\n+allocate in the stack_allocator

    ../src/alert.cpp:2021

    \t}\n+\n+\tdht_immutable_item_alert::dht_immutable_item_alert(aux::stack_allocator&\n+\t\t, sha1_hash const& t, entry i)\n+\t\t: target(t), item(std::move(i))\n+\t{}\n+\n+\tstd::string dht_immutable_item_alert::message() const\n+\t{\n+#ifdef TORRENT_DISABLE_ALERT_MSG\n+\t\treturn {};\n+#else\n+\t\tchar msg[1050];\n+\t\tstd::snprintf(msg, sizeof(msg), \"DHT immutable item %s [ %s ]\"\n+\t\t\t, aux::to_hex(target).c_str()\n+\t\t\t, item.to_string().c_str());\n+\t\treturn msg;\n+#endif\n+\t}\n+\n+
    \tdht_mutable_item_alert::dht_mutable_item_alert(aux::stack_allocator&\n+
    \t\t, std::array<char, 32> const& k\n+\t\t, std::array<char, 64> const& sig\n+\t\t, std::int64_t sequence\n+\t\t, string_view s\n+\t\t, entry i\n+\t\t, bool a)\n+\t\t: key(k), signature(sig), seq(sequence), salt(s), item(std::move(i)), authoritative(a)\n+\t{}\n+\n+\tstd::string dht_mutable_item_alert::message() const\n+\t{\n+#ifdef TORRENT_DISABLE_ALERT_MSG\n+\t\treturn {};\n+#else\n+\t\tchar msg[1050];\n+\t\tstd::snprintf(msg, sizeof(msg), \"DHT mutable item (key=%s salt=%s seq=%\" PRId64 \" %s) [ %s ]\"\n+\t\t\t, aux::to_hex(key).c_str()\n+\t\t\t, salt.c_str()\n+\t\t\t, seq\n+\t\t\t, authoritative ? \"auth\" : \"non-auth\"\n+\t\t\t, item.to_string().c_str());\n+\t\treturn msg;\n+#endif\n+\t}\n+\n+\tdht_put_alert::dht_put_alert(aux::stack_allocator&, sha1_hash const& t, int n)\n+\t\t: target(t)\n+\t\t, public_key()\n+\t\t, signature()\n+\t\t, salt()\n+
    relevance 2../src/udp_tracker_connection.cpp:81support authentication here. tracker_req().auth

    support authentication here. tracker_req().auth

    ../src/udp_tracker_connection.cpp:81

    \t\tudp_tracker_connection::m_connection_cache;\n+\n+\tstd::mutex udp_tracker_connection::m_cache_mutex;\n+\n+\tudp_tracker_connection::udp_tracker_connection(\n+\t\tio_context& ios\n+\t\t, tracker_manager& man\n+\t\t, tracker_request const& req\n+\t\t, std::weak_ptr<request_callback> c)\n+\t\t: tracker_connection(man, req, ios, std::move(c))\n+\t\t, m_transaction_id(0)\n+\t\t, m_attempts(0)\n+\t\t, m_state(action_t::error)\n+\t\t, m_abort(false)\n+\t{\n+\t\tupdate_transaction_id();\n+\t}\n+\n+\tvoid udp_tracker_connection::start()\n+\t{\n+
    \t\tstd::string hostname;\n+
    \t\tstd::string protocol;\n+\t\tint port;\n+\t\terror_code ec;\n+\n+\t\tstd::tie(protocol, std::ignore, hostname, port, std::ignore)\n+\t\t\t= parse_url_components(tracker_req().url, ec);\n+\t\tif (port == -1) port = protocol == \"http\" ? 80 : 443;\n+\n+\t\tif (ec)\n+\t\t{\n+\t\t\ttracker_connection::fail(ec, operation_t::parse_address);\n+\t\t\treturn;\n+\t\t}\n+\n+\t\taux::session_settings const& settings = m_man.settings();\n+\n+\t\tint const proxy_type = settings.get_int(settings_pack::proxy_type);\n+\n+\t\tif (settings.get_bool(settings_pack::proxy_hostnames)\n+\t\t\t&& (proxy_type == settings_pack::socks5\n+\t\t\t\t|| proxy_type == settings_pack::socks5_pw))\n+\t\t{\n+\t\t\tm_hostname = hostname;\n+\t\t\tm_target.port(std::uint16_t(port));\n+\t\t\tstart_announce();\n+\t\t}\n+\t\telse\n+\t\t{\n+\t\t\tusing namespace std::placeholders;\n+\t\t\tADD_OUTSTANDING_ASYNC(\"udp_tracker_connection::name_lookup\");\n+
    relevance 2../src/peer_list.cpp:539it would be nice if there was a way to iterate over these torrent_peer objects in the order they are allocated in the pool instead. It would probably be more efficient

    it would be nice if there was a way to iterate over these\n+torrent_peer objects in the order they are allocated in the pool\n+instead. It would probably be more efficient

    ../src/peer_list.cpp:539

    \t\t, int session_time, torrent_state* state)\n+\t{\n+\t\tTORRENT_ASSERT(is_single_thread());\n+\t\tINVARIANT_CHECK;\n+\n+\t\tconst int candidate_count = 10;\n+\t\tpeers.reserve(candidate_count);\n+\n+\t\tint erase_candidate = -1;\n+\n+\t\tif (bool(m_finished) != state->is_finished)\n+\t\t\trecalculate_connect_candidates(state);\n+\n+\t\texternal_ip const& external = state->ip;\n+\t\tint external_port = state->port;\n+\n+\t\tif (m_round_robin >= int(m_peers.size())) m_round_robin = 0;\n+\n+\t\tint max_peerlist_size = state->max_peerlist_size;\n+\n+
    \t\tfor (int iterations = std::min(int(m_peers.size()), 300);\n+
    \t\t\titerations > 0; --iterations)\n+\t\t{\n+\t\t\t++state->loop_counter;\n+\n+\t\t\tif (m_round_robin >= int(m_peers.size())) m_round_robin = 0;\n+\n+\t\t\ttorrent_peer& pe = *m_peers[m_round_robin];\n+\t\t\tTORRENT_ASSERT(pe.in_use);\n+\t\t\tint current = m_round_robin;\n+\n+\t\t\t// if the number of peers is growing large\n+\t\t\t// we need to start weeding.\n+\n+\t\t\tif (int(m_peers.size()) >= max_peerlist_size * 0.95\n+\t\t\t\t&& max_peerlist_size > 0)\n+\t\t\t{\n+\t\t\t\tif (is_erase_candidate(pe)\n+\t\t\t\t\t&& (erase_candidate == -1\n+\t\t\t\t\t\t|| !compare_peer_erase(*m_peers[erase_candidate], pe)))\n+\t\t\t\t{\n+\t\t\t\t\tif (should_erase_immediately(pe))\n+\t\t\t\t\t{\n+\t\t\t\t\t\tif (erase_candidate > current) --erase_candidate;\n+\t\t\t\t\t\terase_peer(m_peers.begin() + current, state);\n+\t\t\t\t\t\tcontinue;\n+\t\t\t\t\t}\n+\t\t\t\t\telse\n+\t\t\t\t\t{\n+\t\t\t\t\t\terase_candidate = current;\n+\t\t\t\t\t}\n+
    relevance 2../src/kademlia/dht_storage.cpp:87make this configurable in dht_settings

    make this configurable in dht_settings

    ../src/kademlia/dht_storage.cpp:87

    \t\ttcp::endpoint addr;\n+\t\tbool seed = 0;\n+\t};\n+\n+\t// internal\n+\tbool operator<(peer_entry const& lhs, peer_entry const& rhs)\n+\t{\n+\t\treturn lhs.addr.address() == rhs.addr.address()\n+\t\t\t? lhs.addr.port() < rhs.addr.port()\n+\t\t\t: lhs.addr.address() < rhs.addr.address();\n+\t}\n+\n+\t// this is a group. It contains a set of group members\n+\tstruct torrent_entry\n+\t{\n+\t\tstd::string name;\n+\t\tstd::vector<peer_entry> peers4;\n+\t\tstd::vector<peer_entry> peers6;\n+\t};\n+\n+
    \tconstexpr time_duration announce_interval = minutes(30);\n+
    \n+\tstruct dht_immutable_item\n+\t{\n+\t\t// the actual value\n+\t\tstd::unique_ptr<char[]> value;\n+\t\t// this counts the number of IPs we have seen\n+\t\t// announcing this item, this is used to determine\n+\t\t// popularity if we reach the limit of items to store\n+\t\tbloom_filter<128> ips;\n+\t\t// the last time we heard about this item\n+\t\t// the correct interpretation of this field\n+\t\t// requires a time reference\n+\t\ttime_point last_seen;\n+\t\t// number of IPs in the bloom filter\n+\t\tint num_announcers = 0;\n+\t\t// size of malloced space pointed to by value\n+\t\tint size = 0;\n+\t};\n+\n+\tstruct dht_mutable_item : dht_immutable_item\n+\t{\n+\t\tsignature sig{};\n+\t\tsequence_number seq{};\n+\t\tpublic_key key{};\n+\t\tstd::string salt;\n+\t};\n+\n+\tvoid set_value(dht_immutable_item& item, span<char const> buf)\n+\t{\n+\t\tint const size = int(buf.size());\n+
    relevance 2../src/kademlia/node.cpp:684it would be nice to have a bias towards node-id prefixes that are missing in the bucket

    it would be nice to have a bias towards node-id prefixes that\n are missing in the bucket

    ../src/kademlia/node.cpp:684

    \tnode_entry const* ne = m_table.next_refresh();\n \tif (ne == nullptr) return;\n \n \t// this shouldn't happen\n \tTORRENT_ASSERT(m_id != ne->id);\n \tif (ne->id == m_id) return;\n \n@@ -3874,15 +3925,15 @@\n \t\te[\"q\"] = \"get_peers\";\n \t\te[\"a\"][\"info_hash\"] = target.to_string();\n \t\tm_counters.inc_stats_counter(counters::dht_get_peers_out);\n \t}\n \n \to->flags |= observer::flag_queried;\n \tm_rpc.invoke(e, ep, o);\n-
    relevance 2../src/kademlia/node.cpp:757use the non deprecated function instead of this one

    use the non deprecated function instead of this one

    ../src/kademlia/node.cpp:757

    \tret.local_endpoint = make_udp(m_sock.get_local_endpoint());\n+
    relevance 2../src/kademlia/node.cpp:757use the non deprecated function instead of this one

    use the non deprecated function instead of this one

    ../src/kademlia/node.cpp:757

    \tret.local_endpoint = make_udp(m_sock.get_local_endpoint());\n \tm_table.status(ret.table);\n \n \tfor (auto const& r : m_running_requests)\n \t{\n \t\tret.requests.emplace_back();\n \t\tdht_lookup& lookup = ret.requests.back();\n \t\tr->status(lookup);\n@@ -3925,15 +3976,15 @@\n entry write_nodes_entry(std::vector<node_entry> const& nodes)\n {\n \tentry r;\n \tstd::back_insert_iterator<std::string> out(r.string());\n \tfor (auto const& n : nodes)\n \t{\n \t\tstd::copy(n.id.begin(), n.id.end(), out);\n-
    relevance 2../src/kademlia/routing_table.cpp:305use the non deprecated function instead of this one

    use the non deprecated function instead of this one

    ../src/kademlia/routing_table.cpp:305

    \tstatic const aux::array<int, 4> size_exceptions{{{16, 8, 4, 2}}};\n+
    relevance 2../src/kademlia/routing_table.cpp:305use the non deprecated function instead of this one

    use the non deprecated function instead of this one

    ../src/kademlia/routing_table.cpp:305

    \tstatic const aux::array<int, 4> size_exceptions{{{16, 8, 4, 2}}};\n \tif (bucket < size_exceptions.end_index())\n \t\treturn m_bucket_size * size_exceptions[bucket];\n \treturn m_bucket_size;\n }\n \n void routing_table::status(std::vector<dht_routing_bucket>& s) const\n {\n@@ -3953,15 +4004,15 @@\n {\n \tint dht_nodes;\n \tint dht_node_cache;\n \tint ignore;\n \tstd::tie(dht_nodes, dht_node_cache, ignore) = size();\n \ts.dht_nodes += dht_nodes;\n \ts.dht_node_cache += dht_node_cache;\n-
    relevance 2../src/kademlia/routing_table.cpp:940move the lowest priority nodes to the replacement bucket

    move the lowest priority nodes to the replacement bucket

    ../src/kademlia/routing_table.cpp:940

    \tbucket_t& rb = m_buckets[bucket_index].replacements;\n+
    relevance 2../src/kademlia/routing_table.cpp:940move the lowest priority nodes to the replacement bucket

    move the lowest priority nodes to the replacement bucket

    ../src/kademlia/routing_table.cpp:940

    \tbucket_t& rb = m_buckets[bucket_index].replacements;\n \n \t// move any node whose (160 - distance_exp(m_id, id)) >= (i - m_buckets.begin())\n \t// to the new bucket\n \tint const new_bucket_size = bucket_limit(bucket_index + 1);\n \tfor (auto j = b.begin(); j != b.end();)\n \t{\n \t\tint const d = distance_exp(m_id, j->id);\n@@ -4004,118 +4055,15 @@\n \t\t{\n \t\t\t// this entry belongs in the new bucket\n \t\t\tif (j->pinged() && int(new_bucket.size()) < new_bucket_size)\n \t\t\t\tnew_bucket.push_back(*j);\n \t\t\telse\n \t\t\t\tnew_replacement_bucket.push_back(*j);\n \t\t}\n-
    relevance 2../src/kademlia/dht_storage.cpp:87make this configurable in dht_settings

    make this configurable in dht_settings

    ../src/kademlia/dht_storage.cpp:87

    \t\ttcp::endpoint addr;\n-\t\tbool seed = 0;\n-\t};\n-\n-\t// internal\n-\tbool operator<(peer_entry const& lhs, peer_entry const& rhs)\n-\t{\n-\t\treturn lhs.addr.address() == rhs.addr.address()\n-\t\t\t? lhs.addr.port() < rhs.addr.port()\n-\t\t\t: lhs.addr.address() < rhs.addr.address();\n-\t}\n-\n-\t// this is a group. It contains a set of group members\n-\tstruct torrent_entry\n-\t{\n-\t\tstd::string name;\n-\t\tstd::vector<peer_entry> peers4;\n-\t\tstd::vector<peer_entry> peers6;\n-\t};\n-\n-
    \tconstexpr time_duration announce_interval = minutes(30);\n-
    \n-\tstruct dht_immutable_item\n-\t{\n-\t\t// the actual value\n-\t\tstd::unique_ptr<char[]> value;\n-\t\t// this counts the number of IPs we have seen\n-\t\t// announcing this item, this is used to determine\n-\t\t// popularity if we reach the limit of items to store\n-\t\tbloom_filter<128> ips;\n-\t\t// the last time we heard about this item\n-\t\t// the correct interpretation of this field\n-\t\t// requires a time reference\n-\t\ttime_point last_seen;\n-\t\t// number of IPs in the bloom filter\n-\t\tint num_announcers = 0;\n-\t\t// size of malloced space pointed to by value\n-\t\tint size = 0;\n-\t};\n-\n-\tstruct dht_mutable_item : dht_immutable_item\n-\t{\n-\t\tsignature sig{};\n-\t\tsequence_number seq{};\n-\t\tpublic_key key{};\n-\t\tstd::string salt;\n-\t};\n-\n-\tvoid set_value(dht_immutable_item& item, span<char const> buf)\n-\t{\n-\t\tint const size = int(buf.size());\n-
    relevance 2../include/libtorrent/enum_net.hpp:196this could be done more efficiently by just looking up the interface with the given name, maybe even with if_nametoindex()

    this could be done more efficiently by just looking up\n-the interface with the given name, maybe even with if_nametoindex()

    ../include/libtorrent/enum_net.hpp:196

    \t\t\t// IPv6 address. If we're asking to be bound to an IPv6 address and\n-\t\t\t// providing 0.0.0.0 as the device, turn it into \"::\"\n-\t\t\tif (ip == address_v4::any() && protocol == boost::asio::ip::tcp::v6())\n-\t\t\t\tip = address_v6::any();\n-\t\t\tbind_ep.address(ip);\n-\t\t\t// it appears to be an IP. Just bind to that address\n-\t\t\tsock.bind(bind_ep, ec);\n-\t\t\treturn bind_ep.address();\n-\t\t}\n-\n-\t\tec.clear();\n-\n-#if TORRENT_HAS_BINDTODEVICE\n-\t\t// try to use SO_BINDTODEVICE here, if that exists. If it fails,\n-\t\t// fall back to the mechanism we have below\n-\t\taux::bind_device(sock, device_name, ec);\n-\t\tif (ec)\n-#endif\n-\t\t{\n-\t\t\tec.clear();\n-
    \t\t\tstd::vector<ip_interface> ifs = enum_net_interfaces(ios, ec);\n-
    \t\t\tif (ec) return bind_ep.address();\n-\n-\t\t\tbool found = false;\n-\n-\t\t\tfor (auto const& iface : ifs)\n-\t\t\t{\n-\t\t\t\t// we're looking for a specific interface, and its address\n-\t\t\t\t// (which must be of the same family as the address we're\n-\t\t\t\t// connecting to)\n-\t\t\t\tif (std::strcmp(iface.name, device_name) != 0) continue;\n-\t\t\t\tif (iface.interface_address.is_v4() != (protocol == boost::asio::ip::tcp::v4()))\n-\t\t\t\t\tcontinue;\n-\n-\t\t\t\tbind_ep.address(iface.interface_address);\n-\t\t\t\tfound = true;\n-\t\t\t\tbreak;\n-\t\t\t}\n-\n-\t\t\tif (!found)\n-\t\t\t{\n-\t\t\t\tec = error_code(boost::system::errc::no_such_device, generic_category());\n-\t\t\t\treturn bind_ep.address();\n-\t\t\t}\n-\t\t}\n-\t\tsock.bind(bind_ep, ec);\n-\t\treturn bind_ep.address();\n-\t}\n-\n-\t// returns the device name whose local address is ``addr``. If\n-\t// no such device is found, an empty string is returned.\n-
    relevance 2../include/libtorrent/proxy_base.hpp:327use the resolver interface that has a built-in cache

    use the resolver interface that has a built-in cache

    ../include/libtorrent/proxy_base.hpp:327

    \n+
    relevance 2../include/libtorrent/proxy_base.hpp:327use the resolver interface that has a built-in cache

    use the resolver interface that has a built-in cache

    ../include/libtorrent/proxy_base.hpp:327

    \n \t// The handler must be taken as lvalue reference here since we may not call\n \t// it. But if we do, we want the call operator to own the function object.\n \ttemplate <typename Handler>\n \tbool handle_error(error_code e, Handler&& h)\n \t{\n \t\tTORRENT_ASSERT(m_magic == 0x1337);\n \t\tif (!e) return false;\n@@ -4158,15 +4106,118 @@\n \tusing allocator_type = typename boost::asio::associated_allocator<UnderlyingHandler>::type;\n \tusing executor_type = typename boost::asio::associated_executor<UnderlyingHandler>::type;\n \n \tallocator_type get_allocator() const noexcept\n \t{ return boost::asio::get_associated_allocator(m_underlying_handler); }\n \n \texecutor_type get_executor() const noexcept\n-
    relevance 2../include/libtorrent/peer_connection.hpp:996this should really be a circular buffer

    this should really be a circular buffer

    ../include/libtorrent/peer_connection.hpp:996

    \t\t// it just serves as a queue to remember what we've sent, to avoid\n+
    relevance 2../include/libtorrent/piece_picker.hpp:668having 8 priority levels is probably excessive. It should probably be changed to 3 levels + dont-download

    having 8 priority levels is probably excessive. It should\n+probably be changed to 3 levels + dont-download

    ../include/libtorrent/piece_picker.hpp:668

    \t\t\t\telse if (state() == piece_full)\n+\t\t\t\t\t\tstate(piece_full_reverse);\n+\t\t\t}\n+\n+\t\t\t// the number of peers that has this piece\n+\t\t\t// (availability)\n+\t\t\tstd::uint32_t peer_count : 26;\n+\n+\t\t\t// one of the download_queue_t values. This indicates whether this piece\n+\t\t\t// is currently being downloaded or not, and what state it's in if\n+\t\t\t// it is. Specifically, as an optimization, pieces that have all blocks\n+\t\t\t// requested from them are separated out into separate lists to make\n+\t\t\t// lookups quicker. The main oddity is that whether a downloading piece\n+\t\t\t// has only been requested from peers that are reverse, that's\n+\t\t\t// recorded as piece_downloading_reverse, which really means the same\n+\t\t\t// as piece_downloading, it just saves space to also indicate that it\n+\t\t\t// has a bit lower priority. The reverse bit is only relevant if the\n+\t\t\t// state is piece_downloading.\n+\t\t\tstd::uint32_t download_state : 3;\n+\n+
    \n+
    \t\t\t// is 0 if the piece is filtered (not to be downloaded)\n+\t\t\t// 1 is low priority\n+\t\t\t// 2 is low priority\n+\t\t\t// 3 is mid priority\n+\t\t\t// 4 is default priority\n+\t\t\t// 5 is mid priority\n+\t\t\t// 6 is high priority\n+\t\t\t// 7 is high priority\n+\t\t\tstd::uint32_t piece_priority : 3;\n+\n+\t\t\t// index in to the piece_info vector\n+\t\t\tprio_index_t index;\n+\n+#ifdef TORRENT_DEBUG_REFCOUNTS\n+\t\t\t// all the peers that have this piece\n+\t\t\tstd::set<const torrent_peer*> have_peers;\n+#endif\n+\n+\t\t\t// index is set to this to indicate that we have the\n+\t\t\t// piece. There is no entry for the piece in the\n+\t\t\t// buckets if this is the case.\n+\t\t\tstatic constexpr prio_index_t we_have_index{-1};\n+\n+\t\t\t// the priority value that means the piece is filtered\n+\t\t\tstatic constexpr std::uint32_t filter_priority = 0;\n+\n+\t\t\t// the max number the peer count can hold\n+\t\t\tstatic constexpr std::uint32_t max_peer_count = 0xffff;\n+\n+\t\t\tbool have() const { return index == we_have_index; }\n+
    relevance 2../include/libtorrent/socks5_stream.hpp:153add async_connect() that takes a hostname and port as well

    add async_connect() that takes a hostname and port as well

    ../include/libtorrent/socks5_stream.hpp:153

    \t\tTORRENT_ASSERT(!aux::is_ip_address(host));\n+\t\tm_dst_name = host;\n+\t\tif (m_dst_name.size() > 255)\n+\t\t\tm_dst_name.resize(255);\n+\t}\n+\n+\tvoid close(error_code& ec)\n+\t{\n+\t\tm_dst_name.clear();\n+\t\tproxy_base::close(ec);\n+\t}\n+\n+#ifndef BOOST_NO_EXCEPTIONS\n+\tvoid close()\n+\t{\n+\t\tm_dst_name.clear();\n+\t\tproxy_base::close();\n+\t}\n+#endif\n+\n+
    \ttemplate <class Handler>\n+
    \tvoid async_connect(endpoint_type const& endpoint, Handler handler)\n+\t{\n+\t\t// make sure we don't try to connect to INADDR_ANY. binding is fine,\n+\t\t// and using a hostname is fine on SOCKS version 5.\n+\t\tTORRENT_ASSERT(endpoint.address() != address()\n+\t\t\t|| (!m_dst_name.empty() && m_version == 5));\n+\n+\t\tm_remote_endpoint = endpoint;\n+\n+\t\t// the connect is split up in the following steps:\n+\t\t// 1. resolve name of proxy server\n+\t\t// 2. connect to proxy server\n+\t\t// 3. if version == 5:\n+\t\t// 3.1 send SOCKS5 authentication method message\n+\t\t// 3.2 read SOCKS5 authentication response\n+\t\t// 3.3 send username+password\n+\t\t// 4. send SOCKS command message\n+\n+\t\tADD_OUTSTANDING_ASYNC(\"socks5_stream::name_lookup\");\n+\t\tm_resolver.async_resolve(m_hostname, to_string(m_port).data(), wrap_allocator(\n+\t\t\t[this](error_code const& ec, tcp::resolver::results_type ips, Handler hn) {\n+\t\t\t\tname_lookup(ec, std::move(ips), std::move(hn));\n+\t\t\t}, std::move(handler)));\n+\t}\n+\n+private:\n+\n+\ttemplate <typename Handler>\n+\tvoid name_lookup(error_code const& e, tcp::resolver::results_type ips\n+\t\t, Handler h)\n+
    relevance 2../include/libtorrent/peer_connection.hpp:996this should really be a circular buffer

    this should really be a circular buffer

    ../include/libtorrent/peer_connection.hpp:996

    \t\t// it just serves as a queue to remember what we've sent, to avoid\n \t\t// re-sending suggests for the same piece\n \t\t// i.e. outgoing suggest pieces\n \t\taux::vector<piece_index_t> m_suggest_pieces;\n \n \t\t// the pieces we will send to the peer\n \t\t// if requested (regardless of choke state)\n \t\tstd::vector<piece_index_t> m_accept_fast;\n@@ -4207,15 +4258,15 @@\n \n \t\ttemplate <typename Fun, typename... Args>\n \t\tvoid wrap(Fun f, Args&&... a);\n \n \t\t// statistics about upload and download speeds\n \t\t// and total amount of uploads and downloads for\n \t\t// this peer\n-
    relevance 2../include/libtorrent/peer_connection.hpp:1086rename this target queue size

    rename this target queue size

    ../include/libtorrent/peer_connection.hpp:1086

    \t\t// this is the piece that is available to this peer. Only\n+
    relevance 2../include/libtorrent/peer_connection.hpp:1086rename this target queue size

    rename this target queue size

    ../include/libtorrent/peer_connection.hpp:1086

    \t\t// this is the piece that is available to this peer. Only\n \t\t// these two pieces can be downloaded from us by this peer.\n \t\t// This will remain the current piece for this peer until\n \t\t// another peer sends us a have message for this piece\n \t\tstd::array<piece_index_t, 2> m_superseed_piece = {{piece_index_t(-1), piece_index_t(-1)}};\n #endif\n \n \t\t// the number of bytes send to the disk-io\n@@ -4258,117 +4309,66 @@\n \t\t// could be considered: true = local, false = remote\n \t\tbool m_outgoing:1;\n \n \t\t// is true if we learn the incoming connections listening\n \t\t// during the extended handshake\n \t\tbool m_received_listen_port:1;\n \n-
    relevance 2../include/libtorrent/socks5_stream.hpp:153add async_connect() that takes a hostname and port as well

    add async_connect() that takes a hostname and port as well

    ../include/libtorrent/socks5_stream.hpp:153

    \t\tTORRENT_ASSERT(!aux::is_ip_address(host));\n-\t\tm_dst_name = host;\n-\t\tif (m_dst_name.size() > 255)\n-\t\t\tm_dst_name.resize(255);\n-\t}\n+
    relevance 2../include/libtorrent/enum_net.hpp:196this could be done more efficiently by just looking up the interface with the given name, maybe even with if_nametoindex()

    this could be done more efficiently by just looking up\n+the interface with the given name, maybe even with if_nametoindex()

    ../include/libtorrent/enum_net.hpp:196

    \t\t\t// IPv6 address. If we're asking to be bound to an IPv6 address and\n+\t\t\t// providing 0.0.0.0 as the device, turn it into \"::\"\n+\t\t\tif (ip == address_v4::any() && protocol == boost::asio::ip::tcp::v6())\n+\t\t\t\tip = address_v6::any();\n+\t\t\tbind_ep.address(ip);\n+\t\t\t// it appears to be an IP. Just bind to that address\n+\t\t\tsock.bind(bind_ep, ec);\n+\t\t\treturn bind_ep.address();\n+\t\t}\n \n-\tvoid close(error_code& ec)\n-\t{\n-\t\tm_dst_name.clear();\n-\t\tproxy_base::close(ec);\n-\t}\n+\t\tec.clear();\n \n-#ifndef BOOST_NO_EXCEPTIONS\n-\tvoid close()\n-\t{\n-\t\tm_dst_name.clear();\n-\t\tproxy_base::close();\n-\t}\n+#if TORRENT_HAS_BINDTODEVICE\n+\t\t// try to use SO_BINDTODEVICE here, if that exists. If it fails,\n+\t\t// fall back to the mechanism we have below\n+\t\taux::bind_device(sock, device_name, ec);\n+\t\tif (ec)\n #endif\n+\t\t{\n+\t\t\tec.clear();\n+
    \t\t\tstd::vector<ip_interface> ifs = enum_net_interfaces(ios, ec);\n+
    \t\t\tif (ec) return bind_ep.address();\n \n-
    \ttemplate <class Handler>\n-
    \tvoid async_connect(endpoint_type const& endpoint, Handler handler)\n-\t{\n-\t\t// make sure we don't try to connect to INADDR_ANY. binding is fine,\n-\t\t// and using a hostname is fine on SOCKS version 5.\n-\t\tTORRENT_ASSERT(endpoint.address() != address()\n-\t\t\t|| (!m_dst_name.empty() && m_version == 5));\n-\n-\t\tm_remote_endpoint = endpoint;\n-\n-\t\t// the connect is split up in the following steps:\n-\t\t// 1. resolve name of proxy server\n-\t\t// 2. connect to proxy server\n-\t\t// 3. if version == 5:\n-\t\t// 3.1 send SOCKS5 authentication method message\n-\t\t// 3.2 read SOCKS5 authentication response\n-\t\t// 3.3 send username+password\n-\t\t// 4. send SOCKS command message\n-\n-\t\tADD_OUTSTANDING_ASYNC(\"socks5_stream::name_lookup\");\n-\t\tm_resolver.async_resolve(m_hostname, to_string(m_port).data(), wrap_allocator(\n-\t\t\t[this](error_code const& ec, tcp::resolver::results_type ips, Handler hn) {\n-\t\t\t\tname_lookup(ec, std::move(ips), std::move(hn));\n-\t\t\t}, std::move(handler)));\n-\t}\n+\t\t\tbool found = false;\n \n-private:\n+\t\t\tfor (auto const& iface : ifs)\n+\t\t\t{\n+\t\t\t\t// we're looking for a specific interface, and its address\n+\t\t\t\t// (which must be of the same family as the address we're\n+\t\t\t\t// connecting to)\n+\t\t\t\tif (std::strcmp(iface.name, device_name) != 0) continue;\n+\t\t\t\tif (iface.interface_address.is_v4() != (protocol == boost::asio::ip::tcp::v4()))\n+\t\t\t\t\tcontinue;\n \n-\ttemplate <typename Handler>\n-\tvoid name_lookup(error_code const& e, tcp::resolver::results_type ips\n-\t\t, Handler h)\n-
    relevance 2../include/libtorrent/piece_picker.hpp:668having 8 priority levels is probably excessive. It should probably be changed to 3 levels + dont-download

    having 8 priority levels is probably excessive. It should\n-probably be changed to 3 levels + dont-download

    ../include/libtorrent/piece_picker.hpp:668

    \t\t\t\telse if (state() == piece_full)\n-\t\t\t\t\t\tstate(piece_full_reverse);\n+\t\t\t\tbind_ep.address(iface.interface_address);\n+\t\t\t\tfound = true;\n+\t\t\t\tbreak;\n \t\t\t}\n \n-\t\t\t// the number of peers that has this piece\n-\t\t\t// (availability)\n-\t\t\tstd::uint32_t peer_count : 26;\n-\n-\t\t\t// one of the download_queue_t values. This indicates whether this piece\n-\t\t\t// is currently being downloaded or not, and what state it's in if\n-\t\t\t// it is. Specifically, as an optimization, pieces that have all blocks\n-\t\t\t// requested from them are separated out into separate lists to make\n-\t\t\t// lookups quicker. The main oddity is that whether a downloading piece\n-\t\t\t// has only been requested from peers that are reverse, that's\n-\t\t\t// recorded as piece_downloading_reverse, which really means the same\n-\t\t\t// as piece_downloading, it just saves space to also indicate that it\n-\t\t\t// has a bit lower priority. The reverse bit is only relevant if the\n-\t\t\t// state is piece_downloading.\n-\t\t\tstd::uint32_t download_state : 3;\n-\n-
    \n-
    \t\t\t// is 0 if the piece is filtered (not to be downloaded)\n-\t\t\t// 1 is low priority\n-\t\t\t// 2 is low priority\n-\t\t\t// 3 is mid priority\n-\t\t\t// 4 is default priority\n-\t\t\t// 5 is mid priority\n-\t\t\t// 6 is high priority\n-\t\t\t// 7 is high priority\n-\t\t\tstd::uint32_t piece_priority : 3;\n-\n-\t\t\t// index in to the piece_info vector\n-\t\t\tprio_index_t index;\n-\n-#ifdef TORRENT_DEBUG_REFCOUNTS\n-\t\t\t// all the peers that have this piece\n-\t\t\tstd::set<const torrent_peer*> have_peers;\n-#endif\n-\n-\t\t\t// index is set to this to indicate that we have the\n-\t\t\t// piece. There is no entry for the piece in the\n-\t\t\t// buckets if this is the case.\n-\t\t\tstatic constexpr prio_index_t we_have_index{-1};\n-\n-\t\t\t// the priority value that means the piece is filtered\n-\t\t\tstatic constexpr std::uint32_t filter_priority = 0;\n-\n-\t\t\t// the max number the peer count can hold\n-\t\t\tstatic constexpr std::uint32_t max_peer_count = 0xffff;\n+\t\t\tif (!found)\n+\t\t\t{\n+\t\t\t\tec = error_code(boost::system::errc::no_such_device, generic_category());\n+\t\t\t\treturn bind_ep.address();\n+\t\t\t}\n+\t\t}\n+\t\tsock.bind(bind_ep, ec);\n+\t\treturn bind_ep.address();\n+\t}\n \n-\t\t\tbool have() const { return index == we_have_index; }\n+\t// returns the device name whose local address is ``addr``. If\n+\t// no such device is found, an empty string is returned.\n
    relevance 2../include/libtorrent/aux_/chained_buffer.hpp:59this type should probably be renamed to send_buffer

    this type should probably be renamed to send_buffer

    ../include/libtorrent/aux_/chained_buffer.hpp:59

    #include \"libtorrent/aux_/buffer.hpp\"\n \n #include <deque>\n #include <vector>\n \n #include \"libtorrent/aux_/disable_warnings_push.hpp\"\n #include <boost/asio/buffer.hpp>\n@@ -4493,67 +4493,15 @@\n \t\tvirtual void remove_torrent(torrent_handle const& h, remove_flags_t options = {}) = 0;\n \t\tvirtual void remove_torrent_impl(std::shared_ptr<torrent> tptr, remove_flags_t options) = 0;\n \n \t\t// port filter\n \t\tvirtual port_filter const& get_port_filter() const = 0;\n \t\tvirtual void ban_ip(address addr) = 0;\n \n-
    relevance 1../src/session_impl.cpp:5707report the proper address of the router as the source IP of this vote of our external address, instead of the empty address

    report the proper address of the router as the source IP of\n-this vote of our external address, instead of the empty address

    ../src/session_impl.cpp:5707

    \t\t, listen_socket_handle const& ls)\n-\t{\n-\t\tTORRENT_ASSERT(is_single_thread());\n-\n-\t\tlisten_socket_t* listen_socket = ls.get();\n-\n-\t\t// NOTE: don't assume that if ec != 0, the rest of the logic\n-\t\t// is not necessary, the ports still need to be set, in other\n-\t\t// words, don't early return without careful review of the\n-\t\t// remaining logic\n-\t\tif (ec && m_alerts.should_post<portmap_error_alert>())\n-\t\t{\n-\t\t\tm_alerts.emplace_alert<portmap_error_alert>(mapping\n-\t\t\t\t, transport, ec, listen_socket ? listen_socket->local_endpoint.address() : address());\n-\t\t}\n-\n-\t\tif (!listen_socket) return;\n-\n-\t\tif (!ec && !external_ip.is_unspecified())\n-\t\t{\n-
    \t\t\tlisten_socket->external_address.cast_vote(external_ip, source_router, address());\n-
    \t\t}\n-\n-\t\t// need to check whether this mapping is for one of session ports (it could also be a user mapping)\n-\t\tif ((proto == portmap_protocol::tcp) && (listen_socket->tcp_port_mapping[transport].mapping == mapping))\n-\t\t\tlisten_socket->tcp_port_mapping[transport].port = port;\n-\t\telse if ((proto == portmap_protocol::udp) && (listen_socket->udp_port_mapping[transport].mapping == mapping))\n-\t\t\tlisten_socket->udp_port_mapping[transport].port = port;\n-\n-\t\tif (!ec && m_alerts.should_post<portmap_alert>())\n-\t\t{\n-\t\t\tm_alerts.emplace_alert<portmap_alert>(mapping, port\n-\t\t\t\t, transport, proto, listen_socket->local_endpoint.address());\n-\t\t}\n-\t}\n-\n-#if TORRENT_ABI_VERSION == 1\n-\tsession_status session_impl::status() const\n-\t{\n-//\t\tINVARIANT_CHECK;\n-\t\tTORRENT_ASSERT(is_single_thread());\n-\n-\t\tsession_status s;\n-\n-\t\ts.optimistic_unchoke_counter = m_optimistic_unchoke_time_scaler;\n-\t\ts.unchoke_counter = m_unchoke_time_scaler;\n-\t\ts.num_dead_peers = int(m_undead_peers.size());\n-\n-\t\ts.num_peers = int(m_stats_counters[counters::num_peers_connected]);\n-\t\ts.num_unchoked = int(m_stats_counters[counters::num_peers_up_unchoked_all]);\n-\t\ts.allowed_upload_slots = int(m_stats_counters[counters::num_unchoke_slots]);\n-
    relevance 1../src/torrent.cpp:1126make this depend on the error and on the filesystem the files are being downloaded to. If the error is no_space_left_on_device and the filesystem doesn't support sparse files, only zero the priorities of the pieces that are at the tails of all files, leaving everything up to the highest written piece in each file

    make this depend on the error and on the filesystem the\n+

    relevance 1../src/torrent.cpp:1126make this depend on the error and on the filesystem the files are being downloaded to. If the error is no_space_left_on_device and the filesystem doesn't support sparse files, only zero the priorities of the pieces that are at the tails of all files, leaving everything up to the highest written piece in each file

    make this depend on the error and on the filesystem the\n files are being downloaded to. If the error is no_space_left_on_device\n and the filesystem doesn't support sparse files, only zero the priorities\n of the pieces that are at the tails of all files, leaving everything\n up to the highest written piece in each file

    ../src/torrent.cpp:1126

    \n \t\t// notify the user of the error\n \t\tif (alerts().should_post<file_error_alert>())\n \t\t\talerts().emplace_alert<file_error_alert>(error.ec\n@@ -4600,15 +4548,15 @@\n \t\tpause();\n \t}\n \n \tvoid torrent::on_piece_fail_sync(piece_index_t const piece, piece_block) try\n \t{\n \t\tif (m_abort) return;\n \n-
    relevance 1../src/torrent.cpp:8398should disconnect all peers that have the pieces we have not just seeds. It would be pretty expensive to check all pieces for all peers though

    should disconnect all peers that have the pieces we have\n+

    relevance 1../src/torrent.cpp:8398should disconnect all peers that have the pieces we have not just seeds. It would be pretty expensive to check all pieces for all peers though

    should disconnect all peers that have the pieces we have\n not just seeds. It would be pretty expensive to check all pieces\n for all peers though

    ../src/torrent.cpp:8398

    \n \t\tset_state(torrent_status::finished);\n \t\tset_queue_position(no_pos);\n \n \t\tm_became_finished = aux::time_now32();\n \n@@ -4653,14 +4601,66 @@\n \t\t\t// we need to keep the object alive during this operation\n \t\t\tm_ses.disk_thread().async_release_files(m_storage\n \t\t\t\t, std::bind(&torrent::on_cache_flushed, shared_from_this(), false));\n \t\t\tm_ses.deferred_submit_jobs();\n \t\t}\n \n \t\t// this torrent just completed downloads, which means it will fall\n+
    relevance 1../src/session_impl.cpp:5707report the proper address of the router as the source IP of this vote of our external address, instead of the empty address

    report the proper address of the router as the source IP of\n+this vote of our external address, instead of the empty address

    ../src/session_impl.cpp:5707

    \t\t, listen_socket_handle const& ls)\n+\t{\n+\t\tTORRENT_ASSERT(is_single_thread());\n+\n+\t\tlisten_socket_t* listen_socket = ls.get();\n+\n+\t\t// NOTE: don't assume that if ec != 0, the rest of the logic\n+\t\t// is not necessary, the ports still need to be set, in other\n+\t\t// words, don't early return without careful review of the\n+\t\t// remaining logic\n+\t\tif (ec && m_alerts.should_post<portmap_error_alert>())\n+\t\t{\n+\t\t\tm_alerts.emplace_alert<portmap_error_alert>(mapping\n+\t\t\t\t, transport, ec, listen_socket ? listen_socket->local_endpoint.address() : address());\n+\t\t}\n+\n+\t\tif (!listen_socket) return;\n+\n+\t\tif (!ec && !external_ip.is_unspecified())\n+\t\t{\n+
    \t\t\tlisten_socket->external_address.cast_vote(external_ip, source_router, address());\n+
    \t\t}\n+\n+\t\t// need to check whether this mapping is for one of session ports (it could also be a user mapping)\n+\t\tif ((proto == portmap_protocol::tcp) && (listen_socket->tcp_port_mapping[transport].mapping == mapping))\n+\t\t\tlisten_socket->tcp_port_mapping[transport].port = port;\n+\t\telse if ((proto == portmap_protocol::udp) && (listen_socket->udp_port_mapping[transport].mapping == mapping))\n+\t\t\tlisten_socket->udp_port_mapping[transport].port = port;\n+\n+\t\tif (!ec && m_alerts.should_post<portmap_alert>())\n+\t\t{\n+\t\t\tm_alerts.emplace_alert<portmap_alert>(mapping, port\n+\t\t\t\t, transport, proto, listen_socket->local_endpoint.address());\n+\t\t}\n+\t}\n+\n+#if TORRENT_ABI_VERSION == 1\n+\tsession_status session_impl::status() const\n+\t{\n+//\t\tINVARIANT_CHECK;\n+\t\tTORRENT_ASSERT(is_single_thread());\n+\n+\t\tsession_status s;\n+\n+\t\ts.optimistic_unchoke_counter = m_optimistic_unchoke_time_scaler;\n+\t\ts.unchoke_counter = m_unchoke_time_scaler;\n+\t\ts.num_dead_peers = int(m_undead_peers.size());\n+\n+\t\ts.num_peers = int(m_stats_counters[counters::num_peers_connected]);\n+\t\ts.num_unchoked = int(m_stats_counters[counters::num_peers_up_unchoked_all]);\n+\t\ts.allowed_upload_slots = int(m_stats_counters[counters::num_unchoke_slots]);\n
    relevance 1../include/libtorrent/ip_voter.hpp:130have one instance per possible subnet, 192.168.x.x, 10.x.x.x, etc.

    have one instance per possible subnet, 192.168.x.x, 10.x.x.x, etc.

    ../include/libtorrent/ip_voter.hpp:130

    \t// stores one address for each combination of local/global and ipv4/ipv6\n \t// use of this class should be avoided, get the IP from the appropriate\n \t// listen interface wherever possible\n \tstruct TORRENT_EXTRA_EXPORT external_ip\n \t{\n \t\texternal_ip()\n \t\t\t: m_addresses{{address_v4(), address_v6()}, {address_v4(), address_v6()}}\n@@ -4679,138 +4679,67 @@\n \t\t// [n][0] = IPv4 [n][1] = IPv6\n 
    \t\taddress m_addresses[2][2];\n
    \t};\n \n }\n \n #endif\n-
    relevance 0../test/test_bloom_filter.cpp:135test size()

    test size()

    ../test/test_bloom_filter.cpp:135

    relevance 0../test/test_bloom_filter.cpp:136test clear()

    test clear()

    ../test/test_bloom_filter.cpp:136

    \tsha1_hash k(\"\\x01\\x00\\x02\\x00                \");\n-\tTEST_CHECK(!filter.find(k));\n-\tfilter.set(k);\n-\tTEST_CHECK(filter.find(k));\n-\n-\tstd::uint8_t compare[4] = { 0x16, 0xff, 0x55, 0xaa};\n-\n-\tbits_out = filter.to_string();\n-\tTEST_EQUAL(memcmp(compare, bits_out.c_str(), 4), 0);\n-}\n-\n-} // anonymous namespace\n+
    relevance 0../test/test_file_storage.cpp:1208test file attributes

    test file attributes

    ../test/test_file_storage.cpp:1208

    relevance 0../test/test_file_storage.cpp:1209test symlinks

    test symlinks

    ../test/test_file_storage.cpp:1209

    relevance 0../test/test_transfer.cpp:173these settings_pack tests belong in their own test

    these settings_pack tests belong in their own test

    ../test/test_transfer.cpp:173

    \t// to the time it will take to complete the test\n+\tpack.set_int(settings_pack::min_reconnect_time, 0);\n+\tpack.set_int(settings_pack::stop_tracker_timeout, 1);\n+\tpack.set_bool(settings_pack::announce_to_all_trackers, true);\n+\tpack.set_bool(settings_pack::announce_to_all_tiers, true);\n \n-TORRENT_TEST(bloom_filter)\n-{\n-\ttest_set_and_get();\n-\ttest_set_bits();\n-\ttest_count_zeroes();\n-\ttest_to_from_string();\n+\t// make sure we announce to both http and udp trackers\n+\tpack.set_bool(settings_pack::prefer_udp_trackers, false);\n+\tpack.set_bool(settings_pack::enable_outgoing_utp, false);\n+\tpack.set_bool(settings_pack::enable_incoming_utp, false);\n+\tpack.set_bool(settings_pack::enable_lsd, false);\n+\tpack.set_bool(settings_pack::enable_natpmp, false);\n+\tpack.set_bool(settings_pack::enable_upnp, false);\n+\tpack.set_bool(settings_pack::enable_dht, false);\n \n-
    }\n-
    relevance 0../test/test_file_storage.cpp:1208test file attributes

    test file attributes

    ../test/test_file_storage.cpp:1208

    relevance 0../test/test_file_storage.cpp:1209test symlinks

    test symlinks

    ../test/test_file_storage.cpp:1209

    relevance 0../test/test_flags.cpp:163change to a different test setup. currently always paused. test_set_after_add(torrent_flags::paused); test_unset_after_add(torrent_flags::paused);

    change to a different test setup. currently always paused.\n-test_set_after_add(torrent_flags::paused);\n-test_unset_after_add(torrent_flags::paused);

    ../test/test_flags.cpp:163

    {\n-\t// share-mode\n-\ttest_add_and_get_flags(torrent_flags::share_mode);\n-\ttest_set_after_add(torrent_flags::share_mode);\n-\ttest_unset_after_add(torrent_flags::share_mode);\n-}\n-#endif\n+\tpack.set_int(settings_pack::out_enc_policy, settings_pack::pe_disabled);\n+\tpack.set_int(settings_pack::in_enc_policy, settings_pack::pe_disabled);\n \n-TORRENT_TEST(flag_apply_ip_filter)\n-{\n-\t// apply-ip-filter\n-\ttest_add_and_get_flags(torrent_flags::apply_ip_filter);\n-\ttest_set_after_add(torrent_flags::apply_ip_filter);\n-\ttest_unset_after_add(torrent_flags::apply_ip_filter);\n-}\n+\tpack.set_bool(settings_pack::allow_multiple_connections_per_ip, false);\n \n-TORRENT_TEST(flag_paused)\n-{\n-\t// paused\n-\ttest_add_and_get_flags(torrent_flags::paused);\n-
    }\n-
    \n-TORRENT_TEST(flag_auto_managed)\n-{\n-\t// auto-managed\n-\ttest_add_and_get_flags(torrent_flags::auto_managed);\n-\ttest_set_after_add(torrent_flags::auto_managed);\n-\ttest_unset_after_add(torrent_flags::auto_managed);\n-}\n+
    \tpack.set_int(settings_pack::unchoke_slots_limit, 0);\n+
    \tses1.apply_settings(pack);\n+\tTEST_CHECK(ses1.get_settings().get_int(settings_pack::unchoke_slots_limit) == 0);\n \n-// super seeding mode is automatically turned off if we're not a seed\n-// since the posix_disk_io is not threaded, this will happen immediately\n-#if TORRENT_HAVE_MMAP\n-#ifndef TORRENT_DISABLE_SUPERSEEDING\n-TORRENT_TEST(flag_super_seeding)\n-{\n-\t// super-seeding\n-\ttest_add_and_get_flags(torrent_flags::super_seeding);\n-\ttest_unset_after_add(torrent_flags::super_seeding);\n-\ttest_set_after_add(torrent_flags::super_seeding);\n-}\n-#endif\n-#endif\n+\tpack.set_int(settings_pack::unchoke_slots_limit, -1);\n+\tses1.apply_settings(pack);\n+\tTEST_CHECK(ses1.get_settings().get_int(settings_pack::unchoke_slots_limit) == -1);\n \n-TORRENT_TEST(flag_sequential_download)\n-{\n-\t// sequential-download\n-\ttest_add_and_get_flags(torrent_flags::sequential_download);\n-\ttest_set_after_add(torrent_flags::sequential_download);\n-\ttest_unset_after_add(torrent_flags::sequential_download);\n-}\n-
    relevance 0../test/test_flags.cpp:205this test is flaky, since the torrent will become ready before asking for the flags, and by then stop_when_ready will have been cleared test_add_and_get_flags(torrent_flags::stop_when_ready); setting stop-when-ready when already stopped has no effect.

    this test is flaky, since the torrent will become ready before\n-asking for the flags, and by then stop_when_ready will have been cleared\n-test_add_and_get_flags(torrent_flags::stop_when_ready);\n-setting stop-when-ready when already stopped has no effect.

    ../test/test_flags.cpp:205

    relevance 0../test/test_flags.cpp:209change to a different test setup. currently always paused. test_set_after_add(torrent_flags::stop_when_ready);

    change to a different test setup. currently always paused.\n-test_set_after_add(torrent_flags::stop_when_ready);

    ../test/test_flags.cpp:209

    \ttest_set_after_add(torrent_flags::super_seeding);\n-}\n-#endif\n-#endif\n+\tpack.set_int(settings_pack::unchoke_slots_limit, 8);\n+\tses1.apply_settings(pack);\n+\tTEST_CHECK(ses1.get_settings().get_int(settings_pack::unchoke_slots_limit) == 8);\n \n-TORRENT_TEST(flag_sequential_download)\n-{\n-\t// sequential-download\n-\ttest_add_and_get_flags(torrent_flags::sequential_download);\n-\ttest_set_after_add(torrent_flags::sequential_download);\n-\ttest_unset_after_add(torrent_flags::sequential_download);\n-}\n+\tses2.apply_settings(pack);\n \n-// the stop when ready flag will be cleared when the torrent is ready to start\n-// downloading.\n-// since the posix_disk_io is not threaded, this will happen immediately\n-#if TORRENT_HAVE_MMAP\n-TORRENT_TEST(flag_stop_when_ready)\n-{\n-\t// stop-when-ready\n-
    \ttest_unset_after_add(torrent_flags::stop_when_ready);\n-
    }\n-#endif\n+\ttorrent_handle tor1;\n+\ttorrent_handle tor2;\n \n-TORRENT_TEST(flag_disable_dht)\n-{\n-\ttest_add_and_get_flags(torrent_flags::disable_dht);\n-\ttest_set_after_add(torrent_flags::disable_dht);\n-\ttest_unset_after_add(torrent_flags::disable_dht);\n-}\n+\tcreate_directory(\"tmp1_transfer\", ec);\n+\tstd::ofstream file(\"tmp1_transfer/temporary\");\n+\tstd::shared_ptr<torrent_info> t = ::create_torrent(&file, \"temporary\", 32 * 1024, 13, false);\n+\tfile.close();\n \n+\tTEST_CHECK(exists(combine_path(\"tmp1_transfer\", \"temporary\")));\n \n-TORRENT_TEST(flag_disable_lsd)\n-{\n-\ttest_add_and_get_flags(torrent_flags::disable_lsd);\n-\ttest_set_after_add(torrent_flags::disable_lsd);\n-\ttest_unset_after_add(torrent_flags::disable_lsd);\n-}\n+\tadd_torrent_params params;\n+\tparams.storage_mode = storage_mode;\n+\tparams.flags &= ~torrent_flags::paused;\n+\tparams.flags &= ~torrent_flags::auto_managed;\n \n-TORRENT_TEST(flag_disable_pex)\n-{\n-\ttest_add_and_get_flags(torrent_flags::disable_pex);\n-\ttest_set_after_add(torrent_flags::disable_pex);\n-\ttest_unset_after_add(torrent_flags::disable_pex);\n-}\n-
    relevance 0../test/test_dht.cpp:472check to make sure the \"best\" items are stored

    check to make sure the \"best\" items are stored

    ../test/test_dht.cpp:472

    \t\t\t, msg_args().target(items[j].target));\n+\twait_for_listen(ses1, \"ses1\");\n+\twait_for_listen(ses2, \"ses2\");\n+
    relevance 0../test/test_fast_extension.cpp:1135test sending invalid requests (out of bound piece index, offsets and sizes)

    test sending invalid requests (out of bound piece index, offsets and\n+sizes)

    ../test/test_fast_extension.cpp:1135

    relevance 0../test/test_dht.cpp:472check to make sure the \"best\" items are stored

    check to make sure the \"best\" items are stored

    ../test/test_dht.cpp:472

    \t\t\t, msg_args().target(items[j].target));\n \n \t\tkey_desc_t const desc[] =\n \t\t{\n \t\t\t{ \"r\", bdecode_node::dict_t, 0, key_desc_t::parse_children },\n \t\t\t\t{ \"v\", bdecode_node::dict_t, 0, 0},\n \t\t\t\t{ \"id\", bdecode_node::string_t, 20, key_desc_t::last_child},\n \t\t\t{ \"y\", bdecode_node::string_t, 1, 0},\n@@ -4853,15 +4782,15 @@\n }\n \n void put_mutable_item_data_cb(dht::item& i)\n {\n \tif (!i.empty())\n \t\tg_got_items.push_back(i);\n \n-
    relevance 0../test/test_dht.cpp:3223this won't work because the second node isn't pinged so it wont be added to the routing table

    this won't work because the second node isn't pinged so it wont\n+

    relevance 0../test/test_dht.cpp:3223this won't work because the second node isn't pinged so it wont be added to the routing table

    this won't work because the second node isn't pinged so it wont\n be added to the routing table

    ../test/test_dht.cpp:3223

    \tbool ret = verify_message(request, get_item_desc_ro, parsed, error_string);\n \n \tTEST_CHECK(ret);\n \tTEST_EQUAL(parsed[3].int_value(), 1);\n \n \t// should have one node now, which is 4.4.4.4:1234\n \tTEST_EQUAL(std::get<0>(node.size()), 1);\n@@ -4900,15 +4829,15 @@\n }\n \n #ifndef TORRENT_DISABLE_LOGGING\n // these tests rely on logging being enabled\n \n TORRENT_TEST(invalid_error_msg)\n {\n-
    relevance 0../test/test_dht.cpp:4081test obfuscated_get_peers

    test obfuscated_get_peers

    ../test/test_dht.cpp:4081

    \t\tTEST_CHECK(sm.has_quota());\n+
    relevance 0../test/test_dht.cpp:4081test obfuscated_get_peers

    test obfuscated_get_peers

    ../test/test_dht.cpp:4081

    \t\tTEST_CHECK(sm.has_quota());\n \t});\n }\n \n TORRENT_TEST(rate_limit_accrue_limit)\n {\n \taux::session_settings sett;\n \tsett.set_int(settings_pack::dht_upload_rate_limit, std::numeric_limits<int>::max());\n@@ -4929,15 +4858,15 @@\n TORRENT_TEST(dht)\n {\n \t// dummy dht test\n \tTEST_CHECK(true);\n }\n \n #endif\n-
    relevance 0../test/test_peer_list.cpp:1241test erasing peers

    test erasing peers

    ../test/test_peer_list.cpp:1241

    relevance 0../test/test_peer_list.cpp:1242test update_peer_port with allow_multiple_connections_per_ip and without

    test update_peer_port with allow_multiple_connections_per_ip and without

    ../test/test_peer_list.cpp:1242

    relevance 0../test/test_peer_list.cpp:1243test add i2p peers

    test add i2p peers

    ../test/test_peer_list.cpp:1243

    relevance 0../test/test_peer_list.cpp:1244test allow_i2p_mixed

    test allow_i2p_mixed

    ../test/test_peer_list.cpp:1244

    relevance 0../test/test_peer_list.cpp:1245test insert_peer failing with all error conditions

    test insert_peer failing with all error conditions

    ../test/test_peer_list.cpp:1245

    relevance 0../test/test_peer_list.cpp:1246test IPv6

    test IPv6

    ../test/test_peer_list.cpp:1246

    relevance 0../test/test_peer_list.cpp:1247test connect_to_peer() failing

    test connect_to_peer() failing

    ../test/test_peer_list.cpp:1247

    relevance 0../test/test_peer_list.cpp:1248test connection_closed

    test connection_closed

    ../test/test_peer_list.cpp:1248

    relevance 0../test/test_peer_list.cpp:1249connect candidates recalculation when incrementing failcount

    connect candidates recalculation when incrementing failcount

    ../test/test_peer_list.cpp:1249

    relevance 0../test/test_ssl.cpp:407test using a signed certificate with the wrong info-hash in DN

    test using a signed certificate with the wrong info-hash in DN

    ../test/test_ssl.cpp:407

    \t// in verifying peers\n+
    relevance 0../test/test_ssl.cpp:407test using a signed certificate with the wrong info-hash in DN

    test using a signed certificate with the wrong info-hash in DN

    ../test/test_ssl.cpp:407

    \t// in verifying peers\n \tctx.set_verify_mode(context::verify_none, ec);\n \tif (ec)\n \t{\n \t\tstd::printf(\"Failed to set SSL verify mode: %s\\n\"\n \t\t\t, ec.message().c_str());\n \t\tTEST_CHECK(!ec);\n \t\treturn false;\n@@ -4980,15 +4909,15 @@\n \t\tctx.use_private_key_file(private_key, context::pem, ec);\n \t\tif (ec)\n \t\t{\n \t\t\tstd::printf(\"Failed to set private key: %s\\n\"\n \t\t\t\t, ec.message().c_str());\n \t\t\tTEST_CHECK(!ec);\n \t\t\treturn false;\n-
    relevance 0../test/test_ssl.cpp:509also test using a hash that refers to a valid torrent but that differs from the SNI hash

    also test using a hash that refers to a valid torrent\n+

    relevance 0../test/test_ssl.cpp:509also test using a hash that refers to a valid torrent but that differs from the SNI hash

    also test using a hash that refers to a valid torrent\n but that differs from the SNI hash

    ../test/test_ssl.cpp:509

    \tprint_alerts(ses1, \"ses1\", true, true, &on_alert);\n \tif (ec)\n \t{\n \t\tstd::printf(\"Failed SSL handshake: %s\\n\"\n \t\t\t, ec.message().c_str());\n \t\treturn false;\n \t}\n@@ -5032,198 +4961,138 @@\n \t\treturn false;\n \t}\n \n \tif (memcmp(buf, \"\\x13\" \"BitTorrent protocol\", 20) != 0)\n \t{\n \t\tstd::printf(\"invalid bittorrent handshake\\n\");\n \t\treturn false;\n-
    relevance 0../test/test_transfer.cpp:173these settings_pack tests belong in their own test

    these settings_pack tests belong in their own test

    ../test/test_transfer.cpp:173

    \t// to the time it will take to complete the test\n-\tpack.set_int(settings_pack::min_reconnect_time, 0);\n-\tpack.set_int(settings_pack::stop_tracker_timeout, 1);\n-\tpack.set_bool(settings_pack::announce_to_all_trackers, true);\n-\tpack.set_bool(settings_pack::announce_to_all_tiers, true);\n-\n-\t// make sure we announce to both http and udp trackers\n-\tpack.set_bool(settings_pack::prefer_udp_trackers, false);\n-\tpack.set_bool(settings_pack::enable_outgoing_utp, false);\n-\tpack.set_bool(settings_pack::enable_incoming_utp, false);\n-\tpack.set_bool(settings_pack::enable_lsd, false);\n-\tpack.set_bool(settings_pack::enable_natpmp, false);\n-\tpack.set_bool(settings_pack::enable_upnp, false);\n-\tpack.set_bool(settings_pack::enable_dht, false);\n-\n-\tpack.set_int(settings_pack::out_enc_policy, settings_pack::pe_disabled);\n-\tpack.set_int(settings_pack::in_enc_policy, settings_pack::pe_disabled);\n-\n-\tpack.set_bool(settings_pack::allow_multiple_connections_per_ip, false);\n-\n-
    \tpack.set_int(settings_pack::unchoke_slots_limit, 0);\n-
    \tses1.apply_settings(pack);\n-\tTEST_CHECK(ses1.get_settings().get_int(settings_pack::unchoke_slots_limit) == 0);\n-\n-\tpack.set_int(settings_pack::unchoke_slots_limit, -1);\n-\tses1.apply_settings(pack);\n-\tTEST_CHECK(ses1.get_settings().get_int(settings_pack::unchoke_slots_limit) == -1);\n-\n-\tpack.set_int(settings_pack::unchoke_slots_limit, 8);\n-\tses1.apply_settings(pack);\n-\tTEST_CHECK(ses1.get_settings().get_int(settings_pack::unchoke_slots_limit) == 8);\n-\n-\tses2.apply_settings(pack);\n-\n-\ttorrent_handle tor1;\n-\ttorrent_handle tor2;\n-\n-\tcreate_directory(\"tmp1_transfer\", ec);\n-\tstd::ofstream file(\"tmp1_transfer/temporary\");\n-\tstd::shared_ptr<torrent_info> t = ::create_torrent(&file, \"temporary\", 32 * 1024, 13, false);\n-\tfile.close();\n-\n-\tTEST_CHECK(exists(combine_path(\"tmp1_transfer\", \"temporary\")));\n-\n-\tadd_torrent_params params;\n-\tparams.storage_mode = storage_mode;\n-\tparams.flags &= ~torrent_flags::paused;\n-\tparams.flags &= ~torrent_flags::auto_managed;\n-\n-\twait_for_listen(ses1, \"ses1\");\n-\twait_for_listen(ses2, \"ses2\");\n-
    relevance 0../test/test_timestamp_history.cpp:54test the case where we have > 120 samples (and have the base delay actually be updated)

    test the case where we have > 120 samples (and have the base delay actually be updated)

    ../test/test_timestamp_history.cpp:54

    relevance 0../test/test_timestamp_history.cpp:55test the case where a sample is lower than the history entry but not lower than the base

    test the case where a sample is lower than the history entry but not lower than the base

    ../test/test_timestamp_history.cpp:55

    #include \"libtorrent/aux_/timestamp_history.hpp\"\n+
    relevance 0../test/test_flags.cpp:163change to a different test setup. currently always paused. test_set_after_add(torrent_flags::paused); test_unset_after_add(torrent_flags::paused);

    change to a different test setup. currently always paused.\n+test_set_after_add(torrent_flags::paused);\n+test_unset_after_add(torrent_flags::paused);

    ../test/test_flags.cpp:163

    {\n+\t// share-mode\n+\ttest_add_and_get_flags(torrent_flags::share_mode);\n+\ttest_set_after_add(torrent_flags::share_mode);\n+\ttest_unset_after_add(torrent_flags::share_mode);\n+}\n+#endif\n \n-TORRENT_TEST(timestamp_history)\n+TORRENT_TEST(flag_apply_ip_filter)\n {\n-\tusing namespace lt;\n-\n-\taux::timestamp_history h;\n-\tTEST_EQUAL(h.add_sample(0x32, false), 0);\n-\tTEST_EQUAL(h.base(), 0x32);\n-\tTEST_EQUAL(h.add_sample(0x33, false), 0x1);\n-\tTEST_EQUAL(h.base(), 0x32);\n-\tTEST_EQUAL(h.add_sample(0x3433, false), 0x3401);\n-\tTEST_EQUAL(h.base(), 0x32);\n-\tTEST_EQUAL(h.add_sample(0x30, false), 0);\n-\tTEST_EQUAL(h.base(), 0x30);\n-\n-\t// test that wrapping of the timestamp is properly handled\n-\th.add_sample(0xfffffff3, false);\n-\tTEST_EQUAL(h.base(), 0xfffffff3);\n+\t// apply-ip-filter\n+\ttest_add_and_get_flags(torrent_flags::apply_ip_filter);\n+\ttest_set_after_add(torrent_flags::apply_ip_filter);\n+\ttest_unset_after_add(torrent_flags::apply_ip_filter);\n+}\n \n+TORRENT_TEST(flag_paused)\n+{\n+\t// paused\n+\ttest_add_and_get_flags(torrent_flags::paused);\n 
    }\n
    \n-
    relevance 0../test/test_torrent_info.cpp:459test remap_files

    test remap_files

    ../test/test_torrent_info.cpp:459

    relevance 0../test/test_torrent_info.cpp:460torrent with 'p' (padfile) attribute

    torrent with 'p' (padfile) attribute

    ../test/test_torrent_info.cpp:460

    relevance 0../test/test_torrent_info.cpp:461torrent with 'h' (hidden) attribute

    torrent with 'h' (hidden) attribute

    ../test/test_torrent_info.cpp:461

    relevance 0../test/test_torrent_info.cpp:462torrent with 'x' (executable) attribute

    torrent with 'x' (executable) attribute

    ../test/test_torrent_info.cpp:462

    relevance 0../test/test_torrent_info.cpp:463torrent with 'l' (symlink) attribute

    torrent with 'l' (symlink) attribute

    ../test/test_torrent_info.cpp:463

    relevance 0../test/test_torrent_info.cpp:464torrent with multiple trackers in multiple tiers, making sure we shuffle them (how do you test shuffling?, load it multiple times and make sure it's in different order at least once)

    torrent with multiple trackers in multiple tiers, making sure we\n-shuffle them (how do you test shuffling?, load it multiple times and make\n-sure it's in different order at least once)

    ../test/test_torrent_info.cpp:464

    relevance 0../test/test_torrent_info.cpp:467torrents with a zero-length name

    torrents with a zero-length name

    ../test/test_torrent_info.cpp:467

    relevance 0../test/test_torrent_info.cpp:468torrent with a non-dictionary info-section

    torrent with a non-dictionary info-section

    ../test/test_torrent_info.cpp:468

    relevance 0../test/test_torrent_info.cpp:469torrents with DHT nodes

    torrents with DHT nodes

    ../test/test_torrent_info.cpp:469

    relevance 0../test/test_torrent_info.cpp:470torrent with url-list as a single string

    torrent with url-list as a single string

    ../test/test_torrent_info.cpp:470

    relevance 0../test/test_torrent_info.cpp:471torrent with http seed as a single string

    torrent with http seed as a single string

    ../test/test_torrent_info.cpp:471

    relevance 0../test/test_torrent_info.cpp:472torrent with a comment

    torrent with a comment

    ../test/test_torrent_info.cpp:472

    relevance 0../test/test_torrent_info.cpp:473torrent with an SSL cert

    torrent with an SSL cert

    ../test/test_torrent_info.cpp:473

    relevance 0../test/test_torrent_info.cpp:474torrent with attributes (executable and hidden)

    torrent with attributes (executable and hidden)

    ../test/test_torrent_info.cpp:474

    relevance 0../test/test_torrent_info.cpp:475torrent_info constructor that takes an invalid bencoded buffer

    torrent_info constructor that takes an invalid bencoded buffer

    ../test/test_torrent_info.cpp:475

    relevance 0../test/test_torrent_info.cpp:476verify_encoding with a string that triggers character replacement

    verify_encoding with a string that triggers character replacement

    ../test/test_torrent_info.cpp:476

    \t{ \"v2_non_multiple_piece_layer.torrent\", errors::torrent_invalid_piece_layer},\n-\t{ \"v2_piece_layer_invalid_file_hash.torrent\", errors::torrent_invalid_piece_layer},\n-\t{ \"v2_invalid_piece_layer.torrent\", errors::torrent_invalid_piece_layer},\n-\t{ \"v2_invalid_piece_layer_root.torrent\", errors::torrent_invalid_piece_layer},\n-\t{ \"v2_unknown_piece_layer_entry.torrent\", errors::torrent_invalid_piece_layer},\n-\t{ \"v2_invalid_piece_layer_size.torrent\", errors::torrent_invalid_piece_layer},\n-\t{ \"v2_bad_file_alignment.torrent\", errors::torrent_inconsistent_files},\n-\t{ \"v2_unordered_files.torrent\", errors::invalid_bencoding},\n-\t{ \"v2_overlong_integer.torrent\", errors::invalid_bencoding},\n-\t{ \"v2_missing_file_root_invalid_symlink.torrent\", errors::torrent_missing_pieces_root},\n-\t{ \"v2_large_file.torrent\", errors::torrent_invalid_length},\n-\t{ \"v2_large_offset.torrent\", errors::too_many_pieces_in_torrent},\n-\t{ \"v2_piece_size.torrent\", errors::torrent_missing_piece_length},\n-\t{ \"v2_invalid_pad_file.torrent\", errors::torrent_invalid_pad_file},\n-\t{ \"v2_zero_root.torrent\", errors::torrent_missing_pieces_root},\n-\t{ \"v2_zero_root_small.torrent\", errors::torrent_missing_pieces_root},\n-};\n+TORRENT_TEST(flag_auto_managed)\n+{\n+\t// auto-managed\n+\ttest_add_and_get_flags(torrent_flags::auto_managed);\n+\ttest_set_after_add(torrent_flags::auto_managed);\n+\ttest_unset_after_add(torrent_flags::auto_managed);\n+}\n \n-} // anonymous namespace\n+// super seeding mode is automatically turned off if we're not a seed\n+// since the posix_disk_io is not threaded, this will happen immediately\n+#if TORRENT_HAVE_MMAP\n+#ifndef TORRENT_DISABLE_SUPERSEEDING\n+TORRENT_TEST(flag_super_seeding)\n+{\n+\t// super-seeding\n+\ttest_add_and_get_flags(torrent_flags::super_seeding);\n+\ttest_unset_after_add(torrent_flags::super_seeding);\n+\ttest_set_after_add(torrent_flags::super_seeding);\n+}\n+#endif\n+#endif\n \n-
    \n-
    TORRENT_TEST(add_tracker)\n+TORRENT_TEST(flag_sequential_download)\n {\n-\ttorrent_info ti(info_hash_t(sha1_hash(\" \")));\n-\tTEST_EQUAL(ti.trackers().size(), 0);\n+\t// sequential-download\n+\ttest_add_and_get_flags(torrent_flags::sequential_download);\n+\ttest_set_after_add(torrent_flags::sequential_download);\n+\ttest_unset_after_add(torrent_flags::sequential_download);\n+}\n+
    relevance 0../test/test_flags.cpp:205this test is flaky, since the torrent will become ready before asking for the flags, and by then stop_when_ready will have been cleared test_add_and_get_flags(torrent_flags::stop_when_ready); setting stop-when-ready when already stopped has no effect.

    this test is flaky, since the torrent will become ready before\n+asking for the flags, and by then stop_when_ready will have been cleared\n+test_add_and_get_flags(torrent_flags::stop_when_ready);\n+setting stop-when-ready when already stopped has no effect.

    ../test/test_flags.cpp:205

    relevance 0../test/test_flags.cpp:209change to a different test setup. currently always paused. test_set_after_add(torrent_flags::stop_when_ready);

    change to a different test setup. currently always paused.\n+test_set_after_add(torrent_flags::stop_when_ready);

    ../test/test_flags.cpp:209

    \ttest_set_after_add(torrent_flags::super_seeding);\n+}\n+#endif\n+#endif\n \n-\tti.add_tracker(\"http://test.com/announce\");\n-\tTEST_EQUAL(ti.trackers().size(), 1);\n+TORRENT_TEST(flag_sequential_download)\n+{\n+\t// sequential-download\n+\ttest_add_and_get_flags(torrent_flags::sequential_download);\n+\ttest_set_after_add(torrent_flags::sequential_download);\n+\ttest_unset_after_add(torrent_flags::sequential_download);\n+}\n \n-\tannounce_entry ae = ti.trackers()[0];\n-\tTEST_EQUAL(ae.url, \"http://test.com/announce\");\n+// the stop when ready flag will be cleared when the torrent is ready to start\n+// downloading.\n+// since the posix_disk_io is not threaded, this will happen immediately\n+#if TORRENT_HAVE_MMAP\n+TORRENT_TEST(flag_stop_when_ready)\n+{\n+\t// stop-when-ready\n+
    \ttest_unset_after_add(torrent_flags::stop_when_ready);\n+
    }\n+#endif\n \n-\tti.clear_trackers();\n-\tTEST_EQUAL(ti.trackers().size(), 0);\n+TORRENT_TEST(flag_disable_dht)\n+{\n+\ttest_add_and_get_flags(torrent_flags::disable_dht);\n+\ttest_set_after_add(torrent_flags::disable_dht);\n+\ttest_unset_after_add(torrent_flags::disable_dht);\n }\n \n-TORRENT_TEST(url_list_and_httpseeds)\n-{\n-\tentry info;\n-\tinfo[\"pieces\"] = \"aaaaaaaaaaaaaaaaaaaa\";\n-\tinfo[\"name.utf-8\"] = \"test1\";\n-\tinfo[\"name\"] = \"test__\";\n-\tinfo[\"piece length\"] = 16 * 1024;\n-\tinfo[\"length\"] = 3245;\n-\tentry::list_type l;\n-\tl.push_back(entry(\"http://foo.com/bar1\"));\n-\tl.push_back(entry(\"http://foo.com/bar1\"));\n-\tl.push_back(entry(\"http://foo.com/bar2\"));\n-\tentry const e(l);\n-\tentry torrent;\n-\ttorrent[\"url-list\"] = e;\n-
    relevance 0../test/test_tracker.cpp:60test scrape requests

    test scrape requests

    ../test/test_tracker.cpp:60

    relevance 0../test/test_tracker.cpp:61test parse peers6

    test parse peers6

    ../test/test_tracker.cpp:61

    relevance 0../test/test_tracker.cpp:62test parse tracker-id

    test parse tracker-id

    ../test/test_tracker.cpp:62

    relevance 0../test/test_tracker.cpp:63test parse failure-reason

    test parse failure-reason

    ../test/test_tracker.cpp:63

    relevance 0../test/test_tracker.cpp:64test all failure paths, including invalid bencoding not a dictionary no files entry in scrape response no info-hash entry in scrape response malformed peers in peer list of dictionaries uneven number of bytes in peers and peers6 string responses

    test all failure paths, including\n-invalid bencoding\n-not a dictionary\n-no files entry in scrape response\n-no info-hash entry in scrape response\n-malformed peers in peer list of dictionaries\n-uneven number of bytes in peers and peers6 string responses

    ../test/test_tracker.cpp:64

    #include \"test_utils.hpp\"\n-#include \"udp_tracker.hpp\"\n-#include \"settings.hpp\"\n-#include \"test_utils.hpp\"\n-#include \"libtorrent/alert.hpp\"\n-#include \"libtorrent/peer_info.hpp\" // for peer_list_entry\n-#include \"libtorrent/alert_types.hpp\"\n-#include \"libtorrent/session.hpp\"\n-#include \"libtorrent/session_params.hpp\"\n-#include \"libtorrent/error_code.hpp\"\n-#include \"libtorrent/tracker_manager.hpp\"\n-#include \"libtorrent/http_tracker_connection.hpp\" // for parse_tracker_response\n-#include \"libtorrent/torrent_info.hpp\"\n-#include \"libtorrent/announce_entry.hpp\"\n-#include \"libtorrent/torrent.hpp\"\n-#include \"libtorrent/aux_/path.hpp\"\n-#include \"libtorrent/socket_io.hpp\"\n \n-using namespace lt;\n+TORRENT_TEST(flag_disable_lsd)\n+{\n+\ttest_add_and_get_flags(torrent_flags::disable_lsd);\n+\ttest_set_after_add(torrent_flags::disable_lsd);\n+\ttest_unset_after_add(torrent_flags::disable_lsd);\n+}\n \n-
    \n-
    TORRENT_TEST(parse_hostname_peers)\n+TORRENT_TEST(flag_disable_pex)\n {\n-\tchar const response[] = \"d5:peersld7:peer id20:aaaaaaaaaaaaaaaaaaaa\"\n-\t\t\"2:ip13:test_hostname4:porti1000eed\"\n-\t\t\"7:peer id20:bbbbabaababababababa2:ip12:another_host4:porti1001eeee\";\n-\terror_code ec;\n-\ttracker_response resp = parse_tracker_response(response\n-\t\t, ec, {}, sha1_hash());\n+\ttest_add_and_get_flags(torrent_flags::disable_pex);\n+\ttest_set_after_add(torrent_flags::disable_pex);\n+\ttest_unset_after_add(torrent_flags::disable_pex);\n+}\n+
    relevance 0../test/test_bloom_filter.cpp:135test size()

    test size()

    ../test/test_bloom_filter.cpp:135

    relevance 0../test/test_bloom_filter.cpp:136test clear()

    test clear()

    ../test/test_bloom_filter.cpp:136

    \tsha1_hash k(\"\\x01\\x00\\x02\\x00                \");\n+\tTEST_CHECK(!filter.find(k));\n+\tfilter.set(k);\n+\tTEST_CHECK(filter.find(k));\n \n-\tTEST_EQUAL(ec, error_code());\n-\tTEST_EQUAL(resp.peers.size(), 2);\n-\tif (resp.peers.size() == 2)\n-\t{\n-\t\tpeer_entry const& e0 = resp.peers[0];\n-\t\tpeer_entry const& e1 = resp.peers[1];\n-\t\tTEST_EQUAL(e0.hostname, \"test_hostname\");\n-\t\tTEST_EQUAL(e0.port, 1000);\n-\t\tTEST_EQUAL(e0.pid, peer_id(\"aaaaaaaaaaaaaaaaaaaa\"));\n+\tstd::uint8_t compare[4] = { 0x16, 0xff, 0x55, 0xaa};\n \n-\t\tTEST_EQUAL(e1.hostname, \"another_host\");\n-\t\tTEST_EQUAL(e1.port, 1001);\n-\t\tTEST_EQUAL(e1.pid, peer_id(\"bbbbabaababababababa\"));\n-\t}\n+\tbits_out = filter.to_string();\n+\tTEST_EQUAL(memcmp(compare, bits_out.c_str(), 4), 0);\n }\n \n-TORRENT_TEST(parse_peers4)\n+} // anonymous namespace\n+\n+TORRENT_TEST(bloom_filter)\n {\n-\tchar const response[] = \"d5:peers12:\\x01\\x02\\x03\\x04\\x30\\x10\"\n-\t\t\"\\x09\\x08\\x07\\x06\\x20\\x10\" \"e\";\n-\terror_code ec;\n-
    relevance 0../test/test_resume.cpp:582test what happens when loading a resume file with both piece priorities and file priorities (file prio should take precedence)

    test what happens when loading a resume file with both piece priorities\n+\ttest_set_and_get();\n+\ttest_set_bits();\n+\ttest_count_zeroes();\n+\ttest_to_from_string();\n+\n+
    }\n+

    relevance 0../test/test_resume.cpp:582test what happens when loading a resume file with both piece priorities and file priorities (file prio should take precedence)

    test what happens when loading a resume file with both piece priorities\n and file priorities (file prio should take precedence)

    ../test/test_resume.cpp:582

    \t\t{\n \t\t\tTEST_EQUAL(pieces[i], true);\n \t\t}\n \t}\n }\n \n } // anonymous namespace\n@@ -5237,15 +5106,15 @@\n {\n \tsettings_pack sett = settings();\n \tsett.set_int(settings_pack::suggest_mode, settings_pack::suggest_read_cache);\n \ttest_piece_slots_seed(sett);\n }\n \n 
    \n-
    relevance 0../test/test_resume.cpp:585make sure a resume file only ever contain file priorities OR piece priorities. Never both.

    make sure a resume file only ever contain file priorities OR piece\n+

    relevance 0../test/test_resume.cpp:585make sure a resume file only ever contain file priorities OR piece priorities. Never both.

    make sure a resume file only ever contain file priorities OR piece\n priorities. Never both.

    ../test/test_resume.cpp:585

    \t\t\tTEST_EQUAL(pieces[i], true);\n \t\t}\n \t}\n }\n \n } // anonymous namespace\n \n@@ -5259,15 +5128,15 @@\n \tsettings_pack sett = settings();\n \tsett.set_int(settings_pack::suggest_mode, settings_pack::suggest_read_cache);\n \ttest_piece_slots_seed(sett);\n }\n \n \n 
    \n-
    relevance 0../test/test_resume.cpp:588generally save

    generally save

    ../test/test_resume.cpp:588

    \t\t}\n+
    relevance 0../test/test_resume.cpp:588generally save

    generally save

    ../test/test_resume.cpp:588

    \t\t}\n \t}\n }\n \n } // anonymous namespace\n \n TORRENT_TEST(piece_slots_seed)\n {\n@@ -5310,15 +5179,15 @@\n \tTEST_EQUAL(file_priorities[2], 3);\n }\n \n // if both resume data and add_torrent_params has file_priorities, the\n // add_torrent_params one take precedence\n TORRENT_TEST(file_priorities_in_resume_and_params_deprecated)\n {\n-
    relevance 0../test/test_resume.cpp:911test all other resume flags here too. This would require returning more than just the torrent_status from test_resume_flags. Also http seeds and trackers for instance

    test all other resume flags here too. This would require returning\n+

    relevance 0../test/test_resume.cpp:911test all other resume flags here too. This would require returning more than just the torrent_status from test_resume_flags. Also http seeds and trackers for instance

    test all other resume flags here too. This would require returning\n more than just the torrent_status from test_resume_flags. Also http seeds\n and trackers for instance

    ../test/test_resume.cpp:911

    \tTEST_EQUAL(s.connections_limit, 1345);\n \tTEST_EQUAL(s.uploads_limit, 1346);\n }\n \n TORRENT_TEST(paused_deprecated)\n {\n@@ -5363,15 +5232,15 @@\n \n TORRENT_TEST(resume_override_torrent_deprecated)\n {\n \t// resume data overrides the .torrent_file\n \tstd::printf(\"flags: no merge_resume_http_seed\\n\");\n \tlt::session ses(settings());\n \ttorrent_handle h = test_resume_flags(ses,\n-
    relevance 0../test/test_resume.cpp:1683test all other resume flags here too. This would require returning more than just the torrent_status from test_resume_flags. Also http seeds and trackers for instance

    test all other resume flags here too. This would require returning\n+

    relevance 0../test/test_resume.cpp:1683test all other resume flags here too. This would require returning more than just the torrent_status from test_resume_flags. Also http seeds and trackers for instance

    test all other resume flags here too. This would require returning\n more than just the torrent_status from test_resume_flags. Also http seeds\n and trackers for instance

    ../test/test_resume.cpp:1683

    \tTEST_EQUAL(s.connections_limit, 1345);\n \tTEST_EQUAL(s.uploads_limit, 1346);\n }\n \n TORRENT_TEST(paused)\n {\n@@ -5416,16 +5285,15 @@\n template <typename Fun>\n void test_unfinished_pieces(Fun f)\n {\n \t// create a torrent and complete files\n \tstd::shared_ptr<torrent_info> ti = generate_torrent(true, true);\n \n \tadd_torrent_params p;\n-
    relevance 0../test/test_fast_extension.cpp:1135test sending invalid requests (out of bound piece index, offsets and sizes)

    test sending invalid requests (out of bound piece index, offsets and\n-sizes)

    ../test/test_fast_extension.cpp:1135

    relevance 0../test/test_resolve_links.cpp:95test files with different piece size (negative test)

    test files with different piece size (negative test)

    ../test/test_resolve_links.cpp:95

    \t{ \"test2\", \"test1_pad_files\", 0},\n+
    relevance 0../test/test_resolve_links.cpp:95test files with different piece size (negative test)

    test files with different piece size (negative test)

    ../test/test_resolve_links.cpp:95

    \t{ \"test2\", \"test1_pad_files\", 0},\n \t{ \"test3\", \"test1_pad_files\", 0},\n \t{ \"test2\", \"test1_single\", 0},\n \n \t// these are all padded. The first small file will accidentally also\n \t// match, even though it's not tail padded, the following file is identical\n \t{ \"test2_pad_files\", \"test1_pad_files\", 2},\n \t{ \"test3_pad_files\", \"test1_pad_files\", 2},\n@@ -5439,15 +5307,15 @@\n \t{ \"test1_pad_files\", \"test1_single\", 0},\n \n \t// if it's padded on the other hand, it will work\n \t{ \"test1_pad_files\", \"test1_single_padded\", 1},\n \n 
    };\n
    \n-
    relevance 0../test/test_resolve_links.cpp:98it would be nice to test resolving of more than just 2 files as well. like 3 single file torrents merged into one, resolving all 3 files.

    it would be nice to test resolving of more than just 2 files as well.\n+

    relevance 0../test/test_resolve_links.cpp:98it would be nice to test resolving of more than just 2 files as well. like 3 single file torrents merged into one, resolving all 3 files.

    it would be nice to test resolving of more than just 2 files as well.\n like 3 single file torrents merged into one, resolving all 3 files.

    ../test/test_resolve_links.cpp:98

    \t{ \"test2\", \"test1_single\", 0},\n \n \t// these are all padded. The first small file will accidentally also\n \t// match, even though it's not tail padded, the following file is identical\n \t{ \"test2_pad_files\", \"test1_pad_files\", 2},\n \t{ \"test3_pad_files\", \"test1_pad_files\", 2},\n \t{ \"test3_pad_files\", \"test2_pad_files\", 2},\n@@ -5491,14 +5359,146 @@\n \t\tauto const num_matches = std::size_t(std::count_if(links.begin(), links.end()\n \t\t\t, std::bind(&resolve_links::link_t::ti, _1)));\n \n \t\t// some debug output in case the test fails\n \t\tif (num_matches > e.expected_matches)\n \t\t{\n \t\t\tfile_storage const& fs = ti1->files();\n+
    relevance 0../test/test_peer_list.cpp:1241test erasing peers

    test erasing peers

    ../test/test_peer_list.cpp:1241

    relevance 0../test/test_peer_list.cpp:1242test update_peer_port with allow_multiple_connections_per_ip and without

    test update_peer_port with allow_multiple_connections_per_ip and without

    ../test/test_peer_list.cpp:1242

    relevance 0../test/test_peer_list.cpp:1243test add i2p peers

    test add i2p peers

    ../test/test_peer_list.cpp:1243

    relevance 0../test/test_peer_list.cpp:1244test allow_i2p_mixed

    test allow_i2p_mixed

    ../test/test_peer_list.cpp:1244

    relevance 0../test/test_peer_list.cpp:1245test insert_peer failing with all error conditions

    test insert_peer failing with all error conditions

    ../test/test_peer_list.cpp:1245

    relevance 0../test/test_peer_list.cpp:1246test IPv6

    test IPv6

    ../test/test_peer_list.cpp:1246

    relevance 0../test/test_peer_list.cpp:1247test connect_to_peer() failing

    test connect_to_peer() failing

    ../test/test_peer_list.cpp:1247

    relevance 0../test/test_peer_list.cpp:1248test connection_closed

    test connection_closed

    ../test/test_peer_list.cpp:1248

    relevance 0../test/test_peer_list.cpp:1249connect candidates recalculation when incrementing failcount

    connect candidates recalculation when incrementing failcount

    ../test/test_peer_list.cpp:1249

    relevance 0../test/test_torrent_info.cpp:459test remap_files

    test remap_files

    ../test/test_torrent_info.cpp:459

    relevance 0../test/test_torrent_info.cpp:460torrent with 'p' (padfile) attribute

    torrent with 'p' (padfile) attribute

    ../test/test_torrent_info.cpp:460

    relevance 0../test/test_torrent_info.cpp:461torrent with 'h' (hidden) attribute

    torrent with 'h' (hidden) attribute

    ../test/test_torrent_info.cpp:461

    relevance 0../test/test_torrent_info.cpp:462torrent with 'x' (executable) attribute

    torrent with 'x' (executable) attribute

    ../test/test_torrent_info.cpp:462

    relevance 0../test/test_torrent_info.cpp:463torrent with 'l' (symlink) attribute

    torrent with 'l' (symlink) attribute

    ../test/test_torrent_info.cpp:463

    relevance 0../test/test_torrent_info.cpp:464torrent with multiple trackers in multiple tiers, making sure we shuffle them (how do you test shuffling?, load it multiple times and make sure it's in different order at least once)

    torrent with multiple trackers in multiple tiers, making sure we\n+shuffle them (how do you test shuffling?, load it multiple times and make\n+sure it's in different order at least once)

    ../test/test_torrent_info.cpp:464

    relevance 0../test/test_torrent_info.cpp:467torrents with a zero-length name

    torrents with a zero-length name

    ../test/test_torrent_info.cpp:467

    relevance 0../test/test_torrent_info.cpp:468torrent with a non-dictionary info-section

    torrent with a non-dictionary info-section

    ../test/test_torrent_info.cpp:468

    relevance 0../test/test_torrent_info.cpp:469torrents with DHT nodes

    torrents with DHT nodes

    ../test/test_torrent_info.cpp:469

    relevance 0../test/test_torrent_info.cpp:470torrent with url-list as a single string

    torrent with url-list as a single string

    ../test/test_torrent_info.cpp:470

    relevance 0../test/test_torrent_info.cpp:471torrent with http seed as a single string

    torrent with http seed as a single string

    ../test/test_torrent_info.cpp:471

    relevance 0../test/test_torrent_info.cpp:472torrent with a comment

    torrent with a comment

    ../test/test_torrent_info.cpp:472

    relevance 0../test/test_torrent_info.cpp:473torrent with an SSL cert

    torrent with an SSL cert

    ../test/test_torrent_info.cpp:473

    relevance 0../test/test_torrent_info.cpp:474torrent with attributes (executable and hidden)

    torrent with attributes (executable and hidden)

    ../test/test_torrent_info.cpp:474

    relevance 0../test/test_torrent_info.cpp:475torrent_info constructor that takes an invalid bencoded buffer

    torrent_info constructor that takes an invalid bencoded buffer

    ../test/test_torrent_info.cpp:475

    relevance 0../test/test_torrent_info.cpp:476verify_encoding with a string that triggers character replacement

    verify_encoding with a string that triggers character replacement

    ../test/test_torrent_info.cpp:476

    \t{ \"v2_non_multiple_piece_layer.torrent\", errors::torrent_invalid_piece_layer},\n+\t{ \"v2_piece_layer_invalid_file_hash.torrent\", errors::torrent_invalid_piece_layer},\n+\t{ \"v2_invalid_piece_layer.torrent\", errors::torrent_invalid_piece_layer},\n+\t{ \"v2_invalid_piece_layer_root.torrent\", errors::torrent_invalid_piece_layer},\n+\t{ \"v2_unknown_piece_layer_entry.torrent\", errors::torrent_invalid_piece_layer},\n+\t{ \"v2_invalid_piece_layer_size.torrent\", errors::torrent_invalid_piece_layer},\n+\t{ \"v2_bad_file_alignment.torrent\", errors::torrent_inconsistent_files},\n+\t{ \"v2_unordered_files.torrent\", errors::invalid_bencoding},\n+\t{ \"v2_overlong_integer.torrent\", errors::invalid_bencoding},\n+\t{ \"v2_missing_file_root_invalid_symlink.torrent\", errors::torrent_missing_pieces_root},\n+\t{ \"v2_large_file.torrent\", errors::torrent_invalid_length},\n+\t{ \"v2_large_offset.torrent\", errors::too_many_pieces_in_torrent},\n+\t{ \"v2_piece_size.torrent\", errors::torrent_missing_piece_length},\n+\t{ \"v2_invalid_pad_file.torrent\", errors::torrent_invalid_pad_file},\n+\t{ \"v2_zero_root.torrent\", errors::torrent_missing_pieces_root},\n+\t{ \"v2_zero_root_small.torrent\", errors::torrent_missing_pieces_root},\n+};\n+\n+} // anonymous namespace\n+\n+
    \n+
    TORRENT_TEST(add_tracker)\n+{\n+\ttorrent_info ti(info_hash_t(sha1_hash(\" \")));\n+\tTEST_EQUAL(ti.trackers().size(), 0);\n+\n+\tti.add_tracker(\"http://test.com/announce\");\n+\tTEST_EQUAL(ti.trackers().size(), 1);\n+\n+\tannounce_entry ae = ti.trackers()[0];\n+\tTEST_EQUAL(ae.url, \"http://test.com/announce\");\n+\n+\tti.clear_trackers();\n+\tTEST_EQUAL(ti.trackers().size(), 0);\n+}\n+\n+TORRENT_TEST(url_list_and_httpseeds)\n+{\n+\tentry info;\n+\tinfo[\"pieces\"] = \"aaaaaaaaaaaaaaaaaaaa\";\n+\tinfo[\"name.utf-8\"] = \"test1\";\n+\tinfo[\"name\"] = \"test__\";\n+\tinfo[\"piece length\"] = 16 * 1024;\n+\tinfo[\"length\"] = 3245;\n+\tentry::list_type l;\n+\tl.push_back(entry(\"http://foo.com/bar1\"));\n+\tl.push_back(entry(\"http://foo.com/bar1\"));\n+\tl.push_back(entry(\"http://foo.com/bar2\"));\n+\tentry const e(l);\n+\tentry torrent;\n+\ttorrent[\"url-list\"] = e;\n+
    relevance 0../test/test_tracker.cpp:60test scrape requests

    test scrape requests

    ../test/test_tracker.cpp:60

    relevance 0../test/test_tracker.cpp:61test parse peers6

    test parse peers6

    ../test/test_tracker.cpp:61

    relevance 0../test/test_tracker.cpp:62test parse tracker-id

    test parse tracker-id

    ../test/test_tracker.cpp:62

    relevance 0../test/test_tracker.cpp:63test parse failure-reason

    test parse failure-reason

    ../test/test_tracker.cpp:63

    relevance 0../test/test_tracker.cpp:64test all failure paths, including invalid bencoding not a dictionary no files entry in scrape response no info-hash entry in scrape response malformed peers in peer list of dictionaries uneven number of bytes in peers and peers6 string responses

    test all failure paths, including\n+invalid bencoding\n+not a dictionary\n+no files entry in scrape response\n+no info-hash entry in scrape response\n+malformed peers in peer list of dictionaries\n+uneven number of bytes in peers and peers6 string responses

    ../test/test_tracker.cpp:64

    #include \"test_utils.hpp\"\n+#include \"udp_tracker.hpp\"\n+#include \"settings.hpp\"\n+#include \"test_utils.hpp\"\n+#include \"libtorrent/alert.hpp\"\n+#include \"libtorrent/peer_info.hpp\" // for peer_list_entry\n+#include \"libtorrent/alert_types.hpp\"\n+#include \"libtorrent/session.hpp\"\n+#include \"libtorrent/session_params.hpp\"\n+#include \"libtorrent/error_code.hpp\"\n+#include \"libtorrent/tracker_manager.hpp\"\n+#include \"libtorrent/http_tracker_connection.hpp\" // for parse_tracker_response\n+#include \"libtorrent/torrent_info.hpp\"\n+#include \"libtorrent/announce_entry.hpp\"\n+#include \"libtorrent/torrent.hpp\"\n+#include \"libtorrent/aux_/path.hpp\"\n+#include \"libtorrent/socket_io.hpp\"\n+\n+using namespace lt;\n+\n+
    \n+
    TORRENT_TEST(parse_hostname_peers)\n+{\n+\tchar const response[] = \"d5:peersld7:peer id20:aaaaaaaaaaaaaaaaaaaa\"\n+\t\t\"2:ip13:test_hostname4:porti1000eed\"\n+\t\t\"7:peer id20:bbbbabaababababababa2:ip12:another_host4:porti1001eeee\";\n+\terror_code ec;\n+\ttracker_response resp = parse_tracker_response(response\n+\t\t, ec, {}, sha1_hash());\n+\n+\tTEST_EQUAL(ec, error_code());\n+\tTEST_EQUAL(resp.peers.size(), 2);\n+\tif (resp.peers.size() == 2)\n+\t{\n+\t\tpeer_entry const& e0 = resp.peers[0];\n+\t\tpeer_entry const& e1 = resp.peers[1];\n+\t\tTEST_EQUAL(e0.hostname, \"test_hostname\");\n+\t\tTEST_EQUAL(e0.port, 1000);\n+\t\tTEST_EQUAL(e0.pid, peer_id(\"aaaaaaaaaaaaaaaaaaaa\"));\n+\n+\t\tTEST_EQUAL(e1.hostname, \"another_host\");\n+\t\tTEST_EQUAL(e1.port, 1001);\n+\t\tTEST_EQUAL(e1.pid, peer_id(\"bbbbabaababababababa\"));\n+\t}\n+}\n+\n+TORRENT_TEST(parse_peers4)\n+{\n+\tchar const response[] = \"d5:peers12:\\x01\\x02\\x03\\x04\\x30\\x10\"\n+\t\t\"\\x09\\x08\\x07\\x06\\x20\\x10\" \"e\";\n+\terror_code ec;\n+
    relevance 0../test/test_timestamp_history.cpp:54test the case where we have > 120 samples (and have the base delay actually be updated)

    test the case where we have > 120 samples (and have the base delay actually be updated)

    ../test/test_timestamp_history.cpp:54

    relevance 0../test/test_timestamp_history.cpp:55test the case where a sample is lower than the history entry but not lower than the base

    test the case where a sample is lower than the history entry but not lower than the base

    ../test/test_timestamp_history.cpp:55

    #include \"libtorrent/aux_/timestamp_history.hpp\"\n+\n+TORRENT_TEST(timestamp_history)\n+{\n+\tusing namespace lt;\n+\n+\taux::timestamp_history h;\n+\tTEST_EQUAL(h.add_sample(0x32, false), 0);\n+\tTEST_EQUAL(h.base(), 0x32);\n+\tTEST_EQUAL(h.add_sample(0x33, false), 0x1);\n+\tTEST_EQUAL(h.base(), 0x32);\n+\tTEST_EQUAL(h.add_sample(0x3433, false), 0x3401);\n+\tTEST_EQUAL(h.base(), 0x32);\n+\tTEST_EQUAL(h.add_sample(0x30, false), 0);\n+\tTEST_EQUAL(h.base(), 0x30);\n+\n+\t// test that wrapping of the timestamp is properly handled\n+\th.add_sample(0xfffffff3, false);\n+\tTEST_EQUAL(h.base(), 0xfffffff3);\n+\n+
    }\n+
    \n
    relevance 0../test/test_upnp.cpp:156store the log and verify that some key messages are there

    store the log and verify that some key messages are there

    ../test/test_upnp.cpp:156

    \t\t\t, portmap_protocol const protocol, error_code const& err\n \t\t\t, portmap_transport, aux::listen_socket_handle const&) override\n \t\t{\n \t\t\tcallback_info info = {mapping, port, err};\n \t\t\tcallbacks.push_back(info);\n \t\t\tstd::cout << \"mapping: \" << static_cast<int>(mapping)\n \t\t\t\t<< \", port: \" << port << \", IP: \" << ip\n@@ -5614,190 +5614,1300 @@\n \tfor (int i = 127; i < 127 + 4; ++i)\n \t\tTEST_CHECK(t[i] == f[i]);\n \n \tTEST_CHECK(t.verified_leafs() == none_set(num_blocks));\n }\n \n 
    \n-
    relevance 0../src/udp_tracker_connection.cpp:633why is this a linked list?

    why is this a linked list?

    ../src/udp_tracker_connection.cpp:633

    \t\t\t\tipv6_peer_entry e{};\n-\t\t\t\tstd::memcpy(e.ip.data(), buf.data(), 16);\n-\t\t\t\tbuf = buf.subspan(16);\n-\t\t\t\te.port = aux::read_uint16(buf);\n-\t\t\t\tresp.peers6.push_back(e);\n-\t\t\t}\n-\t\t}\n-\t\telse\n-\t\t{\n-\t\t\tresp.peers4.reserve(static_cast<std::size_t>(num_peers));\n-\t\t\tfor (int i = 0; i < num_peers; ++i)\n-\t\t\t{\n-\t\t\t\tipv4_peer_entry e{};\n-\t\t\t\tstd::memcpy(e.ip.data(), buf.data(), 4);\n-\t\t\t\tbuf = buf.subspan(4);\n-\t\t\t\te.port = aux::read_uint16(buf);\n-\t\t\t\tresp.peers4.push_back(e);\n-\t\t\t}\n-\t\t}\n-\n-
    \t\tstd::list<address> ip_list;\n-
    \t\tstd::transform(m_endpoints.begin(), m_endpoints.end(), std::back_inserter(ip_list)\n-\t\t\t, [](tcp::endpoint const& ep) { return ep.address(); } );\n-\n-\t\tcb->tracker_response(tracker_req(), m_target.address(), ip_list, resp);\n+
    relevance 0../src/torrent_peer.cpp:192how do we deal with our external address changing?

    how do we deal with our external address changing?

    ../src/torrent_peer.cpp:192

    \t\t// connections. If it fails, we'll\n+\t\t// retry with encryption\n+\t\t, pe_support(false)\n+#endif\n+\t\t, is_v6_addr(false)\n+#if TORRENT_USE_I2P\n+\t\t, is_i2p_addr(false)\n+#endif\n+\t\t, on_parole(false)\n+\t\t, banned(false)\n+\t\t, supports_utp(true) // assume peers support utp\n+\t\t, confirmed_supports_utp(false)\n+\t\t, supports_holepunch(false)\n+\t\t, web_seed(false)\n+\t\t, protocol_v2(false)\n+\t{}\n \n-\t\tclose();\n-\t\treturn true;\n+\tstd::uint32_t torrent_peer::rank(external_ip const& external, int external_port) const\n+\t{\n+\t\tTORRENT_ASSERT(in_use);\n+
    \t\tif (peer_rank == 0)\n+
    \t\t\tpeer_rank = peer_priority(\n+\t\t\t\ttcp::endpoint(external.external_address(this->address()), std::uint16_t(external_port))\n+\t\t\t\t, tcp::endpoint(this->address(), this->port));\n+\t\treturn peer_rank;\n \t}\n \n-\tbool udp_tracker_connection::on_scrape_response(span<char const> buf)\n+#ifndef TORRENT_DISABLE_LOGGING\n+\tstd::string torrent_peer::to_string() const\n \t{\n-\t\trestart_read_timeout();\n-\t\tauto const action = static_cast<action_t>(aux::read_int32(buf));\n-\t\tstd::uint32_t const transaction = aux::read_uint32(buf);\n+\t\tTORRENT_ASSERT(in_use);\n+#if TORRENT_USE_I2P\n+\t\tif (is_i2p_addr) return dest().to_string();\n+#endif // TORRENT_USE_I2P\n+\t\treturn address().to_string();\n+\t}\n+#endif\n \n-\t\tif (transaction != m_transaction_id)\n+\tstd::int64_t torrent_peer::total_download() const\n+\t{\n+\t\tTORRENT_ASSERT(in_use);\n+\t\tif (connection != nullptr)\n \t\t{\n-\t\t\tfail(error_code(errors::invalid_tracker_transaction_id), operation_t::bittorrent);\n-\t\t\treturn false;\n+\t\t\tTORRENT_ASSERT(prev_amount_download == 0);\n+\t\t\treturn connection->statistics().total_payload_download();\n \t\t}\n-\n-\t\tif (action == action_t::error)\n+\t\telse\n \t\t{\n-\t\t\tfail(error_code(errors::tracker_failure), operation_t::bittorrent\n-\t\t\t\t, std::string(buf.data(), static_cast<std::size_t>(buf.size())).c_str());\n-\t\t\treturn true;\n+\t\t\treturn std::int64_t(prev_amount_download) << 10;\n \t\t}\n-\n-\t\tif (action != action_t::scrape)\n-\t\t{\n-
    relevance 0../src/merkle_tree.cpp:110in C++20, use std::identity

    in C++20, use std::identity

    ../src/merkle_tree.cpp:110

    \t\tallocate_full();\n-\n-\t\tmerkle_validate_copy(t, m_tree, root(), m_block_verified);\n-\n-\t\tload_verified_bits(verified);\n-\n-\t\toptimize_storage();\n-\t\toptimize_storage_piece_layer();\n \t}\n+
    relevance 0../src/magnet_uri.cpp:439what's the right number here?

    what's the right number here?

    ../src/magnet_uri.cpp:439

    \t\t\t}\n+\t\t\telse if (string_equal_no_case(name, \"so\"_sv)) // select-only (files)\n+\t\t\t{\n+\t\t\t\t// accept only digits, '-' and ','\n+\t\t\t\tif (std::any_of(value.begin(), value.end(), [](char c)\n+\t\t\t\t\t{ return !is_digit(c) && c != '-' && c != ','; }))\n+\t\t\t\t\tcontinue;\n \n-\tvoid merkle_tree::clear()\n-\t{\n-\t\tm_tree.clear();\n-\t\tm_tree.shrink_to_fit();\n-\t\tm_block_verified.clear();\n-\t\tm_mode = mode_t::empty_tree;\n-\t}\n+\t\t\t\t// make sure all file priorities are set to 0, except the ones\n+\t\t\t\t// we specify in the file_priorities\n+\t\t\t\tp.flags |= torrent_flags::default_dont_download;\n \n-namespace {\n+\t\t\t\tdo\n+\t\t\t\t{\n+\t\t\t\t\tstring_view token;\n+\t\t\t\t\tstd::tie(token, value) = split_string(value, ',');\n \n-
    \tstruct identity\n-
    \t{\n-\t\tbool operator()(bool b) const { return b; }\n-\t};\n-}\n+\t\t\t\t\tif (token.empty()) continue;\n \n-\tvoid merkle_tree::load_sparse_tree(span<sha256_hash const> t\n-\t\t, std::vector<bool> const& mask\n-\t\t, std::vector<bool> const& verified)\n-\t{\n-\t\tINVARIANT_CHECK;\n-\t\tTORRENT_ASSERT(mask.size() == size());\n-\t\tif (size() != mask.size()) return;\n+\t\t\t\t\tint idx1, idx2;\n+
    \t\t\t\t\tconstexpr int max_index = 10000; // can't risk out of memory\n+
    \n+\t\t\t\t\tauto const divider = token.find_first_of('-');\n+\t\t\t\t\tif (divider != std::string::npos) // it's a range\n+\t\t\t\t\t{\n+\t\t\t\t\t\tif (divider == 0) // no start index\n+\t\t\t\t\t\t\tcontinue;\n+\t\t\t\t\t\tif (divider == token.size() - 1) // no end index\n+\t\t\t\t\t\t\tcontinue;\n \n-\t\tint const first_block = block_layer_start();\n-\t\tint const end_block = first_block + m_num_blocks;\n+\t\t\t\t\t\tidx1 = std::atoi(token.substr(0, divider).to_string().c_str());\n+\t\t\t\t\t\tif (idx1 < 0 || idx1 > max_index) // invalid index\n+\t\t\t\t\t\t\tcontinue;\n+\t\t\t\t\t\tidx2 = std::atoi(token.substr(divider + 1).to_string().c_str());\n+\t\t\t\t\t\tif (idx2 < 0 || idx2 > max_index) // invalid index\n+\t\t\t\t\t\t\tcontinue;\n \n-\t\tTORRENT_ASSERT(first_block < int(mask.size()));\n-\t\tTORRENT_ASSERT(end_block <= int(mask.size()));\n+\t\t\t\t\t\tif (idx1 > idx2) // wrong range limits\n+\t\t\t\t\t\t\tcontinue;\n+\t\t\t\t\t}\n+\t\t\t\t\telse // it's an index\n+\t\t\t\t\t{\n+\t\t\t\t\t\tidx1 = std::atoi(token.to_string().c_str());\n+\t\t\t\t\t\tif (idx1 < 0 || idx1 > max_index) // invalid index\n+\t\t\t\t\t\t\tcontinue;\n+\t\t\t\t\t\tidx2 = idx1;\n+\t\t\t\t\t}\n \n-\t\t// if the mask covers all blocks, go straight to block_layer\n-\t\t// mode, and validate\n-\t\tif (std::all_of(mask.begin() + first_block, mask.begin() + end_block, identity()))\n-\t\t{\n-\t\t\t// the index in t that points to first_block\n-\t\t\tauto const block_index = std::count_if(mask.begin(), mask.begin() + first_block, identity());\n+\t\t\t\t\tif (int(p.file_priorities.size()) <= idx2)\n+\t\t\t\t\t\tp.file_priorities.resize(static_cast<std::size_t>(idx2) + 1, dont_download);\n \n-\t\t\t// discrepancy\n-\t\t\tif (t.size() < block_index + m_num_blocks)\n-\t\t\t\treturn clear();\n+
    relevance 0../src/random.cpp:141improve calling RAND_bytes multiple times, using fallback for now

    improve calling RAND_bytes multiple times, using fallback for now

    ../src/random.cpp:141

    #else\n+\t\t\tstd::generate(buffer.begin(), buffer.end(), [] { return char(random(0xff)); });\n+#endif\n+\t\t}\n \n-
    relevance 0../src/merkle_tree.cpp:319this can be optimized by using m_tree as storage to fill this tree into, and then clear it if the hashes fail

    this can be optimized by using m_tree as storage to fill this\n-tree into, and then clear it if the hashes fail

    ../src/merkle_tree.cpp:319

    \t{\n-\t\tINVARIANT_CHECK;\n+\t\tvoid crypto_random_bytes(span<char> buffer)\n+\t\t{\n+#ifdef TORRENT_BUILD_SIMULATOR\n+\t\t\t// In the simulator we want deterministic random numbers\n+\t\t\tstd::generate(buffer.begin(), buffer.end(), [] { return char(random(0xff)); });\n+#elif TORRENT_USE_CNG\n+\t\t\taux::cng_gen_random(buffer);\n+#elif TORRENT_USE_CRYPTOAPI\n+\t\t\t// windows\n+\t\t\taux::crypt_gen_random(buffer);\n+#elif defined TORRENT_USE_LIBCRYPTO && !defined TORRENT_USE_WOLFSSL\n+// wolfSSL uses wc_RNG_GenerateBlock as the internal function for the\n+// openssl compatibility layer. This function API does not support\n+// an arbitrary buffer size (openssl does), it is limited by the\n+// constant RNG_MAX_BLOCK_LEN.\n+
    \n+
    \t\t\t// openssl\n+\t\t\tint r = RAND_bytes(reinterpret_cast<unsigned char*>(buffer.data())\n+\t\t\t\t, int(buffer.size()));\n+\t\t\tif (r != 1) aux::throw_ex<system_error>(errors::no_entropy);\n+#elif TORRENT_USE_GETRANDOM\n+\t\t\tssize_t const r = ::getrandom(buffer.data(), static_cast<std::size_t>(buffer.size()), 0);\n+\t\t\tif (r == ssize_t(buffer.size())) return;\n+\t\t\tif (r == -1 && errno != ENOSYS) aux::throw_ex<system_error>(error_code(errno, generic_category()));\n+\t\t\tstatic dev_random dev;\n+\t\t\tdev.read(buffer);\n+#elif TORRENT_USE_DEV_RANDOM\n+\t\t\tstatic dev_random dev;\n+\t\t\tdev.read(buffer);\n+#else\n \n-\t\t// as we set the hashes of interior nodes, we may be able to validate\n-\t\t// block hashes that we had since earlier. Any blocks that can be\n-\t\t// validated, and failed, are added to this list\n-\t\tadd_hashes_result_t ret;\n+#if TORRENT_BROKEN_RANDOM_DEVICE\n+\t\t\t// even pseudo random numbers rely on being able to seed the random\n+\t\t\t// generator\n+#error \"no entropy source available\"\n+#else\n+#ifdef TORRENT_I_WANT_INSECURE_RANDOM_NUMBERS\n+\t\t\tstd::generate(buffer.begin(), buffer.end(), [] { return char(random(0xff)); });\n+#else\n+#error \"no secure entropy source available. If you really want insecure random numbers, define TORRENT_I_WANT_INSECURE_RANDOM_NUMBERS\"\n+#endif\n+#endif\n \n-\t\t// we already have all hashes\n-\t\tif (m_mode == mode_t::block_layer)\n-\t\t{\n-\t\t\t// since we're already on the block layer mode, we have the whole\n-\t\t\t// tree, and we've already reported any pieces as passing that may\n-\t\t\t// have existed in the tree when we completed it. At this point no\n-\t\t\t// more pieces should be reported as passed\n-\t\t\treturn ret;\n+#endif\n \t\t}\n+}\n+
    relevance 0../src/hash_picker.cpp:309use structured bindings in C++17

    use structured bindings in C++17

    ../src/hash_picker.cpp:309

    \t\t, int const offset, sha256_hash const& h)\n+\t{\n+\t\tTORRENT_ASSERT(offset >= 0);\n+\t\tauto const f = m_files.file_index_at_piece(piece);\n \n-\t\tallocate_full();\n+\t\tif (m_files.pad_file_at(f))\n+\t\t\treturn { set_block_hash_result::result::success, 0, 0 };\n \n-
    \t\tint const leaf_count = merkle_num_leafs(int(hashes.size()));\n-
    \t\taux::vector<sha256_hash> tree(merkle_num_nodes(leaf_count));\n-\t\tstd::copy(hashes.begin(), hashes.end(), tree.end() - leaf_count);\n+\t\tauto& merkle_tree = m_merkle_trees[f];\n+\t\tpiece_index_t const file_first_piece = m_files.piece_index_at_file(f);\n+\t\tstd::int64_t const block_offset = static_cast<int>(piece) * std::int64_t(m_files.piece_length())\n+\t\t\t+ offset - m_files.file_offset(f);\n+\t\tint const block_index = aux::numeric_cast<int>(block_offset / default_block_size);\n \n-\t\t// the end of a file is a special case, we may need to pad the leaf layer\n-\t\tif (leaf_count > hashes.size())\n+\t\tif (h.is_all_zeros())\n \t\t{\n-\t\t\tint const leaf_layer_size = num_leafs();\n-\t\t\t// assuming uncle_hashes lead all the way to the root, they tell us\n-\t\t\t// how many layers down we are\n-\t\t\tint const insert_layer_size = leaf_count << uncle_hashes.size();\n-\t\t\tif (leaf_layer_size != insert_layer_size)\n-\t\t\t{\n-\t\t\t\tsha256_hash const pad_hash = merkle_pad(leaf_layer_size, insert_layer_size);\n-\t\t\t\tfor (int i = int(hashes.size()); i < leaf_count; ++i)\n-\t\t\t\t\ttree[tree.end_index() - leaf_count + i] = pad_hash;\n-\t\t\t}\n+\t\t\tTORRENT_ASSERT_FAIL();\n+\t\t\treturn set_block_hash_result::block_hash_failed();\n \t\t}\n \n-\t\tmerkle_fill_tree(tree, leaf_count);\n-\n-\t\tint const base_num_layers = merkle_num_layers(leaf_count);\n+
    \t\taux::merkle_tree::set_block_result result;\n+
    \t\tint leafs_index;\n+\t\tint leafs_size;\n+\t\tstd::tie(result, leafs_index, leafs_size) = merkle_tree.set_block(block_index, h);\n \n-\t\t// this is the index of the node where we'll insert the root of the\n-\t\t// subtree (tree). It's also the hash the uncle_hashes are here to prove\n-\t\t// is valid.\n-\t\tint const insert_root_idx = dest_start_idx >> base_num_layers;\n+\t\tif (result == aux::merkle_tree::set_block_result::unknown)\n+\t\t\treturn set_block_hash_result::unknown();\n+\t\tif (result == aux::merkle_tree::set_block_result::block_hash_failed)\n+\t\t\treturn set_block_hash_result::block_hash_failed();\n \n-\t\t// start with validating the proofs, and inserting them as we go.\n-\t\tif (!merkle_validate_and_insert_proofs(m_tree, insert_root_idx, tree[0], uncle_hashes))\n-\t\t\treturn {};\n-
    relevance 0../src/merkle_tree.cpp:367a piece outside of this range may also fail, if one of the uncle hashes is at the layer right above the block hashes

    a piece outside of this range may also fail, if one of the uncle\n-hashes is at the layer right above the block hashes

    ../src/merkle_tree.cpp:367

    \t\tint const insert_root_idx = dest_start_idx >> base_num_layers;\n+\t\tauto const status = (result == aux::merkle_tree::set_block_result::hash_failed)\n+\t\t\t? set_block_hash_result::result::piece_hash_failed\n+\t\t\t: set_block_hash_result::result::success;\n \n-\t\t// start with validating the proofs, and inserting them as we go.\n-\t\tif (!merkle_validate_and_insert_proofs(m_tree, insert_root_idx, tree[0], uncle_hashes))\n-\t\t\treturn {};\n+\t\tint const blocks_per_piece = m_files.piece_length() / default_block_size;\n \n-\t\t// first fill in the subtree of known hashes from the base layer\n-\t\tauto const num_leafs = merkle_num_leafs(m_num_blocks);\n-\t\tauto const first_leaf = merkle_first_leaf(num_leafs);\n+\t\treturn { status\n+\t\t\t, int(leafs_index - static_cast<int>(piece - file_first_piece) * blocks_per_piece)\n+\t\t\t, std::min(leafs_size, m_files.file_num_pieces(f) * blocks_per_piece - leafs_index) };\n+\t}\n \n-\t\t// this is the start of the leaf layer of \"tree\". We'll use this\n-\t\t// variable to step upwards towards the root\n-\t\tint source_cursor = int(tree.size()) - leaf_count;\n-\t\t// the running index in the loop\n-\t\tint dest_cursor = dest_start_idx;\n+\tvoid hash_picker::hashes_rejected(hash_request const& req)\n+\t{\n+\t\tTORRENT_ASSERT(req.base == m_piece_layer && req.index % 512 == 0);\n \n-\t\t// the number of tree levels in a piece hash. 0 means the block layer is\n-\t\t// the same as the piece layer\n-\t\tint const base = piece_levels();\n+\t\tfor (int i = req.index; i < req.index + req.count; i += 512)\n+\t\t{\n+\t\t\tm_piece_hash_requested[req.file][i / 512].last_request = min_time();\n+\t\t\t--m_piece_hash_requested[req.file][i / 512].num_requests;\n+\t\t}\n \n-
    \t\tfor (int layer_size = leaf_count; layer_size != 0; layer_size /= 2)\n+
    relevance 0../src/part_file.cpp:300what do we do if someone is currently reading from the disk from this piece? does it matter? Since we won't actively erase the data from disk, but it may be overwritten soon, it's probably not that big of a deal

    what do we do if someone is currently reading from the disk\n+from this piece? does it matter? Since we won't actively erase the\n+data from disk, but it may be overwritten soon, it's probably not that\n+big of a deal

    ../src/part_file.cpp:300

    \t\t\t\tcreate_directories(m_path, ec);\n+\t\t\t\tif (ec) return {};\n+\t\t\t\treturn aux::file_handle(fn, 0, mode);\n+\t\t\t}\n+\t\t\treturn {};\n+\t\t}\n+\t}\n+\tcatch (storage_error const& e)\n+\t{\n+\t\tec = e.ec;\n+\t\treturn {};\n+\t}\n+\n+\tvoid part_file::free_piece(piece_index_t const piece)\n+\t{\n+\t\tstd::lock_guard<std::mutex> l(m_mutex);\n+\n+\t\tauto const i = m_piece_map.find(piece);\n+\t\tif (i == m_piece_map.end()) return;\n+\n+
    \n+
    \t\tm_free_slots.push_back(i->second);\n+\t\tm_piece_map.erase(i);\n+\t\tm_dirty_metadata = true;\n+\t}\n+\n+\tvoid part_file::move_partfile(std::string const& path, error_code& ec)\n+\t{\n+\t\tstd::lock_guard<std::mutex> l(m_mutex);\n+\n+\t\tflush_metadata_impl(ec);\n+\t\tif (ec) return;\n+\n+\t\tif (!m_piece_map.empty())\n+\t\t{\n+\t\t\tstd::string old_path = combine_path(m_path, m_name);\n+\t\t\tstd::string new_path = combine_path(path, m_name);\n+\n+\t\t\trename(old_path, new_path, ec);\n+\t\t\tif (ec == boost::system::errc::no_such_file_or_directory)\n+\t\t\t\tec.clear();\n+\n+\t\t\tif (ec)\n+\t\t\t{\n+\t\t\t\tstorage_error se;\n+\t\t\t\taux::copy_file(old_path, new_path, se);\n+\t\t\t\tec = se.ec;\n+\t\t\t\tif (ec) return;\n+\t\t\t\tremove(old_path, ec);\n+\t\t\t}\n+\t\t}\n+
    relevance 0../src/part_file.cpp:411instead of rebuilding the whole file header and flushing it, update the slot entries as we go

    instead of rebuilding the whole file header\n+and flushing it, update the slot entries as we go

    ../src/part_file.cpp:411

    \t\t\t\t\t\tTORRENT_ASSERT(j->second == slot);\n+\t\t\t\t\t\tm_free_slots.push_back(j->second);\n+\t\t\t\t\t\tm_piece_map.erase(j);\n+\t\t\t\t\t\tm_dirty_metadata = true;\n+\t\t\t\t\t}\n+\t\t\t\t}\n+\t\t\t}\n+\t\t\tfile_offset += block_to_copy;\n+\t\t\tpiece_offset = 0;\n+\t\t\tsize -= block_to_copy;\n+\t\t}\n+\t}\n+\n+\tvoid part_file::flush_metadata(error_code& ec)\n+\t{\n+\t\tstd::lock_guard<std::mutex> l(m_mutex);\n+\n+\t\tflush_metadata_impl(ec);\n+\t}\n+\n+
    \tvoid part_file::flush_metadata_impl(error_code& ec)\n+
    \t{\n+\t\t// do we need to flush the metadata?\n+\t\tif (m_dirty_metadata == false) return;\n+\n+\t\tif (m_piece_map.empty())\n+\t\t{\n+\t\t\t// if we don't have any pieces left in the\n+\t\t\t// part file, remove it\n+\t\t\tstd::string const p = combine_path(m_path, m_name);\n+\t\t\tremove(p, ec);\n+\n+\t\t\tif (ec == boost::system::errc::no_such_file_or_directory)\n+\t\t\t\tec.clear();\n+\t\t\treturn;\n+\t\t}\n+\n+\t\tauto f = open_file(aux::open_mode::write | aux::open_mode::hidden, ec);\n+\t\tif (ec) return;\n+\n+\t\tstd::vector<char> header(static_cast<std::size_t>(m_header_size));\n+\n+\t\tusing namespace libtorrent::aux;\n+\n+\t\tchar* ptr = header.data();\n+\t\twrite_uint32(m_max_pieces, ptr);\n+\t\twrite_uint32(m_piece_size, ptr);\n+\n+\t\tfor (piece_index_t piece(0); piece < piece_index_t(m_max_pieces); ++piece)\n+\t\t{\n+\t\t\tauto const i = m_piece_map.find(piece);\n+
    relevance 0../src/file_storage.cpp:457maybe it would be nice to have a better index here

    maybe it would be nice to have a better index here

    ../src/file_storage.cpp:457

    \t\t// find the file iterator and file offset\n+\t\taux::file_entry target;\n+\t\ttarget.offset = aux::numeric_cast<std::uint64_t>(offset);\n+\t\tTORRENT_ASSERT(!compare_file_offset(target, m_files.front()));\n+\n+\t\tauto file_iter = std::upper_bound(\n+\t\t\tm_files.begin(), m_files.end(), target, compare_file_offset);\n+\n+\t\tTORRENT_ASSERT(file_iter != m_files.begin());\n+\t\t--file_iter;\n+\t\treturn file_index_t{int(file_iter - m_files.begin())};\n+\t}\n+\n+\tfile_index_t file_storage::file_index_at_piece(piece_index_t const piece) const\n+\t{\n+\t\treturn file_index_at_offset(static_cast<int>(piece) * std::int64_t(piece_length()));\n+\t}\n+\n+\tfile_index_t file_storage::file_index_for_root(sha256_hash const& root_hash) const\n+\t{\n+
    \t\tfor (file_index_t const i : file_range())\n+
    \t\t{\n+\t\t\tif (root(i) == root_hash) return i;\n+\t\t}\n+\t\treturn file_index_t{-1};\n+\t}\n+\n+\tpiece_index_t file_storage::piece_index_at_file(file_index_t f) const\n+\t{\n+\t\treturn piece_index_t{aux::numeric_cast<int>(file_offset(f) / piece_length())};\n+\t}\n+\n+#if TORRENT_ABI_VERSION <= 2\n+\tchar const* file_storage::file_name_ptr(file_index_t const index) const\n+\t{\n+\t\treturn m_files[index].name;\n+\t}\n+\n+\tint file_storage::file_name_len(file_index_t const index) const\n+\t{\n+\t\tif (m_files[index].name_len == aux::file_entry::name_is_owned)\n+\t\t\treturn -1;\n+\t\treturn m_files[index].name_len;\n+\t}\n+#endif\n+\n+\tstd::vector<file_slice> file_storage::map_block(piece_index_t const piece\n+\t\t, std::int64_t const offset, std::int64_t size) const\n+\t{\n+\t\tTORRENT_ASSERT_PRECOND(piece >= piece_index_t{0});\n+\t\tTORRENT_ASSERT_PRECOND(piece < end_piece());\n+
    relevance 0../src/file_storage.cpp:1242this would be more efficient if m_paths was sorted first, such that a lower path index always meant sorted-before

    this would be more efficient if m_paths was sorted first, such\n+that a lower path index always meant sorted-before

    ../src/file_storage.cpp:1242

    \t}\n+\n+\tvoid file_storage::canonicalize_impl(bool const backwards_compatible)\n+\t{\n+\t\tTORRENT_ASSERT(piece_length() >= 16 * 1024);\n+\n+\t\t// use this vector to track the new ordering of files\n+\t\t// this allows the use of STL algorithms despite them\n+\t\t// not supporting a custom swap functor\n+\t\taux::vector<file_index_t, file_index_t> new_order(end_file());\n+\t\tfor (auto i : file_range())\n+\t\t\tnew_order[i] = i;\n+\n+\t\t// remove any existing pad files\n+\t\t{\n+\t\t\tauto pad_begin = std::partition(new_order.begin(), new_order.end()\n+\t\t\t\t, [this](file_index_t i) { return !m_files[i].pad_file; });\n+\t\t\tnew_order.erase(pad_begin, new_order.end());\n+\t\t}\n+\n+
    \n+
    \t\t// sort files by path/name\n+\t\tstd::sort(new_order.begin(), new_order.end()\n+\t\t\t, [this](file_index_t l, file_index_t r)\n+\t\t{\n+\t\t\t// assuming m_paths are unique!\n+\t\t\tauto const& lf = m_files[l];\n+\t\t\tauto const& rf = m_files[r];\n+\t\t\tif (lf.path_index != rf.path_index)\n+\t\t\t{\n+\t\t\t\tint const ret = path_compare(m_paths[lf.path_index], lf.filename()\n+\t\t\t\t\t, m_paths[rf.path_index], rf.filename());\n+\t\t\t\tif (ret != 0) return ret < 0;\n+\t\t\t}\n+\t\t\treturn lf.filename() < rf.filename();\n+\t\t});\n+\n+\t\taux::vector<aux::file_entry, file_index_t> new_files;\n+\t\taux::vector<char const*, file_index_t> new_file_hashes;\n+\t\taux::vector<std::time_t, file_index_t> new_mtime;\n+\n+\t\t// reserve enough space for the worst case after padding\n+\t\tnew_files.reserve(new_order.size() * 2 - 1);\n+\t\tif (!m_file_hashes.empty())\n+\t\t\tnew_file_hashes.reserve(new_order.size() * 2 - 1);\n+\t\tif (!m_mtime.empty())\n+\t\t\tnew_mtime.reserve(new_order.size() * 2 - 1);\n+\n+\t\t// re-compute offsets and insert pad files as necessary\n+\t\tstd::int64_t off = 0;\n+\n+
    relevance 0../src/file_storage.cpp:1345in C++17 this could be string_view

    in C++17 this could be string_view

    ../src/file_storage.cpp:1345

    \t\t\t\tadd_pad_file(i);\n+\t\t}\n+\n+\t\tm_files = std::move(new_files);\n+\t\tm_file_hashes = std::move(new_file_hashes);\n+\t\tm_mtime = std::move(new_mtime);\n+\n+\t\tm_total_size = off;\n+\t}\n+\n+\tvoid file_storage::sanitize_symlinks()\n+\t{\n+\t\t// symlinks are unusual, this function is optimized assuming there are no\n+\t\t// symbolic links in the torrent. If we find one symbolic link, we'll\n+\t\t// build the hash table of files it's allowed to refer to, but don't pay\n+\t\t// that price up-front.\n+\t\tstd::unordered_map<std::string, file_index_t> file_map;\n+\t\tbool file_map_initialized = false;\n+\n+\t\t// lazily instantiated set of all valid directories a symlink may point to\n+
    \t\tstd::unordered_set<std::string> dir_map;\n+
    \t\tbool dir_map_initialized = false;\n+\n+\t\t// symbolic links that points to directories\n+\t\tstd::unordered_map<std::string, std::string> dir_links;\n+\n+\t\t// we validate symlinks in (potentially) 2 passes over the files.\n+\t\t// remaining symlinks to validate after the first pass\n+\t\tstd::vector<file_index_t> symlinks_to_validate;\n+\n+\t\tfor (auto const i : file_range())\n+\t\t{\n+\t\t\tif (!(file_flags(i) & file_storage::flag_symlink)) continue;\n+\n+\t\t\tif (!file_map_initialized)\n+\t\t\t{\n+\t\t\t\tfor (auto const j : file_range())\n+\t\t\t\t\tfile_map.insert({internal_file_path(j), j});\n+\t\t\t\tfile_map_initialized = true;\n+\t\t\t}\n+\n+\t\t\taux::file_entry const& fe = m_files[i];\n+\t\t\tTORRENT_ASSERT(fe.symlink_index < int(m_symlinks.size()));\n+\n+\t\t\t// symlink targets are only allowed to point to files or directories in\n+\t\t\t// this torrent.\n+\t\t\t{\n+\t\t\t\tstd::string target = m_symlinks[fe.symlink_index];\n+\n+\t\t\t\tif (is_complete(target))\n+\t\t\t\t{\n+
    relevance 0../src/torrent.cpp:1951this could be optimized by looking up which files are complete and just look at those

    this could be optimized by looking up which files are\n+complete and just look at those

    ../src/torrent.cpp:1951

    //\t\t\t\tTORRENT_ASSERT(picker().have_piece(i));\n+\t\t\t\twe_have(i);\n+\t\t\t}\n+\t\t}\n+\n+\t\tset_state(torrent_status::checking_resume_data);\n+\n+\t\taux::vector<std::string, file_index_t> links;\n+#ifndef TORRENT_DISABLE_MUTABLE_TORRENTS\n+\t\tif (!m_torrent_file->similar_torrents().empty()\n+\t\t\t|| !m_torrent_file->collections().empty())\n+\t\t{\n+\t\t\tresolve_links res(m_torrent_file);\n+\n+\t\t\tfor (auto const& ih : m_torrent_file->similar_torrents())\n+\t\t\t{\n+\t\t\t\tstd::shared_ptr<torrent> t = m_ses.find_torrent(info_hash_t(ih)).lock();\n+\t\t\t\tif (!t) continue;\n+\n+\t\t\t\t// Only attempt to reuse files from torrents that are seeding.\n+
    \t\t\t\tif (!t->is_seed()) continue;\n+
    \n+\t\t\t\tres.match(t->get_torrent_file(), t->save_path());\n+\t\t\t}\n+\t\t\tfor (auto const& c : m_torrent_file->collections())\n+\t\t\t{\n+\t\t\t\tstd::vector<std::shared_ptr<torrent>> ts = m_ses.find_collection(c);\n+\n+\t\t\t\tfor (auto const& t : ts)\n+\t\t\t\t{\n+\t\t\t\t\t// Only attempt to reuse files from torrents that are seeding.\n+
    relevance 0../src/torrent.cpp:1964this could be optimized by looking up which files are complete and just look at those

    this could be optimized by looking up which files are\n+complete and just look at those

    ../src/torrent.cpp:1964

    \t\t{\n+\t\t\tresolve_links res(m_torrent_file);\n+\n+\t\t\tfor (auto const& ih : m_torrent_file->similar_torrents())\n+\t\t\t{\n+\t\t\t\tstd::shared_ptr<torrent> t = m_ses.find_torrent(info_hash_t(ih)).lock();\n+\t\t\t\tif (!t) continue;\n+\n+\t\t\t\t// Only attempt to reuse files from torrents that are seeding.\n+\t\t\t\tif (!t->is_seed()) continue;\n+\n+\t\t\t\tres.match(t->get_torrent_file(), t->save_path());\n+\t\t\t}\n+\t\t\tfor (auto const& c : m_torrent_file->collections())\n+\t\t\t{\n+\t\t\t\tstd::vector<std::shared_ptr<torrent>> ts = m_ses.find_collection(c);\n+\n+\t\t\t\tfor (auto const& t : ts)\n+\t\t\t\t{\n+\t\t\t\t\t// Only attempt to reuse files from torrents that are seeding.\n+
    \t\t\t\t\tif (!t->is_seed()) continue;\n+
    \n+\t\t\t\t\tres.match(t->get_torrent_file(), t->save_path());\n+\t\t\t\t}\n+\t\t\t}\n+\n+\t\t\tstd::vector<resolve_links::link_t> const& l = res.get_links();\n+\t\t\tif (!l.empty())\n+\t\t\t{\n+\t\t\t\tlinks.resize(m_torrent_file->files().num_files());\n+\t\t\t\tfor (auto const& i : l)\n+\t\t\t\t{\n+\t\t\t\t\tif (!i.ti) continue;\n+\t\t\t\t\tlinks[i.file_idx] = combine_path(i.save_path\n+\t\t\t\t\t\t, i.ti->files().file_path(i.file_idx));\n+\t\t\t\t}\n+\t\t\t}\n+\t\t}\n+#endif // TORRENT_DISABLE_MUTABLE_TORRENTS\n+\n+#if TORRENT_USE_ASSERTS\n+\t\tTORRENT_ASSERT(m_outstanding_check_files == false);\n+\t\tm_outstanding_check_files = true;\n+#endif\n+\n+\t\tif (!m_add_torrent_params || !(m_add_torrent_params->flags & torrent_flags::no_verify_files))\n+\t\t{\n+\t\t\tm_ses.disk_thread().async_check_files(\n+\t\t\t\tm_storage, m_add_torrent_params ? m_add_torrent_params.get() : nullptr\n+\t\t\t\t, std::move(links), [self = shared_from_this()](status_t st, storage_error const& error)\n+\t\t\t\t{ self->on_resume_data_checked(st, error); });\n+
    relevance 0../src/torrent.cpp:2728this pattern is repeated in a few places. Factor this into a function and generalize the concept of a torrent having a dedicated listen port

    this pattern is repeated in a few places. Factor this into\n+a function and generalize the concept of a torrent having a\n+dedicated listen port

    ../src/torrent.cpp:2728

    \t\t// not ready for peers. Except, if we don't have metadata,\n+\t\t// we need peers to download from\n+\t\tif (!m_files_checked && valid_metadata()) return;\n+\n+\t\tif (!m_announce_to_lsd) return;\n+\n+\t\t// private torrents are never announced on LSD\n+\t\tif (m_torrent_file->is_valid() && m_torrent_file->priv()) return;\n+\n+#if TORRENT_USE_I2P\n+\t\t// i2p torrents are also never announced on LSD\n+\t\t// unless we allow mixed swarms\n+\t\tif (is_i2p() && !settings().get_bool(settings_pack::allow_i2p_mixed))\n+\t\t\treturn;\n+#endif\n+\n+\t\tif (is_paused()) return;\n+\n+\t\tif (!m_ses.has_lsd()) return;\n+\n+
    #ifdef TORRENT_SSL_PEERS\n+
    \t\tint port = is_ssl_torrent() ? m_ses.ssl_listen_port() : m_ses.listen_port();\n+#else\n+\t\tint port = m_ses.listen_port();\n+#endif\n+\n+\t\t// announce with the local discovery service\n+\t\tm_torrent_file->info_hashes().for_each([&](sha1_hash const& ih, protocol_version)\n+\t\t{\n+\t\t\tm_ses.announce_lsd(ih, port);\n+\t\t});\n+\t}\n+\n+#ifndef TORRENT_DISABLE_DHT\n+\n+\tvoid torrent::dht_announce()\n+\t{\n+\t\tTORRENT_ASSERT(is_single_thread());\n+\t\tif (!m_ses.dht())\n+\t\t{\n+#ifndef TORRENT_DISABLE_LOGGING\n+\t\t\tdebug_log(\"DHT: no dht initialized\");\n+#endif\n+\t\t\treturn;\n+\t\t}\n+\t\tif (!should_announce_dht())\n+\t\t{\n+#ifndef TORRENT_DISABLE_LOGGING\n+\t\t\tif (should_log())\n+\t\t\t{\n+#if TORRENT_USE_I2P\n+
    relevance 0../src/torrent.cpp:3885add one peer per IP the hostname resolves to

    add one peer per IP the hostname resolves to

    ../src/torrent.cpp:3885

    \tcatch (...) { handle_exception(); }\n+#endif\n+\n+\tvoid torrent::on_peer_name_lookup(error_code const& e\n+\t\t, std::vector<address> const& host_list, int const port\n+\t\t, protocol_version const v) try\n+\t{\n+\t\tTORRENT_ASSERT(is_single_thread());\n+\n+\t\tINVARIANT_CHECK;\n+\n+\t\tCOMPLETE_ASYNC(\"torrent::on_peer_name_lookup\");\n+\n+#ifndef TORRENT_DISABLE_LOGGING\n+\t\tif (e && should_log())\n+\t\t\tdebug_log(\"peer name lookup error: %s\", e.message().c_str());\n+#endif\n+\n+\t\tif (e || m_abort || host_list.empty() || m_ses.is_aborted()) return;\n+\n+
    \t\ttcp::endpoint host(host_list.front(), std::uint16_t(port));\n+
    \n+\t\tif (m_ip_filter && m_ip_filter->access(host.address()) & ip_filter::blocked)\n+\t\t{\n+#ifndef TORRENT_DISABLE_LOGGING\n+\t\t\tif (should_log())\n+\t\t\t{\n+\t\t\t\tdebug_log(\"blocked ip from tracker: %s\", host.address().to_string().c_str());\n+\t\t\t}\n+#endif\n+\t\t\tif (m_ses.alerts().should_post<peer_blocked_alert>())\n+\t\t\t\tm_ses.alerts().emplace_alert<peer_blocked_alert>(get_handle()\n+\t\t\t\t\t, host, peer_blocked_alert::ip_filter);\n+\t\t\treturn;\n+\t\t}\n+\n+\t\tif (add_peer(host, peer_info::tracker, v == protocol_version::V2 ? pex_lt_v2 : pex_flags_t(0)))\n+\t\t{\n+\t\t\tstate_updated();\n+\n+#ifndef TORRENT_DISABLE_LOGGING\n+\t\t\tif (should_log())\n+\t\t\t{\n+\t\t\t\tdebug_log(\"name-lookup add_peer() [ %s ] connect-candidates: %d\"\n+\t\t\t\t\t, host.address().to_string().c_str()\n+\t\t\t\t\t, m_peer_list ? m_peer_list->num_connect_candidates() : -1);\n+\t\t\t}\n+#endif\n+\t\t}\n+\t\tupdate_want_peers();\n+\t}\n+
    relevance 0../src/torrent.cpp:4581only do this if the piece size > 1 blocks This is a v2 torrent so we can request get block level hashes.

    only do this if the piece size > 1 blocks\n+This is a v2 torrent so we can request get block\n+level hashes.

    ../src/torrent.cpp:4581

    \t\t{\n+\t\t\tstd::set<torrent_peer*> ret;\n+\t\t\tif (!blocks.empty() && !downloaders.empty())\n+\t\t\t{\n+\t\t\t\tfor (auto const b : blocks) ret.insert(downloaders[std::size_t(b)]);\n+\t\t\t}\n+\t\t\telse\n+\t\t\t{\n+\t\t\t\tstd::copy(downloaders.begin(), downloaders.end(), std::inserter(ret, ret.begin()));\n+\t\t\t}\n+\t\t\treturn ret;\n+\t\t}();\n+\n+\t\t// if this piece wasn't downloaded from peers, we just found it on disk.\n+\t\t// In that case, we should just consider it as \"not-have\" and there's no\n+\t\t// need to try to get higher fidelity hashes (yet)\n+\t\tbool const found_on_disk = peers.size() == 1 && peers.count(nullptr);\n+\n+\t\tif (!torrent_file().info_hashes().has_v1() && blocks.empty() && !found_on_disk)\n+\t\t{\n+
    \t\t\tverify_block_hashes(index);\n+
    \t\t}\n+\n+\t\t// the below code is penalizing peers that sent use bad data.\n+\t\t// increase the total amount of failed bytes\n+\t\tif (!found_on_disk)\n+\t\t{\n+\t\t\tif (blocks.empty())\n+\t\t\t\tadd_failed_bytes(m_torrent_file->piece_size(index));\n+\t\t\telse\n+\t\t\t\tadd_failed_bytes(static_cast<int>(blocks.size()) * default_block_size);\n+\n+#ifndef TORRENT_DISABLE_EXTENSIONS\n+\t\t\tfor (auto& ext : m_extensions)\n+\t\t\t{\n+\t\t\t\text->on_piece_failed(index);\n+\t\t\t}\n+#endif\n+\n+\t\t\t// did we receive this piece from a single peer?\n+\t\t\t// if we know exactly which blocks failed the hash, we can also be certain\n+\t\t\t// that all peers in the list sent us bad data\n+\t\t\tbool const known_bad_peer = (!found_on_disk && peers.size() == 1) || !blocks.empty();\n+\n+\t\t\tpenalize_peers(peers, index, known_bad_peer);\n+\t\t}\n+\n+\t\t// If m_storage isn't set here, it means we're shutting down\n+\t\tif (m_storage)\n+\t\t{\n+\t\t\t// it doesn't make much sense to fail to hash a piece\n+
    relevance 0../src/torrent.cpp:7525come up with a better way of doing this, instead of an immediately invoked lambda expression.

    come up with a better way of doing this, instead of an\n+immediately invoked lambda expression.

    ../src/torrent.cpp:7525

    \t\t\t\t\t|| peerinfo->confirmed_supports_utp))\n+\t\t\t{\n+\t\t\t\tsm = m_ses.utp_socket_manager();\n+\t\t\t}\n+\n+\t\t\t// don't make a TCP connection if it's disabled\n+\t\t\tif (sm == nullptr && !settings().get_bool(settings_pack::enable_outgoing_tcp))\n+\t\t\t{\n+#ifndef TORRENT_DISABLE_LOGGING\n+\t\t\t\tif (should_log())\n+\t\t\t\t{\n+\t\t\t\t\tdebug_log(\"discarding peer \\\"%s\\\": TCP connections disabled \"\n+\t\t\t\t\t\t\"[ supports-utp: %d ]\", peerinfo->to_string().c_str()\n+\t\t\t\t\t\t, peerinfo->supports_utp);\n+\t\t\t\t}\n+#endif\n+\t\t\t\treturn false;\n+\t\t\t}\n+\t\t}\n+\n+
    \t\taux::socket_type s = [&] {\n+
    \n+#if TORRENT_USE_I2P\n+\t\tif (peerinfo->is_i2p_addr)\n+\t\t{\n+\t\t\t// It's not entirely obvious why this peer connection is not marked as\n+\t\t\t// one. The main feature of a peer connection is that whether or not we\n+\t\t\t// proxy it is configurable. When we use i2p, we want to always prox\n+\t\t\t// everything via i2p.\n+\n+\t\t\taux::proxy_settings proxy;\n+\t\t\tproxy.hostname = settings().get_str(settings_pack::i2p_hostname);\n+\t\t\tproxy.port = std::uint16_t(settings().get_int(settings_pack::i2p_port));\n+\t\t\tproxy.type = settings_pack::i2p_proxy;\n+\n+\t\t\taux::socket_type ret = instantiate_connection(m_ses.get_context()\n+\t\t\t\t, proxy, nullptr, nullptr, false, false);\n+\t\t\ti2p_stream& str = boost::get<i2p_stream>(ret);\n+\t\t\tstr.set_local_i2p_endpoint(m_ses.local_i2p_endpoint());\n+\t\t\tstr.set_destination(static_cast<i2p_peer*>(peerinfo)->dest());\n+\t\t\tstr.set_command(i2p_stream::cmd_connect);\n+\t\t\tstr.set_session_id(m_ses.i2p_session());\n+\t\t\treturn ret;\n+\t\t}\n+\t\telse\n+#endif\n+\t\t{\n+\t\t\tvoid* userdata = nullptr;\n+#ifdef TORRENT_SSL_PEERS\n+\t\t\tif (is_ssl_torrent())\n+\t\t\t{\n+
    relevance 0../src/torrent.cpp:9118perhaps 0 should actually mean 0

    perhaps 0 should actually mean 0

    ../src/torrent.cpp:9118

    \t\t// finished torrents may not change their queue positions, as it's set to\n+\t\t// -1\n+\t\tif ((m_abort || is_finished()) && p != no_pos) return;\n+\n+\t\tTORRENT_ASSERT((p == no_pos) == is_finished()\n+\t\t\t|| (!m_auto_managed && p == no_pos)\n+\t\t\t|| (m_abort && p == no_pos)\n+\t\t\t|| (!m_added && p == no_pos));\n+\t\tif (p == m_sequence_number) return;\n+\n+\t\tTORRENT_ASSERT(p >= no_pos);\n+\n+\t\tstate_updated();\n+\n+\t\tm_ses.set_queue_position(this, p);\n+\t}\n+\n+\tvoid torrent::set_max_uploads(int limit, bool const state_update)\n+\t{\n+\t\tTORRENT_ASSERT(is_single_thread());\n+
    \t\tif (limit <= 0) limit = (1 << 24) - 1;\n+
    \t\tif (int(m_max_uploads) == limit) return;\n+\t\tif (state_update) state_updated();\n+\t\tm_max_uploads = aux::numeric_cast<std::uint32_t>(limit);\n+#ifndef TORRENT_DISABLE_LOGGING\n+\t\tif (should_log() && state_update)\n+\t\t\tdebug_log(\"*** set-max-uploads: %d\", m_max_uploads);\n+#endif\n+\n+\t\tif (state_update)\n+\t\t\tset_need_save_resume(torrent_handle::if_config_changed);\n+\t}\n+\n+\tvoid torrent::set_max_connections(int limit, bool const state_update)\n+\t{\n+\t\tTORRENT_ASSERT(is_single_thread());\n+
    relevance 0../src/torrent.cpp:9135perhaps 0 should actually mean 0

    perhaps 0 should actually mean 0

    ../src/torrent.cpp:9135

    \n+\tvoid torrent::set_max_uploads(int limit, bool const state_update)\n+\t{\n+\t\tTORRENT_ASSERT(is_single_thread());\n+\t\tif (limit <= 0) limit = (1 << 24) - 1;\n+\t\tif (int(m_max_uploads) == limit) return;\n+\t\tif (state_update) state_updated();\n+\t\tm_max_uploads = aux::numeric_cast<std::uint32_t>(limit);\n+#ifndef TORRENT_DISABLE_LOGGING\n+\t\tif (should_log() && state_update)\n+\t\t\tdebug_log(\"*** set-max-uploads: %d\", m_max_uploads);\n+#endif\n+\n+\t\tif (state_update)\n+\t\t\tset_need_save_resume(torrent_handle::if_config_changed);\n+\t}\n+\n+\tvoid torrent::set_max_connections(int limit, bool const state_update)\n+\t{\n+\t\tTORRENT_ASSERT(is_single_thread());\n+
    \t\tif (limit <= 0) limit = (1 << 24) - 1;\n+
    \t\tif (int(m_max_connections) == limit) return;\n+\t\tif (state_update) state_updated();\n+\t\tm_max_connections = aux::numeric_cast<std::uint32_t>(limit);\n+\t\tupdate_want_peers();\n+\n+#ifndef TORRENT_DISABLE_LOGGING\n+\t\tif (should_log() && state_update)\n+\t\t\tdebug_log(\"*** set-max-connections: %d\", m_max_connections);\n+#endif\n+\n+\t\tif (num_peers() > int(m_max_connections))\n+\t\t{\n+\t\t\tdisconnect_peers(num_peers() - m_max_connections\n+\t\t\t\t, errors::too_many_connections);\n+\t\t}\n+\n+\t\tif (state_update)\n+\t\t\tset_need_save_resume(torrent_handle::if_config_changed);\n+\t}\n+\n+\tvoid torrent::set_upload_limit(int const limit)\n+\t{\n+\t\tset_limit_impl(limit, peer_connection::upload_channel);\n+#ifndef TORRENT_DISABLE_LOGGING\n+\t\tdebug_log(\"*** set-upload-limit: %d\", limit);\n+#endif\n+\t}\n+\n+\tvoid torrent::set_download_limit(int const limit)\n+\t{\n+
    relevance 0../src/torrent.cpp:11061instead of resorting the whole list, insert the peers directly into the right place

    instead of resorting the whole list, insert the peers\n+directly into the right place

    ../src/torrent.cpp:11061

    \t\t\t\tstd::printf(\"timed out [average-piece-time: %d ms ]\\n\"\n+\t\t\t\t\t, m_average_piece_time);\n+#endif\n+\t\t\t}\n+\n+\t\t\t// pick all blocks for this piece. the peers list is kept up to date\n+\t\t\t// and sorted. when we issue a request to a peer, its download queue\n+\t\t\t// time will increase and it may need to be bumped in the peers list,\n+\t\t\t// since it's ordered by download queue time\n+\t\t\tpick_time_critical_block(peers, ignore_peers\n+\t\t\t\t, peers_with_requests\n+\t\t\t\t, pi, &i, m_picker.get()\n+\t\t\t\t, blocks_in_piece, timed_out);\n+\n+\t\t\t// put back the peers we ignored into the peer list for the next piece\n+\t\t\tif (!ignore_peers.empty())\n+\t\t\t{\n+\t\t\t\tpeers.insert(peers.begin(), ignore_peers.begin(), ignore_peers.end());\n+\t\t\t\tignore_peers.clear();\n+\n+
    \t\t\t\tstd::sort(peers.begin(), peers.end()\n+
    \t\t\t\t\t, [] (peer_connection const* lhs, peer_connection const* rhs)\n+\t\t\t\t\t{ return lhs->download_queue_time(16*1024) < rhs->download_queue_time(16*1024); });\n+\t\t\t}\n+\n+\t\t\t// if this peer's download time exceeds 2 seconds, we're done.\n+\t\t\t// We don't want to build unreasonably long request queues\n+\t\t\tif (!peers.empty() && peers[0]->download_queue_time() > milliseconds(2000))\n+\t\t\t\tbreak;\n+\t\t}\n+\n+\t\t// commit all the time critical requests\n+\t\tfor (auto p : peers_with_requests)\n+\t\t{\n+\t\t\tp->send_block_requests();\n+\t\t}\n+\t}\n+#endif // TORRENT_DISABLE_STREAMING\n+\n+\tstd::set<std::string> torrent::web_seeds(web_seed_entry::type_t const type) const\n+\t{\n+\t\tTORRENT_ASSERT(is_single_thread());\n+\t\tstd::set<std::string> ret;\n+\t\tfor (auto const& s : m_web_seeds)\n+\t\t{\n+\t\t\tif (s.peer_info.banned) continue;\n+\t\t\tif (s.removed) continue;\n+\t\t\tif (s.type != type) continue;\n+\t\t\tret.insert(s.url);\n+\t\t}\n+\t\treturn ret;\n+
    relevance 0../src/add_torrent_params.cpp:78pre C++17, GCC and msvc does not make std::string nothrow move assignable, which means no type containing a string will be nothrow move assignable by default either static_assert(std::is_nothrow_move_assignable::value , \"should be nothrow move assignable\");

    pre C++17, GCC and msvc does not make std::string nothrow move\n+assignable, which means no type containing a string will be nothrow move\n+assignable by default either\n+static_assert(std::is_nothrow_move_assignable::value\n+, \"should be nothrow move assignable\");

    ../src/add_torrent_params.cpp:78

    \t\t\tDECL_FLAG(sequential_download);\n+\t\t\tDECL_FLAG(pinned);\n+\t\t\tDECL_FLAG(stop_when_ready);\n+\t\t\tDECL_FLAG(override_trackers);\n+\t\t\tDECL_FLAG(override_web_seeds);\n+\t\t\tDECL_FLAG(need_save_resume);\n+\t\t\tDECL_FLAG(override_resume_data);\n+\t\t\tDECL_FLAG(merge_resume_trackers);\n+\t\t\tDECL_FLAG(use_resume_save_path);\n+\t\t\tDECL_FLAG(merge_resume_http_seeds);\n+\t\t\tDECL_FLAG(default_flags);\n+#undef DECL_FLAG\n+#endif // TORRENT_ABI_VERSION\n+\n+\tstatic_assert(std::is_nothrow_move_constructible<add_torrent_params>::value\n+\t\t, \"should be nothrow move constructible\");\n+\n+\tstatic_assert(std::is_nothrow_move_constructible<std::string>::value\n+\t\t, \"should be nothrow move constructible\");\n+\n+
    \n+
    relevance 0../src/add_torrent_params.cpp:84it would be nice if this was nothrow default constructible static_assert(std::is_nothrow_default_constructible::value , \"should be nothrow default constructible\");

    it would be nice if this was nothrow default constructible\n+static_assert(std::is_nothrow_default_constructible::value\n+, \"should be nothrow default constructible\");

    ../src/add_torrent_params.cpp:84

    \t\t\tDECL_FLAG(pinned);\n+\t\t\tDECL_FLAG(stop_when_ready);\n+\t\t\tDECL_FLAG(override_trackers);\n+\t\t\tDECL_FLAG(override_web_seeds);\n+\t\t\tDECL_FLAG(need_save_resume);\n+\t\t\tDECL_FLAG(override_resume_data);\n+\t\t\tDECL_FLAG(merge_resume_trackers);\n+\t\t\tDECL_FLAG(use_resume_save_path);\n+\t\t\tDECL_FLAG(merge_resume_http_seeds);\n+\t\t\tDECL_FLAG(default_flags);\n+#undef DECL_FLAG\n+#endif // TORRENT_ABI_VERSION\n+\n+\tstatic_assert(std::is_nothrow_move_constructible<add_torrent_params>::value\n+\t\t, \"should be nothrow move constructible\");\n+\n+\tstatic_assert(std::is_nothrow_move_constructible<std::string>::value\n+\t\t, \"should be nothrow move constructible\");\n+\n+\n+
    \n+
    namespace aux {\n+\n+\t// returns whether this add_torrent_params object has \"resume-data\", i.e.\n+\t// information about which pieces we have.\n+\tbool contains_resume_data(add_torrent_params const& atp)\n+\t{\n+\t\treturn !atp.have_pieces.empty()\n+\t\t\t|| (atp.flags & torrent_flags::seed_mode);\n+\t}\n+}\n+\n+}\n+
    relevance 0../src/storage_utils.cpp:230ideally, if we end up copying files because of a move across volumes, the source should not be deleted until they've all been copied. That would let us rollback with higher confidence.

    ideally, if we end up copying files because of a move across\n+volumes, the source should not be deleted until they've all been\n+copied. That would let us rollback with higher confidence.

    ../src/storage_utils.cpp:230

    \t\t// later\n+\t\taux::vector<bool, file_index_t> copied_files(std::size_t(f.num_files()), false);\n+\n+\t\t// track how far we got in case of an error\n+\t\tfile_index_t file_index{};\n+\t\tfor (auto const i : f.file_range())\n+\t\t{\n+\t\t\t// files moved out to absolute paths are not moved\n+\t\t\tif (f.file_absolute_path(i)) continue;\n+\n+\t\t\tstd::string const old_path = combine_path(save_path, f.file_path(i));\n+\t\t\tstd::string const new_path = combine_path(new_save_path, f.file_path(i));\n+\n+\t\t\terror_code ignore;\n+\t\t\tif (flags == move_flags_t::dont_replace && exists(new_path, ignore))\n+\t\t\t{\n+\t\t\t\tif (ret == status_t::no_error) ret = status_t::need_full_check;\n+\t\t\t\tcontinue;\n+\t\t\t}\n+\n+
    \t\t\tmove_file(old_path, new_path, ec);\n+
    \n+\t\t\t// if the source file doesn't exist. That's not a problem\n+\t\t\t// we just ignore that file\n+\t\t\tif (ec.ec == boost::system::errc::no_such_file_or_directory)\n+\t\t\t\tec.ec.clear();\n+\t\t\telse if (ec\n+\t\t\t\t&& ec.ec != boost::system::errc::invalid_argument\n+\t\t\t\t&& ec.ec != boost::system::errc::permission_denied)\n+\t\t\t{\n+\t\t\t\t// moving the file failed\n+\t\t\t\t// on OSX, the error when trying to rename a file across different\n+\t\t\t\t// volumes is EXDEV, which will make it fall back to copying.\n+\t\t\t\tec.ec.clear();\n+\t\t\t\tcopy_file(old_path, new_path, ec);\n+\t\t\t\tif (!ec) copied_files[i] = true;\n+\t\t\t}\n+\n+\t\t\tif (ec)\n+\t\t\t{\n+\t\t\t\tec.file(i);\n+\t\t\t\tfile_index = i;\n+\t\t\t\tbreak;\n+\t\t\t}\n+\t\t}\n+\n+\t\tif (!ec && move_partfile)\n+\t\t{\n+\t\t\terror_code e;\n+\t\t\tmove_partfile(new_save_path, e);\n+\t\t\tif (e)\n+
    relevance 0../src/storage_utils.cpp:538it would seem reasonable to, instead, set the have_pieces bits for the pieces representing these files, and resume with the normal logic

    it would seem reasonable to, instead, set the have_pieces bits\n+for the pieces representing these files, and resume with the normal\n+logic

    ../src/storage_utils.cpp:538

    \t\t\t\t\tcontinue;\n+\n+\t\t\t\tstd::int64_t const size = get_filesize(stat, file_index, fs\n+\t\t\t\t\t, save_path, ec);\n+\t\t\t\tif (size < 0) return false;\n+\n+\t\t\t\tif (size < fs.file_size(file_index))\n+\t\t\t\t{\n+\t\t\t\t\tec.ec = errors::mismatching_file_size;\n+\t\t\t\t\tec.file(file_index);\n+\t\t\t\t\tec.operation = operation_t::check_resume;\n+\t\t\t\t\treturn false;\n+\t\t\t\t}\n+\t\t\t}\n+\t\t\treturn true;\n+\t\t}\n+\n+#ifndef TORRENT_DISABLE_MUTABLE_TORRENTS\n+\t\t// always trigger a full recheck when we pull in files from other\n+\t\t// torrents, via hard links\n+
    \t\tif (added_files) return false;\n+
    #endif\n+\n+\t\t// parse have bitmask. Verify that the files we expect to have\n+\t\t// actually do exist\n+\t\tpiece_index_t const end_piece = std::min(rd.have_pieces.end_index(), fs.end_piece());\n+\t\tfor (piece_index_t i(0); i < end_piece; ++i)\n+\t\t{\n+\t\t\tif (rd.have_pieces.get_bit(i) == false) continue;\n+\n+\t\t\tstd::vector<file_slice> f = fs.map_block(i, 0, 1);\n+\t\t\tTORRENT_ASSERT(!f.empty());\n+\n+\t\t\tfile_index_t const file_index = f[0].file_index;\n+\n+\t\t\t// files with priority zero may not have been saved to disk at their\n+\t\t\t// expected location, but is likely to be in a partfile. Just exempt it\n+\t\t\t// from checking\n+\t\t\tif (file_index < file_priority.end_index()\n+\t\t\t\t&& file_priority[file_index] == dont_download)\n+\t\t\t\tcontinue;\n+\n+\t\t\tif (fs.pad_file_at(file_index)) continue;\n+\n+\t\t\tif (get_filesize(stat, file_index, fs, save_path, ec) < 0)\n+\t\t\t\treturn false;\n+\n+\t\t\t// OK, this file existed, good. Now, skip all remaining pieces in\n+\t\t\t// this file. We're just sanity-checking whether the files exist\n+\t\t\t// or not.\n+\t\t\tpeer_request const pr = fs.map_file(file_index\n+
    relevance 0../src/http_seed_connection.cpp:441technically, this isn't supposed to happen, but it seems to sometimes. Some of the accounting is probably wrong in certain cases

    technically, this isn't supposed to happen, but it seems to\n+sometimes. Some of the accounting is probably wrong in certain\n+cases

    ../src/http_seed_connection.cpp:441

    \t\t\t\t\t// cut out the chunk header from the receive buffer\n+\t\t\t\t\tTORRENT_ASSERT(m_chunk_pos + m_body_start < INT_MAX);\n+\t\t\t\t\tm_recv_buffer.cut(header_size, t->block_size() + 1024, aux::numeric_cast<int>(m_chunk_pos + m_body_start));\n+\t\t\t\t\trecv_buffer = m_recv_buffer.get();\n+\t\t\t\t\trecv_buffer = recv_buffer.subspan(m_body_start);\n+\t\t\t\t\tm_chunk_pos += chunk_size;\n+\t\t\t\t\tif (chunk_size == 0)\n+\t\t\t\t\t{\n+\t\t\t\t\t\tTORRENT_ASSERT(m_recv_buffer.get().size() < m_chunk_pos + m_body_start + 1\n+\t\t\t\t\t\t\t|| m_recv_buffer.get()[static_cast<std::ptrdiff_t>(m_chunk_pos + m_body_start)] == 'H'\n+\t\t\t\t\t\t\t|| (m_parser.chunked_encoding()\n+\t\t\t\t\t\t\t\t&& m_recv_buffer.get()[static_cast<std::ptrdiff_t>(m_chunk_pos + m_body_start)] == '\\r'));\n+\t\t\t\t\t\tm_chunk_pos = -1;\n+\t\t\t\t\t}\n+\t\t\t\t}\n+\t\t\t}\n+\n+\t\t\tint payload = int(bytes_transferred);\n+\t\t\tif (payload > m_response_left) payload = int(m_response_left);\n+\t\t\tif (payload > front_request.length) payload = front_request.length;\n+
    \t\t\tif (payload > outstanding_bytes()) payload = outstanding_bytes();\n+
    \t\t\treceived_bytes(payload, 0);\n+\t\t\tincoming_piece_fragment(payload);\n+\t\t\tm_response_left -= payload;\n+\n+\t\t\tif (m_parser.status_code() == 503)\n+\t\t\t{\n+\t\t\t\tif (!m_parser.finished()) return;\n+\n+\t\t\t\tint retry_time = std::atoi(std::string(recv_buffer.begin(), recv_buffer.end()).c_str());\n+\t\t\t\tif (retry_time <= 0) retry_time = 60;\n+#ifndef TORRENT_DISABLE_LOGGING\n+\t\t\t\tpeer_log(peer_log_alert::info, \"CONNECT\", \"retrying in %d seconds\", retry_time);\n+#endif\n+\n+\t\t\t\treceived_bytes(0, int(bytes_transferred));\n+\t\t\t\t// temporarily unavailable, retry later\n+\t\t\t\tt->retry_web_seed(this, seconds32(retry_time));\n+\t\t\t\tdisconnect(error_code(m_parser.status_code(), http_category()), operation_t::bittorrent, failure);\n+\t\t\t\treturn;\n+\t\t\t}\n+\n+\n+\t\t\t// we only received the header, no data\n+\t\t\tif (recv_buffer.empty()) break;\n+\n+\t\t\tif (recv_buffer.size() < front_request.length) break;\n+\n+\t\t\t// if the response is chunked, we need to receive the last\n+\t\t\t// terminating chunk and the tail headers before we can proceed\n+\t\t\tif (m_parser.chunked_encoding() && m_chunk_pos >= 0) break;\n+
    relevance 0../src/load_torrent.cpp:121move the loading logic from torrent_info constructor into here

    move the loading logic from torrent_info constructor into here

    ../src/load_torrent.cpp:121

    \t\t\t\tmask.resize(std::size_t(full_size), false);\n+\t\t\t\tfor (int i = merkle_first_leaf(piece_layer_size)\n+\t\t\t\t\t, end = i + num_pieces; i < end; ++i)\n+\t\t\t\t{\n+\t\t\t\t\tmask[std::size_t(i)] = true;\n+\t\t\t\t}\n+\t\t\t}\n+\t\t\tti->free_piece_layers();\n+\t\t}\n+\t\tatp.info_hashes = atp.ti->info_hashes();\n+\t}\n+}\n+\n+\tadd_torrent_params load_torrent_file(std::string const& filename)\n+\t{ return load_torrent_file(filename, load_torrent_limits{}); }\n+\tadd_torrent_params load_torrent_buffer(span<char const> buffer)\n+\t{ return load_torrent_buffer(buffer, load_torrent_limits{}); }\n+\tadd_torrent_params load_torrent_parsed(bdecode_node const& torrent_file)\n+\t{ return load_torrent_parsed(torrent_file, load_torrent_limits{}); }\n+\n+
    \tadd_torrent_params load_torrent_file(std::string const& filename, load_torrent_limits const& cfg)\n+
    \t{\n+\t\tadd_torrent_params ret;\n+\t\tret.ti = std::make_shared<torrent_info>(filename, cfg);\n+\t\tupdate_atp(ret);\n+\t\treturn ret;\n+\t}\n+\n+\tadd_torrent_params load_torrent_buffer(span<char const> buffer, load_torrent_limits const& cfg)\n+\t{\n+\t\tadd_torrent_params ret;\n+\t\tret.ti = std::make_shared<torrent_info>(buffer, cfg, from_span);\n+\t\tupdate_atp(ret);\n+\t\treturn ret;\n+\t}\n+\n+\tadd_torrent_params load_torrent_parsed(bdecode_node const& torrent_file, load_torrent_limits const& cfg)\n+\t{\n+\t\tadd_torrent_params ret;\n+\t\tret.ti = std::make_shared<torrent_info>(torrent_file, cfg);\n+\t\tupdate_atp(ret);\n+\t\treturn ret;\n+\t}\n+\n+}\n+\n+
    relevance 0../src/merkle_tree.cpp:110in C++20, use std::identity

    in C++20, use std::identity

    ../src/merkle_tree.cpp:110

    \t\tallocate_full();\n+\n+\t\tmerkle_validate_copy(t, m_tree, root(), m_block_verified);\n+\n+\t\tload_verified_bits(verified);\n+\n+\t\toptimize_storage();\n+\t\toptimize_storage_piece_layer();\n+\t}\n+\n+\tvoid merkle_tree::clear()\n+\t{\n+\t\tm_tree.clear();\n+\t\tm_tree.shrink_to_fit();\n+\t\tm_block_verified.clear();\n+\t\tm_mode = mode_t::empty_tree;\n+\t}\n+\n+namespace {\n+\n+
    \tstruct identity\n+
    \t{\n+\t\tbool operator()(bool b) const { return b; }\n+\t};\n+}\n+\n+\tvoid merkle_tree::load_sparse_tree(span<sha256_hash const> t\n+\t\t, std::vector<bool> const& mask\n+\t\t, std::vector<bool> const& verified)\n+\t{\n+\t\tINVARIANT_CHECK;\n+\t\tTORRENT_ASSERT(mask.size() == size());\n+\t\tif (size() != mask.size()) return;\n+\n+\t\tint const first_block = block_layer_start();\n+\t\tint const end_block = first_block + m_num_blocks;\n+\n+\t\tTORRENT_ASSERT(first_block < int(mask.size()));\n+\t\tTORRENT_ASSERT(end_block <= int(mask.size()));\n+\n+\t\t// if the mask covers all blocks, go straight to block_layer\n+\t\t// mode, and validate\n+\t\tif (std::all_of(mask.begin() + first_block, mask.begin() + end_block, identity()))\n+\t\t{\n+\t\t\t// the index in t that points to first_block\n+\t\t\tauto const block_index = std::count_if(mask.begin(), mask.begin() + first_block, identity());\n+\n+\t\t\t// discrepancy\n+\t\t\tif (t.size() < block_index + m_num_blocks)\n+\t\t\t\treturn clear();\n+\n+
    relevance 0../src/merkle_tree.cpp:319this can be optimized by using m_tree as storage to fill this tree into, and then clear it if the hashes fail

    this can be optimized by using m_tree as storage to fill this\n+tree into, and then clear it if the hashes fail

    ../src/merkle_tree.cpp:319

    \t{\n+\t\tINVARIANT_CHECK;\n+\n+\t\t// as we set the hashes of interior nodes, we may be able to validate\n+\t\t// block hashes that we had since earlier. Any blocks that can be\n+\t\t// validated, and failed, are added to this list\n+\t\tadd_hashes_result_t ret;\n+\n+\t\t// we already have all hashes\n+\t\tif (m_mode == mode_t::block_layer)\n+\t\t{\n+\t\t\t// since we're already on the block layer mode, we have the whole\n+\t\t\t// tree, and we've already reported any pieces as passing that may\n+\t\t\t// have existed in the tree when we completed it. At this point no\n+\t\t\t// more pieces should be reported as passed\n+\t\t\treturn ret;\n+\t\t}\n+\n+\t\tallocate_full();\n+\n+
    \t\tint const leaf_count = merkle_num_leafs(int(hashes.size()));\n+
    \t\taux::vector<sha256_hash> tree(merkle_num_nodes(leaf_count));\n+\t\tstd::copy(hashes.begin(), hashes.end(), tree.end() - leaf_count);\n+\n+\t\t// the end of a file is a special case, we may need to pad the leaf layer\n+\t\tif (leaf_count > hashes.size())\n+\t\t{\n+\t\t\tint const leaf_layer_size = num_leafs();\n+\t\t\t// assuming uncle_hashes lead all the way to the root, they tell us\n+\t\t\t// how many layers down we are\n+\t\t\tint const insert_layer_size = leaf_count << uncle_hashes.size();\n+\t\t\tif (leaf_layer_size != insert_layer_size)\n+\t\t\t{\n+\t\t\t\tsha256_hash const pad_hash = merkle_pad(leaf_layer_size, insert_layer_size);\n+\t\t\t\tfor (int i = int(hashes.size()); i < leaf_count; ++i)\n+\t\t\t\t\ttree[tree.end_index() - leaf_count + i] = pad_hash;\n+\t\t\t}\n+\t\t}\n+\n+\t\tmerkle_fill_tree(tree, leaf_count);\n+\n+\t\tint const base_num_layers = merkle_num_layers(leaf_count);\n+\n+\t\t// this is the index of the node where we'll insert the root of the\n+\t\t// subtree (tree). It's also the hash the uncle_hashes are here to prove\n+\t\t// is valid.\n+\t\tint const insert_root_idx = dest_start_idx >> base_num_layers;\n+\n+\t\t// start with validating the proofs, and inserting them as we go.\n+\t\tif (!merkle_validate_and_insert_proofs(m_tree, insert_root_idx, tree[0], uncle_hashes))\n+\t\t\treturn {};\n+
    relevance 0../src/merkle_tree.cpp:367a piece outside of this range may also fail, if one of the uncle hashes is at the layer right above the block hashes

    a piece outside of this range may also fail, if one of the uncle\n+hashes is at the layer right above the block hashes

    ../src/merkle_tree.cpp:367

    \t\tint const insert_root_idx = dest_start_idx >> base_num_layers;\n+\n+\t\t// start with validating the proofs, and inserting them as we go.\n+\t\tif (!merkle_validate_and_insert_proofs(m_tree, insert_root_idx, tree[0], uncle_hashes))\n+\t\t\treturn {};\n+\n+\t\t// first fill in the subtree of known hashes from the base layer\n+\t\tauto const num_leafs = merkle_num_leafs(m_num_blocks);\n+\t\tauto const first_leaf = merkle_first_leaf(num_leafs);\n+\n+\t\t// this is the start of the leaf layer of \"tree\". We'll use this\n+\t\t// variable to step upwards towards the root\n+\t\tint source_cursor = int(tree.size()) - leaf_count;\n+\t\t// the running index in the loop\n+\t\tint dest_cursor = dest_start_idx;\n+\n+\t\t// the number of tree levels in a piece hash. 0 means the block layer is\n+\t\t// the same as the piece layer\n+\t\tint const base = piece_levels();\n+\n+
    \t\tfor (int layer_size = leaf_count; layer_size != 0; layer_size /= 2)\n
    \t\t{\n \t\t\tfor (int i = 0; i < layer_size; ++i)\n \t\t\t{\n \t\t\t\tint const dst_idx = dest_cursor + i;\n \t\t\t\tint const src_idx = source_cursor + i;\n \t\t\t\tif (has_node(dst_idx))\n \t\t\t\t{\n@@ -5820,15 +6930,15 @@\n \n \t\t\t\t\t\t// now that this hash has been reported as failing, we\n \t\t\t\t\t\t// can clear it. This will prevent it from being\n \t\t\t\t\t\t// reported as failing again.\n \t\t\t\t\t\tm_tree[dst_idx].clear();\n \t\t\t\t\t}\n \t\t\t\t\telse if (dst_idx >= first_leaf)\n-
    relevance 0../src/merkle_tree.cpp:447instead of overwriting the root and comparing it against hashes[], write a functions that *validates* a tree by just filling it up to the level below the root and then validates it.

    instead of overwriting the root and comparing it\n+

    relevance 0../src/merkle_tree.cpp:447instead of overwriting the root and comparing it against hashes[], write a functions that *validates* a tree by just filling it up to the level below the root and then validates it.

    instead of overwriting the root and comparing it\n against hashes[], write a functions that *validates* a tree\n by just filling it up to the level below the root and then\n validates it.

    ../src/merkle_tree.cpp:447

    \t\t\t&& dest_start_idx < first_piece_idx + num_pieces())\n \t\t{\n \t\t\tint const blocks_in_piece = 1 << base;\n \n \t\t\t// it may now be possible to verify the hashes of previously received blocks\n@@ -5863,15 +6973,15 @@\n \t\t\t\t}\n \t\t\t\telse\n \t\t\t\t{\n \t\t\t\t\tret.passed.push_back(piece_index_t{piece - first_piece_idx} + file_piece_offset);\n \t\t\t\t\t// record that these block hashes are correct!\n \t\t\t\t\tint const leafs_start = block_idx - block_layer_start();\n \t\t\t\t\tint const leafs_end = std::min(m_num_blocks, leafs_start + blocks_in_piece);\n-
    relevance 0../src/merkle_tree.cpp:471this could be done more efficiently if bitfield had a function to set a range of bits

    this could be done more efficiently if bitfield had a function\n+

    relevance 0../src/merkle_tree.cpp:471this could be done more efficiently if bitfield had a function to set a range of bits

    this could be done more efficiently if bitfield had a function\n to set a range of bits

    ../src/merkle_tree.cpp:471

    \t\t\t\tmerkle_fill_tree(m_tree, blocks_in_piece, block_idx);\n \t\t\t\tif (m_tree[piece] != hashes[i])\n \t\t\t\t{\n \t\t\t\t\tmerkle_clear_tree(m_tree, blocks_in_piece, block_idx);\n \t\t\t\t\t// write back the correct hash\n \t\t\t\t\tm_tree[piece] = hashes[i];\n \t\t\t\t\tTORRENT_ASSERT(blocks_in_piece == blocks_per_piece());\n@@ -5915,15 +7025,15 @@\n \t\tif (blocks_verified(block_index, 1))\n \t\t{\n \t\t\t// if this blocks's hash is already known, check the passed-in hash against it\n \t\t\tif (compare_node(block_tree_index, h))\n \t\t\t\treturn std::make_tuple(set_block_result::ok, block_index, 1);\n \t\t\telse\n \t\t\t\treturn std::make_tuple(set_block_result::block_hash_failed, block_index, 1);\n-
    relevance 0../src/merkle_tree.cpp:514use structured binding in C++17

    use structured binding in C++17

    ../src/merkle_tree.cpp:514

    \t\tauto const first_leaf = merkle_first_leaf(num_leafs);\n+
    relevance 0../src/merkle_tree.cpp:514use structured binding in C++17

    use structured binding in C++17

    ../src/merkle_tree.cpp:514

    \t\tauto const first_leaf = merkle_first_leaf(num_leafs);\n \t\tauto const block_tree_index = first_leaf + block_index;\n \n \t\tif (blocks_verified(block_index, 1))\n \t\t{\n \t\t\t// if this blocks's hash is already known, check the passed-in hash against it\n \t\t\tif (compare_node(block_tree_index, h))\n \t\t\t\treturn std::make_tuple(set_block_result::ok, block_index, 1);\n@@ -5959,15 +7069,15 @@\n \t\t\t// the whole piece failed the hash check. Clear all block hashes\n \t\t\t// in this piece and report a hash failure\n \t\t\tmerkle_clear_tree(m_tree, leafs_size, first_leaf + leafs_start);\n \t\t\tm_tree[root_index] = root;\n \t\t\treturn std::make_tuple(set_block_result::hash_failed, leafs_start, leafs_size);\n \t\t}\n \n-
    relevance 0../src/merkle_tree.cpp:539this could be done more efficiently if bitfield had a function to set a range of bits

    this could be done more efficiently if bitfield had a function\n+

    relevance 0../src/merkle_tree.cpp:539this could be done more efficiently if bitfield had a function to set a range of bits

    this could be done more efficiently if bitfield had a function\n to set a range of bits

    ../src/merkle_tree.cpp:539

    \t\t\tmerkle_find_known_subtree(m_tree, block_index, m_num_blocks);\n \n \t\t// if the root node is unknown the hashes cannot be verified yet\n \t\tif (m_tree[root_index].is_all_zeros())\n \t\t\treturn std::make_tuple(set_block_result::unknown, leafs_start, leafs_size);\n \n \t\t// save the root hash because merkle_fill_tree will overwrite it\n@@ -6011,227 +7121,586 @@\n \tint merkle_tree::block_layer_start() const\n \t{\n \t\tint const num_leafs = merkle_num_leafs(m_num_blocks);\n \t\tTORRENT_ASSERT(num_leafs > 0);\n \t\treturn merkle_first_leaf(num_leafs);\n \t}\n \n-
    relevance 0../src/storage_utils.cpp:230ideally, if we end up copying files because of a move across volumes, the source should not be deleted until they've all been copied. That would let us rollback with higher confidence.

    ideally, if we end up copying files because of a move across\n-volumes, the source should not be deleted until they've all been\n-copied. That would let us rollback with higher confidence.

    ../src/storage_utils.cpp:230

    \t\t// later\n-\t\taux::vector<bool, file_index_t> copied_files(std::size_t(f.num_files()), false);\n+
    relevance 0../src/choker.cpp:258make configurable

    make configurable

    ../src/choker.cpp:258

    \t\t\t// first reset the number of unchoke slots, because we'll calculate\n+\t\t\t// it purely based on the current state of our peers.\n+\t\t\tupload_slots = 0;\n \n-\t\t// track how far we got in case of an error\n-\t\tfile_index_t file_index{};\n-\t\tfor (auto const i : f.file_range())\n+\t\t\tint rate_threshold = sett.get_int(settings_pack::rate_choker_initial_threshold);\n+\n+\t\t\tstd::sort(peers.begin(), peers.end()\n+\t\t\t\t, [](peer_connection const* lhs, peer_connection const* rhs)\n+\t\t\t\t{ return upload_rate_compare(lhs, rhs); });\n+\n+\t\t\tfor (auto const* p : peers)\n+\t\t\t{\n+\t\t\t\tint const rate = int(p->uploaded_in_last_round()\n+\t\t\t\t\t* 1000 / total_milliseconds(unchoke_interval));\n+\n+\t\t\t\t// always have at least 1 unchoke slot\n+\t\t\t\tif (rate < rate_threshold) break;\n+\n+\t\t\t\t++upload_slots;\n+\n+
    \t\t\t\trate_threshold += 2048;\n+
    \t\t\t}\n+\t\t\t++upload_slots;\n+\t\t}\n+\n+\t\t// sorts the peers that are eligible for unchoke by download rate and\n+\t\t// secondary by total upload. The reason for this is, if all torrents are\n+\t\t// being seeded, the download rate will be 0, and the peers we have sent\n+\t\t// the least to should be unchoked\n+\n+\t\t// we use partial sort here, because we only care about the top\n+\t\t// upload_slots peers.\n+\n+\t\tint const slots = std::min(upload_slots, int(peers.size()));\n+\n+\t\tif (sett.get_int(settings_pack::seed_choking_algorithm)\n+\t\t\t== settings_pack::round_robin)\n \t\t{\n-\t\t\t// files moved out to absolute paths are not moved\n-\t\t\tif (f.file_absolute_path(i)) continue;\n+\t\t\tint const pieces = sett.get_int(settings_pack::seeding_piece_quota);\n \n-\t\t\tstd::string const old_path = combine_path(save_path, f.file_path(i));\n-\t\t\tstd::string const new_path = combine_path(new_save_path, f.file_path(i));\n+\t\t\tstd::nth_element(peers.begin(), peers.begin()\n+\t\t\t\t+ slots, peers.end()\n+\t\t\t\t, [pieces](peer_connection const* lhs, peer_connection const* rhs)\n+\t\t\t\t{ return unchoke_compare_rr(lhs, rhs, pieces); });\n+\t\t}\n+\t\telse if (sett.get_int(settings_pack::seed_choking_algorithm)\n+\t\t\t== settings_pack::fastest_upload)\n+\t\t{\n+\t\t\tstd::nth_element(peers.begin(), peers.begin()\n+\t\t\t\t+ slots, peers.end()\n+\t\t\t\t, [](peer_connection const* lhs, peer_connection const* rhs)\n+
    relevance 0../src/piece_picker.cpp:121find a better place for this

    find a better place for this

    ../src/piece_picker.cpp:121

    \t\t\tif (limit == 0)\n+\t\t\t{\n+\t\t\t\tstd::cerr << \" ...\";\n+\t\t\t\tbreak;\n+\t\t\t}\n+\t\t\tif (*i == -1) break;\n+\t\t\twhile (j != p.m_priority_boundaries.end() && *j <= index)\n+\t\t\t{\n+\t\t\t\tstd::cerr << \"| \";\n+\t\t\t\t++j;\n+\t\t\t}\n+\t\t\tstd::cerr << *i << \"(\" << p.m_piece_map[*i].index << \") \";\n+\t\t\t--limit;\n+\t\t}\n+\t\tstd::cerr << std::endl;\n+\t}\n+}\n+#endif // TORRENT_PICKER_LOG\n+namespace libtorrent {\n \n-\t\t\terror_code ignore;\n-\t\t\tif (flags == move_flags_t::dont_replace && exists(new_path, ignore))\n+
    \tconst piece_block piece_block::invalid(\n+
    \t\tstd::numeric_limits<piece_index_t>::max()\n+\t\t, std::numeric_limits<int>::max());\n+\n+\tconstexpr prio_index_t piece_picker::piece_pos::we_have_index;\n+\n+\tconstexpr picker_options_t piece_picker::rarest_first;\n+\tconstexpr picker_options_t piece_picker::reverse;\n+\tconstexpr picker_options_t piece_picker::on_parole;\n+\tconstexpr picker_options_t piece_picker::prioritize_partials;\n+\tconstexpr picker_options_t piece_picker::sequential;\n+\tconstexpr picker_options_t piece_picker::align_expanded_pieces;\n+\tconstexpr picker_options_t piece_picker::piece_extent_affinity;\n+\n+\tconstexpr download_queue_t piece_picker::piece_pos::piece_downloading;\n+\tconstexpr download_queue_t piece_picker::piece_pos::piece_full;\n+\tconstexpr download_queue_t piece_picker::piece_pos::piece_finished;\n+\tconstexpr download_queue_t piece_picker::piece_pos::piece_zero_prio;\n+\tconstexpr download_queue_t piece_picker::piece_pos::num_download_categories;\n+\tconstexpr download_queue_t piece_picker::piece_pos::piece_open;\n+\tconstexpr download_queue_t piece_picker::piece_pos::piece_downloading_reverse;\n+\tconstexpr download_queue_t piece_picker::piece_pos::piece_full_reverse;\n+\n+\t// the max number of blocks to create an affinity for\n+\tconstexpr int max_piece_affinity_extent = 4 * 1024 * 1024 / default_block_size;\n+\n+\tpiece_picker::piece_picker(std::int64_t const total_size, int const piece_size)\n+\t\t: m_priority_boundaries(1, m_pieces.end_index())\n+\t{\n+\t\tTORRENT_ASSERT(total_size > 0);\n+\t\tTORRENT_ASSERT(piece_size > 0);\n+
    relevance 0../src/piece_picker.cpp:2067this could probably be optimized by incrementally calling partial_sort to sort one more element in the list. Because chances are that we'll just need a single piece, and once we've picked from it we're done. Sorting the rest of the list in that case is a waste of time.

    this could probably be optimized by incrementally\n+calling partial_sort to sort one more element in the list. Because\n+chances are that we'll just need a single piece, and once we've\n+picked from it we're done. Sorting the rest of the list in that\n+case is a waste of time.

    ../src/piece_picker.cpp:2067

    \t\t\t// now, copy over the pointers. We also apply a filter here to not\n+\t\t\t// include ineligible pieces in certain modes. For instance, a piece\n+\t\t\t// that the current peer doesn't have is not included.\n+\t\t\tfor (auto& dp : m_downloads[piece_pos::piece_downloading])\n \t\t\t{\n-\t\t\t\tif (ret == status_t::no_error) ret = status_t::need_full_check;\n-\t\t\t\tcontinue;\n+\t\t\t\tpc.inc_stats_counter(counters::piece_picker_partial_loops);\n+\n+\t\t\t\tif (!is_piece_free(dp.index, pieces)) continue;\n+\n+\t\t\t\tTORRENT_ASSERT(m_piece_map[dp.index].download_queue()\n+\t\t\t\t\t== piece_pos::piece_downloading);\n+\n+\t\t\t\tordered_partials[num_ordered_partials++] = &dp;\n \t\t\t}\n \n-
    \t\t\tmove_file(old_path, new_path, ec);\n-
    \n-\t\t\t// if the source file doesn't exist. That's not a problem\n-\t\t\t// we just ignore that file\n-\t\t\tif (ec.ec == boost::system::errc::no_such_file_or_directory)\n-\t\t\t\tec.ec.clear();\n-\t\t\telse if (ec\n-\t\t\t\t&& ec.ec != boost::system::errc::invalid_argument\n-\t\t\t\t&& ec.ec != boost::system::errc::permission_denied)\n+\t\t\t// now, sort the list.\n+\t\t\tif (options & rarest_first)\n \t\t\t{\n-\t\t\t\t// moving the file failed\n-\t\t\t\t// on OSX, the error when trying to rename a file across different\n-\t\t\t\t// volumes is EXDEV, which will make it fall back to copying.\n-\t\t\t\tec.ec.clear();\n-\t\t\t\tcopy_file(old_path, new_path, ec);\n-\t\t\t\tif (!ec) copied_files[i] = true;\n+\t\t\t\tret |= picker_log_alert::rarest_first_partials;\n+\n+
    \t\t\t\tstd::sort(ordered_partials.begin(), ordered_partials.begin() + num_ordered_partials\n+
    \t\t\t\t\t, std::bind(&piece_picker::partial_compare_rarest_first, this\n+\t\t\t\t\t\t, _1, _2));\n \t\t\t}\n \n-\t\t\tif (ec)\n+\t\t\tfor (int i = 0; i < num_ordered_partials; ++i)\n \t\t\t{\n-\t\t\t\tec.file(i);\n-\t\t\t\tfile_index = i;\n-\t\t\t\tbreak;\n+\t\t\t\tret |= picker_log_alert::prioritize_partials;\n+\n+\t\t\t\tnum_blocks = add_blocks_downloading(*ordered_partials[i], pieces\n+\t\t\t\t\t, interesting_blocks, backup_blocks, backup_blocks2\n+\t\t\t\t\t, num_blocks, prefer_contiguous_blocks, peer, options);\n+\t\t\t\tif (num_blocks <= 0) return ret;\n+\t\t\t\tif (int(backup_blocks.size()) >= num_blocks\n+\t\t\t\t\t&& int(backup_blocks2.size()) >= num_blocks)\n+\t\t\t\t\tbreak;\n \t\t\t}\n+\n+\t\t\tnum_blocks = append_blocks(interesting_blocks, backup_blocks\n+\t\t\t\t, num_blocks);\n+\t\t\tif (num_blocks <= 0) return ret;\n+\n+\t\t\tnum_blocks = append_blocks(interesting_blocks, backup_blocks2\n+\t\t\t\t, num_blocks);\n+\t\t\tif (num_blocks <= 0) return ret;\n \t\t}\n \n-\t\tif (!ec && move_partfile)\n+\t\tif (!suggested_pieces.empty())\n \t\t{\n-\t\t\terror_code e;\n-\t\t\tmove_partfile(new_save_path, e);\n-\t\t\tif (e)\n-
    relevance 0../src/storage_utils.cpp:538it would seem reasonable to, instead, set the have_pieces bits for the pieces representing these files, and resume with the normal logic

    it would seem reasonable to, instead, set the have_pieces bits\n-for the pieces representing these files, and resume with the normal\n-logic

    ../src/storage_utils.cpp:538

    \t\t\t\t\tcontinue;\n+\t\t\tfor (piece_index_t i : suggested_pieces)\n+\t\t\t{\n+
    relevance 0../src/piece_picker.cpp:2211Is it a good idea that this affinity takes precedence over piece priority?

    Is it a good idea that this affinity takes precedence over\n+piece priority?

    ../src/piece_picker.cpp:2211

    \t\t\t\t\tprio_index_t const end = priority_end(i);\n+\t\t\t\t\tfor (prio_index_t p = prev(end); p >= start; --p)\n+\t\t\t\t\t{\n+\t\t\t\t\t\tpc.inc_stats_counter(counters::piece_picker_reverse_rare_loops);\n \n-\t\t\t\tstd::int64_t const size = get_filesize(stat, file_index, fs\n-\t\t\t\t\t, save_path, ec);\n-\t\t\t\tif (size < 0) return false;\n+\t\t\t\t\t\tif (!is_piece_free(m_pieces[p], pieces)) continue;\n \n-\t\t\t\tif (size < fs.file_size(file_index))\n-\t\t\t\t{\n-\t\t\t\t\tec.ec = errors::mismatching_file_size;\n-\t\t\t\t\tec.file(file_index);\n-\t\t\t\t\tec.operation = operation_t::check_resume;\n-\t\t\t\t\treturn false;\n+\t\t\t\t\t\tret |= picker_log_alert::reverse_rarest_first;\n+\n+\t\t\t\t\t\tnum_blocks = add_blocks(m_pieces[p], pieces\n+\t\t\t\t\t\t\t, interesting_blocks, backup_blocks\n+\t\t\t\t\t\t\t, backup_blocks2, num_blocks\n+\t\t\t\t\t\t\t, prefer_contiguous_blocks, peer, ignored_pieces\n+\t\t\t\t\t\t\t, options);\n+\t\t\t\t\t\tif (num_blocks <= 0) return ret;\n+\t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n-\t\t\treturn true;\n+\t\t\telse\n+\t\t\t{\n+
    \t\t\t\tif (options & piece_extent_affinity)\n+
    \t\t\t\t{\n+\t\t\t\t\tint to_erase = -1;\n+\t\t\t\t\tint idx = -1;\n+\t\t\t\t\tfor (piece_extent_t const e : m_recent_extents)\n+\t\t\t\t\t{\n+\t\t\t\t\t\t++idx;\n+\t\t\t\t\t\tbool have_all = true;\n+\t\t\t\t\t\tfor (piece_index_t const p : extent_for(e))\n+\t\t\t\t\t\t{\n+\t\t\t\t\t\t\tif (!m_piece_map[p].have()) have_all = false;\n+\t\t\t\t\t\t\tif (!is_piece_free(p, pieces)) continue;\n+\n+\t\t\t\t\t\t\tret |= picker_log_alert::extent_affinity;\n+\n+\t\t\t\t\t\t\tnum_blocks = add_blocks(p, pieces\n+\t\t\t\t\t\t\t\t, interesting_blocks, backup_blocks\n+\t\t\t\t\t\t\t\t, backup_blocks2, num_blocks\n+\t\t\t\t\t\t\t\t, prefer_contiguous_blocks, peer, ignored_pieces\n+\t\t\t\t\t\t\t\t, options);\n+\t\t\t\t\t\t\tif (num_blocks <= 0)\n+\t\t\t\t\t\t\t{\n+\t\t\t\t\t\t\t\t// if we have all pieces belonging to this extent, remove it\n+\t\t\t\t\t\t\t\tif (to_erase != -1) m_recent_extents.erase(m_recent_extents.begin() + to_erase);\n+\t\t\t\t\t\t\t\treturn ret;\n+\t\t\t\t\t\t\t}\n+\t\t\t\t\t\t}\n+\t\t\t\t\t\t// if we have all pieces belonging to this extent, remove it\n+\t\t\t\t\t\tif (have_all) to_erase = idx;\n+\t\t\t\t\t}\n+\t\t\t\t\tif (to_erase != -1) m_recent_extents.erase(m_recent_extents.begin() + to_erase);\n+
    relevance 0../src/piece_picker.cpp:2566when expanding pieces for cache stripe reasons, the !downloading condition doesn't make much sense

    when expanding pieces for cache stripe reasons,\n+the !downloading condition doesn't make much sense

    ../src/piece_picker.cpp:2566

    \t\tTORRENT_ASSERT(index < m_piece_map.end_index());\n+\t\tif (next(index) == m_piece_map.end_index())\n+\t\t\treturn m_blocks_in_last_piece;\n+\t\telse\n+\t\t\treturn blocks_per_piece();\n+\t}\n+\n+\tbool piece_picker::is_piece_free(piece_index_t const piece\n+\t\t, typed_bitfield<piece_index_t> const& bitmask) const\n+\t{\n+\t\treturn bitmask[piece]\n+\t\t\t&& !m_piece_map[piece].have()\n+\t\t\t&& !m_piece_map[piece].filtered();\n+\t}\n+\n+\tbool piece_picker::can_pick(piece_index_t const piece\n+\t\t, typed_bitfield<piece_index_t> const& bitmask) const\n+\t{\n+\t\treturn bitmask[piece]\n+\t\t\t&& !m_piece_map[piece].have()\n+
    \t\t\t&& !m_piece_map[piece].downloading()\n+
    \t\t\t&& !m_piece_map[piece].filtered();\n+\t}\n+\n+#if TORRENT_USE_INVARIANT_CHECKS\n+\tvoid piece_picker::check_peers()\n+\t{\n+\t\tfor (auto const& b : m_block_info)\n+\t\t{\n+\t\t\tTORRENT_ASSERT(b.peer == nullptr || static_cast<torrent_peer*>(b.peer)->in_use);\n \t\t}\n+\t}\n+#endif\n \n-#ifndef TORRENT_DISABLE_MUTABLE_TORRENTS\n-\t\t// always trigger a full recheck when we pull in files from other\n-\t\t// torrents, via hard links\n-
    \t\tif (added_files) return false;\n-
    #endif\n+\tvoid piece_picker::clear_peer(torrent_peer* peer)\n+\t{\n+\t\tfor (auto& b : m_block_info)\n+\t\t{\n+\t\t\tif (b.peer == peer) b.peer = nullptr;\n+\t\t}\n+\t}\n \n-\t\t// parse have bitmask. Verify that the files we expect to have\n-\t\t// actually do exist\n-\t\tpiece_index_t const end_piece = std::min(rd.have_pieces.end_index(), fs.end_piece());\n-\t\tfor (piece_index_t i(0); i < end_piece; ++i)\n+\t// the first bool is true if this is the only peer that has requested and downloaded\n+\t// blocks from this piece.\n+\t// the second bool is true if this is the only active peer that is requesting\n+\t// and downloading blocks from this piece. Active means having a connection.\n+
    relevance 0../src/piece_picker.cpp:3144should 5 be configurable?

    should 5 be configurable?

    ../src/piece_picker.cpp:3144

    \t\tbool have_all = true;\n+\n+\t\tfor (auto const piece : extent_for(this_extent))\n \t\t{\n-\t\t\tif (rd.have_pieces.get_bit(i) == false) continue;\n+\t\t\tif (piece == p) continue;\n \n-\t\t\tstd::vector<file_slice> f = fs.map_block(i, 0, 1);\n-\t\t\tTORRENT_ASSERT(!f.empty());\n+\t\t\tif (!m_piece_map[piece].have()) have_all = false;\n \n-\t\t\tfile_index_t const file_index = f[0].file_index;\n+\t\t\t// if at least one piece in this extent has a different priority than\n+\t\t\t// the one we just started downloading, don't create an affinity for\n+\t\t\t// adjacent pieces. This probably means the pieces belong to different\n+\t\t\t// files, or that some other mechanism determining the priority should\n+\t\t\t// take precedence.\n+\t\t\tif (piece_priority(piece) != this_prio) return;\n+\t\t}\n \n-\t\t\t// files with priority zero may not have been saved to disk at their\n-\t\t\t// expected location, but is likely to be in a partfile. Just exempt it\n-\t\t\t// from checking\n-\t\t\tif (file_index < file_priority.end_index()\n-\t\t\t\t&& file_priority[file_index] == dont_download)\n-\t\t\t\tcontinue;\n+\t\t// if we already have all the *other* pieces in this extent, there's no\n+\t\t// need to inflate their priorities\n+\t\tif (have_all) return;\n \n-\t\t\tif (fs.pad_file_at(file_index)) continue;\n+
    \t\tif (m_recent_extents.size() < 5)\n+
    \t\t\tm_recent_extents.push_back(this_extent);\n \n-\t\t\tif (get_filesize(stat, file_index, fs, save_path, ec) < 0)\n-\t\t\t\treturn false;\n+\t\t// limit the number of extent affinities active at any given time to limit\n+\t\t// the cost of checking them. Also, don't replace them, commit to\n+\t\t// finishing them before starting another extent. This is analogous to\n+\t\t// limiting the number of partial pieces.\n+\t}\n \n-\t\t\t// OK, this file existed, good. Now, skip all remaining pieces in\n-\t\t\t// this file. We're just sanity-checking whether the files exist\n-\t\t\t// or not.\n-\t\t\tpeer_request const pr = fs.map_file(file_index\n-
    relevance 0../src/part_file.cpp:300what do we do if someone is currently reading from the disk from this piece? does it matter? Since we won't actively erase the data from disk, but it may be overwritten soon, it's probably not that big of a deal

    what do we do if someone is currently reading from the disk\n-from this piece? does it matter? Since we won't actively erase the\n-data from disk, but it may be overwritten soon, it's probably not that\n-big of a deal

    ../src/part_file.cpp:300

    \t\t\t\tcreate_directories(m_path, ec);\n-\t\t\t\tif (ec) return {};\n-\t\t\t\treturn aux::file_handle(fn, 0, mode);\n-\t\t\t}\n-\t\t\treturn {};\n+\t// options may be 0 or piece_picker::reverse\n+\t// returns false if the block could not be marked as downloading\n+\tbool piece_picker::mark_as_downloading(piece_block const block\n+\t\t, torrent_peer* peer, picker_options_t const options)\n+\t{\n+#ifdef TORRENT_PICKER_LOG\n+\t\tstd::cerr << \"[\" << this << \"] \" << \"mark_as_downloading( {\"\n+\t\t\t<< block.piece_index << \", \" << block.block_index << \"} )\" << std::endl;\n+#endif\n+\n+\t\tTORRENT_ASSERT(peer == nullptr || peer->in_use);\n+\t\tTORRENT_ASSERT(block.block_index != piece_block::invalid.block_index);\n+\t\tTORRENT_ASSERT(block.piece_index != piece_block::invalid.piece_index);\n+\t\tTORRENT_ASSERT(block.piece_index < m_piece_map.end_index());\n+\t\tTORRENT_ASSERT(block.block_index < blocks_in_piece(block.piece_index));\n+\t\tTORRENT_ASSERT(!m_piece_map[block.piece_index].have());\n+\n+\t\tpiece_pos& p = m_piece_map[block.piece_index];\n+\t\tif (p.download_queue() == piece_pos::piece_open)\n+\t\t{\n+#ifdef TORRENT_EXPENSIVE_INVARIANT_CHECKS\n+\t\t\tINVARIANT_CHECK;\n+
    relevance 0../src/session.cpp:540In C++17. use if constexpr instead

    In C++17. use if constexpr instead

    ../src/session.cpp:540

    \t{}\n+\tsession_proxy::session_proxy(session_proxy const&) = default;\n+\tsession_proxy& session_proxy::operator=(session_proxy const&) & = default;\n+\tsession_proxy::session_proxy(session_proxy&&) noexcept = default;\n+\tsession_proxy& session_proxy::operator=(session_proxy&&) & noexcept = default;\n+\tsession_proxy::~session_proxy()\n+\t{\n+\t\tif (m_thread && m_thread.use_count() == 1)\n+\t\t{\n+#if defined TORRENT_ASIO_DEBUGGING\n+\t\t\twait_for_asio_handlers();\n+#endif\n+\t\t\tm_thread->join();\n \t\t}\n \t}\n-\tcatch (storage_error const& e)\n+\n+\tTORRENT_EXPORT std::unique_ptr<disk_interface> default_disk_io_constructor(\n+\t\tio_context& ios, settings_interface const& sett, counters& cnt)\n \t{\n-\t\tec = e.ec;\n-\t\treturn {};\n+#if TORRENT_HAVE_MMAP || TORRENT_HAVE_MAP_VIEW_OF_FILE\n+
    #include \"libtorrent/aux_/disable_deprecation_warnings_push.hpp\"\n+
    \t\tif (sizeof(void*) == 8)\n+\t\t\treturn mmap_disk_io_constructor(ios, sett, cnt);\n+\t\telse\n+\t\t\treturn posix_disk_io_constructor(ios, sett, cnt);\n+#include \"libtorrent/aux_/disable_warnings_pop.hpp\"\n+#else\n+\t\treturn posix_disk_io_constructor(ios, sett, cnt);\n+#endif\n \t}\n \n-\tvoid part_file::free_piece(piece_index_t const piece)\n-\t{\n-\t\tstd::lock_guard<std::mutex> l(m_mutex);\n+}\n+
    relevance 0../src/enum_net.cpp:144in C++17, use __has_include for this. Other operating systems are likely to require this as well

    in C++17, use __has_include for this. Other operating systems are\n+likely to require this as well

    ../src/enum_net.cpp:144

    #include <arpa/inet.h>\n+#include <cstring>\n+#include <cstdlib>\n+#include <unistd.h>\n+#include <sys/types.h>\n \n-\t\tauto const i = m_piece_map.find(piece);\n-\t\tif (i == m_piece_map.end()) return;\n+#if defined TORRENT_ANDROID && !defined IFA_F_DADFAILED\n+#define IFA_F_DADFAILED 8\n+#endif\n \n-
    \n-
    \t\tm_free_slots.push_back(i->second);\n-\t\tm_piece_map.erase(i);\n-\t\tm_dirty_metadata = true;\n+#endif\n+\n+#if TORRENT_USE_IFADDRS\n+#include <ifaddrs.h>\n+#include <net/if.h>\n+#include <sys/ioctl.h>\n+#endif\n+\n+#if TORRENT_USE_IFADDRS || TORRENT_USE_IFCONF || TORRENT_USE_NETLINK || TORRENT_USE_SYSCTL\n+#ifdef TORRENT_BEOS\n+
    #include <sys/sockio.h>\n+
    #endif\n+// capture this here where warnings are disabled (the macro generates warnings)\n+const unsigned long siocgifmtu = SIOCGIFMTU;\n+#endif\n+\n+#include \"libtorrent/aux_/disable_warnings_pop.hpp\"\n+\n+#if defined(TORRENT_OS2) && !defined(IF_NAMESIZE)\n+#define IF_NAMESIZE IFNAMSIZ\n+#endif\n+\n+namespace libtorrent {\n+\n+namespace {\n+\n+#if !defined TORRENT_WINDOWS && !defined TORRENT_BUILD_SIMULATOR\n+\tstruct socket_closer\n+\t{\n+\t\tsocket_closer(int s) : m_socket(s) {}\n+\t\tsocket_closer(socket_closer const&) = delete;\n+\t\tsocket_closer(socket_closer &&) = delete;\n+\t\tsocket_closer& operator=(socket_closer const&) = delete;\n+\t\tsocket_closer& operator=(socket_closer &&) = delete;\n+\t\t~socket_closer() { ::close(m_socket); }\n+\tprivate:\n+\t\tint m_socket;\n+\t};\n+#endif\n+\n+#if !defined TORRENT_BUILD_SIMULATOR\n+
    relevance 0../src/enum_net.cpp:268if we get here, the caller still assumes the error code is reported via errno

    if we get here, the caller still assumes the error code\n+is reported via errno

    ../src/enum_net.cpp:268

    \t\t;\n \t}\n+#endif\n \n-\tvoid part_file::move_partfile(std::string const& path, error_code& ec)\n+#if TORRENT_USE_NETLINK\n+\n+\tint read_nl_sock(int sock, std::uint32_t const seq, std::uint32_t const pid\n+\t\t, std::function<void(nlmsghdr const*)> on_msg)\n \t{\n-\t\tstd::lock_guard<std::mutex> l(m_mutex);\n+\t\tstd::array<char, 4096> buf;\n+\t\tfor (;;)\n+\t\t{\n+\t\t\tint const read_len = int(recv(sock, buf.data(), buf.size(), 0));\n+\t\t\tif (read_len < 0) return -1;\n \n-\t\tflush_metadata_impl(ec);\n-\t\tif (ec) return;\n+\t\t\tauto const* nl_hdr = reinterpret_cast<nlmsghdr const*>(buf.data());\n+\t\t\tint len = read_len;\n \n-\t\tif (!m_piece_map.empty())\n+\t\t\tfor (; len > 0 && aux::nlmsg_ok(nl_hdr, len); nl_hdr = aux::nlmsg_next(nl_hdr, len))\n+\t\t\t{\n+
    \t\t\t\tif ((aux::nlmsg_ok(nl_hdr, read_len) == 0) || (nl_hdr->nlmsg_type == NLMSG_ERROR))\n+
    \t\t\t\t\treturn -1;\n+\t\t\t\t// this function doesn't handle multiple requests at the same time\n+\t\t\t\t// so report an error if the message does not have the expected seq and pid\n+
    relevance 0../src/enum_net.cpp:274if we get here, the caller still assumes the error code is reported via errno

    if we get here, the caller still assumes the error code\n+is reported via errno

    ../src/enum_net.cpp:274

    #if TORRENT_USE_NETLINK\n+\n+\tint read_nl_sock(int sock, std::uint32_t const seq, std::uint32_t const pid\n+\t\t, std::function<void(nlmsghdr const*)> on_msg)\n+\t{\n+\t\tstd::array<char, 4096> buf;\n+\t\tfor (;;)\n \t\t{\n-\t\t\tstd::string old_path = combine_path(m_path, m_name);\n-\t\t\tstd::string new_path = combine_path(path, m_name);\n+\t\t\tint const read_len = int(recv(sock, buf.data(), buf.size(), 0));\n+\t\t\tif (read_len < 0) return -1;\n \n-\t\t\trename(old_path, new_path, ec);\n-\t\t\tif (ec == boost::system::errc::no_such_file_or_directory)\n-\t\t\t\tec.clear();\n+\t\t\tauto const* nl_hdr = reinterpret_cast<nlmsghdr const*>(buf.data());\n+\t\t\tint len = read_len;\n \n-\t\t\tif (ec)\n+\t\t\tfor (; len > 0 && aux::nlmsg_ok(nl_hdr, len); nl_hdr = aux::nlmsg_next(nl_hdr, len))\n \t\t\t{\n-\t\t\t\tstorage_error se;\n-\t\t\t\taux::copy_file(old_path, new_path, se);\n-\t\t\t\tec = se.ec;\n-\t\t\t\tif (ec) return;\n-\t\t\t\tremove(old_path, ec);\n-\t\t\t}\n-\t\t}\n-
    relevance 0../src/part_file.cpp:411instead of rebuilding the whole file header and flushing it, update the slot entries as we go

    instead of rebuilding the whole file header\n-and flushing it, update the slot entries as we go

    ../src/part_file.cpp:411

    \t\t\t\t\t\tTORRENT_ASSERT(j->second == slot);\n-\t\t\t\t\t\tm_free_slots.push_back(j->second);\n-\t\t\t\t\t\tm_piece_map.erase(j);\n-\t\t\t\t\t\tm_dirty_metadata = true;\n-\t\t\t\t\t}\n-\t\t\t\t}\n+\t\t\t\tif ((aux::nlmsg_ok(nl_hdr, read_len) == 0) || (nl_hdr->nlmsg_type == NLMSG_ERROR))\n+\t\t\t\t\treturn -1;\n+\t\t\t\t// this function doesn't handle multiple requests at the same time\n+\t\t\t\t// so report an error if the message does not have the expected seq and pid\n+
    \t\t\t\tif (nl_hdr->nlmsg_seq != seq || nl_hdr->nlmsg_pid != pid)\n+
    \t\t\t\t\treturn -1;\n+\n+\t\t\t\tif (nl_hdr->nlmsg_type == NLMSG_DONE) return 0;\n+\n+\t\t\t\ton_msg(nl_hdr);\n+\n+\t\t\t\tif ((nl_hdr->nlmsg_flags & NLM_F_MULTI) == 0) return 0;\n \t\t\t}\n-\t\t\tfile_offset += block_to_copy;\n-\t\t\tpiece_offset = 0;\n-\t\t\tsize -= block_to_copy;\n \t\t}\n+//\t\treturn 0;\n \t}\n \n-\tvoid part_file::flush_metadata(error_code& ec)\n+\tint nl_dump_request(int const sock, std::uint32_t const seq\n+\t\t, nlmsghdr* const request_msg, std::function<void(nlmsghdr const*)> on_msg)\n \t{\n-\t\tstd::lock_guard<std::mutex> l(m_mutex);\n+\t\trequest_msg->nlmsg_flags = NLM_F_DUMP | NLM_F_REQUEST;\n+\t\trequest_msg->nlmsg_seq = seq;\n+\t\t// in theory nlmsg_pid should be set to the netlink port ID (NOT the process ID)\n+\t\t// of the sender, but the kernel ignores this field so it is typically set to\n+\t\t// zero\n+\t\trequest_msg->nlmsg_pid = 0;\n \n-\t\tflush_metadata_impl(ec);\n+\t\tif (::send(sock, request_msg, request_msg->nlmsg_len, 0) < 0)\n+\t\t\treturn -1;\n+\n+\t\t// get the socket's port ID so that we can verify it in the response\n+\t\tsockaddr_nl sock_addr;\n+\t\tsocklen_t sock_addr_len = sizeof(sock_addr);\n+\t\tif (::getsockname(sock, reinterpret_cast<sockaddr*>(&sock_addr), &sock_addr_len) < 0)\n+\t\t\treturn -1;\n+
    relevance 0../src/packet_buffer.cpp:157use compare_less_wrap for this comparison as well

    use compare_less_wrap for this comparison as well

    ../src/packet_buffer.cpp:157

    \t{\n+\t\tINVARIANT_CHECK;\n+\t\tTORRENT_ASSERT_VAL(size <= 0xffff, size);\n+\t\tstd::uint32_t new_size = m_capacity == 0 ? 16 : m_capacity;\n+\n+\t\twhile (new_size < size)\n+\t\t\tnew_size <<= 1;\n+\n+\t\taux::unique_ptr<packet_ptr[], index_type> new_storage(new packet_ptr[new_size]);\n+\n+\t\tfor (index_type i = m_first; i < (m_first + m_capacity); ++i)\n+\t\t\tnew_storage[i & (new_size - 1)] = std::move(m_storage[i & (m_capacity - 1)]);\n+\n+\t\tm_storage = std::move(new_storage);\n+\t\tm_capacity = new_size;\n \t}\n \n-
    \tvoid part_file::flush_metadata_impl(error_code& ec)\n-
    \t{\n-\t\t// do we need to flush the metadata?\n-\t\tif (m_dirty_metadata == false) return;\n+\tpacket_ptr packet_buffer::remove(index_type idx)\n+\t{\n+\t\tINVARIANT_CHECK;\n+
    \t\tif (idx >= m_first + m_capacity)\n+
    \t\t\treturn packet_ptr();\n \n-\t\tif (m_piece_map.empty())\n+\t\tif (compare_less_wrap(idx, m_first, 0xffff))\n+\t\t\treturn packet_ptr();\n+\n+\t\tstd::size_t const mask = m_capacity - 1;\n+\t\tpacket_ptr old_value = std::move(m_storage[idx & mask]);\n+\t\tm_storage[idx & mask].reset();\n+\n+\t\tif (old_value)\n \t\t{\n-\t\t\t// if we don't have any pieces left in the\n-\t\t\t// part file, remove it\n-\t\t\tstd::string const p = combine_path(m_path, m_name);\n-\t\t\tremove(p, ec);\n+\t\t\t--m_size;\n+\t\t\tif (m_size == 0) m_last = m_first;\n+\t\t}\n \n-\t\t\tif (ec == boost::system::errc::no_such_file_or_directory)\n-\t\t\t\tec.clear();\n-\t\t\treturn;\n+\t\tif (idx == m_first && m_size != 0)\n+\t\t{\n+\t\t\t++m_first;\n+\t\t\tfor (index_type i = 0; i < m_capacity; ++i, ++m_first)\n+\t\t\t\tif (m_storage[m_first & mask]) break;\n+\t\t\tm_first &= 0xffff;\n \t\t}\n \n-\t\tauto f = open_file(aux::open_mode::write | aux::open_mode::hidden, ec);\n-\t\tif (ec) return;\n+\t\tif (((idx + 1) & 0xffff) == m_last && m_size != 0)\n+\t\t{\n+\t\t\t--m_last;\n+\t\t\tfor (index_type i = 0; i < m_capacity; ++i, --m_last)\n+\t\t\t\tif (m_storage[m_last & mask]) break;\n+\t\t\t++m_last;\n+\t\t\tm_last &= 0xffff;\n+
    relevance 0../src/udp_socket.cpp:659perhaps an attempt should be made to bind m_socks5_sock to the device of m_listen_socket

    perhaps an attempt should be made to bind m_socks5_sock to the\n+device of m_listen_socket

    ../src/udp_socket.cpp:659

    \tif (ec)\n+\t{\n+\t\tif (m_alerts.should_post<socks5_alert>())\n+\t\t\tm_alerts.emplace_alert<socks5_alert>(m_proxy_addr, operation_t::sock_option, ec);\n+\t\tec.clear();\n+\t}\n+#endif\n+#endif\n \n-\t\tstd::vector<char> header(static_cast<std::size_t>(m_header_size));\n+\ttcp::endpoint const bind_ep(m_listen_socket.get_local_endpoint().address(), 0);\n+\tm_socks5_sock.bind(bind_ep, ec);\n+\tif (ec)\n+\t{\n+\t\tif (m_alerts.should_post<socks5_alert>())\n+\t\t\tm_alerts.emplace_alert<socks5_alert>(m_proxy_addr, operation_t::sock_bind, ec);\n+\t\t++m_failures;\n+\t\tretry_connection();\n+\t\treturn;\n+\t}\n \n-\t\tusing namespace libtorrent::aux;\n+
    \n+
    \tADD_OUTSTANDING_ASYNC(\"socks5::on_connected\");\n+\tm_socks5_sock.async_connect(m_proxy_addr\n+\t\t, std::bind(&socks5::on_connected, self(), _1));\n \n-\t\tchar* ptr = header.data();\n-\t\twrite_uint32(m_max_pieces, ptr);\n-\t\twrite_uint32(m_piece_size, ptr);\n+\tADD_OUTSTANDING_ASYNC(\"socks5::on_connect_timeout\");\n+\tm_timer.expires_after(seconds(10));\n+\tm_timer.async_wait(std::bind(&socks5::on_connect_timeout\n+\t\t, self(), _1));\n+}\n \n-\t\tfor (piece_index_t piece(0); piece < piece_index_t(m_max_pieces); ++piece)\n-\t\t{\n-\t\t\tauto const i = m_piece_map.find(piece);\n-
    relevance 0../src/session_impl.cpp:615come up with some abstraction to do this for gnutls as well load certificates from the windows system certificate store

    come up with some abstraction to do this for gnutls as well\n+void socks5::on_connect_timeout(error_code const& e)\n+{\n+\tCOMPLETE_ASYNC(\"socks5::on_connect_timeout\");\n+\n+\tif (e == boost::asio::error::operation_aborted) return;\n+\n+\tif (m_abort) return;\n+\n+\tif (m_alerts.should_post<socks5_alert>())\n+\t\tm_alerts.emplace_alert<socks5_alert>(m_proxy_addr, operation_t::connect, errors::timed_out);\n+\n+\terror_code ignore;\n+\tm_socks5_sock.close(ignore);\n+\n+\t++m_failures;\n+\tretry_connection();\n+}\n+\n+void socks5::on_connected(error_code const& e)\n+{\n+

    relevance 0../src/session_impl.cpp:615come up with some abstraction to do this for gnutls as well load certificates from the windows system certificate store

    come up with some abstraction to do this for gnutls as well\n load certificates from the windows system certificate store

    ../src/session_impl.cpp:615

    \t\tpause();\n \t}\n #endif\n \n \t// This function is called by the creating thread, not in the message loop's\n \t// io_context thread.\n \tvoid session_impl::start_session()\n@@ -6275,15 +7744,15 @@\n #endif\n #ifdef __APPLE__\n \t\tm_ssl_ctx.load_verify_file(\"/etc/ssl/cert.pem\", ec);\n #ifndef TORRENT_DISABLE_LOGGING\n \t\tif (ec) session_log(\"SSL load_verify_file failed: %s\", ec.message().c_str());\n \t\tec.clear();\n #endif\n-
    relevance 0../src/session_impl.cpp:1484it would be nice to reserve() these vectors up front

    it would be nice to reserve() these vectors up front

    ../src/session_impl.cpp:1484

    \t\t\tbandwidth_channel* ch = &p->channel[peer_connection::download_channel];\n+
    relevance 0../src/session_impl.cpp:1484it would be nice to reserve() these vectors up front

    it would be nice to reserve() these vectors up front

    ../src/session_impl.cpp:1484

    \t\t\tbandwidth_channel* ch = &p->channel[peer_connection::download_channel];\n \t\t\tif (use_quota_overhead(ch, amount_down))\n \t\t\t\tret |= 1 << peer_connection::download_channel;\n \t\t\tch = &p->channel[peer_connection::upload_channel];\n \t\t\tif (use_quota_overhead(ch, amount_up))\n \t\t\t\tret |= 1 << peer_connection::upload_channel;\n \t\t}\n \t\treturn ret;\n@@ -6326,15 +7795,15 @@\n \tbool get_setting_impl(Pack const& p, int name, bool*)\n \t{ return p.get_bool(name); }\n \n \ttemplate <typename Pack>\n \tstd::string get_setting_impl(Pack const& p, int name, std::string*)\n \t{ return p.get_str(name); }\n \n-
    relevance 0../src/session_impl.cpp:1998could this function be merged with expand_unspecified_addresses? right now both listen_endpoint_t and listen_interface_t are almost identical, maybe the latter could be removed too

    could this function be merged with expand_unspecified_addresses?\n+

    relevance 0../src/session_impl.cpp:1998could this function be merged with expand_unspecified_addresses? right now both listen_endpoint_t and listen_interface_t are almost identical, maybe the latter could be removed too

    could this function be merged with expand_unspecified_addresses?\n right now both listen_endpoint_t and listen_interface_t are almost\n identical, maybe the latter could be removed too

    ../src/session_impl.cpp:1998

    \t\tsession_log(\"FATAL SESSION ERROR (%s : %d) [%s]\"\n \t\t\t, ec.category().name(), ec.value(), ec.message().c_str());\n #endif\n \t\tthis->abort();\n \t}\n \n@@ -6379,15 +7848,15 @@\n \t\t\t\t// (which must be of the same family as the address we're\n \t\t\t\t// connecting to)\n \t\t\t\tif (iface.device != ipface.name) continue;\n \n \t\t\t\tbool const local = iface.local\n \t\t\t\t\t|| ipface.interface_address.is_loopback()\n \t\t\t\t\t|| is_link_local(ipface.interface_address);\n-
    relevance 0../src/session_impl.cpp:2306it would probably be better to do this by having a listen-socket \"version\" number that gets bumped. And instead of setting a bool to disable a tracker, we set the version number that it was disabled at. This change would affect the ABI in 1.2, so should be done in 2.0 or later

    it would probably be better to do this by having a\n+

    relevance 0../src/session_impl.cpp:2306it would probably be better to do this by having a listen-socket \"version\" number that gets bumped. And instead of setting a bool to disable a tracker, we set the version number that it was disabled at. This change would affect the ABI in 1.2, so should be done in 2.0 or later

    it would probably be better to do this by having a\n listen-socket \"version\" number that gets bumped. And instead of\n setting a bool to disable a tracker, we set the version number that\n it was disabled at. This change would affect the ABI in 1.2, so\n should be done in 2.0 or later

    ../src/session_impl.cpp:2306

    \t\t{\n \t\t\tfor (auto const& s : m_listen_sockets)\n \t\t\t\tremap_ports(remap_natpmp_and_upnp, *s);\n \t\t}\n@@ -6434,15 +7903,15 @@\n \t\t\tif (ep != EndpointType())\n \t\t\t\tmap_handle = m.add_mapping(protocol, ep.port(), ep, device);\n \t\t}\n \t}\n \n \tvoid session_impl::remap_ports(remap_port_mask_t const mask\n \t\t, listen_socket_t& s)\n-
    relevance 0../src/session_impl.cpp:2866this size need to be capped

    this size need to be capped

    ../src/session_impl.cpp:2866

    \t\t\t\t// handshaking\n+
    relevance 0../src/session_impl.cpp:2866this size need to be capped

    this size need to be capped

    ../src/session_impl.cpp:2866

    \t\t\t\t// handshaking\n \t\t\t\treturn socket_type(ssl_stream<tcp::socket>(tcp::socket(std::move(s)), m_peer_ssl_ctx));\n \t\t\t}\n \t\t\telse\n #endif\n \t\t\t{\n \t\t\t\treturn socket_type(tcp::socket(std::move(s)));\n \t\t\t}\n@@ -6478,15 +7947,15 @@\n \n \tvoid session_impl::on_incoming_utp_ssl(socket_type s)\n \t{\n \t\tTORRENT_ASSERT(is_ssl(s));\n \n \t\t// save the socket so we can cancel the handshake\n \n-
    relevance 0../src/session_impl.cpp:2891this size need to be capped

    this size need to be capped

    ../src/session_impl.cpp:2891

    \t\t\t// after the handshake is done\n+
    relevance 0../src/session_impl.cpp:2891this size need to be capped

    this size need to be capped

    ../src/session_impl.cpp:2891

    \t\t\t// after the handshake is done\n \t\t\tADD_OUTSTANDING_ASYNC(\"session_impl::ssl_handshake\");\n \t\t\tboost::get<ssl_stream<tcp::socket>>(**iter).async_accept_handshake(\n \t\t\t\t[this, sock] (error_code const& err) { ssl_handshake(err, sock); });\n \t\t}\n \t\telse\n #endif\n \t\t{\n@@ -6529,15 +7998,15 @@\n \t\tif (iter == m_incoming_sockets.end()) return;\n \n \t\tsocket_type s(std::move(**iter));\n \t\tTORRENT_ASSERT(is_ssl(s));\n \t\tm_incoming_sockets.erase(iter);\n \n \t\terror_code e;\n-
    relevance 0../src/session_impl.cpp:3590have a separate list for these connections, instead of having to loop through all of them

    have a separate list for these connections, instead of having to loop through all of them

    ../src/session_impl.cpp:3590

    \t\t// --------------------------------------------------------------\n+
    relevance 0../src/session_impl.cpp:3590have a separate list for these connections, instead of having to loop through all of them

    have a separate list for these connections, instead of having to loop through all of them

    ../src/session_impl.cpp:3590

    \t\t// --------------------------------------------------------------\n \t\tif (!m_paused) m_auto_manage_time_scaler--;\n \t\tif (m_auto_manage_time_scaler < 0)\n \t\t{\n \t\t\tm_auto_manage_time_scaler = settings().get_int(settings_pack::auto_manage_interval);\n \t\t\trecalculate_auto_managed_torrents();\n \t\t}\n \n@@ -6580,15 +8049,15 @@\n \n \t\t\t// if the call to second_tick caused the torrent\n \t\t\t// to no longer want to be ticked (i.e. it was\n \t\t\t// removed from the list) we need to back up the counter\n \t\t\t// to not miss the torrent after it\n \t\t\tif (!t.want_tick()) --i;\n \t\t}\n-
    relevance 0../src/session_impl.cpp:3623this should apply to all bandwidth channels

    this should apply to all bandwidth channels

    ../src/session_impl.cpp:3623

    #if TORRENT_DEBUG_STREAMING > 0\n+
    relevance 0../src/session_impl.cpp:3623this should apply to all bandwidth channels

    this should apply to all bandwidth channels

    ../src/session_impl.cpp:3623

    #if TORRENT_DEBUG_STREAMING > 0\n \t\tstd::printf(\"\\033[2J\\033[0;0H\");\n #endif\n \n \t\taux::vector<torrent*>& want_tick = m_torrent_lists[torrent_want_tick];\n \t\tfor (int i = 0; i < int(want_tick.size()); ++i)\n \t\t{\n \t\t\ttorrent& t = *want_tick[i];\n@@ -6631,15 +8100,15 @@\n #endif\n \n \t\tm_stat.second_tick(tick_interval_ms);\n \n \t\t// --------------------------------------------------------------\n \t\t// scrape paused torrents that are auto managed\n \t\t// (unless the session is paused)\n-
    relevance 0../src/session_impl.cpp:4314use a lower limit than m_settings.connections_limit to allocate the to 10% or so of connection slots for incoming connections cap this at max - 1, since we may add one below

    use a lower limit than m_settings.connections_limit\n+

    relevance 0../src/session_impl.cpp:4314use a lower limit than m_settings.connections_limit to allocate the to 10% or so of connection slots for incoming connections cap this at max - 1, since we may add one below

    use a lower limit than m_settings.connections_limit\n to allocate the to 10% or so of connection slots for incoming\n connections\n cap this at max - 1, since we may add one below

    ../src/session_impl.cpp:4314

    \t\t// boost, which are done immediately on a tracker response. These\n \t\t// connections needs to be deducted from the regular connection attempt\n \t\t// quota for this tick\n \t\tif (m_boost_connections > 0)\n \t\t{\n@@ -6685,15 +8154,15 @@\n \n \t\t\tif (m_next_finished_connect_torrent >= int(want_peers_finished.size()))\n \t\t\t\tm_next_finished_connect_torrent = 0;\n \n \t\t\ttorrent* t = nullptr;\n \t\t\t// there are prioritized torrents. Pick one of those\n \t\t\twhile (!m_prio_torrents.empty())\n-
    relevance 0../src/session_impl.cpp:4459post a message to have this happen immediately instead of waiting for the next tick

    post a message to have this happen\n+

    relevance 0../src/session_impl.cpp:4459post a message to have this happen immediately instead of waiting for the next tick

    post a message to have this happen\n immediately instead of waiting for the next tick

    ../src/session_impl.cpp:4459

    \t\t\t\tcontinue;\n \t\t\t}\n \n \t\t\tif (!p->is_peer_interested()\n \t\t\t\t|| p->is_disconnecting()\n \t\t\t\t|| p->is_connecting())\n \t\t\t{\n@@ -6737,15 +8206,15 @@\n \t\tif (should_log())\n \t\t{\n \t\t\tsession_log(\"RECALCULATE UNCHOKE SLOTS: [ peers: %d \"\n \t\t\t\t\"eligible-peers: %d\"\n \t\t\t\t\" allowed-slots: %d ]\"\n \t\t\t\t, int(m_connections.size())\n \t\t\t\t, int(peers.size())\n-
    relevance 0../src/session_impl.cpp:4786it might be a nice feature here to limit the number of torrents to send in a single update. By just posting the first n torrents, they would nicely be round-robined because the torrent lists are always pushed back. Perhaps the status_update_alert could even have a fixed array of n entries rather than a vector, to further improve memory locality.

    it might be a nice feature here to limit the number of torrents\n+

    relevance 0../src/session_impl.cpp:4786it might be a nice feature here to limit the number of torrents to send in a single update. By just posting the first n torrents, they would nicely be round-robined because the torrent lists are always pushed back. Perhaps the status_update_alert could even have a fixed array of n entries rather than a vector, to further improve memory locality.

    it might be a nice feature here to limit the number of torrents\n to send in a single update. By just posting the first n torrents, they\n would nicely be round-robined because the torrent lists are always\n pushed back. Perhaps the status_update_alert could even have a fixed\n array of n entries rather than a vector, to further improve memory\n locality.

    ../src/session_impl.cpp:4786

    \t\t\tt->status(&st, flags);\n \t\t}\n \t}\n@@ -6793,15 +8262,15 @@\n \t\t\tm_posted_stats_header = true;\n \t\t\tm_alerts.emplace_alert<session_stats_header_alert>();\n \t\t}\n \t\tm_disk_thread->update_stats_counters(m_stats_counters);\n \n #ifndef TORRENT_DISABLE_DHT\n \t\tif (m_dht)\n-
    relevance 0../src/session_impl.cpp:5161factor out this logic into a separate function for unit testing

    factor out this logic into a separate function for unit\n+

    relevance 0../src/session_impl.cpp:5161factor out this logic into a separate function for unit testing

    factor out this logic into a separate function for unit\n testing

    ../src/session_impl.cpp:5161

    \t\tif (m_settings.get_int(settings_pack::outgoing_port) > 0)\n \t\t{\n #ifdef TORRENT_WINDOWS\n \t\t\ts.set_option(exclusive_address_use(true), ec);\n #else\n \t\t\ts.set_option(tcp::acceptor::reuse_address(true), ec);\n #endif\n@@ -6845,15 +8314,15 @@\n \n \t\t\t\tif (ls->flags & listen_socket_t::proxy\n \t\t\t\t\t|| match_addr_mask(ls->local_endpoint.address(), remote_address, ls->netmask))\n \t\t\t\t{\n \t\t\t\t\t// is this better than the previous match?\n \t\t\t\t\tmatch = ls;\n \t\t\t\t}\n-
    relevance 0../src/session_impl.cpp:5880refactor, move the storage to dht_tracker

    refactor, move the storage to dht_tracker

    ../src/session_impl.cpp:5880

    #ifndef TORRENT_DISABLE_LOGGING\n+
    relevance 0../src/session_impl.cpp:5880refactor, move the storage to dht_tracker

    refactor, move the storage to dht_tracker

    ../src/session_impl.cpp:5880

    #ifndef TORRENT_DISABLE_LOGGING\n \t\t\tsession_log(\"not starting DHT, outstanding router lookups: %d\"\n \t\t\t\t, m_outstanding_router_lookups);\n #endif\n \t\t\treturn;\n \t\t}\n \n \t\tif (m_abort)\n@@ -6896,15 +8365,15 @@\n \t\tfor (auto const& n : m_dht_router_nodes)\n \t\t{\n \t\t\tm_dht->add_router_node(n);\n \t\t}\n \n \t\tfor (auto const& n : m_dht_nodes)\n \t\t{\n-
    relevance 0../src/session_impl.cpp:6267asserts that no outstanding async operations are still in flight

    asserts that no outstanding async operations are still in flight

    ../src/session_impl.cpp:6267

    \t\tif (!m_dht) return;\n+
    relevance 0../src/session_impl.cpp:6267asserts that no outstanding async operations are still in flight

    asserts that no outstanding async operations are still in flight

    ../src/session_impl.cpp:6267

    \t\tif (!m_dht) return;\n \t\tm_dht->direct_request(ep, e, std::bind(&on_direct_response, std::ref(m_alerts), userdata, _1));\n \t}\n \n #endif\n \n \tbool session_impl::is_listening() const\n \t{\n@@ -6947,865 +8416,168 @@\n \t\t\tfor (wakeup_t const& w : _wakeups)\n \t\t\t{\n \t\t\t\tbool const idle_wakeup = w.context_switches > prev_csw;\n \t\t\t\tstd::fprintf(f, \"%\" PRId64 \"\\t%\" PRId64 \"\\t%\" PRId64 \"\\t%c\\t%s\\n\"\n \t\t\t\t\t, total_microseconds(w.timestamp - m)\n \t\t\t\t\t, total_microseconds(w.timestamp - prev)\n \t\t\t\t\t, w.context_switches\n-
    relevance 0../src/torrent_info.cpp:887this should be considered a failure, and the .torrent file rejected

    this should be considered a failure, and the .torrent file\n-rejected

    ../src/torrent_info.cpp:887

    \t\t\tstd::string ext = extension(filename);\n-\t\t\tint cnt = 0;\n-\t\t\tfor (;;)\n-\t\t\t{\n-\t\t\t\t++cnt;\n-\t\t\t\tchar new_ext[50];\n-\t\t\t\tstd::snprintf(new_ext, sizeof(new_ext), \".%d%s\", cnt, ext.c_str());\n-\t\t\t\tfilename = base + new_ext;\n-\n-\t\t\t\tboost::crc_optimal<32, 0x1EDC6F41, 0xFFFFFFFF, 0xFFFFFFFF, true, true> crc;\n-\t\t\t\tprocess_string_lowercase(crc, filename);\n-\t\t\t\tstd::uint32_t const new_hash = crc.checksum();\n-\t\t\t\tif (files.find(new_hash) == files.end())\n-\t\t\t\t{\n-\t\t\t\t\tfiles.insert({new_hash, {i, 0}});\n-\t\t\t\t\tbreak;\n-\t\t\t\t}\n-\t\t\t\t++num_collisions;\n-\t\t\t\tif (num_collisions > 100)\n-\t\t\t\t{\n-
    \t\t\t\t}\n-
    \t\t\t}\n-\n-\t\t\tcopy_on_write();\n-\t\t\tm_files.rename_file(i, filename);\n-\t\t}\n-\t}\n-\n-\tvoid torrent_info::remap_files(file_storage const& f)\n-\t{\n-\t\tINVARIANT_CHECK;\n-\n-\t\tTORRENT_ASSERT(is_loaded());\n-\t\t// the new specified file storage must have the exact\n-\t\t// same size as the current file storage\n-\t\tTORRENT_ASSERT(m_files.total_size() == f.total_size());\n-\n-\t\tif (m_files.total_size() != f.total_size()) return;\n-\t\tcopy_on_write();\n-\t\tm_files = f;\n-\t\tm_files.set_num_pieces(m_orig_files->num_pieces());\n-\t\tm_files.set_piece_length(m_orig_files->piece_length());\n-\t}\n-\n-#if TORRENT_ABI_VERSION == 1\n-\t// standard constructor that parses a torrent file\n-\ttorrent_info::torrent_info(entry const& torrent_file)\n-\t{\n-\t\tstd::vector<char> tmp;\n-\t\tstd::back_insert_iterator<std::vector<char>> out(tmp);\n-\t\tbencode(out, torrent_file);\n-
    relevance 0../src/add_torrent_params.cpp:78pre C++17, GCC and msvc does not make std::string nothrow move assignable, which means no type containing a string will be nothrow move assignable by default either static_assert(std::is_nothrow_move_assignable::value , \"should be nothrow move assignable\");

    pre C++17, GCC and msvc does not make std::string nothrow move\n-assignable, which means no type containing a string will be nothrow move\n-assignable by default either\n-static_assert(std::is_nothrow_move_assignable::value\n-, \"should be nothrow move assignable\");

    ../src/add_torrent_params.cpp:78

    \t\t\tDECL_FLAG(sequential_download);\n-\t\t\tDECL_FLAG(pinned);\n-\t\t\tDECL_FLAG(stop_when_ready);\n-\t\t\tDECL_FLAG(override_trackers);\n-\t\t\tDECL_FLAG(override_web_seeds);\n-\t\t\tDECL_FLAG(need_save_resume);\n-\t\t\tDECL_FLAG(override_resume_data);\n-\t\t\tDECL_FLAG(merge_resume_trackers);\n-\t\t\tDECL_FLAG(use_resume_save_path);\n-\t\t\tDECL_FLAG(merge_resume_http_seeds);\n-\t\t\tDECL_FLAG(default_flags);\n-#undef DECL_FLAG\n-#endif // TORRENT_ABI_VERSION\n-\n-\tstatic_assert(std::is_nothrow_move_constructible<add_torrent_params>::value\n-\t\t, \"should be nothrow move constructible\");\n-\n-\tstatic_assert(std::is_nothrow_move_constructible<std::string>::value\n-\t\t, \"should be nothrow move constructible\");\n-\n-
    \n-
    relevance 0../src/add_torrent_params.cpp:84it would be nice if this was nothrow default constructible static_assert(std::is_nothrow_default_constructible::value , \"should be nothrow default constructible\");

    it would be nice if this was nothrow default constructible\n-static_assert(std::is_nothrow_default_constructible::value\n-, \"should be nothrow default constructible\");

    ../src/add_torrent_params.cpp:84

    \t\t\tDECL_FLAG(pinned);\n-\t\t\tDECL_FLAG(stop_when_ready);\n-\t\t\tDECL_FLAG(override_trackers);\n-\t\t\tDECL_FLAG(override_web_seeds);\n-\t\t\tDECL_FLAG(need_save_resume);\n-\t\t\tDECL_FLAG(override_resume_data);\n-\t\t\tDECL_FLAG(merge_resume_trackers);\n-\t\t\tDECL_FLAG(use_resume_save_path);\n-\t\t\tDECL_FLAG(merge_resume_http_seeds);\n-\t\t\tDECL_FLAG(default_flags);\n-#undef DECL_FLAG\n-#endif // TORRENT_ABI_VERSION\n-\n-\tstatic_assert(std::is_nothrow_move_constructible<add_torrent_params>::value\n-\t\t, \"should be nothrow move constructible\");\n-\n-\tstatic_assert(std::is_nothrow_move_constructible<std::string>::value\n-\t\t, \"should be nothrow move constructible\");\n-\n-\n-
    \n-
    namespace aux {\n-\n-\t// returns whether this add_torrent_params object has \"resume-data\", i.e.\n-\t// information about which pieces we have.\n-\tbool contains_resume_data(add_torrent_params const& atp)\n-\t{\n-\t\treturn !atp.have_pieces.empty()\n-\t\t\t|| (atp.flags & torrent_flags::seed_mode);\n-\t}\n-}\n-\n-}\n-
    relevance 0../src/packet_buffer.cpp:157use compare_less_wrap for this comparison as well

    use compare_less_wrap for this comparison as well

    ../src/packet_buffer.cpp:157

    \t{\n-\t\tINVARIANT_CHECK;\n-\t\tTORRENT_ASSERT_VAL(size <= 0xffff, size);\n-\t\tstd::uint32_t new_size = m_capacity == 0 ? 16 : m_capacity;\n-\n-\t\twhile (new_size < size)\n-\t\t\tnew_size <<= 1;\n-\n-\t\taux::unique_ptr<packet_ptr[], index_type> new_storage(new packet_ptr[new_size]);\n-\n-\t\tfor (index_type i = m_first; i < (m_first + m_capacity); ++i)\n-\t\t\tnew_storage[i & (new_size - 1)] = std::move(m_storage[i & (m_capacity - 1)]);\n-\n-\t\tm_storage = std::move(new_storage);\n-\t\tm_capacity = new_size;\n-\t}\n-\n-\tpacket_ptr packet_buffer::remove(index_type idx)\n-\t{\n-\t\tINVARIANT_CHECK;\n-
    \t\tif (idx >= m_first + m_capacity)\n-
    \t\t\treturn packet_ptr();\n-\n-\t\tif (compare_less_wrap(idx, m_first, 0xffff))\n-\t\t\treturn packet_ptr();\n-\n-\t\tstd::size_t const mask = m_capacity - 1;\n-\t\tpacket_ptr old_value = std::move(m_storage[idx & mask]);\n-\t\tm_storage[idx & mask].reset();\n-\n-\t\tif (old_value)\n-\t\t{\n-\t\t\t--m_size;\n-\t\t\tif (m_size == 0) m_last = m_first;\n-\t\t}\n-\n-\t\tif (idx == m_first && m_size != 0)\n-\t\t{\n-\t\t\t++m_first;\n-\t\t\tfor (index_type i = 0; i < m_capacity; ++i, ++m_first)\n-\t\t\t\tif (m_storage[m_first & mask]) break;\n-\t\t\tm_first &= 0xffff;\n+
    relevance 0../src/settings_pack.cpp:305deprecate this

    deprecate this

    ../src/settings_pack.cpp:305

    \t\tSET(outgoing_port, 0, nullptr),\n+\t\tSET(num_outgoing_ports, 0, nullptr),\n+\t\tSET(peer_dscp, 0x04, &session_impl::update_peer_dscp),\n+\t\tSET(active_downloads, 3, &session_impl::trigger_auto_manage),\n+\t\tSET(active_seeds, 5, &session_impl::trigger_auto_manage),\n+\t\tSET(active_checking, 1, &session_impl::trigger_auto_manage),\n+\t\tSET(active_dht_limit, 88, nullptr),\n+\t\tSET(active_tracker_limit, 1600, nullptr),\n+\t\tSET(active_lsd_limit, 60, nullptr),\n+\t\tSET(active_limit, 500, &session_impl::trigger_auto_manage),\n+\t\tDEPRECATED_SET(active_loaded_limit, 0, &session_impl::trigger_auto_manage),\n+\t\tSET(auto_manage_interval, 30, nullptr),\n+\t\tSET(seed_time_limit, 24 * 60 * 60, nullptr),\n+\t\tSET(auto_scrape_interval, 1800, nullptr),\n+\t\tSET(auto_scrape_min_interval, 300, nullptr),\n+\t\tSET(max_peerlist_size, 3000, nullptr),\n+\t\tSET(max_paused_peerlist_size, 1000, nullptr),\n+\t\tSET(min_announce_interval, 5 * 60, nullptr),\n+\t\tSET(auto_manage_startup, 60, nullptr),\n+\t\tSET(seeding_piece_quota, 20, nullptr),\n+
    \t\tSET(max_rejects, 50, nullptr),\n+
    \t\tSET(recv_socket_buffer_size, 0, &session_impl::update_socket_buffer_size),\n+\t\tSET(send_socket_buffer_size, 0, &session_impl::update_socket_buffer_size),\n+\t\tSET(max_peer_recv_buffer_size, 2 * 1024 * 1024, nullptr),\n+\t\tDEPRECATED_SET(file_checks_delay_per_block, 0, nullptr),\n+\t\tDEPRECATED2_SET(read_cache_line_size, 32, nullptr),\n+\t\tDEPRECATED2_SET(write_cache_line_size, 16, nullptr),\n+\t\tSET(optimistic_disk_retry, 10 * 60, nullptr),\n+\t\tSET(max_suggest_pieces, 16, nullptr),\n+\t\tSET(local_service_announce_interval, 5 * 60, nullptr),\n+\t\tSET(dht_announce_interval, 15 * 60, &session_impl::update_dht_announce_interval),\n+\t\tSET(udp_tracker_token_expiry, 60, nullptr),\n+\t\tDEPRECATED_SET(default_cache_min_age, 1, nullptr),\n+\t\tSET(num_optimistic_unchoke_slots, 0, nullptr),\n+\t\tDEPRECATED_SET(default_est_reciprocation_rate, 16000, nullptr),\n+\t\tDEPRECATED_SET(increase_est_reciprocation_rate, 20, nullptr),\n+\t\tDEPRECATED_SET(decrease_est_reciprocation_rate, 3, nullptr),\n+\t\tSET(max_pex_peers, 50, nullptr),\n+\t\tSET(tick_interval, 500, nullptr),\n+\t\tSET(share_mode_target, 3, nullptr),\n+\t\tSET(upload_rate_limit, 0, &session_impl::update_upload_rate),\n+\t\tSET(download_rate_limit, 0, &session_impl::update_download_rate),\n+\t\tDEPRECATED_SET(local_upload_rate_limit, 0, &session_impl::update_local_upload_rate),\n+\t\tDEPRECATED_SET(local_download_rate_limit, 0, &session_impl::update_local_download_rate),\n+\t\tSET(dht_upload_rate_limit, 8000, &session_impl::update_dht_upload_rate_limit),\n+\t\tSET(unchoke_slots_limit, 8, &session_impl::update_unchoke_limit),\n+\t\tDEPRECATED_SET(half_open_limit, 0, nullptr),\n+\t\tSET(connections_limit, 200, &session_impl::update_connections_limit),\n+\t\tSET(connections_slack, 10, nullptr),\n+\t\tSET(utp_target_delay, 100, nullptr),\n+\t\tSET(utp_gain_factor, 3000, nullptr),\n+
    relevance 0../src/settings_pack.cpp:590it would be nice to reserve() these vectors up front

    it would be nice to reserve() these vectors up front

    ../src/settings_pack.cpp:590

    \t\t\ts.set_str(settings_pack::string_type_base | i, str_settings[i].default_value);\n+\t\t\tTORRENT_ASSERT(s.get_str(settings_pack::string_type_base + i) == str_settings[i].default_value);\n \t\t}\n \n-\t\tif (((idx + 1) & 0xffff) == m_last && m_size != 0)\n+\t\tfor (int i = 0; i < settings_pack::num_int_settings; ++i)\n \t\t{\n-\t\t\t--m_last;\n-\t\t\tfor (index_type i = 0; i < m_capacity; ++i, --m_last)\n-\t\t\t\tif (m_storage[m_last & mask]) break;\n-\t\t\t++m_last;\n-\t\t\tm_last &= 0xffff;\n-
    relevance 0../src/magnet_uri.cpp:439what's the right number here?

    what's the right number here?

    ../src/magnet_uri.cpp:439

    \t\t\t}\n-\t\t\telse if (string_equal_no_case(name, \"so\"_sv)) // select-only (files)\n-\t\t\t{\n-\t\t\t\t// accept only digits, '-' and ','\n-\t\t\t\tif (std::any_of(value.begin(), value.end(), [](char c)\n-\t\t\t\t\t{ return !is_digit(c) && c != '-' && c != ','; }))\n-\t\t\t\t\tcontinue;\n-\n-\t\t\t\t// make sure all file priorities are set to 0, except the ones\n-\t\t\t\t// we specify in the file_priorities\n-\t\t\t\tp.flags |= torrent_flags::default_dont_download;\n-\n-\t\t\t\tdo\n-\t\t\t\t{\n-\t\t\t\t\tstring_view token;\n-\t\t\t\t\tstd::tie(token, value) = split_string(value, ',');\n-\n-\t\t\t\t\tif (token.empty()) continue;\n-\n-\t\t\t\t\tint idx1, idx2;\n-
    \t\t\t\t\tconstexpr int max_index = 10000; // can't risk out of memory\n-
    \n-\t\t\t\t\tauto const divider = token.find_first_of('-');\n-\t\t\t\t\tif (divider != std::string::npos) // it's a range\n-\t\t\t\t\t{\n-\t\t\t\t\t\tif (divider == 0) // no start index\n-\t\t\t\t\t\t\tcontinue;\n-\t\t\t\t\t\tif (divider == token.size() - 1) // no end index\n-\t\t\t\t\t\t\tcontinue;\n-\n-\t\t\t\t\t\tidx1 = std::atoi(token.substr(0, divider).to_string().c_str());\n-\t\t\t\t\t\tif (idx1 < 0 || idx1 > max_index) // invalid index\n-\t\t\t\t\t\t\tcontinue;\n-\t\t\t\t\t\tidx2 = std::atoi(token.substr(divider + 1).to_string().c_str());\n-\t\t\t\t\t\tif (idx2 < 0 || idx2 > max_index) // invalid index\n-\t\t\t\t\t\t\tcontinue;\n-\n-\t\t\t\t\t\tif (idx1 > idx2) // wrong range limits\n-\t\t\t\t\t\t\tcontinue;\n-\t\t\t\t\t}\n-\t\t\t\t\telse // it's an index\n-\t\t\t\t\t{\n-\t\t\t\t\t\tidx1 = std::atoi(token.to_string().c_str());\n-\t\t\t\t\t\tif (idx1 < 0 || idx1 > max_index) // invalid index\n-\t\t\t\t\t\t\tcontinue;\n-\t\t\t\t\t\tidx2 = idx1;\n-\t\t\t\t\t}\n-\n-\t\t\t\t\tif (int(p.file_priorities.size()) <= idx2)\n-\t\t\t\t\t\tp.file_priorities.resize(static_cast<std::size_t>(idx2) + 1, dont_download);\n-\n-
    relevance 0../src/performance_counters.cpp:40move stats_counter_t out of counters

    move stats_counter_t out of counters

    ../src/performance_counters.cpp:40

    relevance 0../src/performance_counters.cpp:41should bittorrent keep-alive messages have a counter too?

    should bittorrent keep-alive messages have a counter too?

    ../src/performance_counters.cpp:41

    relevance 0../src/performance_counters.cpp:42It would be nice if this could be an internal type. default_disk_constructor depends on it now

    It would be nice if this could be an internal type. default_disk_constructor depends on it now

    ../src/performance_counters.cpp:42

    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n-ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n-LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n-CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n-POSSIBILITY OF SUCH DAMAGE.\n-\n-*/\n-\n-#include \"libtorrent/performance_counters.hpp\"\n-#include \"libtorrent/assert.hpp\"\n-#include <cstring> // for memset\n-\n-namespace libtorrent {\n-\n-
    \tcounters::counters() TORRENT_COUNTER_NOEXCEPT\n-
    \t{\n-#ifdef ATOMIC_LLONG_LOCK_FREE\n-\t\tfor (auto& counter : m_stats_counter)\n-\t\t\tcounter.store(0, std::memory_order_relaxed);\n-#else\n-\t\tm_stats_counter.fill(0);\n-#endif\n-\t}\n-\n-\tcounters::counters(counters const& c) TORRENT_COUNTER_NOEXCEPT\n-\t{\n-#ifdef ATOMIC_LLONG_LOCK_FREE\n-\t\tfor (int i = 0; i < m_stats_counter.end_index(); ++i)\n-\t\t\tm_stats_counter[i].store(\n-\t\t\t\tc.m_stats_counter[i].load(std::memory_order_relaxed)\n-\t\t\t\t\t, std::memory_order_relaxed);\n-#else\n-\t\tstd::lock_guard<std::mutex> l(c.m_mutex);\n-\t\tm_stats_counter = c.m_stats_counter;\n-#endif\n-\t}\n-\n-\tcounters& counters::operator=(counters const& c) & TORRENT_COUNTER_NOEXCEPT\n-\t{\n-\t\tif (&c == this) return *this;\n-#ifdef ATOMIC_LLONG_LOCK_FREE\n-\t\tfor (int i = 0; i < m_stats_counter.end_index(); ++i)\n-\t\t\tm_stats_counter[i].store(\n-\t\t\t\tc.m_stats_counter[i].load(std::memory_order_relaxed)\n-\t\t\t\t\t, std::memory_order_relaxed);\n-
    relevance 0../src/torrent.cpp:1951this could be optimized by looking up which files are complete and just look at those

    this could be optimized by looking up which files are\n-complete and just look at those

    ../src/torrent.cpp:1951

    //\t\t\t\tTORRENT_ASSERT(picker().have_piece(i));\n-\t\t\t\twe_have(i);\n-\t\t\t}\n+\t\t\ts.set_int(settings_pack::int_type_base | i, int_settings[i].default_value);\n+\t\t\tTORRENT_ASSERT(s.get_int(settings_pack::int_type_base + i) == int_settings[i].default_value);\n \t\t}\n \n-\t\tset_state(torrent_status::checking_resume_data);\n-\n-\t\taux::vector<std::string, file_index_t> links;\n-#ifndef TORRENT_DISABLE_MUTABLE_TORRENTS\n-\t\tif (!m_torrent_file->similar_torrents().empty()\n-\t\t\t|| !m_torrent_file->collections().empty())\n+\t\tfor (int i = 0; i < settings_pack::num_bool_settings; ++i)\n \t\t{\n-\t\t\tresolve_links res(m_torrent_file);\n-\n-\t\t\tfor (auto const& ih : m_torrent_file->similar_torrents())\n-\t\t\t{\n-\t\t\t\tstd::shared_ptr<torrent> t = m_ses.find_torrent(info_hash_t(ih)).lock();\n-\t\t\t\tif (!t) continue;\n-\n-\t\t\t\t// Only attempt to reuse files from torrents that are seeding.\n-
    \t\t\t\tif (!t->is_seed()) continue;\n-
    \n-\t\t\t\tres.match(t->get_torrent_file(), t->save_path());\n-\t\t\t}\n-\t\t\tfor (auto const& c : m_torrent_file->collections())\n-\t\t\t{\n-\t\t\t\tstd::vector<std::shared_ptr<torrent>> ts = m_ses.find_collection(c);\n-\n-\t\t\t\tfor (auto const& t : ts)\n-\t\t\t\t{\n-\t\t\t\t\t// Only attempt to reuse files from torrents that are seeding.\n-
    relevance 0../src/torrent.cpp:1964this could be optimized by looking up which files are complete and just look at those

    this could be optimized by looking up which files are\n-complete and just look at those

    ../src/torrent.cpp:1964

    \t\t{\n-\t\t\tresolve_links res(m_torrent_file);\n-\n-\t\t\tfor (auto const& ih : m_torrent_file->similar_torrents())\n-\t\t\t{\n-\t\t\t\tstd::shared_ptr<torrent> t = m_ses.find_torrent(info_hash_t(ih)).lock();\n-\t\t\t\tif (!t) continue;\n-\n-\t\t\t\t// Only attempt to reuse files from torrents that are seeding.\n-\t\t\t\tif (!t->is_seed()) continue;\n-\n-\t\t\t\tres.match(t->get_torrent_file(), t->save_path());\n-\t\t\t}\n-\t\t\tfor (auto const& c : m_torrent_file->collections())\n-\t\t\t{\n-\t\t\t\tstd::vector<std::shared_ptr<torrent>> ts = m_ses.find_collection(c);\n-\n-\t\t\t\tfor (auto const& t : ts)\n-\t\t\t\t{\n-\t\t\t\t\t// Only attempt to reuse files from torrents that are seeding.\n-
    \t\t\t\t\tif (!t->is_seed()) continue;\n-
    \n-\t\t\t\t\tres.match(t->get_torrent_file(), t->save_path());\n-\t\t\t\t}\n-\t\t\t}\n-\n-\t\t\tstd::vector<resolve_links::link_t> const& l = res.get_links();\n-\t\t\tif (!l.empty())\n-\t\t\t{\n-\t\t\t\tlinks.resize(m_torrent_file->files().num_files());\n-\t\t\t\tfor (auto const& i : l)\n-\t\t\t\t{\n-\t\t\t\t\tif (!i.ti) continue;\n-\t\t\t\t\tlinks[i.file_idx] = combine_path(i.save_path\n-\t\t\t\t\t\t, i.ti->files().file_path(i.file_idx));\n-\t\t\t\t}\n-\t\t\t}\n+\t\t\ts.set_bool(settings_pack::bool_type_base | i, bool_settings[i].default_value);\n+\t\t\tTORRENT_ASSERT(s.get_bool(settings_pack::bool_type_base + i) == bool_settings[i].default_value);\n \t\t}\n-#endif // TORRENT_DISABLE_MUTABLE_TORRENTS\n-\n-#if TORRENT_USE_ASSERTS\n-\t\tTORRENT_ASSERT(m_outstanding_check_files == false);\n-\t\tm_outstanding_check_files = true;\n-#endif\n-\n-\t\tif (!m_add_torrent_params || !(m_add_torrent_params->flags & torrent_flags::no_verify_files))\n-\t\t{\n-\t\t\tm_ses.disk_thread().async_check_files(\n-\t\t\t\tm_storage, m_add_torrent_params ? m_add_torrent_params.get() : nullptr\n-\t\t\t\t, std::move(links), [self = shared_from_this()](status_t st, storage_error const& error)\n-\t\t\t\t{ self->on_resume_data_checked(st, error); });\n-
    relevance 0../src/torrent.cpp:2728this pattern is repeated in a few places. Factor this into a function and generalize the concept of a torrent having a dedicated listen port

    this pattern is repeated in a few places. Factor this into\n-a function and generalize the concept of a torrent having a\n-dedicated listen port

    ../src/torrent.cpp:2728

    \t\t// not ready for peers. Except, if we don't have metadata,\n-\t\t// we need peers to download from\n-\t\tif (!m_files_checked && valid_metadata()) return;\n-\n-\t\tif (!m_announce_to_lsd) return;\n-\n-\t\t// private torrents are never announced on LSD\n-\t\tif (m_torrent_file->is_valid() && m_torrent_file->priv()) return;\n-\n-#if TORRENT_USE_I2P\n-\t\t// i2p torrents are also never announced on LSD\n-\t\t// unless we allow mixed swarms\n-\t\tif (is_i2p() && !settings().get_bool(settings_pack::allow_i2p_mixed))\n-\t\t\treturn;\n-#endif\n-\n-\t\tif (is_paused()) return;\n-\n-\t\tif (!m_ses.has_lsd()) return;\n-\n-
    #ifdef TORRENT_SSL_PEERS\n-
    \t\tint port = is_ssl_torrent() ? m_ses.ssl_listen_port() : m_ses.listen_port();\n-#else\n-\t\tint port = m_ses.listen_port();\n-#endif\n-\n-\t\t// announce with the local discovery service\n-\t\tm_torrent_file->info_hashes().for_each([&](sha1_hash const& ih, protocol_version)\n-\t\t{\n-\t\t\tm_ses.announce_lsd(ih, port);\n-\t\t});\n \t}\n \n-#ifndef TORRENT_DISABLE_DHT\n-\n-\tvoid torrent::dht_announce()\n-\t{\n-\t\tTORRENT_ASSERT(is_single_thread());\n-\t\tif (!m_ses.dht())\n-\t\t{\n-#ifndef TORRENT_DISABLE_LOGGING\n-\t\t\tdebug_log(\"DHT: no dht initialized\");\n-#endif\n-\t\t\treturn;\n-\t\t}\n-\t\tif (!should_announce_dht())\n-\t\t{\n-#ifndef TORRENT_DISABLE_LOGGING\n-\t\t\tif (should_log())\n-\t\t\t{\n-#if TORRENT_USE_I2P\n-
    relevance 0../src/torrent.cpp:3885add one peer per IP the hostname resolves to

    add one peer per IP the hostname resolves to

    ../src/torrent.cpp:3885

    \tcatch (...) { handle_exception(); }\n-#endif\n-\n-\tvoid torrent::on_peer_name_lookup(error_code const& e\n-\t\t, std::vector<address> const& host_list, int const port\n-\t\t, protocol_version const v) try\n+\tsettings_pack default_settings()\n \t{\n-\t\tTORRENT_ASSERT(is_single_thread());\n-\n-\t\tINVARIANT_CHECK;\n-\n-\t\tCOMPLETE_ASYNC(\"torrent::on_peer_name_lookup\");\n-\n-#ifndef TORRENT_DISABLE_LOGGING\n-\t\tif (e && should_log())\n-\t\t\tdebug_log(\"peer name lookup error: %s\", e.message().c_str());\n-#endif\n-\n-\t\tif (e || m_abort || host_list.empty() || m_ses.is_aborted()) return;\n-\n-
    \t\ttcp::endpoint host(host_list.front(), std::uint16_t(port));\n-
    \n-\t\tif (m_ip_filter && m_ip_filter->access(host.address()) & ip_filter::blocked)\n-\t\t{\n-#ifndef TORRENT_DISABLE_LOGGING\n-\t\t\tif (should_log())\n-\t\t\t{\n-\t\t\t\tdebug_log(\"blocked ip from tracker: %s\", host.address().to_string().c_str());\n-\t\t\t}\n-#endif\n-\t\t\tif (m_ses.alerts().should_post<peer_blocked_alert>())\n-\t\t\t\tm_ses.alerts().emplace_alert<peer_blocked_alert>(get_handle()\n-\t\t\t\t\t, host, peer_blocked_alert::ip_filter);\n-\t\t\treturn;\n-\t\t}\n-\n-\t\tif (add_peer(host, peer_info::tracker, v == protocol_version::V2 ? pex_lt_v2 : pex_flags_t(0)))\n-\t\t{\n-\t\t\tstate_updated();\n-\n-#ifndef TORRENT_DISABLE_LOGGING\n-\t\t\tif (should_log())\n-\t\t\t{\n-\t\t\t\tdebug_log(\"name-lookup add_peer() [ %s ] connect-candidates: %d\"\n-\t\t\t\t\t, host.address().to_string().c_str()\n-\t\t\t\t\t, m_peer_list ? m_peer_list->num_connect_candidates() : -1);\n-\t\t\t}\n-#endif\n-\t\t}\n-\t\tupdate_want_peers();\n-\t}\n-
    relevance 0../src/torrent.cpp:4581only do this if the piece size > 1 blocks This is a v2 torrent so we can request get block level hashes.

    only do this if the piece size > 1 blocks\n-This is a v2 torrent so we can request get block\n-level hashes.

    ../src/torrent.cpp:4581

    \t\t{\n-\t\t\tstd::set<torrent_peer*> ret;\n-\t\t\tif (!blocks.empty() && !downloaders.empty())\n-\t\t\t{\n-\t\t\t\tfor (auto const b : blocks) ret.insert(downloaders[std::size_t(b)]);\n-\t\t\t}\n-\t\t\telse\n-\t\t\t{\n-\t\t\t\tstd::copy(downloaders.begin(), downloaders.end(), std::inserter(ret, ret.begin()));\n-\t\t\t}\n-\t\t\treturn ret;\n-\t\t}();\n-\n-\t\t// if this piece wasn't downloaded from peers, we just found it on disk.\n-\t\t// In that case, we should just consider it as \"not-have\" and there's no\n-\t\t// need to try to get higher fidelity hashes (yet)\n-\t\tbool const found_on_disk = peers.size() == 1 && peers.count(nullptr);\n-\n-\t\tif (!torrent_file().info_hashes().has_v1() && blocks.empty() && !found_on_disk)\n-\t\t{\n-
    \t\t\tverify_block_hashes(index);\n-
    \t\t}\n-\n-\t\t// the below code is penalizing peers that sent use bad data.\n-\t\t// increase the total amount of failed bytes\n-\t\tif (!found_on_disk)\n-\t\t{\n-\t\t\tif (blocks.empty())\n-\t\t\t\tadd_failed_bytes(m_torrent_file->piece_size(index));\n-\t\t\telse\n-\t\t\t\tadd_failed_bytes(static_cast<int>(blocks.size()) * default_block_size);\n-\n-#ifndef TORRENT_DISABLE_EXTENSIONS\n-\t\t\tfor (auto& ext : m_extensions)\n-\t\t\t{\n-\t\t\t\text->on_piece_failed(index);\n-\t\t\t}\n-#endif\n-\n-\t\t\t// did we receive this piece from a single peer?\n-\t\t\t// if we know exactly which blocks failed the hash, we can also be certain\n-\t\t\t// that all peers in the list sent us bad data\n-\t\t\tbool const known_bad_peer = (!found_on_disk && peers.size() == 1) || !blocks.empty();\n-\n-\t\t\tpenalize_peers(peers, index, known_bad_peer);\n+\t\tsettings_pack ret;\n+
    \t\tfor (int i = 0; i < settings_pack::num_string_settings; ++i)\n+
    \t\t{\n+\t\t\tif (str_settings[i].default_value == nullptr) continue;\n+\t\t\tret.set_str(settings_pack::string_type_base + i, str_settings[i].default_value);\n \t\t}\n \n-\t\t// If m_storage isn't set here, it means we're shutting down\n-\t\tif (m_storage)\n+\t\tfor (int i = 0; i < settings_pack::num_int_settings; ++i)\n \t\t{\n-\t\t\t// it doesn't make much sense to fail to hash a piece\n-
    relevance 0../src/torrent.cpp:7525come up with a better way of doing this, instead of an immediately invoked lambda expression.

    come up with a better way of doing this, instead of an\n-immediately invoked lambda expression.

    ../src/torrent.cpp:7525

    \t\t\t\t\t|| peerinfo->confirmed_supports_utp))\n-\t\t\t{\n-\t\t\t\tsm = m_ses.utp_socket_manager();\n-\t\t\t}\n-\n-\t\t\t// don't make a TCP connection if it's disabled\n-\t\t\tif (sm == nullptr && !settings().get_bool(settings_pack::enable_outgoing_tcp))\n-\t\t\t{\n-#ifndef TORRENT_DISABLE_LOGGING\n-\t\t\t\tif (should_log())\n-\t\t\t\t{\n-\t\t\t\t\tdebug_log(\"discarding peer \\\"%s\\\": TCP connections disabled \"\n-\t\t\t\t\t\t\"[ supports-utp: %d ]\", peerinfo->to_string().c_str()\n-\t\t\t\t\t\t, peerinfo->supports_utp);\n-\t\t\t\t}\n-#endif\n-\t\t\t\treturn false;\n-\t\t\t}\n+\t\t\tret.set_int(settings_pack::int_type_base + i, int_settings[i].default_value);\n \t\t}\n \n-
    \t\taux::socket_type s = [&] {\n-
    \n-#if TORRENT_USE_I2P\n-\t\tif (peerinfo->is_i2p_addr)\n+\t\tfor (int i = 0; i < settings_pack::num_bool_settings; ++i)\n \t\t{\n-\t\t\t// It's not entirely obvious why this peer connection is not marked as\n-\t\t\t// one. The main feature of a peer connection is that whether or not we\n-\t\t\t// proxy it is configurable. When we use i2p, we want to always prox\n-\t\t\t// everything via i2p.\n-\n-\t\t\taux::proxy_settings proxy;\n-\t\t\tproxy.hostname = settings().get_str(settings_pack::i2p_hostname);\n-\t\t\tproxy.port = std::uint16_t(settings().get_int(settings_pack::i2p_port));\n-\t\t\tproxy.type = settings_pack::i2p_proxy;\n-\n-\t\t\taux::socket_type ret = instantiate_connection(m_ses.get_context()\n-\t\t\t\t, proxy, nullptr, nullptr, false, false);\n-\t\t\ti2p_stream& str = boost::get<i2p_stream>(ret);\n-\t\t\tstr.set_local_i2p_endpoint(m_ses.local_i2p_endpoint());\n-\t\t\tstr.set_destination(static_cast<i2p_peer*>(peerinfo)->dest());\n-\t\t\tstr.set_command(i2p_stream::cmd_connect);\n-\t\t\tstr.set_session_id(m_ses.i2p_session());\n-\t\t\treturn ret;\n+\t\t\tret.set_bool(settings_pack::bool_type_base + i, bool_settings[i].default_value);\n \t\t}\n-\t\telse\n-#endif\n-\t\t{\n-\t\t\tvoid* userdata = nullptr;\n-#ifdef TORRENT_SSL_PEERS\n-\t\t\tif (is_ssl_torrent())\n-\t\t\t{\n-
    relevance 0../src/torrent.cpp:9118perhaps 0 should actually mean 0

    perhaps 0 should actually mean 0

    ../src/torrent.cpp:9118

    \t\t// finished torrents may not change their queue positions, as it's set to\n-\t\t// -1\n-\t\tif ((m_abort || is_finished()) && p != no_pos) return;\n-\n-\t\tTORRENT_ASSERT((p == no_pos) == is_finished()\n-\t\t\t|| (!m_auto_managed && p == no_pos)\n-\t\t\t|| (m_abort && p == no_pos)\n-\t\t\t|| (!m_added && p == no_pos));\n-\t\tif (p == m_sequence_number) return;\n-\n-\t\tTORRENT_ASSERT(p >= no_pos);\n-\n-\t\tstate_updated();\n-\n-\t\tm_ses.set_queue_position(this, p);\n-\t}\n-\n-\tvoid torrent::set_max_uploads(int limit, bool const state_update)\n-\t{\n-\t\tTORRENT_ASSERT(is_single_thread());\n-
    \t\tif (limit <= 0) limit = (1 << 24) - 1;\n-
    \t\tif (int(m_max_uploads) == limit) return;\n-\t\tif (state_update) state_updated();\n-\t\tm_max_uploads = aux::numeric_cast<std::uint32_t>(limit);\n-#ifndef TORRENT_DISABLE_LOGGING\n-\t\tif (should_log() && state_update)\n-\t\t\tdebug_log(\"*** set-max-uploads: %d\", m_max_uploads);\n-#endif\n-\n-\t\tif (state_update)\n-\t\t\tset_need_save_resume(torrent_handle::if_config_changed);\n-\t}\n-\n-\tvoid torrent::set_max_connections(int limit, bool const state_update)\n-\t{\n-\t\tTORRENT_ASSERT(is_single_thread());\n-
    relevance 0../src/torrent.cpp:9135perhaps 0 should actually mean 0

    perhaps 0 should actually mean 0

    ../src/torrent.cpp:9135

    \n-\tvoid torrent::set_max_uploads(int limit, bool const state_update)\n-\t{\n-\t\tTORRENT_ASSERT(is_single_thread());\n-\t\tif (limit <= 0) limit = (1 << 24) - 1;\n-\t\tif (int(m_max_uploads) == limit) return;\n-\t\tif (state_update) state_updated();\n-\t\tm_max_uploads = aux::numeric_cast<std::uint32_t>(limit);\n-#ifndef TORRENT_DISABLE_LOGGING\n-\t\tif (should_log() && state_update)\n-\t\t\tdebug_log(\"*** set-max-uploads: %d\", m_max_uploads);\n-#endif\n-\n-\t\tif (state_update)\n-\t\t\tset_need_save_resume(torrent_handle::if_config_changed);\n+\t\treturn ret;\n \t}\n \n-\tvoid torrent::set_max_connections(int limit, bool const state_update)\n+\tvoid apply_pack(settings_pack const* pack, aux::session_settings& sett\n+\t\t, aux::session_impl* ses)\n \t{\n-\t\tTORRENT_ASSERT(is_single_thread());\n-
    \t\tif (limit <= 0) limit = (1 << 24) - 1;\n-
    \t\tif (int(m_max_connections) == limit) return;\n-\t\tif (state_update) state_updated();\n-\t\tm_max_connections = aux::numeric_cast<std::uint32_t>(limit);\n-\t\tupdate_want_peers();\n-\n-#ifndef TORRENT_DISABLE_LOGGING\n-\t\tif (should_log() && state_update)\n-\t\t\tdebug_log(\"*** set-max-connections: %d\", m_max_connections);\n-#endif\n+\t\tusing fun_t = void (aux::session_impl::*)();\n+\t\tstd::vector<fun_t> callbacks;\n \n-\t\tif (num_peers() > int(m_max_connections))\n+\t\tsett.bulk_set([&](aux::session_settings_single_thread& s)\n \t\t{\n-\t\t\tdisconnect_peers(num_peers() - m_max_connections\n-\t\t\t\t, errors::too_many_connections);\n-\t\t}\n-\n-\t\tif (state_update)\n-\t\t\tset_need_save_resume(torrent_handle::if_config_changed);\n-\t}\n+\t\t\tapply_pack_impl(pack, s, ses ? &callbacks : nullptr);\n+\t\t});\n \n-\tvoid torrent::set_upload_limit(int const limit)\n-\t{\n-\t\tset_limit_impl(limit, peer_connection::upload_channel);\n-#ifndef TORRENT_DISABLE_LOGGING\n-\t\tdebug_log(\"*** set-upload-limit: %d\", limit);\n-#endif\n+\t\t// call the callbacks once all the settings have been applied, and\n+\t\t// only once per callback\n+
    relevance 0../src/create_torrent.cpp:618this can be optimized

    this can be optimized

    ../src/create_torrent.cpp:618

    \t\tstd::string& attr = e[\"attr\"].string();\n+\t\tif (flags & file_storage::flag_pad_file) attr += 'p';\n+\t\tif (flags & file_storage::flag_hidden) attr += 'h';\n+\t\tif (flags & file_storage::flag_executable) attr += 'x';\n+\t\tif (include_symlinks && (flags & file_storage::flag_symlink)) attr += 'l';\n \t}\n \n-\tvoid torrent::set_download_limit(int const limit)\n+\tvoid add_symlink_path(entry& e, std::string symlink_path)\n \t{\n-
    relevance 0../src/torrent.cpp:11061instead of resorting the whole list, insert the peers directly into the right place

    instead of resorting the whole list, insert the peers\n-directly into the right place

    ../src/torrent.cpp:11061

    \t\t\t\tstd::printf(\"timed out [average-piece-time: %d ms ]\\n\"\n-\t\t\t\t\t, m_average_piece_time);\n-#endif\n-\t\t\t}\n-\n-\t\t\t// pick all blocks for this piece. the peers list is kept up to date\n-\t\t\t// and sorted. when we issue a request to a peer, its download queue\n-\t\t\t// time will increase and it may need to be bumped in the peers list,\n-\t\t\t// since it's ordered by download queue time\n-\t\t\tpick_time_critical_block(peers, ignore_peers\n-\t\t\t\t, peers_with_requests\n-\t\t\t\t, pi, &i, m_picker.get()\n-\t\t\t\t, blocks_in_piece, timed_out);\n-\n-\t\t\t// put back the peers we ignored into the peer list for the next piece\n-\t\t\tif (!ignore_peers.empty())\n-\t\t\t{\n-\t\t\t\tpeers.insert(peers.begin(), ignore_peers.begin(), ignore_peers.end());\n-\t\t\t\tignore_peers.clear();\n-\n-
    \t\t\t\tstd::sort(peers.begin(), peers.end()\n-
    \t\t\t\t\t, [] (peer_connection const* lhs, peer_connection const* rhs)\n-\t\t\t\t\t{ return lhs->download_queue_time(16*1024) < rhs->download_queue_time(16*1024); });\n-\t\t\t}\n-\n-\t\t\t// if this peer's download time exceeds 2 seconds, we're done.\n-\t\t\t// We don't want to build unreasonably long request queues\n-\t\t\tif (!peers.empty() && peers[0]->download_queue_time() > milliseconds(2000))\n-\t\t\t\tbreak;\n-\t\t}\n+\t\tentry& sympath_e = e[\"symlink path\"];\n \n-\t\t// commit all the time critical requests\n-\t\tfor (auto p : peers_with_requests)\n-\t\t{\n-\t\t\tp->send_block_requests();\n-\t\t}\n+\t\tstd::string const link = lexically_relative(\"\", symlink_path);\n+\t\tfor (auto elems = lsplit_path(link); !elems.first.empty();\n+\t\t\telems = lsplit_path(elems.second))\n+\t\t\tsympath_e.list().emplace_back(elems.first);\n \t}\n-#endif // TORRENT_DISABLE_STREAMING\n+}\n \n-\tstd::set<std::string> torrent::web_seeds(web_seed_entry::type_t const type) const\n+\tstd::vector<char> create_torrent::generate_buf() const\n \t{\n-\t\tTORRENT_ASSERT(is_single_thread());\n-\t\tstd::set<std::string> ret;\n-\t\tfor (auto const& s : m_web_seeds)\n-\t\t{\n-\t\t\tif (s.peer_info.banned) continue;\n-\t\t\tif (s.removed) continue;\n-\t\t\tif (s.type != type) continue;\n-\t\t\tret.insert(s.url);\n-\t\t}\n+
    \t\tstd::vector<char> ret;\n+
    \t\tbencode(std::back_inserter(ret), generate());\n \t\treturn ret;\n-
    relevance 0../src/cpuid.cpp:131enable when aarch64 is really tested

    enable when aarch64 is really tested

    ../src/cpuid.cpp:131

    \tbool supports_mmx() noexcept\n-\t{\n-#if TORRENT_HAS_SSE\n-\t\tstd::uint32_t cpui[4] = {0};\n-\t\tcpuid(cpui, 1);\n-\t\treturn (cpui[2] & (1 << 23)) != 0;\n-#else\n-\t\treturn false;\n-#endif\n \t}\n \n-\tbool supports_arm_neon() noexcept\n-\t{\n-#if TORRENT_HAS_ARM_NEON && TORRENT_HAS_AUXV\n-#if defined __arm__\n-\t\t//return (getauxval(AT_HWCAP) & HWCAP_NEON);\n-\t\treturn (helper_getauxval(16) & (1 << 12));\n-#elif defined __aarch64__\n-\t\t//return (getauxval(AT_HWCAP) & HWCAP_ASIMD);\n-\t\t//return (getauxval(16) & (1 << 1));\n-
    \t\treturn false;\n-
    #endif\n-#else\n-\t\treturn false;\n-#endif\n-\t}\n-\n-\tbool supports_arm_crc32c() noexcept\n-\t{\n-#if TORRENT_HAS_ARM_CRC32 && TORRENT_HAS_AUXV\n-#if defined TORRENT_FORCE_ARM_CRC32\n-\t\treturn true;\n-#elif defined __arm__\n-\t\t//return (getauxval(AT_HWCAP2) & HWCAP2_CRC32);\n-\t\treturn (helper_getauxval(26) & (1 << 4));\n-#elif defined __aarch64__\n-\t\t//return (getauxval(AT_HWCAP) & HWCAP_CRC32);\n-\t\treturn (helper_getauxval(16) & (1 << 7));\n-#endif\n-#else\n-\t\treturn false;\n-#endif\n-\t}\n-\n-} // anonymous namespace\n-\n-\tbool const sse42_support = supports_sse42();\n-\tbool const mmx_support = supports_mmx();\n-\tbool const arm_neon_support = supports_arm_neon();\n-\tbool const arm_crc32c_support = supports_arm_crc32c();\n-} }\n-
    relevance 0../src/hash_picker.cpp:309use structured bindings in C++17

    use structured bindings in C++17

    ../src/hash_picker.cpp:309

    \t\t, int const offset, sha256_hash const& h)\n+\tentry create_torrent::generate() const\n \t{\n-\t\tTORRENT_ASSERT(offset >= 0);\n-\t\tauto const f = m_files.file_index_at_piece(piece);\n-\n-\t\tif (m_files.pad_file_at(f))\n-\t\t\treturn { set_block_hash_result::result::success, 0, 0 };\n-\n-\t\tauto& merkle_tree = m_merkle_trees[f];\n-\t\tpiece_index_t const file_first_piece = m_files.piece_index_at_file(f);\n-\t\tstd::int64_t const block_offset = static_cast<int>(piece) * std::int64_t(m_files.piece_length())\n-\t\t\t+ offset - m_files.file_offset(f);\n-\t\tint const block_index = aux::numeric_cast<int>(block_offset / default_block_size);\n-\n-\t\tif (h.is_all_zeros())\n-\t\t{\n-\t\t\tTORRENT_ASSERT_FAIL();\n-\t\t\treturn set_block_hash_result::block_hash_failed();\n-\t\t}\n-\n-
    \t\taux::merkle_tree::set_block_result result;\n-
    \t\tint leafs_index;\n-\t\tint leafs_size;\n-\t\tstd::tie(result, leafs_index, leafs_size) = merkle_tree.set_block(block_index, h);\n-\n-\t\tif (result == aux::merkle_tree::set_block_result::unknown)\n-\t\t\treturn set_block_hash_result::unknown();\n-\t\tif (result == aux::merkle_tree::set_block_result::block_hash_failed)\n-\t\t\treturn set_block_hash_result::block_hash_failed();\n-\n-\t\tauto const status = (result == aux::merkle_tree::set_block_result::hash_failed)\n-\t\t\t? set_block_hash_result::result::piece_hash_failed\n-\t\t\t: set_block_hash_result::result::success;\n-\n-\t\tint const blocks_per_piece = m_files.piece_length() / default_block_size;\n-\n-\t\treturn { status\n-\t\t\t, int(leafs_index - static_cast<int>(piece - file_first_piece) * blocks_per_piece)\n-\t\t\t, std::min(leafs_size, m_files.file_num_pieces(f) * blocks_per_piece - leafs_index) };\n-\t}\n+\t\tif (m_files.num_files() == 0 || m_files.total_size() == 0)\n+\t\t\taux::throw_ex<system_error>(errors::torrent_missing_file_tree);\n \n-\tvoid hash_picker::hashes_rejected(hash_request const& req)\n-\t{\n-\t\tTORRENT_ASSERT(req.base == m_piece_layer && req.index % 512 == 0);\n+\t\t// if all v2 hashes are set correctly, generate the v2 parts of the\n+\t\t// torrent\n+\t\tbool const make_v2 = validate_v2_hashes(m_files, m_file_piece_hash);\n+\t\tbool const make_v1 = validate_v1_hashes(m_files, m_piece_hash);\n \n-\t\tfor (int i = req.index; i < req.index + req.count; i += 512)\n-\t\t{\n-\t\t\tm_piece_hash_requested[req.file][i / 512].last_request = min_time();\n-\t\t\t--m_piece_hash_requested[req.file][i / 512].num_requests;\n-\t\t}\n+\t\t// if neither v1 nor v2 hashes were set, we can't create a torrent\n+\t\tif (!make_v1 && !make_v2)\n+\t\t\taux::throw_ex<system_error>(errors::invalid_hash_entry);\n \n-
    relevance 0../src/torrent_peer.cpp:192how do we deal with our external address changing?

    how do we deal with our external address changing?

    ../src/torrent_peer.cpp:192

    \t\t// connections. If it fails, we'll\n-\t\t// retry with encryption\n-\t\t, pe_support(false)\n-#endif\n-\t\t, is_v6_addr(false)\n-#if TORRENT_USE_I2P\n-\t\t, is_i2p_addr(false)\n-#endif\n-\t\t, on_parole(false)\n-\t\t, banned(false)\n-\t\t, supports_utp(true) // assume peers support utp\n-\t\t, confirmed_supports_utp(false)\n-\t\t, supports_holepunch(false)\n-\t\t, web_seed(false)\n-\t\t, protocol_v2(false)\n-\t{}\n+\t\tTORRENT_ASSERT(m_files.piece_length() > 0);\n \n-\tstd::uint32_t torrent_peer::rank(external_ip const& external, int external_port) const\n-\t{\n-\t\tTORRENT_ASSERT(in_use);\n-
    \t\tif (peer_rank == 0)\n-
    \t\t\tpeer_rank = peer_priority(\n-\t\t\t\ttcp::endpoint(external.external_address(this->address()), std::uint16_t(external_port))\n-\t\t\t\t, tcp::endpoint(this->address(), this->port));\n-\t\treturn peer_rank;\n-\t}\n+\t\tentry dict;\n \n-#ifndef TORRENT_DISABLE_LOGGING\n-\tstd::string torrent_peer::to_string() const\n-\t{\n-\t\tTORRENT_ASSERT(in_use);\n-#if TORRENT_USE_I2P\n-\t\tif (is_i2p_addr) return dest().to_string();\n-#endif // TORRENT_USE_I2P\n-\t\treturn address().to_string();\n-\t}\n-#endif\n+\t\tif (!m_urls.empty()) dict[\"announce\"] = m_urls.front().first;\n \n-\tstd::int64_t torrent_peer::total_download() const\n-\t{\n-\t\tTORRENT_ASSERT(in_use);\n-\t\tif (connection != nullptr)\n-\t\t{\n-\t\t\tTORRENT_ASSERT(prev_amount_download == 0);\n-\t\t\treturn connection->statistics().total_payload_download();\n-\t\t}\n-\t\telse\n+\t\tif (!m_nodes.empty())\n \t\t{\n-\t\t\treturn std::int64_t(prev_amount_download) << 10;\n-\t\t}\n-\t}\n-
    relevance 0../src/session_handle.cpp:499in C++14, use unique_ptr and move it into the lambda

    in C++14, use unique_ptr and move it into the lambda

    ../src/session_handle.cpp:499

    #ifndef BOOST_NO_EXCEPTIONS\n+\t\t\tentry& nodes = dict[\"nodes\"];\n+\t\t\tentry::list_type& nodes_list = nodes.list();\n+\t\t\tfor (auto const& n : m_nodes)\n+\t\t\t{\n+
    relevance 0../src/session_handle.cpp:499in C++14, use unique_ptr and move it into the lambda

    in C++14, use unique_ptr and move it into the lambda

    ../src/session_handle.cpp:499

    #ifndef BOOST_NO_EXCEPTIONS\n \t\tif (params.save_path.empty())\n \t\t\taux::throw_ex<system_error>(error_code(errors::invalid_save_path));\n #else\n \t\tTORRENT_ASSERT_PRECOND(!params.save_path.empty());\n #endif\n \n #if TORRENT_ABI_VERSION < 3\n@@ -7848,98 +8620,169 @@\n \t\tp.save_path = save_path;\n \t\tif (resume_data.type() != entry::undefined_t)\n \t\t{\n \t\t\tbencode(std::back_inserter(p.resume_data), resume_data);\n \t\t}\n \t\tp.storage_mode = storage_mode;\n \t\tif (add_paused) p.flags |= add_torrent_params::flag_paused;\n-
    relevance 0../src/choker.cpp:258make configurable

    make configurable

    ../src/choker.cpp:258

    \t\t\t// first reset the number of unchoke slots, because we'll calculate\n-\t\t\t// it purely based on the current state of our peers.\n-\t\t\tupload_slots = 0;\n+
    relevance 0../src/peer_connection.cpp:1105this should be the global download rate

    this should be the global download rate

    ../src/peer_connection.cpp:1105

    \n+\t\tint rate = 0;\n \n-\t\t\tint rate_threshold = sett.get_int(settings_pack::rate_choker_initial_threshold);\n+\t\t// if we haven't received any data recently, the current download rate\n+\t\t// is not representative\n+\t\tif (aux::time_now() - m_last_piece.get(m_connect) > seconds(30) && m_download_rate_peak > 0)\n+\t\t{\n+\t\t\trate = m_download_rate_peak;\n+\t\t}\n+\t\telse if (aux::time_now() - m_last_unchoked.get(m_connect) < seconds(5)\n+\t\t\t&& m_statistics.total_payload_upload() < 2 * 0x4000)\n+\t\t{\n+\t\t\t// if we're have only been unchoked for a short period of time,\n+\t\t\t// we don't know what rate we can get from this peer. Instead of assuming\n+\t\t\t// the lowest possible rate, assume the average.\n \n-\t\t\tstd::sort(peers.begin(), peers.end()\n-\t\t\t\t, [](peer_connection const* lhs, peer_connection const* rhs)\n-\t\t\t\t{ return upload_rate_compare(lhs, rhs); });\n+\t\t\tint peers_with_requests = int(stats_counters()[counters::num_peers_down_requests]);\n+\t\t\t// avoid division by 0\n+\t\t\tif (peers_with_requests == 0) peers_with_requests = 1;\n \n-\t\t\tfor (auto const* p : peers)\n-\t\t\t{\n-\t\t\t\tint const rate = int(p->uploaded_in_last_round()\n-\t\t\t\t\t* 1000 / total_milliseconds(unchoke_interval));\n+
    \t\t\trate = t->statistics().transfer_rate(stat::download_payload) / peers_with_requests;\n+
    \t\t}\n+\t\telse\n+\t\t{\n+\t\t\t// current download rate in bytes per seconds\n+\t\t\trate = m_statistics.transfer_rate(stat::download_payload);\n+\t\t}\n \n-\t\t\t\t// always have at least 1 unchoke slot\n-\t\t\t\tif (rate < rate_threshold) break;\n+\t\t// avoid division by zero\n+\t\tif (rate < 50) rate = 50;\n \n-\t\t\t\t++upload_slots;\n+\t\t// average of current rate and peak\n+//\t\trate = (rate + m_download_rate_peak) / 2;\n \n-
    \t\t\t\trate_threshold += 2048;\n-
    \t\t\t}\n-\t\t\t++upload_slots;\n+\t\treturn milliseconds((m_outstanding_bytes + extra_bytes\n+\t\t\t+ m_queued_time_critical * t->block_size() * 1000) / rate);\n+\t}\n+\n+\tvoid peer_connection::add_stat(std::int64_t const downloaded, std::int64_t const uploaded)\n+\t{\n+\t\tTORRENT_ASSERT(is_single_thread());\n+\t\tm_statistics.add_stat(downloaded, uploaded);\n+\t}\n+\n+\tsha1_hash peer_connection::associated_info_hash() const\n+\t{\n+\t\tstd::shared_ptr<torrent> t = associated_torrent().lock();\n+\t\tTORRENT_ASSERT(t);\n+\t\tauto const& ih = t->info_hash();\n+\t\t// if protocol_v2 is set on the peer, this better be a v2 torrent,\n+\t\t// otherwise something isn't right\n+
    relevance 0../src/peer_connection.cpp:3536sort the allowed fast set in priority order

    sort the allowed fast set in priority order

    ../src/peer_connection.cpp:3536

    \n+\t\t// if the peer has the piece and we want\n+\t\t// to download it, request it\n+\t\tif (index < m_have_piece.end_index()\n+\t\t\t&& m_have_piece[index]\n+\t\t\t&& !t->have_piece(index)\n+\t\t\t&& t->valid_metadata()\n+\t\t\t&& t->has_picker()\n+\t\t\t&& t->picker().piece_priority(index) > dont_download)\n+\t\t{\n+\t\t\tt->peer_is_interesting(*this);\n \t\t}\n+\t}\n \n-\t\t// sorts the peers that are eligible for unchoke by download rate and\n-\t\t// secondary by total upload. The reason for this is, if all torrents are\n-\t\t// being seeded, the download rate will be 0, and the peers we have sent\n-\t\t// the least to should be unchoked\n+\tstd::vector<piece_index_t> const& peer_connection::allowed_fast()\n+\t{\n+\t\tTORRENT_ASSERT(is_single_thread());\n+\t\tstd::shared_ptr<torrent> t = m_torrent.lock();\n+\t\tTORRENT_ASSERT(t);\n \n-\t\t// we use partial sort here, because we only care about the top\n-\t\t// upload_slots peers.\n+
    \t\treturn m_allowed_fast;\n+
    \t}\n \n-\t\tint const slots = std::min(upload_slots, int(peers.size()));\n+\tbool peer_connection::can_request_time_critical() const\n+\t{\n+\t\tTORRENT_ASSERT(is_single_thread());\n+\t\tif (has_peer_choked() || !is_interesting()) return false;\n+\t\tif (int(m_download_queue.size()) + int(m_request_queue.size())\n+\t\t\t> m_desired_queue_size * 2) return false;\n+\t\tif (on_parole()) return false;\n+\t\tif (m_disconnecting) return false;\n+\t\tstd::shared_ptr<torrent> t = m_torrent.lock();\n+\t\tTORRENT_ASSERT(t);\n+\t\tif (t->upload_mode()) return false;\n \n-\t\tif (sett.get_int(settings_pack::seed_choking_algorithm)\n-\t\t\t== settings_pack::round_robin)\n-\t\t{\n-\t\t\tint const pieces = sett.get_int(settings_pack::seeding_piece_quota);\n+\t\t// ignore snubbed peers, since they're not likely to return pieces in a\n+\t\t// timely manner anyway\n+\t\tif (m_snubbed) return false;\n+\t\treturn true;\n+\t}\n \n-\t\t\tstd::nth_element(peers.begin(), peers.begin()\n-\t\t\t\t+ slots, peers.end()\n-\t\t\t\t, [pieces](peer_connection const* lhs, peer_connection const* rhs)\n-\t\t\t\t{ return unchoke_compare_rr(lhs, rhs, pieces); });\n-\t\t}\n-\t\telse if (sett.get_int(settings_pack::seed_choking_algorithm)\n-\t\t\t== settings_pack::fastest_upload)\n-\t\t{\n-\t\t\tstd::nth_element(peers.begin(), peers.begin()\n-\t\t\t\t+ slots, peers.end()\n-\t\t\t\t, [](peer_connection const* lhs, peer_connection const* rhs)\n-
    relevance 0../src/session.cpp:540In C++17. use if constexpr instead

    In C++17. use if constexpr instead

    ../src/session.cpp:540

    \t{}\n-\tsession_proxy::session_proxy(session_proxy const&) = default;\n-\tsession_proxy& session_proxy::operator=(session_proxy const&) & = default;\n-\tsession_proxy::session_proxy(session_proxy&&) noexcept = default;\n-\tsession_proxy& session_proxy::operator=(session_proxy&&) & noexcept = default;\n-\tsession_proxy::~session_proxy()\n+\tbool peer_connection::make_time_critical(piece_block const& block)\n \t{\n-\t\tif (m_thread && m_thread.use_count() == 1)\n+\t\tTORRENT_ASSERT(is_single_thread());\n+\t\tauto const rit = std::find_if(m_request_queue.begin()\n+\t\t\t, m_request_queue.end(), aux::has_block(block));\n+\t\tif (rit == m_request_queue.end()) return false;\n+#if TORRENT_USE_ASSERTS\n+\t\tstd::shared_ptr<torrent> t = m_torrent.lock();\n+\t\tTORRENT_ASSERT(t);\n+\t\tTORRENT_ASSERT(t->has_picker());\n+
    relevance 0../src/utp_stream.cpp:1467this loop is not very efficient. It could be fixed by having a separate list of sequence numbers that need resending

    this loop is not very efficient. It could be fixed by having\n+a separate list of sequence numbers that need resending

    ../src/utp_stream.cpp:1467

    #endif\n+\n+\tif (m_stalled)\n+\t{\n+\t\tif (flags & pkt_ack)\n+\t\t\tdefer_ack();\n+\t\treturn false;\n+\t}\n+\n+\t// m_out_eof means we're trying to close the write side of this socket,\n+\t// we need to flush all payload before we can send the FIN packet, so don't\n+\t// store any payload in the nagle packet\n+\tbool const force = (flags & pkt_ack) || (flags & pkt_fin) || m_out_eof;\n+\n+\t// when we want to close the outgoing stream, we need to send the\n+\t// remaining nagle packet even though it won't fill a packet.\n+\tbool const force_flush_nagle = m_out_eof && m_write_buffer_size;\n+\n+\t// first see if we need to resend any packets\n+\n+
    \tfor (int i = (m_acked_seq_nr + 1) & ACK_MASK; i != m_seq_nr; i = (i + 1) & ACK_MASK)\n+
    \t{\n+\t\tpacket* p = m_outbuf.at(aux::numeric_cast<packet_buffer::index_type>(i));\n+\t\tif (!p) continue;\n+\t\tif (!p->need_resend) continue;\n+\t\tif (!resend_packet(p))\n \t\t{\n-#if defined TORRENT_ASIO_DEBUGGING\n-\t\t\twait_for_asio_handlers();\n-#endif\n-\t\t\tm_thread->join();\n+\t\t\t// we couldn't resend the packet. It probably doesn't\n+\t\t\t// fit in our cwnd. If force is set, we need to continue\n+\t\t\t// to send our packet anyway, if we don't have force set,\n+\t\t\t// we might as well return\n+\t\t\tif (!force) return false;\n+\t\t\t// resend_packet might have failed\n+\t\t\tif (state() == state_t::error_wait || state() == state_t::deleting) return false;\n+\t\t\tif (m_stalled) return false;\n+\t\t\tbreak;\n \t\t}\n-\t}\n \n-\tTORRENT_EXPORT std::unique_ptr<disk_interface> default_disk_io_constructor(\n-\t\tio_context& ios, settings_interface const& sett, counters& cnt)\n-\t{\n-#if TORRENT_HAVE_MMAP || TORRENT_HAVE_MAP_VIEW_OF_FILE\n-
    #include \"libtorrent/aux_/disable_deprecation_warnings_push.hpp\"\n-
    \t\tif (sizeof(void*) == 8)\n-\t\t\treturn mmap_disk_io_constructor(ios, sett, cnt);\n-\t\telse\n-\t\t\treturn posix_disk_io_constructor(ios, sett, cnt);\n-#include \"libtorrent/aux_/disable_warnings_pop.hpp\"\n-#else\n-\t\treturn posix_disk_io_constructor(ios, sett, cnt);\n-#endif\n+\t\t// don't fast-resend this packet\n+\t\tif (m_fast_resend_seq_nr == i)\n+\t\t\tm_fast_resend_seq_nr = (m_fast_resend_seq_nr + 1) & ACK_MASK;\n \t}\n \n-}\n-
    relevance 0../src/posix_part_file.cpp:337what do we do if someone is currently reading from the disk from this piece? does it matter? Since we won't actively erase the data from disk, but it may be overwritten soon, it's probably not that big of a deal

    what do we do if someone is currently reading from the disk\n+\t// MTU DISCOVERY\n+\n+\t// under these conditions, the next packet we send should be an MTU probe.\n+\t// MTU probes get to use the mid-point packet size, whereas other packets\n+\t// use a conservative packet size of the largest known to work. The reason\n+\t// for the cwnd condition is to make sure the probe is surrounded by non-\n+\t// probes, to be able to distinguish a loss of the probe vs. just loss in\n+\t// general.\n+

    relevance 0../src/posix_part_file.cpp:337what do we do if someone is currently reading from the disk from this piece? does it matter? Since we won't actively erase the data from disk, but it may be overwritten soon, it's probably not that big of a deal

    what do we do if someone is currently reading from the disk\n from this piece? does it matter? Since we won't actively erase the\n data from disk, but it may be overwritten soon, it's probably not that\n big of a deal

    ../src/posix_part_file.cpp:337

    \n \t\t\tif (ec) return {};\n \n #ifdef TORRENT_WINDOWS\n \t\t\tret = file_pointer(::_wfopen(convert_to_native_path_string(fn).c_str(), L\"wb+\"));\n@@ -7985,15 +8828,15 @@\n \t\t\t\tec = se.ec;\n \t\t\t\tif (ec) return;\n \t\t\t\tremove(old_path, ec);\n \t\t\t}\n \t\t}\n \t\tm_path = path;\n \t}\n-
    relevance 0../src/posix_part_file.cpp:424instead of rebuilding the whole file header and flushing it, update the slot entries as we go

    instead of rebuilding the whole file header\n+

    relevance 0../src/posix_part_file.cpp:424instead of rebuilding the whole file header and flushing it, update the slot entries as we go

    instead of rebuilding the whole file header\n and flushing it, update the slot entries as we go

    ../src/posix_part_file.cpp:424

    \t\t\t\t}\n \t\t\t\tauto bytes_read = std::fread(buf.get(), 1, std::size_t(block_to_copy), file.file());\n \t\t\t\tif (int(bytes_read) != block_to_copy)\n \t\t\t\t\tec.assign(errno, generic_category());\n \n \t\t\t\tif (ec) return;\n \n@@ -8037,430 +8880,272 @@\n \t\tchar* ptr = header.data();\n \t\twrite_uint32(m_max_pieces, ptr);\n \t\twrite_uint32(m_piece_size, ptr);\n \n \t\tfor (piece_index_t piece(0); piece < piece_index_t(m_max_pieces); ++piece)\n \t\t{\n \t\t\tauto const i = m_piece_map.find(piece);\n-
    relevance 0../src/web_connection_base.cpp:72introduce a web-seed default class which has a low download priority

    introduce a web-seed default class which has a low download priority

    ../src/web_connection_base.cpp:72

    \t\t: peer_connection(pack)\n-\t\t, m_first_request(true)\n-\t\t, m_ssl(false)\n-\t\t, m_external_auth(web.auth)\n-\t\t, m_extra_headers(web.extra_headers)\n-\t\t, m_parser(http_parser::dont_parse_chunks)\n-\t\t, m_body_start(0)\n-\t{\n-\t\tTORRENT_ASSERT(&web.peer_info == pack.peerinfo);\n-\t\t// when going through a proxy, we don't necessarily have an endpoint here,\n-\t\t// since the proxy might be resolving the hostname, not us\n-\t\tTORRENT_ASSERT(web.endpoints.empty() || web.endpoints.front() == pack.endp);\n-\n-\t\tINVARIANT_CHECK;\n-\n-\t\tTORRENT_ASSERT(is_outgoing());\n+
    relevance 0../src/ut_metadata.cpp:281we really need to increment the refcounter on the torrent while this buffer is still in the peer's send buffer

    we really need to increment the refcounter on the torrent\n+while this buffer is still in the peer's send buffer

    ../src/ut_metadata.cpp:281

    \t\t\t\tint const offset = piece * 16 * 1024;\n+\t\t\t\tmetadata = m_tp.metadata().data() + offset;\n+\t\t\t\tmetadata_piece_size = std::min(\n+\t\t\t\t\tint(m_tp.metadata().size()) - offset, 16 * 1024);\n+\t\t\t\tTORRENT_ASSERT(metadata_piece_size > 0);\n+\t\t\t\tTORRENT_ASSERT(offset >= 0);\n+\t\t\t\tTORRENT_ASSERT(offset + metadata_piece_size <= m_tp.metadata().size());\n+\t\t\t}\n \n-\t\tTORRENT_ASSERT(!m_torrent.lock()->is_upload_only());\n+\t\t\tchar msg[200];\n+\t\t\tchar* header = msg;\n+\t\t\tchar* p = &msg[6];\n+\t\t\tint const len = bencode(p, e);\n+\t\t\tint const total_size = 2 + len + metadata_piece_size;\n+\t\t\tnamespace io = aux;\n+\t\t\tio::write_uint32(total_size, header);\n+\t\t\tio::write_uint8(bt_peer_connection::msg_extended, header);\n+\t\t\tio::write_uint8(m_message_index, header);\n \n-\t\t// we only want left-over bandwidth\n-
    \n-
    \t\tstd::string protocol;\n-\t\terror_code ec;\n-\t\tstd::tie(protocol, m_basic_auth, m_host, m_port, m_path)\n-\t\t\t= parse_url_components(web.url, ec);\n-\t\tTORRENT_ASSERT(!ec);\n+\t\t\tm_pc.send_buffer({msg, len + 6});\n+
    \t\t\tif (metadata_piece_size)\n+
    \t\t\t{\n+\t\t\t\tm_pc.append_const_send_buffer(\n+\t\t\t\t\tspan<char>(const_cast<char*>(metadata), metadata_piece_size), metadata_piece_size);\n+\t\t\t}\n \n-\t\tif (m_port == -1 && protocol == \"http\")\n-\t\t\tm_port = 80;\n+\t\t\tm_pc.stats_counters().inc_stats_counter(counters::num_outgoing_extended);\n+\t\t\tm_pc.stats_counters().inc_stats_counter(counters::num_outgoing_metadata);\n+\t\t}\n \n-#if TORRENT_USE_SSL\n-\t\tif (protocol == \"https\")\n+\t\tbool on_extended(int const length\n+\t\t\t, int const extended_msg, span<char const> body) override\n \t\t{\n-\t\t\tm_ssl = true;\n-\t\t\tif (m_port == -1) m_port = 443;\n-\t\t}\n+\t\t\tif (extended_msg != 2) return false;\n+\t\t\tif (m_message_index == 0) return false;\n+\n+\t\t\tif (length > 17 * 1024)\n+\t\t\t{\n+#ifndef TORRENT_DISABLE_LOGGING\n+\t\t\t\tm_pc.peer_log(peer_log_alert::incoming_message, \"UT_METADATA\"\n+\t\t\t\t\t, \"packet too big %d\", length);\n #endif\n+\t\t\t\tm_pc.disconnect(errors::invalid_metadata_message, operation_t::bittorrent, peer_connection_interface::peer_error);\n+\t\t\t\treturn true;\n+\t\t\t}\n \n-\t\tif (!m_basic_auth.empty())\n-\t\t\tm_basic_auth = base64encode(m_basic_auth);\n+\t\t\tif (!m_pc.packet_finished()) return true;\n \n-\t\tm_server_string = m_host;\n-\t\taux::verify_encoding(m_server_string);\n+\t\t\terror_code ec;\n+\t\t\tbdecode_node msg = bdecode(body, ec);\n+\t\t\tif (msg.type() != bdecode_node::dict_t)\n+
    relevance 0../src/disabled_disk_io.cpp:106it would be nice to return a valid hash of zeroes here

    it would be nice to return a valid hash of zeroes here

    ../src/disabled_disk_io.cpp:106

    \t\t});\n \t}\n \n-\tint web_connection_base::timeout() const\n+\tbool async_write(storage_index_t\n+\t\t, peer_request const& r\n+\t\t, char const*, std::shared_ptr<disk_observer>\n+\t\t, std::function<void(storage_error const&)> handler\n+\t\t, disk_job_flags_t) override\n \t{\n-\t\t// since this is a web seed, change the timeout\n-\t\t// according to the settings.\n-\t\treturn m_settings.get_int(settings_pack::urlseed_timeout);\n-\t}\n-
    relevance 0../src/random.cpp:141improve calling RAND_bytes multiple times, using fallback for now

    improve calling RAND_bytes multiple times, using fallback for now

    ../src/random.cpp:141

    #else\n-\t\t\tstd::generate(buffer.begin(), buffer.end(), [] { return char(random(0xff)); });\n-#endif\n-\t\t}\n-\n-\t\tvoid crypto_random_bytes(span<char> buffer)\n-\t\t{\n-#ifdef TORRENT_BUILD_SIMULATOR\n-\t\t\t// In the simulator we want deterministic random numbers\n-\t\t\tstd::generate(buffer.begin(), buffer.end(), [] { return char(random(0xff)); });\n-#elif TORRENT_USE_CNG\n-\t\t\taux::cng_gen_random(buffer);\n-#elif TORRENT_USE_CRYPTOAPI\n-\t\t\t// windows\n-\t\t\taux::crypt_gen_random(buffer);\n-#elif defined TORRENT_USE_LIBCRYPTO && !defined TORRENT_USE_WOLFSSL\n-// wolfSSL uses wc_RNG_GenerateBlock as the internal function for the\n-// openssl compatibility layer. This function API does not support\n-// an arbitrary buffer size (openssl does), it is limited by the\n-// constant RNG_MAX_BLOCK_LEN.\n-
    \n-
    \t\t\t// openssl\n-\t\t\tint r = RAND_bytes(reinterpret_cast<unsigned char*>(buffer.data())\n-\t\t\t\t, int(buffer.size()));\n-\t\t\tif (r != 1) aux::throw_ex<system_error>(errors::no_entropy);\n-#elif TORRENT_USE_GETRANDOM\n-\t\t\tssize_t const r = ::getrandom(buffer.data(), static_cast<std::size_t>(buffer.size()), 0);\n-\t\t\tif (r == ssize_t(buffer.size())) return;\n-\t\t\tif (r == -1 && errno != ENOSYS) aux::throw_ex<system_error>(error_code(errno, generic_category()));\n-\t\t\tstatic dev_random dev;\n-\t\t\tdev.read(buffer);\n-#elif TORRENT_USE_DEV_RANDOM\n-\t\t\tstatic dev_random dev;\n-\t\t\tdev.read(buffer);\n-#else\n-\n-#if TORRENT_BROKEN_RANDOM_DEVICE\n-\t\t\t// even pseudo random numbers rely on being able to seed the random\n-\t\t\t// generator\n-#error \"no entropy source available\"\n-#else\n-#ifdef TORRENT_I_WANT_INSECURE_RANDOM_NUMBERS\n-\t\t\tstd::generate(buffer.begin(), buffer.end(), [] { return char(random(0xff)); });\n-#else\n-#error \"no secure entropy source available. If you really want insecure random numbers, define TORRENT_I_WANT_INSECURE_RANDOM_NUMBERS\"\n-#endif\n-#endif\n+\t\tTORRENT_ASSERT(r.length <= default_block_size);\n+\t\tTORRENT_UNUSED(r);\n \n-#endif\n-\t\t}\n-}\n-
    relevance 0../src/torrent_handle.cpp:589support moving files into this call

    support moving files into this call

    ../src/torrent_handle.cpp:589

    \t\tauto retp = &prio;\n-\t\tsync_call(&torrent::piece_priorities, retp);\n-\t\tstd::vector<int> ret;\n-\t\tret.reserve(prio.size());\n-\t\tfor (auto p : prio)\n-\t\t\tret.push_back(int(static_cast<std::uint8_t>(p)));\n-\t\treturn ret;\n+\t\tpost(m_ios, [h = std::move(handler)] { h(storage_error{}); });\n+\t\treturn false;\n \t}\n-#endif\n \n-\tvoid torrent_handle::file_priority(file_index_t index, download_priority_t priority) const\n+\tvoid async_hash(storage_index_t\n+\t\t, piece_index_t piece, span<sha256_hash>, disk_job_flags_t\n+\t\t, std::function<void(piece_index_t, sha1_hash const&, storage_error const&)> handler) override\n \t{\n-\t\tasync_call(&torrent::set_file_priority, index, priority);\n-\t}\n+
    \t\tpost(m_ios, [h = std::move(handler), piece] { h(piece, sha1_hash{}, storage_error{}); });\n+
    \t}\n \n-\tdownload_priority_t torrent_handle::file_priority(file_index_t index) const\n+\tvoid async_hash2(storage_index_t, piece_index_t piece, int\n+\t\t, disk_job_flags_t\n+\t\t, std::function<void(piece_index_t, sha256_hash const&, storage_error const&)> handler) override\n \t{\n-\t\treturn sync_call_ret<download_priority_t>(dont_download, &torrent::file_priority, index);\n+\t\tpost(m_ios, [h = std::move(handler), piece]() { h(piece, sha256_hash{}, storage_error{}); });\n \t}\n \n-
    \tvoid torrent_handle::prioritize_files(std::vector<download_priority_t> const& files) const\n-
    \t{\n-\t\tasync_call(&torrent::prioritize_files\n-\t\t\t, static_cast<aux::vector<download_priority_t, file_index_t> const&>(files));\n+\tvoid async_move_storage(storage_index_t\n+\t\t, std::string p, move_flags_t\n+\t\t, std::function<void(status_t, std::string const&, storage_error const&)> handler) override\n+\t{\n+\t\tpost(m_ios, [h = std::move(handler), path = std::move(p)] () mutable\n+\t\t\t{ h(status_t::no_error, std::move(path), storage_error{}); });\n \t}\n \n-\tstd::vector<download_priority_t> torrent_handle::get_file_priorities() const\n+\tvoid async_release_files(storage_index_t, std::function<void()> handler) override\n \t{\n-\t\taux::vector<download_priority_t, file_index_t> ret;\n-\t\tauto retp = &ret;\n-\t\tsync_call(&torrent::file_priorities, retp);\n-\t\treturn TORRENT_RVO(ret);\n+\t\tpost(m_ios, [h = std::move(handler)] { h(); });\n \t}\n \n-#if TORRENT_ABI_VERSION == 1\n-\n-// ============ start deprecation ===============\n-\n-\tvoid torrent_handle::prioritize_files(std::vector<int> const& files) const\n+\tvoid async_delete_files(storage_index_t\n+\t\t, remove_flags_t, std::function<void(storage_error const&)> handler) override\n \t{\n-\t\taux::vector<download_priority_t, file_index_t> file_prio;\n-\t\tfile_prio.reserve(files.size());\n-\t\tfor (auto const p : files) {\n-\t\t\tfile_prio.push_back(download_priority_t(static_cast<std::uint8_t>(p)));\n-\t\t}\n-\t\tasync_call(&torrent::prioritize_files, file_prio);\n+\t\tpost(m_ios, [h = std::move(handler)] { h(storage_error{}); });\n \t}\n \n-\tstd::vector<int> torrent_handle::file_priorities() const\n+\tvoid async_check_files(storage_index_t\n+\t\t, add_torrent_params const*\n+
    relevance 0../src/cpuid.cpp:131enable when aarch64 is really tested

    enable when aarch64 is really tested

    ../src/cpuid.cpp:131

    \tbool supports_mmx() noexcept\n \t{\n-\t\taux::vector<download_priority_t, file_index_t> prio;\n-
    relevance 0../src/utp_socket_manager.cpp:204this should not be heap allocated, sockets should be movable

    this should not be heap allocated, sockets should be movable

    ../src/utp_socket_manager.cpp:204

    \n-//\t\tUTP_LOGV(\"incoming packet id:%d source:%s\\n\", id, print_endpoint(ep).c_str());\n-\n-\t\tif (!m_sett.get_bool(settings_pack::enable_incoming_utp))\n-\t\t\treturn false;\n-\n-\t\t// if not found, see if it's a SYN packet, if it is,\n-\t\t// create a new utp_stream\n-\t\tif (ph->get_type() == ST_SYN)\n-\t\t{\n-\t\t\t// possible SYN flood. Just ignore\n-\t\t\tif (int(m_utp_sockets.size()) > m_sett.get_int(settings_pack::connections_limit) * 2)\n-\t\t\t\treturn false;\n-\n-\t\t\tTORRENT_ASSERT(m_new_connection == -1);\n-\t\t\t// create the new socket with this ID\n-\t\t\tm_new_connection = id;\n-\n-//\t\t\tUTP_LOGV(\"not found, new connection id:%d\\n\", m_new_connection);\n-\n-
    \t\t\taux::socket_type c(aux::instantiate_connection(m_ios, aux::proxy_settings(), m_ssl_context, this, true, false));\n-
    \n-\t\t\tutp_stream* str = nullptr;\n-#ifdef TORRENT_SSL_PEERS\n-\t\t\tif (is_ssl(c))\n-\t\t\t\tstr = &boost::get<ssl_stream<utp_stream>>(c).next_layer();\n-\t\t\telse\n-#endif\n-\t\t\t\tstr = boost::get<utp_stream>(&c);\n-\n-\t\t\tTORRENT_ASSERT(str);\n-\t\t\tint const mtu = mtu_for_dest(ep.address());\n-\t\t\tstr->get_impl()->init_mtu(mtu);\n-\t\t\tstr->get_impl()->m_sock = std::move(socket);\n-\t\t\tbool const ret = str->get_impl()->incoming_packet(p, ep, receive_time);\n-\t\t\tif (!ret) return false;\n-\t\t\tm_last_socket = str->get_impl();\n-\t\t\tm_cb(std::move(c));\n-\t\t\t// the connection most likely changed its connection ID here\n-\t\t\t// we need to move it to the correct ID\n-\t\t\treturn true;\n-\t\t}\n-\n-\t\tif (ph->get_type() == ST_RESET) return false;\n-\n-\t\t// #error send reset\n-\n+#if TORRENT_HAS_SSE\n+\t\tstd::uint32_t cpui[4] = {0};\n+\t\tcpuid(cpui, 1);\n+\t\treturn (cpui[2] & (1 << 23)) != 0;\n+#else\n \t\treturn false;\n+#endif\n \t}\n \n-\tvoid utp_socket_manager::subscribe_writable(utp_socket_impl* s)\n-
    relevance 0../src/pe_crypto.cpp:60it would be nice to get the literal working

    it would be nice to get the literal working

    ../src/pe_crypto.cpp:60

    #include <algorithm>\n-#include <random>\n-\n-#include \"libtorrent/aux_/disable_warnings_push.hpp\"\n-\n-#include <boost/multiprecision/integer.hpp>\n-#include <boost/multiprecision/cpp_int.hpp>\n-\n-#include \"libtorrent/aux_/disable_warnings_pop.hpp\"\n-\n-#include \"libtorrent/random.hpp\"\n-#include \"libtorrent/aux_/alloca.hpp\"\n-#include \"libtorrent/pe_crypto.hpp\"\n-#include \"libtorrent/hasher.hpp\"\n-\n-namespace libtorrent {\n-\n-\tnamespace mp = boost::multiprecision;\n-\n-\tnamespace {\n-
    \t\tkey_t const dh_prime\n-
    \t\t\t(\"0xFFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A63A36210000000000090563\");\n-\t}\n-\n-\tstd::array<char, 96> export_key(key_t const& k)\n+\tbool supports_arm_neon() noexcept\n \t{\n-\t\tstd::array<char, 96> ret;\n-\t\tauto* begin = reinterpret_cast<std::uint8_t*>(ret.data());\n-\t\tstd::uint8_t* end = mp::export_bits(k, begin, 8);\n-\n-
    relevance 0../src/pe_crypto.cpp:71it would be nice to be able to export to a fixed width field, so we wouldn't have to shift it later

    it would be nice to be able to export to a fixed width field, so\n-we wouldn't have to shift it later

    ../src/pe_crypto.cpp:71

    #include \"libtorrent/random.hpp\"\n-#include \"libtorrent/aux_/alloca.hpp\"\n-#include \"libtorrent/pe_crypto.hpp\"\n-#include \"libtorrent/hasher.hpp\"\n-\n-namespace libtorrent {\n-\n-\tnamespace mp = boost::multiprecision;\n-\n-\tnamespace {\n-\t\tkey_t const dh_prime\n-\t\t\t(\"0xFFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A63A36210000000000090563\");\n+#if TORRENT_HAS_ARM_NEON && TORRENT_HAS_AUXV\n+#if defined __arm__\n+\t\t//return (getauxval(AT_HWCAP) & HWCAP_NEON);\n+\t\treturn (helper_getauxval(16) & (1 << 12));\n+#elif defined __aarch64__\n+\t\t//return (getauxval(AT_HWCAP) & HWCAP_ASIMD);\n+\t\t//return (getauxval(16) & (1 << 1));\n+
    \t\treturn false;\n+
    #endif\n+#else\n+\t\treturn false;\n+#endif\n \t}\n \n-\tstd::array<char, 96> export_key(key_t const& k)\n+\tbool supports_arm_crc32c() noexcept\n \t{\n-\t\tstd::array<char, 96> ret;\n-\t\tauto* begin = reinterpret_cast<std::uint8_t*>(ret.data());\n-\t\tstd::uint8_t* end = mp::export_bits(k, begin, 8);\n-\n-
    \t\tif (end < begin + 96)\n-
    \t\t{\n-\t\t\tint const len = int(end - begin);\n-#if defined __GNUC__ && __GNUC__ == 12\n-#pragma GCC diagnostic push\n-#pragma GCC diagnostic ignored \"-Wstringop-overflow\"\n+#if TORRENT_HAS_ARM_CRC32 && TORRENT_HAS_AUXV\n+#if defined TORRENT_FORCE_ARM_CRC32\n+\t\treturn true;\n+#elif defined __arm__\n+\t\t//return (getauxval(AT_HWCAP2) & HWCAP2_CRC32);\n+\t\treturn (helper_getauxval(26) & (1 << 4));\n+#elif defined __aarch64__\n+\t\t//return (getauxval(AT_HWCAP) & HWCAP_CRC32);\n+\t\treturn (helper_getauxval(16) & (1 << 7));\n #endif\n-\t\t\tstd::memmove(begin + 96 - len, begin, aux::numeric_cast<std::size_t>(len));\n-#if defined __GNUC__ && __GNUC__ == 12\n-#pragma GCC diagnostic pop\n+#else\n+\t\treturn false;\n #endif\n-\t\t\tstd::memset(begin, 0, aux::numeric_cast<std::size_t>(96 - len));\n-\t\t}\n-\t\treturn ret;\n \t}\n \n-\tvoid rc4_init(const unsigned char* in, std::size_t len, rc4 *state);\n-\tstd::size_t rc4_encrypt(unsigned char *out, std::size_t outlen, rc4 *state);\n+} // anonymous namespace\n \n-\t// Set the prime P and the generator, generate local public key\n-\tdh_key_exchange::dh_key_exchange()\n-\t{\n-\t\taux::array<std::uint8_t, 96> random_key;\n-\t\taux::random_bytes({reinterpret_cast<char*>(random_key.data())\n-\t\t\t, static_cast<std::ptrdiff_t>(random_key.size())});\n+\tbool const sse42_support = supports_sse42();\n+\tbool const mmx_support = supports_mmx();\n+\tbool const arm_neon_support = supports_arm_neon();\n+\tbool const arm_crc32c_support = supports_arm_crc32c();\n+} }\n+
    relevance 0../src/torrent_info.cpp:887this should be considered a failure, and the .torrent file rejected

    this should be considered a failure, and the .torrent file\n+rejected

    ../src/torrent_info.cpp:887

    \t\t\tstd::string ext = extension(filename);\n+\t\t\tint cnt = 0;\n+\t\t\tfor (;;)\n+\t\t\t{\n+\t\t\t\t++cnt;\n+\t\t\t\tchar new_ext[50];\n+\t\t\t\tstd::snprintf(new_ext, sizeof(new_ext), \".%d%s\", cnt, ext.c_str());\n+\t\t\t\tfilename = base + new_ext;\n \n-\t\t// create local key (random)\n-\t\tmp::import_bits(m_dh_local_secret, random_key.begin(), random_key.end());\n+\t\t\t\tboost::crc_optimal<32, 0x1EDC6F41, 0xFFFFFFFF, 0xFFFFFFFF, true, true> crc;\n+\t\t\t\tprocess_string_lowercase(crc, filename);\n+\t\t\t\tstd::uint32_t const new_hash = crc.checksum();\n+\t\t\t\tif (files.find(new_hash) == files.end())\n+\t\t\t\t{\n+\t\t\t\t\tfiles.insert({new_hash, {i, 0}});\n+\t\t\t\t\tbreak;\n+\t\t\t\t}\n+\t\t\t\t++num_collisions;\n+\t\t\t\tif (num_collisions > 100)\n+\t\t\t\t{\n+
    \t\t\t\t}\n+
    \t\t\t}\n \n-\t\t// key = (2 ^ secret) % prime\n-\t\tm_dh_local_key = mp::powm(key_t(2), m_dh_local_secret, dh_prime);\n-
    relevance 0../src/enum_net.cpp:144in C++17, use __has_include for this. Other operating systems are likely to require this as well

    in C++17, use __has_include for this. Other operating systems are\n-likely to require this as well

    ../src/enum_net.cpp:144

    #include <arpa/inet.h>\n-#include <cstring>\n-#include <cstdlib>\n-#include <unistd.h>\n-#include <sys/types.h>\n+\t\t\tcopy_on_write();\n+\t\t\tm_files.rename_file(i, filename);\n+\t\t}\n+\t}\n \n-#if defined TORRENT_ANDROID && !defined IFA_F_DADFAILED\n-#define IFA_F_DADFAILED 8\n-#endif\n+\tvoid torrent_info::remap_files(file_storage const& f)\n+\t{\n+\t\tINVARIANT_CHECK;\n \n-#endif\n+\t\tTORRENT_ASSERT(is_loaded());\n+\t\t// the new specified file storage must have the exact\n+\t\t// same size as the current file storage\n+\t\tTORRENT_ASSERT(m_files.total_size() == f.total_size());\n \n-#if TORRENT_USE_IFADDRS\n-#include <ifaddrs.h>\n-#include <net/if.h>\n-#include <sys/ioctl.h>\n-#endif\n+\t\tif (m_files.total_size() != f.total_size()) return;\n+\t\tcopy_on_write();\n+\t\tm_files = f;\n+\t\tm_files.set_num_pieces(m_orig_files->num_pieces());\n+\t\tm_files.set_piece_length(m_orig_files->piece_length());\n+\t}\n \n-#if TORRENT_USE_IFADDRS || TORRENT_USE_IFCONF || TORRENT_USE_NETLINK || TORRENT_USE_SYSCTL\n-#ifdef TORRENT_BEOS\n-
    #include <sys/sockio.h>\n-
    #endif\n-// capture this here where warnings are disabled (the macro generates warnings)\n-const unsigned long siocgifmtu = SIOCGIFMTU;\n-#endif\n+#if TORRENT_ABI_VERSION == 1\n+\t// standard constructor that parses a torrent file\n+\ttorrent_info::torrent_info(entry const& torrent_file)\n+\t{\n+\t\tstd::vector<char> tmp;\n+\t\tstd::back_insert_iterator<std::vector<char>> out(tmp);\n+\t\tbencode(out, torrent_file);\n+
    relevance 0../src/performance_counters.cpp:40move stats_counter_t out of counters

    move stats_counter_t out of counters

    ../src/performance_counters.cpp:40

    relevance 0../src/performance_counters.cpp:41should bittorrent keep-alive messages have a counter too?

    should bittorrent keep-alive messages have a counter too?

    ../src/performance_counters.cpp:41

    relevance 0../src/performance_counters.cpp:42It would be nice if this could be an internal type. default_disk_constructor depends on it now

    It would be nice if this could be an internal type. default_disk_constructor depends on it now

    ../src/performance_counters.cpp:42

    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n+POSSIBILITY OF SUCH DAMAGE.\n \n-#include \"libtorrent/aux_/disable_warnings_pop.hpp\"\n+*/\n \n-#if defined(TORRENT_OS2) && !defined(IF_NAMESIZE)\n-#define IF_NAMESIZE IFNAMSIZ\n-#endif\n+#include \"libtorrent/performance_counters.hpp\"\n+#include \"libtorrent/assert.hpp\"\n+#include <cstring> // for memset\n \n namespace libtorrent {\n \n-namespace {\n-\n-#if !defined TORRENT_WINDOWS && !defined TORRENT_BUILD_SIMULATOR\n-\tstruct socket_closer\n-\t{\n-\t\tsocket_closer(int s) : m_socket(s) {}\n-\t\tsocket_closer(socket_closer const&) = delete;\n-\t\tsocket_closer(socket_closer &&) = delete;\n-\t\tsocket_closer& operator=(socket_closer const&) = delete;\n-\t\tsocket_closer& operator=(socket_closer &&) = delete;\n-\t\t~socket_closer() { ::close(m_socket); }\n-\tprivate:\n-\t\tint m_socket;\n-\t};\n+
    \tcounters::counters() TORRENT_COUNTER_NOEXCEPT\n+
    \t{\n+#ifdef ATOMIC_LLONG_LOCK_FREE\n+\t\tfor (auto& counter : m_stats_counter)\n+\t\t\tcounter.store(0, std::memory_order_relaxed);\n+#else\n+\t\tm_stats_counter.fill(0);\n #endif\n-\n-#if !defined TORRENT_BUILD_SIMULATOR\n-
    relevance 0../src/enum_net.cpp:268if we get here, the caller still assumes the error code is reported via errno

    if we get here, the caller still assumes the error code\n-is reported via errno

    ../src/enum_net.cpp:268

    \t\t;\n \t}\n-#endif\n-\n-#if TORRENT_USE_NETLINK\n-\n-\tint read_nl_sock(int sock, std::uint32_t const seq, std::uint32_t const pid\n-\t\t, std::function<void(nlmsghdr const*)> on_msg)\n-\t{\n-\t\tstd::array<char, 4096> buf;\n-\t\tfor (;;)\n-\t\t{\n-\t\t\tint const read_len = int(recv(sock, buf.data(), buf.size(), 0));\n-\t\t\tif (read_len < 0) return -1;\n \n-\t\t\tauto const* nl_hdr = reinterpret_cast<nlmsghdr const*>(buf.data());\n-\t\t\tint len = read_len;\n-\n-\t\t\tfor (; len > 0 && aux::nlmsg_ok(nl_hdr, len); nl_hdr = aux::nlmsg_next(nl_hdr, len))\n-\t\t\t{\n-
    \t\t\t\tif ((aux::nlmsg_ok(nl_hdr, read_len) == 0) || (nl_hdr->nlmsg_type == NLMSG_ERROR))\n-
    \t\t\t\t\treturn -1;\n-\t\t\t\t// this function doesn't handle multiple requests at the same time\n-\t\t\t\t// so report an error if the message does not have the expected seq and pid\n-
    relevance 0../src/enum_net.cpp:274if we get here, the caller still assumes the error code is reported via errno

    if we get here, the caller still assumes the error code\n-is reported via errno

    ../src/enum_net.cpp:274

    #if TORRENT_USE_NETLINK\n-\n-\tint read_nl_sock(int sock, std::uint32_t const seq, std::uint32_t const pid\n-\t\t, std::function<void(nlmsghdr const*)> on_msg)\n+\tcounters::counters(counters const& c) TORRENT_COUNTER_NOEXCEPT\n \t{\n-\t\tstd::array<char, 4096> buf;\n-\t\tfor (;;)\n-\t\t{\n-\t\t\tint const read_len = int(recv(sock, buf.data(), buf.size(), 0));\n-\t\t\tif (read_len < 0) return -1;\n-\n-\t\t\tauto const* nl_hdr = reinterpret_cast<nlmsghdr const*>(buf.data());\n-\t\t\tint len = read_len;\n-\n-\t\t\tfor (; len > 0 && aux::nlmsg_ok(nl_hdr, len); nl_hdr = aux::nlmsg_next(nl_hdr, len))\n-\t\t\t{\n-\t\t\t\tif ((aux::nlmsg_ok(nl_hdr, read_len) == 0) || (nl_hdr->nlmsg_type == NLMSG_ERROR))\n-\t\t\t\t\treturn -1;\n-\t\t\t\t// this function doesn't handle multiple requests at the same time\n-\t\t\t\t// so report an error if the message does not have the expected seq and pid\n-
    \t\t\t\tif (nl_hdr->nlmsg_seq != seq || nl_hdr->nlmsg_pid != pid)\n-
    \t\t\t\t\treturn -1;\n-\n-\t\t\t\tif (nl_hdr->nlmsg_type == NLMSG_DONE) return 0;\n-\n-\t\t\t\ton_msg(nl_hdr);\n-\n-\t\t\t\tif ((nl_hdr->nlmsg_flags & NLM_F_MULTI) == 0) return 0;\n-\t\t\t}\n-\t\t}\n-//\t\treturn 0;\n+#ifdef ATOMIC_LLONG_LOCK_FREE\n+\t\tfor (int i = 0; i < m_stats_counter.end_index(); ++i)\n+\t\t\tm_stats_counter[i].store(\n+\t\t\t\tc.m_stats_counter[i].load(std::memory_order_relaxed)\n+\t\t\t\t\t, std::memory_order_relaxed);\n+#else\n+\t\tstd::lock_guard<std::mutex> l(c.m_mutex);\n+\t\tm_stats_counter = c.m_stats_counter;\n+#endif\n \t}\n \n-\tint nl_dump_request(int const sock, std::uint32_t const seq\n-\t\t, nlmsghdr* const request_msg, std::function<void(nlmsghdr const*)> on_msg)\n+\tcounters& counters::operator=(counters const& c) & TORRENT_COUNTER_NOEXCEPT\n \t{\n-\t\trequest_msg->nlmsg_flags = NLM_F_DUMP | NLM_F_REQUEST;\n-\t\trequest_msg->nlmsg_seq = seq;\n-\t\t// in theory nlmsg_pid should be set to the netlink port ID (NOT the process ID)\n-\t\t// of the sender, but the kernel ignores this field so it is typically set to\n-\t\t// zero\n-\t\trequest_msg->nlmsg_pid = 0;\n-\n-\t\tif (::send(sock, request_msg, request_msg->nlmsg_len, 0) < 0)\n-\t\t\treturn -1;\n-\n-\t\t// get the socket's port ID so that we can verify it in the response\n-\t\tsockaddr_nl sock_addr;\n-\t\tsocklen_t sock_addr_len = sizeof(sock_addr);\n-\t\tif (::getsockname(sock, reinterpret_cast<sockaddr*>(&sock_addr), &sock_addr_len) < 0)\n-\t\t\treturn -1;\n-
    relevance 0../src/alert.cpp:404move this field into tracker_alert

    move this field into tracker_alert

    ../src/alert.cpp:404

    \n+\t\tif (&c == this) return *this;\n+#ifdef ATOMIC_LLONG_LOCK_FREE\n+\t\tfor (int i = 0; i < m_stats_counter.end_index(); ++i)\n+\t\t\tm_stats_counter[i].store(\n+\t\t\t\tc.m_stats_counter[i].load(std::memory_order_relaxed)\n+\t\t\t\t\t, std::memory_order_relaxed);\n+
    relevance 0../src/alert.cpp:404move this field into tracker_alert

    move this field into tracker_alert

    ../src/alert.cpp:404

    \n \t\treturn torrent_alert::message() + \": state changed to: \"\n \t\t\t+ state_str[state];\n #endif\n \t}\n \n \ttracker_error_alert::tracker_error_alert(aux::stack_allocator& alloc\n \t\t, torrent_handle const& h, tcp::endpoint const& ep, int times\n@@ -8503,15 +9188,15 @@\n \n \ttracker_warning_alert::tracker_warning_alert(aux::stack_allocator& alloc\n \t\t, torrent_handle const& h, tcp::endpoint const& ep\n \t\t, string_view u, protocol_version v, string_view m)\n \t\t: tracker_alert(alloc, h, ep, u)\n \t\t, m_msg_idx(alloc.copy_string(m))\n #if TORRENT_ABI_VERSION == 1\n-
    relevance 0../src/alert.cpp:438move this into tracker_alert

    move this into tracker_alert

    ../src/alert.cpp:438

    \t\treturn {};\n+
    relevance 0../src/alert.cpp:438move this into tracker_alert

    move this into tracker_alert

    ../src/alert.cpp:438

    \t\treturn {};\n #else\n \t\tchar ret[400];\n \t\tstd::snprintf(ret, sizeof(ret), \"%s %s %s \\\"%s\\\" (%d)\"\n \t\t\t, tracker_alert::message().c_str()\n \t\t\t, version == protocol_version::V1 ? \"v1\" : \"v2\"\n \t\t\t, convert_from_native(error.message()).c_str(), error_message()\n \t\t\t, times_in_row);\n@@ -8548,15 +9233,15 @@\n \n \tscrape_reply_alert::scrape_reply_alert(aux::stack_allocator& alloc\n \t\t, torrent_handle const& h, tcp::endpoint const& ep\n \t\t, int incomp, int comp, string_view u, protocol_version const v)\n \t\t: tracker_alert(alloc, h, ep, u)\n \t\t, incomplete(incomp)\n \t\t, complete(comp)\n-
    relevance 0../src/alert.cpp:464move this into tracker_alert

    move this into tracker_alert

    ../src/alert.cpp:464

    \tchar const* tracker_warning_alert::warning_message() const\n+
    relevance 0../src/alert.cpp:464move this into tracker_alert

    move this into tracker_alert

    ../src/alert.cpp:464

    \tchar const* tracker_warning_alert::warning_message() const\n \t{\n \t\treturn m_alloc.get().ptr(m_msg_idx);\n \t}\n \n \tstd::string tracker_warning_alert::message() const\n \t{\n #ifdef TORRENT_DISABLE_ALERT_MSG\n@@ -8596,15 +9281,15 @@\n \t\t, string_view u, protocol_version const v, error_code const& e)\n \t\t: tracker_alert(alloc, h, ep, u)\n \t\t, error(e)\n \t\t, m_msg_idx()\n #if TORRENT_ABI_VERSION == 1\n \t\t, msg(convert_from_native(e.message()))\n #endif\n-
    relevance 0../src/alert.cpp:493move this into tracker_alert

    move this into tracker_alert

    ../src/alert.cpp:493

    \t\treturn {};\n+
    relevance 0../src/alert.cpp:493move this into tracker_alert

    move this into tracker_alert

    ../src/alert.cpp:493

    \t\treturn {};\n #else\n \t\tchar ret[400];\n \t\tstd::snprintf(ret, sizeof(ret), \"%s %s scrape reply: %d %d\"\n \t\t\t, tracker_alert::message().c_str()\n \t\t\t, version == protocol_version::V1 ? \"v1\" : \"v2\"\n \t\t\t, incomplete, complete);\n \t\treturn ret;\n@@ -8647,15 +9332,15 @@\n \tstd::string scrape_failed_alert::message() const\n \t{\n #ifdef TORRENT_DISABLE_ALERT_MSG\n \t\treturn {};\n #else\n \t\treturn tracker_alert::message() + \" scrape failed: \" + error_message();\n #endif\n-
    relevance 0../src/alert.cpp:532move this field into tracker_alert

    move this field into tracker_alert

    ../src/alert.cpp:532

    \tchar const* scrape_failed_alert::error_message() const\n+
    relevance 0../src/alert.cpp:532move this field into tracker_alert

    move this field into tracker_alert

    ../src/alert.cpp:532

    \tchar const* scrape_failed_alert::error_message() const\n \t{\n \t\tif (m_msg_idx == aux::allocation_slot()) return \"\";\n \t\telse return m_alloc.get().ptr(m_msg_idx);\n \t}\n \n \tstd::string scrape_failed_alert::message() const\n \t{\n@@ -8698,15 +9383,15 @@\n \t{}\n \n \tstd::string dht_reply_alert::message() const\n \t{\n #ifdef TORRENT_DISABLE_ALERT_MSG\n \t\treturn {};\n #else\n-
    relevance 0../src/alert.cpp:576move this to tracker_alert

    move this to tracker_alert

    ../src/alert.cpp:576

    \t\t, num_peers(np)\n+
    relevance 0../src/alert.cpp:576move this to tracker_alert

    move this to tracker_alert

    ../src/alert.cpp:576

    \t\t, num_peers(np)\n \t{}\n \n \tstd::string dht_reply_alert::message() const\n \t{\n #ifdef TORRENT_DISABLE_ALERT_MSG\n \t\treturn {};\n #else\n@@ -8749,375 +9434,15 @@\n \t\tTORRENT_ASSERT(index >= piece_index_t(0));\n \t}\n \n \tstd::string hash_failed_alert::message() const\n \t{\n #ifdef TORRENT_DISABLE_ALERT_MSG\n \t\treturn {};\n-
    relevance 0../src/create_torrent.cpp:618this can be optimized

    this can be optimized

    ../src/create_torrent.cpp:618

    \t\tstd::string& attr = e[\"attr\"].string();\n-\t\tif (flags & file_storage::flag_pad_file) attr += 'p';\n-\t\tif (flags & file_storage::flag_hidden) attr += 'h';\n-\t\tif (flags & file_storage::flag_executable) attr += 'x';\n-\t\tif (include_symlinks && (flags & file_storage::flag_symlink)) attr += 'l';\n-\t}\n-\n-\tvoid add_symlink_path(entry& e, std::string symlink_path)\n-\t{\n-\t\tentry& sympath_e = e[\"symlink path\"];\n-\n-\t\tstd::string const link = lexically_relative(\"\", symlink_path);\n-\t\tfor (auto elems = lsplit_path(link); !elems.first.empty();\n-\t\t\telems = lsplit_path(elems.second))\n-\t\t\tsympath_e.list().emplace_back(elems.first);\n-\t}\n-}\n-\n-\tstd::vector<char> create_torrent::generate_buf() const\n-\t{\n-
    \t\tstd::vector<char> ret;\n-
    \t\tbencode(std::back_inserter(ret), generate());\n-\t\treturn ret;\n-\t}\n-\n-\tentry create_torrent::generate() const\n-\t{\n-\t\tif (m_files.num_files() == 0 || m_files.total_size() == 0)\n-\t\t\taux::throw_ex<system_error>(errors::torrent_missing_file_tree);\n-\n-\t\t// if all v2 hashes are set correctly, generate the v2 parts of the\n-\t\t// torrent\n-\t\tbool const make_v2 = validate_v2_hashes(m_files, m_file_piece_hash);\n-\t\tbool const make_v1 = validate_v1_hashes(m_files, m_piece_hash);\n-\n-\t\t// if neither v1 nor v2 hashes were set, we can't create a torrent\n-\t\tif (!make_v1 && !make_v2)\n-\t\t\taux::throw_ex<system_error>(errors::invalid_hash_entry);\n-\n-\t\tTORRENT_ASSERT(m_files.piece_length() > 0);\n-\n-\t\tentry dict;\n-\n-\t\tif (!m_urls.empty()) dict[\"announce\"] = m_urls.front().first;\n-\n-\t\tif (!m_nodes.empty())\n-\t\t{\n-\t\t\tentry& nodes = dict[\"nodes\"];\n-\t\t\tentry::list_type& nodes_list = nodes.list();\n-\t\t\tfor (auto const& n : m_nodes)\n-\t\t\t{\n-
    relevance 0../src/disabled_disk_io.cpp:106it would be nice to return a valid hash of zeroes here

    it would be nice to return a valid hash of zeroes here

    ../src/disabled_disk_io.cpp:106

    \t\t});\n-\t}\n-\n-\tbool async_write(storage_index_t\n-\t\t, peer_request const& r\n-\t\t, char const*, std::shared_ptr<disk_observer>\n-\t\t, std::function<void(storage_error const&)> handler\n-\t\t, disk_job_flags_t) override\n-\t{\n-\t\tTORRENT_ASSERT(r.length <= default_block_size);\n-\t\tTORRENT_UNUSED(r);\n-\n-\t\tpost(m_ios, [h = std::move(handler)] { h(storage_error{}); });\n-\t\treturn false;\n-\t}\n-\n-\tvoid async_hash(storage_index_t\n-\t\t, piece_index_t piece, span<sha256_hash>, disk_job_flags_t\n-\t\t, std::function<void(piece_index_t, sha1_hash const&, storage_error const&)> handler) override\n-\t{\n-
    \t\tpost(m_ios, [h = std::move(handler), piece] { h(piece, sha1_hash{}, storage_error{}); });\n-
    \t}\n-\n-\tvoid async_hash2(storage_index_t, piece_index_t piece, int\n-\t\t, disk_job_flags_t\n-\t\t, std::function<void(piece_index_t, sha256_hash const&, storage_error const&)> handler) override\n-\t{\n-\t\tpost(m_ios, [h = std::move(handler), piece]() { h(piece, sha256_hash{}, storage_error{}); });\n-\t}\n-\n-\tvoid async_move_storage(storage_index_t\n-\t\t, std::string p, move_flags_t\n-\t\t, std::function<void(status_t, std::string const&, storage_error const&)> handler) override\n-\t{\n-\t\tpost(m_ios, [h = std::move(handler), path = std::move(p)] () mutable\n-\t\t\t{ h(status_t::no_error, std::move(path), storage_error{}); });\n-\t}\n-\n-\tvoid async_release_files(storage_index_t, std::function<void()> handler) override\n-\t{\n-\t\tpost(m_ios, [h = std::move(handler)] { h(); });\n-\t}\n-\n-\tvoid async_delete_files(storage_index_t\n-\t\t, remove_flags_t, std::function<void(storage_error const&)> handler) override\n-\t{\n-\t\tpost(m_ios, [h = std::move(handler)] { h(storage_error{}); });\n-\t}\n-\n-\tvoid async_check_files(storage_index_t\n-\t\t, add_torrent_params const*\n-
    relevance 0../src/http_seed_connection.cpp:441technically, this isn't supposed to happen, but it seems to sometimes. Some of the accounting is probably wrong in certain cases

    technically, this isn't supposed to happen, but it seems to\n-sometimes. Some of the accounting is probably wrong in certain\n-cases

    ../src/http_seed_connection.cpp:441

    \t\t\t\t\t// cut out the chunk header from the receive buffer\n-\t\t\t\t\tTORRENT_ASSERT(m_chunk_pos + m_body_start < INT_MAX);\n-\t\t\t\t\tm_recv_buffer.cut(header_size, t->block_size() + 1024, aux::numeric_cast<int>(m_chunk_pos + m_body_start));\n-\t\t\t\t\trecv_buffer = m_recv_buffer.get();\n-\t\t\t\t\trecv_buffer = recv_buffer.subspan(m_body_start);\n-\t\t\t\t\tm_chunk_pos += chunk_size;\n-\t\t\t\t\tif (chunk_size == 0)\n-\t\t\t\t\t{\n-\t\t\t\t\t\tTORRENT_ASSERT(m_recv_buffer.get().size() < m_chunk_pos + m_body_start + 1\n-\t\t\t\t\t\t\t|| m_recv_buffer.get()[static_cast<std::ptrdiff_t>(m_chunk_pos + m_body_start)] == 'H'\n-\t\t\t\t\t\t\t|| (m_parser.chunked_encoding()\n-\t\t\t\t\t\t\t\t&& m_recv_buffer.get()[static_cast<std::ptrdiff_t>(m_chunk_pos + m_body_start)] == '\\r'));\n-\t\t\t\t\t\tm_chunk_pos = -1;\n-\t\t\t\t\t}\n-\t\t\t\t}\n-\t\t\t}\n-\n-\t\t\tint payload = int(bytes_transferred);\n-\t\t\tif (payload > m_response_left) payload = int(m_response_left);\n-\t\t\tif (payload > front_request.length) payload = front_request.length;\n-
    \t\t\tif (payload > outstanding_bytes()) payload = outstanding_bytes();\n-
    \t\t\treceived_bytes(payload, 0);\n-\t\t\tincoming_piece_fragment(payload);\n-\t\t\tm_response_left -= payload;\n-\n-\t\t\tif (m_parser.status_code() == 503)\n-\t\t\t{\n-\t\t\t\tif (!m_parser.finished()) return;\n-\n-\t\t\t\tint retry_time = std::atoi(std::string(recv_buffer.begin(), recv_buffer.end()).c_str());\n-\t\t\t\tif (retry_time <= 0) retry_time = 60;\n-#ifndef TORRENT_DISABLE_LOGGING\n-\t\t\t\tpeer_log(peer_log_alert::info, \"CONNECT\", \"retrying in %d seconds\", retry_time);\n-#endif\n-\n-\t\t\t\treceived_bytes(0, int(bytes_transferred));\n-\t\t\t\t// temporarily unavailable, retry later\n-\t\t\t\tt->retry_web_seed(this, seconds32(retry_time));\n-\t\t\t\tdisconnect(error_code(m_parser.status_code(), http_category()), operation_t::bittorrent, failure);\n-\t\t\t\treturn;\n-\t\t\t}\n-\n-\n-\t\t\t// we only received the header, no data\n-\t\t\tif (recv_buffer.empty()) break;\n-\n-\t\t\tif (recv_buffer.size() < front_request.length) break;\n-\n-\t\t\t// if the response is chunked, we need to receive the last\n-\t\t\t// terminating chunk and the tail headers before we can proceed\n-\t\t\tif (m_parser.chunked_encoding() && m_chunk_pos >= 0) break;\n-
    relevance 0../src/ip_notifier.cpp:41simulator support

    simulator support

    ../src/ip_notifier.cpp:41

          from this software without specific prior written permission.\n-\n-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n-ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n-LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n-CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n-POSSIBILITY OF SUCH DAMAGE.\n-\n-*/\n-\n-#include \"libtorrent/aux_/ip_notifier.hpp\"\n-#include \"libtorrent/assert.hpp\"\n-\n-#if defined TORRENT_BUILD_SIMULATOR\n-
    #elif TORRENT_USE_NETLINK\n-
    #include \"libtorrent/netlink.hpp\"\n-#include \"libtorrent/socket.hpp\"\n-#include <array>\n-#include <unordered_map>\n-#elif TORRENT_USE_SYSTEMCONFIGURATION || TORRENT_USE_SC_NETWORK_REACHABILITY\n-#include <SystemConfiguration/SystemConfiguration.h>\n-#elif defined TORRENT_WINDOWS\n-#include \"libtorrent/aux_/throw.hpp\"\n-#include \"libtorrent/aux_/disable_warnings_push.hpp\"\n-#include <iphlpapi.h>\n-#ifdef TORRENT_WINRT\n-#include <netioapi.h>\n-#endif\n-#include <mutex>\n-#include \"libtorrent/aux_/disable_warnings_pop.hpp\"\n-#endif\n-\n-#include \"libtorrent/aux_/netlink_utils.hpp\"\n-\n-namespace libtorrent { namespace aux {\n-\n-namespace {\n-\n-#if (TORRENT_USE_SYSTEMCONFIGURATION || TORRENT_USE_SC_NETWORK_REACHABILITY) && \\\n-\t!defined TORRENT_BUILD_SIMULATOR\n-\n-// common utilities for Mac and iOS\n-template <typename T> void CFRefRetain(T h) { CFRetain(h); }\n-template <typename T> void CFRefRelease(T h) { CFRelease(h); }\n-\n-
    relevance 0../src/peer_connection.cpp:1105this should be the global download rate

    this should be the global download rate

    ../src/peer_connection.cpp:1105

    \n-\t\tint rate = 0;\n-\n-\t\t// if we haven't received any data recently, the current download rate\n-\t\t// is not representative\n-\t\tif (aux::time_now() - m_last_piece.get(m_connect) > seconds(30) && m_download_rate_peak > 0)\n-\t\t{\n-\t\t\trate = m_download_rate_peak;\n-\t\t}\n-\t\telse if (aux::time_now() - m_last_unchoked.get(m_connect) < seconds(5)\n-\t\t\t&& m_statistics.total_payload_upload() < 2 * 0x4000)\n-\t\t{\n-\t\t\t// if we're have only been unchoked for a short period of time,\n-\t\t\t// we don't know what rate we can get from this peer. Instead of assuming\n-\t\t\t// the lowest possible rate, assume the average.\n-\n-\t\t\tint peers_with_requests = int(stats_counters()[counters::num_peers_down_requests]);\n-\t\t\t// avoid division by 0\n-\t\t\tif (peers_with_requests == 0) peers_with_requests = 1;\n-\n-
    \t\t\trate = t->statistics().transfer_rate(stat::download_payload) / peers_with_requests;\n-
    \t\t}\n-\t\telse\n-\t\t{\n-\t\t\t// current download rate in bytes per seconds\n-\t\t\trate = m_statistics.transfer_rate(stat::download_payload);\n-\t\t}\n-\n-\t\t// avoid division by zero\n-\t\tif (rate < 50) rate = 50;\n-\n-\t\t// average of current rate and peak\n-//\t\trate = (rate + m_download_rate_peak) / 2;\n-\n-\t\treturn milliseconds((m_outstanding_bytes + extra_bytes\n-\t\t\t+ m_queued_time_critical * t->block_size() * 1000) / rate);\n-\t}\n-\n-\tvoid peer_connection::add_stat(std::int64_t const downloaded, std::int64_t const uploaded)\n-\t{\n-\t\tTORRENT_ASSERT(is_single_thread());\n-\t\tm_statistics.add_stat(downloaded, uploaded);\n-\t}\n-\n-\tsha1_hash peer_connection::associated_info_hash() const\n-\t{\n-\t\tstd::shared_ptr<torrent> t = associated_torrent().lock();\n-\t\tTORRENT_ASSERT(t);\n-\t\tauto const& ih = t->info_hash();\n-\t\t// if protocol_v2 is set on the peer, this better be a v2 torrent,\n-\t\t// otherwise something isn't right\n-
    relevance 0../src/peer_connection.cpp:3536sort the allowed fast set in priority order

    sort the allowed fast set in priority order

    ../src/peer_connection.cpp:3536

    \n-\t\t// if the peer has the piece and we want\n-\t\t// to download it, request it\n-\t\tif (index < m_have_piece.end_index()\n-\t\t\t&& m_have_piece[index]\n-\t\t\t&& !t->have_piece(index)\n-\t\t\t&& t->valid_metadata()\n-\t\t\t&& t->has_picker()\n-\t\t\t&& t->picker().piece_priority(index) > dont_download)\n-\t\t{\n-\t\t\tt->peer_is_interesting(*this);\n-\t\t}\n-\t}\n-\n-\tstd::vector<piece_index_t> const& peer_connection::allowed_fast()\n-\t{\n-\t\tTORRENT_ASSERT(is_single_thread());\n-\t\tstd::shared_ptr<torrent> t = m_torrent.lock();\n-\t\tTORRENT_ASSERT(t);\n-\n-
    \t\treturn m_allowed_fast;\n-
    \t}\n-\n-\tbool peer_connection::can_request_time_critical() const\n-\t{\n-\t\tTORRENT_ASSERT(is_single_thread());\n-\t\tif (has_peer_choked() || !is_interesting()) return false;\n-\t\tif (int(m_download_queue.size()) + int(m_request_queue.size())\n-\t\t\t> m_desired_queue_size * 2) return false;\n-\t\tif (on_parole()) return false;\n-\t\tif (m_disconnecting) return false;\n-\t\tstd::shared_ptr<torrent> t = m_torrent.lock();\n-\t\tTORRENT_ASSERT(t);\n-\t\tif (t->upload_mode()) return false;\n-\n-\t\t// ignore snubbed peers, since they're not likely to return pieces in a\n-\t\t// timely manner anyway\n-\t\tif (m_snubbed) return false;\n-\t\treturn true;\n-\t}\n-\n-\tbool peer_connection::make_time_critical(piece_block const& block)\n-\t{\n-\t\tTORRENT_ASSERT(is_single_thread());\n-\t\tauto const rit = std::find_if(m_request_queue.begin()\n-\t\t\t, m_request_queue.end(), aux::has_block(block));\n-\t\tif (rit == m_request_queue.end()) return false;\n-#if TORRENT_USE_ASSERTS\n-\t\tstd::shared_ptr<torrent> t = m_torrent.lock();\n-\t\tTORRENT_ASSERT(t);\n-\t\tTORRENT_ASSERT(t->has_picker());\n-
    relevance 0../src/ut_metadata.cpp:281we really need to increment the refcounter on the torrent while this buffer is still in the peer's send buffer

    we really need to increment the refcounter on the torrent\n-while this buffer is still in the peer's send buffer

    ../src/ut_metadata.cpp:281

    \t\t\t\tint const offset = piece * 16 * 1024;\n-\t\t\t\tmetadata = m_tp.metadata().data() + offset;\n-\t\t\t\tmetadata_piece_size = std::min(\n-\t\t\t\t\tint(m_tp.metadata().size()) - offset, 16 * 1024);\n-\t\t\t\tTORRENT_ASSERT(metadata_piece_size > 0);\n-\t\t\t\tTORRENT_ASSERT(offset >= 0);\n-\t\t\t\tTORRENT_ASSERT(offset + metadata_piece_size <= m_tp.metadata().size());\n-\t\t\t}\n-\n-\t\t\tchar msg[200];\n-\t\t\tchar* header = msg;\n-\t\t\tchar* p = &msg[6];\n-\t\t\tint const len = bencode(p, e);\n-\t\t\tint const total_size = 2 + len + metadata_piece_size;\n-\t\t\tnamespace io = aux;\n-\t\t\tio::write_uint32(total_size, header);\n-\t\t\tio::write_uint8(bt_peer_connection::msg_extended, header);\n-\t\t\tio::write_uint8(m_message_index, header);\n-\n-\t\t\tm_pc.send_buffer({msg, len + 6});\n-
    \t\t\tif (metadata_piece_size)\n-
    \t\t\t{\n-\t\t\t\tm_pc.append_const_send_buffer(\n-\t\t\t\t\tspan<char>(const_cast<char*>(metadata), metadata_piece_size), metadata_piece_size);\n-\t\t\t}\n-\n-\t\t\tm_pc.stats_counters().inc_stats_counter(counters::num_outgoing_extended);\n-\t\t\tm_pc.stats_counters().inc_stats_counter(counters::num_outgoing_metadata);\n-\t\t}\n-\n-\t\tbool on_extended(int const length\n-\t\t\t, int const extended_msg, span<char const> body) override\n-\t\t{\n-\t\t\tif (extended_msg != 2) return false;\n-\t\t\tif (m_message_index == 0) return false;\n-\n-\t\t\tif (length > 17 * 1024)\n-\t\t\t{\n-#ifndef TORRENT_DISABLE_LOGGING\n-\t\t\t\tm_pc.peer_log(peer_log_alert::incoming_message, \"UT_METADATA\"\n-\t\t\t\t\t, \"packet too big %d\", length);\n-#endif\n-\t\t\t\tm_pc.disconnect(errors::invalid_metadata_message, operation_t::bittorrent, peer_connection_interface::peer_error);\n-\t\t\t\treturn true;\n-\t\t\t}\n-\n-\t\t\tif (!m_pc.packet_finished()) return true;\n-\n-\t\t\terror_code ec;\n-\t\t\tbdecode_node msg = bdecode(body, ec);\n-\t\t\tif (msg.type() != bdecode_node::dict_t)\n-
    relevance 0../src/mmap_disk_io.cpp:578in the future, propagate exceptions back to the handlers

    in the future, propagate exceptions back to the handlers

    ../src/mmap_disk_io.cpp:578

    #if DEBUG_DISK_THREAD\n+
    relevance 0../src/mmap_disk_io.cpp:578in the future, propagate exceptions back to the handlers

    in the future, propagate exceptions back to the handlers

    ../src/mmap_disk_io.cpp:578

    #if DEBUG_DISK_THREAD\n \t\t{\n \t\t\tstd::unique_lock<std::mutex> l(m_job_mutex);\n \n \t\t\tDLOG(\"perform_job job: %s ( %s%s) piece: %d offset: %d outstanding: %d\\n\"\n \t\t\t\t, job_action_name[j->action]\n \t\t\t\t, (j->flags & mmap_disk_job::fence) ? \"fence \": \"\"\n \t\t\t\t, (j->flags & mmap_disk_job::force_copy) ? \"force_copy \": \"\"\n@@ -9160,15 +9485,15 @@\n \n \t\t// note that -2 errors are OK\n \t\tTORRENT_ASSERT(ret != status_t::fatal_disk_error\n \t\t\t|| (j->error.ec && j->error.operation != operation_t::unknown));\n \n \t\tm_stats_counters.inc_stats_counter(counters::num_running_disk_jobs, -1);\n \n-
    relevance 0../src/mmap_disk_io.cpp:1017this is potentially very expensive. One way to solve it would be to have a fence for just this one piece. but it hardly seems worth the complexity and cost just for the edge case of receiving a corrupt piece

    this is potentially very expensive. One way to solve\n+

    relevance 0../src/mmap_disk_io.cpp:1017this is potentially very expensive. One way to solve it would be to have a fence for just this one piece. but it hardly seems worth the complexity and cost just for the edge case of receiving a corrupt piece

    this is potentially very expensive. One way to solve\n it would be to have a fence for just this one piece.\n but it hardly seems worth the complexity and cost just for the edge\n case of receiving a corrupt piece

    ../src/mmap_disk_io.cpp:1017

    \t\taux::mmap_disk_job* j = m_job_pool.allocate_job(aux::job_action_t::file_priority);\n \t\tj->storage = m_torrents[storage]->shared_from_this();\n \t\tj->argument = std::move(prios);\n \t\tj->callback = std::move(handler);\n \n@@ -9184,15 +9509,15 @@\n \t\tj->callback = std::move(handler);\n \n \t\t// regular jobs are not guaranteed to be executed in-order\n \t\t// since clear piece must guarantee that all write jobs that\n \t\t// have been issued finish before the clear piece job completes\n \n 
    \n-
    relevance 0../src/mmap_disk_io.cpp:1022Perhaps the job queue could be traversed and all jobs for this piece could be cancelled. If there are no threads currently writing to this piece, we could skip the fence altogether

    Perhaps the job queue could be traversed and all jobs for this\n+

    relevance 0../src/mmap_disk_io.cpp:1022Perhaps the job queue could be traversed and all jobs for this piece could be cancelled. If there are no threads currently writing to this piece, we could skip the fence altogether

    Perhaps the job queue could be traversed and all jobs for this\n piece could be cancelled. If there are no threads currently writing\n to this piece, we could skip the fence altogether

    ../src/mmap_disk_io.cpp:1022

    \t\tj->storage = m_torrents[storage]->shared_from_this();\n \t\tj->argument = std::move(prios);\n \t\tj->callback = std::move(handler);\n \n \t\tadd_fence_job(j);\n \t}\n@@ -9237,676 +9562,351 @@\n \t\tint const blocks_to_read = std::max(blocks_in_piece, blocks_in_piece2);\n \t\ttime_point const start_time = clock_type::now();\n \t\tfor (int i = 0; i < blocks_to_read; ++i)\n \t\t{\n \t\t\tbool const v2_block = i < blocks_in_piece2;\n \n \t\t\tDLOG(\"do_hash: reading (piece: %d block: %d)\\n\", int(j->piece), i);\n-
    relevance 0../src/file_storage.cpp:457maybe it would be nice to have a better index here

    maybe it would be nice to have a better index here

    ../src/file_storage.cpp:457

    \t\t// find the file iterator and file offset\n-\t\taux::file_entry target;\n-\t\ttarget.offset = aux::numeric_cast<std::uint64_t>(offset);\n-\t\tTORRENT_ASSERT(!compare_file_offset(target, m_files.front()));\n-\n-\t\tauto file_iter = std::upper_bound(\n-\t\t\tm_files.begin(), m_files.end(), target, compare_file_offset);\n-\n-\t\tTORRENT_ASSERT(file_iter != m_files.begin());\n-\t\t--file_iter;\n-\t\treturn file_index_t{int(file_iter - m_files.begin())};\n+
    relevance 0../src/torrent_handle.cpp:589support moving files into this call

    support moving files into this call

    ../src/torrent_handle.cpp:589

    \t\tauto retp = &prio;\n+\t\tsync_call(&torrent::piece_priorities, retp);\n+\t\tstd::vector<int> ret;\n+\t\tret.reserve(prio.size());\n+\t\tfor (auto p : prio)\n+\t\t\tret.push_back(int(static_cast<std::uint8_t>(p)));\n+\t\treturn ret;\n \t}\n+#endif\n \n-\tfile_index_t file_storage::file_index_at_piece(piece_index_t const piece) const\n+\tvoid torrent_handle::file_priority(file_index_t index, download_priority_t priority) const\n \t{\n-\t\treturn file_index_at_offset(static_cast<int>(piece) * std::int64_t(piece_length()));\n+\t\tasync_call(&torrent::set_file_priority, index, priority);\n \t}\n \n-\tfile_index_t file_storage::file_index_for_root(sha256_hash const& root_hash) const\n+\tdownload_priority_t torrent_handle::file_priority(file_index_t index) const\n \t{\n-
    \t\tfor (file_index_t const i : file_range())\n-
    \t\t{\n-\t\t\tif (root(i) == root_hash) return i;\n-\t\t}\n-\t\treturn file_index_t{-1};\n+\t\treturn sync_call_ret<download_priority_t>(dont_download, &torrent::file_priority, index);\n \t}\n \n-\tpiece_index_t file_storage::piece_index_at_file(file_index_t f) const\n-\t{\n-\t\treturn piece_index_t{aux::numeric_cast<int>(file_offset(f) / piece_length())};\n+
    \tvoid torrent_handle::prioritize_files(std::vector<download_priority_t> const& files) const\n+
    \t{\n+\t\tasync_call(&torrent::prioritize_files\n+\t\t\t, static_cast<aux::vector<download_priority_t, file_index_t> const&>(files));\n \t}\n \n-#if TORRENT_ABI_VERSION <= 2\n-\tchar const* file_storage::file_name_ptr(file_index_t const index) const\n+\tstd::vector<download_priority_t> torrent_handle::get_file_priorities() const\n \t{\n-\t\treturn m_files[index].name;\n+\t\taux::vector<download_priority_t, file_index_t> ret;\n+\t\tauto retp = &ret;\n+\t\tsync_call(&torrent::file_priorities, retp);\n+\t\treturn TORRENT_RVO(ret);\n \t}\n \n-\tint file_storage::file_name_len(file_index_t const index) const\n-\t{\n-\t\tif (m_files[index].name_len == aux::file_entry::name_is_owned)\n-\t\t\treturn -1;\n-\t\treturn m_files[index].name_len;\n-\t}\n-#endif\n+#if TORRENT_ABI_VERSION == 1\n \n-\tstd::vector<file_slice> file_storage::map_block(piece_index_t const piece\n-\t\t, std::int64_t const offset, std::int64_t size) const\n-\t{\n-\t\tTORRENT_ASSERT_PRECOND(piece >= piece_index_t{0});\n-\t\tTORRENT_ASSERT_PRECOND(piece < end_piece());\n-
    relevance 0../src/file_storage.cpp:1242this would be more efficient if m_paths was sorted first, such that a lower path index always meant sorted-before

    this would be more efficient if m_paths was sorted first, such\n-that a lower path index always meant sorted-before

    ../src/file_storage.cpp:1242

    \t}\n+// ============ start deprecation ===============\n \n-\tvoid file_storage::canonicalize_impl(bool const backwards_compatible)\n+\tvoid torrent_handle::prioritize_files(std::vector<int> const& files) const\n \t{\n-\t\tTORRENT_ASSERT(piece_length() >= 16 * 1024);\n-\n-\t\t// use this vector to track the new ordering of files\n-\t\t// this allows the use of STL algorithms despite them\n-\t\t// not supporting a custom swap functor\n-\t\taux::vector<file_index_t, file_index_t> new_order(end_file());\n-\t\tfor (auto i : file_range())\n-\t\t\tnew_order[i] = i;\n-\n-\t\t// remove any existing pad files\n-\t\t{\n-\t\t\tauto pad_begin = std::partition(new_order.begin(), new_order.end()\n-\t\t\t\t, [this](file_index_t i) { return !m_files[i].pad_file; });\n-\t\t\tnew_order.erase(pad_begin, new_order.end());\n-\t\t}\n-\n-
    \n-
    \t\t// sort files by path/name\n-\t\tstd::sort(new_order.begin(), new_order.end()\n-\t\t\t, [this](file_index_t l, file_index_t r)\n-\t\t{\n-\t\t\t// assuming m_paths are unique!\n-\t\t\tauto const& lf = m_files[l];\n-\t\t\tauto const& rf = m_files[r];\n-\t\t\tif (lf.path_index != rf.path_index)\n-\t\t\t{\n-\t\t\t\tint const ret = path_compare(m_paths[lf.path_index], lf.filename()\n-\t\t\t\t\t, m_paths[rf.path_index], rf.filename());\n-\t\t\t\tif (ret != 0) return ret < 0;\n-\t\t\t}\n-\t\t\treturn lf.filename() < rf.filename();\n-\t\t});\n-\n-\t\taux::vector<aux::file_entry, file_index_t> new_files;\n-\t\taux::vector<char const*, file_index_t> new_file_hashes;\n-\t\taux::vector<std::time_t, file_index_t> new_mtime;\n-\n-\t\t// reserve enough space for the worst case after padding\n-\t\tnew_files.reserve(new_order.size() * 2 - 1);\n-\t\tif (!m_file_hashes.empty())\n-\t\t\tnew_file_hashes.reserve(new_order.size() * 2 - 1);\n-\t\tif (!m_mtime.empty())\n-\t\t\tnew_mtime.reserve(new_order.size() * 2 - 1);\n-\n-\t\t// re-compute offsets and insert pad files as necessary\n-\t\tstd::int64_t off = 0;\n-\n-
    relevance 0../src/file_storage.cpp:1345in C++17 this could be string_view

    in C++17 this could be string_view

    ../src/file_storage.cpp:1345

    \t\t\t\tadd_pad_file(i);\n+\t\taux::vector<download_priority_t, file_index_t> file_prio;\n+\t\tfile_prio.reserve(files.size());\n+\t\tfor (auto const p : files) {\n+\t\t\tfile_prio.push_back(download_priority_t(static_cast<std::uint8_t>(p)));\n \t\t}\n-\n-\t\tm_files = std::move(new_files);\n-\t\tm_file_hashes = std::move(new_file_hashes);\n-\t\tm_mtime = std::move(new_mtime);\n-\n-\t\tm_total_size = off;\n+\t\tasync_call(&torrent::prioritize_files, file_prio);\n \t}\n \n-\tvoid file_storage::sanitize_symlinks()\n+\tstd::vector<int> torrent_handle::file_priorities() const\n \t{\n-\t\t// symlinks are unusual, this function is optimized assuming there are no\n-\t\t// symbolic links in the torrent. If we find one symbolic link, we'll\n-\t\t// build the hash table of files it's allowed to refer to, but don't pay\n-\t\t// that price up-front.\n-\t\tstd::unordered_map<std::string, file_index_t> file_map;\n-\t\tbool file_map_initialized = false;\n-\n-\t\t// lazily instantiated set of all valid directories a symlink may point to\n-
    \t\tstd::unordered_set<std::string> dir_map;\n-
    \t\tbool dir_map_initialized = false;\n-\n-\t\t// symbolic links that points to directories\n-\t\tstd::unordered_map<std::string, std::string> dir_links;\n-\n-\t\t// we validate symlinks in (potentially) 2 passes over the files.\n-\t\t// remaining symlinks to validate after the first pass\n-\t\tstd::vector<file_index_t> symlinks_to_validate;\n-\n-\t\tfor (auto const i : file_range())\n+\t\taux::vector<download_priority_t, file_index_t> prio;\n+
    relevance 0../src/udp_tracker_connection.cpp:633why is this a linked list?

    why is this a linked list?

    ../src/udp_tracker_connection.cpp:633

    \t\t\t\tipv6_peer_entry e{};\n+\t\t\t\tstd::memcpy(e.ip.data(), buf.data(), 16);\n+\t\t\t\tbuf = buf.subspan(16);\n+\t\t\t\te.port = aux::read_uint16(buf);\n+\t\t\t\tresp.peers6.push_back(e);\n+\t\t\t}\n+\t\t}\n+\t\telse\n \t\t{\n-\t\t\tif (!(file_flags(i) & file_storage::flag_symlink)) continue;\n-\n-\t\t\tif (!file_map_initialized)\n+\t\t\tresp.peers4.reserve(static_cast<std::size_t>(num_peers));\n+\t\t\tfor (int i = 0; i < num_peers; ++i)\n \t\t\t{\n-\t\t\t\tfor (auto const j : file_range())\n-\t\t\t\t\tfile_map.insert({internal_file_path(j), j});\n-\t\t\t\tfile_map_initialized = true;\n+\t\t\t\tipv4_peer_entry e{};\n+\t\t\t\tstd::memcpy(e.ip.data(), buf.data(), 4);\n+\t\t\t\tbuf = buf.subspan(4);\n+\t\t\t\te.port = aux::read_uint16(buf);\n+\t\t\t\tresp.peers4.push_back(e);\n \t\t\t}\n+\t\t}\n \n-\t\t\taux::file_entry const& fe = m_files[i];\n-\t\t\tTORRENT_ASSERT(fe.symlink_index < int(m_symlinks.size()));\n+
    \t\tstd::list<address> ip_list;\n+
    \t\tstd::transform(m_endpoints.begin(), m_endpoints.end(), std::back_inserter(ip_list)\n+\t\t\t, [](tcp::endpoint const& ep) { return ep.address(); } );\n \n-\t\t\t// symlink targets are only allowed to point to files or directories in\n-\t\t\t// this torrent.\n-\t\t\t{\n-\t\t\t\tstd::string target = m_symlinks[fe.symlink_index];\n+\t\tcb->tracker_response(tracker_req(), m_target.address(), ip_list, resp);\n \n-\t\t\t\tif (is_complete(target))\n-\t\t\t\t{\n-
    relevance 0../src/udp_socket.cpp:659perhaps an attempt should be made to bind m_socks5_sock to the device of m_listen_socket

    perhaps an attempt should be made to bind m_socks5_sock to the\n-device of m_listen_socket

    ../src/udp_socket.cpp:659

    \tif (ec)\n-\t{\n-\t\tif (m_alerts.should_post<socks5_alert>())\n-\t\t\tm_alerts.emplace_alert<socks5_alert>(m_proxy_addr, operation_t::sock_option, ec);\n-\t\tec.clear();\n+\t\tclose();\n+\t\treturn true;\n \t}\n-#endif\n-#endif\n \n-\ttcp::endpoint const bind_ep(m_listen_socket.get_local_endpoint().address(), 0);\n-\tm_socks5_sock.bind(bind_ep, ec);\n-\tif (ec)\n+\tbool udp_tracker_connection::on_scrape_response(span<char const> buf)\n \t{\n-\t\tif (m_alerts.should_post<socks5_alert>())\n-\t\t\tm_alerts.emplace_alert<socks5_alert>(m_proxy_addr, operation_t::sock_bind, ec);\n-\t\t++m_failures;\n-\t\tretry_connection();\n-\t\treturn;\n-\t}\n-\n-
    \n-
    \tADD_OUTSTANDING_ASYNC(\"socks5::on_connected\");\n-\tm_socks5_sock.async_connect(m_proxy_addr\n-\t\t, std::bind(&socks5::on_connected, self(), _1));\n-\n-\tADD_OUTSTANDING_ASYNC(\"socks5::on_connect_timeout\");\n-\tm_timer.expires_after(seconds(10));\n-\tm_timer.async_wait(std::bind(&socks5::on_connect_timeout\n-\t\t, self(), _1));\n-}\n-\n-void socks5::on_connect_timeout(error_code const& e)\n-{\n-\tCOMPLETE_ASYNC(\"socks5::on_connect_timeout\");\n-\n-\tif (e == boost::asio::error::operation_aborted) return;\n-\n-\tif (m_abort) return;\n-\n-\tif (m_alerts.should_post<socks5_alert>())\n-\t\tm_alerts.emplace_alert<socks5_alert>(m_proxy_addr, operation_t::connect, errors::timed_out);\n-\n-\terror_code ignore;\n-\tm_socks5_sock.close(ignore);\n-\n-\t++m_failures;\n-\tretry_connection();\n-}\n+\t\trestart_read_timeout();\n+\t\tauto const action = static_cast<action_t>(aux::read_int32(buf));\n+\t\tstd::uint32_t const transaction = aux::read_uint32(buf);\n \n-void socks5::on_connected(error_code const& e)\n-{\n-
    relevance 0../src/settings_pack.cpp:305deprecate this

    deprecate this

    ../src/settings_pack.cpp:305

    \t\tSET(outgoing_port, 0, nullptr),\n-\t\tSET(num_outgoing_ports, 0, nullptr),\n-\t\tSET(peer_dscp, 0x04, &session_impl::update_peer_dscp),\n-\t\tSET(active_downloads, 3, &session_impl::trigger_auto_manage),\n-\t\tSET(active_seeds, 5, &session_impl::trigger_auto_manage),\n-\t\tSET(active_checking, 1, &session_impl::trigger_auto_manage),\n-\t\tSET(active_dht_limit, 88, nullptr),\n-\t\tSET(active_tracker_limit, 1600, nullptr),\n-\t\tSET(active_lsd_limit, 60, nullptr),\n-\t\tSET(active_limit, 500, &session_impl::trigger_auto_manage),\n-\t\tDEPRECATED_SET(active_loaded_limit, 0, &session_impl::trigger_auto_manage),\n-\t\tSET(auto_manage_interval, 30, nullptr),\n-\t\tSET(seed_time_limit, 24 * 60 * 60, nullptr),\n-\t\tSET(auto_scrape_interval, 1800, nullptr),\n-\t\tSET(auto_scrape_min_interval, 300, nullptr),\n-\t\tSET(max_peerlist_size, 3000, nullptr),\n-\t\tSET(max_paused_peerlist_size, 1000, nullptr),\n-\t\tSET(min_announce_interval, 5 * 60, nullptr),\n-\t\tSET(auto_manage_startup, 60, nullptr),\n-\t\tSET(seeding_piece_quota, 20, nullptr),\n-
    \t\tSET(max_rejects, 50, nullptr),\n-
    \t\tSET(recv_socket_buffer_size, 0, &session_impl::update_socket_buffer_size),\n-\t\tSET(send_socket_buffer_size, 0, &session_impl::update_socket_buffer_size),\n-\t\tSET(max_peer_recv_buffer_size, 2 * 1024 * 1024, nullptr),\n-\t\tDEPRECATED_SET(file_checks_delay_per_block, 0, nullptr),\n-\t\tDEPRECATED2_SET(read_cache_line_size, 32, nullptr),\n-\t\tDEPRECATED2_SET(write_cache_line_size, 16, nullptr),\n-\t\tSET(optimistic_disk_retry, 10 * 60, nullptr),\n-\t\tSET(max_suggest_pieces, 16, nullptr),\n-\t\tSET(local_service_announce_interval, 5 * 60, nullptr),\n-\t\tSET(dht_announce_interval, 15 * 60, &session_impl::update_dht_announce_interval),\n-\t\tSET(udp_tracker_token_expiry, 60, nullptr),\n-\t\tDEPRECATED_SET(default_cache_min_age, 1, nullptr),\n-\t\tSET(num_optimistic_unchoke_slots, 0, nullptr),\n-\t\tDEPRECATED_SET(default_est_reciprocation_rate, 16000, nullptr),\n-\t\tDEPRECATED_SET(increase_est_reciprocation_rate, 20, nullptr),\n-\t\tDEPRECATED_SET(decrease_est_reciprocation_rate, 3, nullptr),\n-\t\tSET(max_pex_peers, 50, nullptr),\n-\t\tSET(tick_interval, 500, nullptr),\n-\t\tSET(share_mode_target, 3, nullptr),\n-\t\tSET(upload_rate_limit, 0, &session_impl::update_upload_rate),\n-\t\tSET(download_rate_limit, 0, &session_impl::update_download_rate),\n-\t\tDEPRECATED_SET(local_upload_rate_limit, 0, &session_impl::update_local_upload_rate),\n-\t\tDEPRECATED_SET(local_download_rate_limit, 0, &session_impl::update_local_download_rate),\n-\t\tSET(dht_upload_rate_limit, 8000, &session_impl::update_dht_upload_rate_limit),\n-\t\tSET(unchoke_slots_limit, 8, &session_impl::update_unchoke_limit),\n-\t\tDEPRECATED_SET(half_open_limit, 0, nullptr),\n-\t\tSET(connections_limit, 200, &session_impl::update_connections_limit),\n-\t\tSET(connections_slack, 10, nullptr),\n-\t\tSET(utp_target_delay, 100, nullptr),\n-\t\tSET(utp_gain_factor, 3000, nullptr),\n-
    relevance 0../src/settings_pack.cpp:590it would be nice to reserve() these vectors up front

    it would be nice to reserve() these vectors up front

    ../src/settings_pack.cpp:590

    \t\t\ts.set_str(settings_pack::string_type_base | i, str_settings[i].default_value);\n-\t\t\tTORRENT_ASSERT(s.get_str(settings_pack::string_type_base + i) == str_settings[i].default_value);\n+\t\tif (transaction != m_transaction_id)\n+\t\t{\n+\t\t\tfail(error_code(errors::invalid_tracker_transaction_id), operation_t::bittorrent);\n+\t\t\treturn false;\n \t\t}\n \n-\t\tfor (int i = 0; i < settings_pack::num_int_settings; ++i)\n+\t\tif (action == action_t::error)\n \t\t{\n-\t\t\ts.set_int(settings_pack::int_type_base | i, int_settings[i].default_value);\n-\t\t\tTORRENT_ASSERT(s.get_int(settings_pack::int_type_base + i) == int_settings[i].default_value);\n+\t\t\tfail(error_code(errors::tracker_failure), operation_t::bittorrent\n+\t\t\t\t, std::string(buf.data(), static_cast<std::size_t>(buf.size())).c_str());\n+\t\t\treturn true;\n \t\t}\n \n-\t\tfor (int i = 0; i < settings_pack::num_bool_settings; ++i)\n+\t\tif (action != action_t::scrape)\n \t\t{\n-\t\t\ts.set_bool(settings_pack::bool_type_base | i, bool_settings[i].default_value);\n-\t\t\tTORRENT_ASSERT(s.get_bool(settings_pack::bool_type_base + i) == bool_settings[i].default_value);\n-\t\t}\n-\t}\n+
    relevance 0../src/utp_socket_manager.cpp:204this should not be heap allocated, sockets should be movable

    this should not be heap allocated, sockets should be movable

    ../src/utp_socket_manager.cpp:204

    \n+//\t\tUTP_LOGV(\"incoming packet id:%d source:%s\\n\", id, print_endpoint(ep).c_str());\n \n-\tsettings_pack default_settings()\n-\t{\n-\t\tsettings_pack ret;\n-
    \t\tfor (int i = 0; i < settings_pack::num_string_settings; ++i)\n-
    \t\t{\n-\t\t\tif (str_settings[i].default_value == nullptr) continue;\n-\t\t\tret.set_str(settings_pack::string_type_base + i, str_settings[i].default_value);\n-\t\t}\n+\t\tif (!m_sett.get_bool(settings_pack::enable_incoming_utp))\n+\t\t\treturn false;\n \n-\t\tfor (int i = 0; i < settings_pack::num_int_settings; ++i)\n+\t\t// if not found, see if it's a SYN packet, if it is,\n+\t\t// create a new utp_stream\n+\t\tif (ph->get_type() == ST_SYN)\n \t\t{\n-\t\t\tret.set_int(settings_pack::int_type_base + i, int_settings[i].default_value);\n-\t\t}\n+\t\t\t// possible SYN flood. Just ignore\n+\t\t\tif (int(m_utp_sockets.size()) > m_sett.get_int(settings_pack::connections_limit) * 2)\n+\t\t\t\treturn false;\n \n-\t\tfor (int i = 0; i < settings_pack::num_bool_settings; ++i)\n-\t\t{\n-\t\t\tret.set_bool(settings_pack::bool_type_base + i, bool_settings[i].default_value);\n-\t\t}\n-\t\treturn ret;\n-\t}\n+\t\t\tTORRENT_ASSERT(m_new_connection == -1);\n+\t\t\t// create the new socket with this ID\n+\t\t\tm_new_connection = id;\n \n-\tvoid apply_pack(settings_pack const* pack, aux::session_settings& sett\n-\t\t, aux::session_impl* ses)\n-\t{\n-\t\tusing fun_t = void (aux::session_impl::*)();\n-\t\tstd::vector<fun_t> callbacks;\n+//\t\t\tUTP_LOGV(\"not found, new connection id:%d\\n\", m_new_connection);\n \n-\t\tsett.bulk_set([&](aux::session_settings_single_thread& s)\n-\t\t{\n-\t\t\tapply_pack_impl(pack, s, ses ? &callbacks : nullptr);\n-\t\t});\n+
    \t\t\taux::socket_type c(aux::instantiate_connection(m_ios, aux::proxy_settings(), m_ssl_context, this, true, false));\n+
    \n+\t\t\tutp_stream* str = nullptr;\n+#ifdef TORRENT_SSL_PEERS\n+\t\t\tif (is_ssl(c))\n+\t\t\t\tstr = &boost::get<ssl_stream<utp_stream>>(c).next_layer();\n+\t\t\telse\n+#endif\n+\t\t\t\tstr = boost::get<utp_stream>(&c);\n \n-\t\t// call the callbacks once all the settings have been applied, and\n-\t\t// only once per callback\n-
    relevance 0../src/utp_stream.cpp:1467this loop is not very efficient. It could be fixed by having a separate list of sequence numbers that need resending

    this loop is not very efficient. It could be fixed by having\n-a separate list of sequence numbers that need resending

    ../src/utp_stream.cpp:1467

    #endif\n+\t\t\tTORRENT_ASSERT(str);\n+\t\t\tint const mtu = mtu_for_dest(ep.address());\n+\t\t\tstr->get_impl()->init_mtu(mtu);\n+\t\t\tstr->get_impl()->m_sock = std::move(socket);\n+\t\t\tbool const ret = str->get_impl()->incoming_packet(p, ep, receive_time);\n+\t\t\tif (!ret) return false;\n+\t\t\tm_last_socket = str->get_impl();\n+\t\t\tm_cb(std::move(c));\n+\t\t\t// the connection most likely changed its connection ID here\n+\t\t\t// we need to move it to the correct ID\n+\t\t\treturn true;\n+\t\t}\n+\n+\t\tif (ph->get_type() == ST_RESET) return false;\n+\n+\t\t// #error send reset\n \n-\tif (m_stalled)\n-\t{\n-\t\tif (flags & pkt_ack)\n-\t\t\tdefer_ack();\n \t\treturn false;\n \t}\n \n-\t// m_out_eof means we're trying to close the write side of this socket,\n-\t// we need to flush all payload before we can send the FIN packet, so don't\n-\t// store any payload in the nagle packet\n-\tbool const force = (flags & pkt_ack) || (flags & pkt_fin) || m_out_eof;\n+\tvoid utp_socket_manager::subscribe_writable(utp_socket_impl* s)\n+
    relevance 0../src/web_connection_base.cpp:72introduce a web-seed default class which has a low download priority

    introduce a web-seed default class which has a low download priority

    ../src/web_connection_base.cpp:72

    \t\t: peer_connection(pack)\n+\t\t, m_first_request(true)\n+\t\t, m_ssl(false)\n+\t\t, m_external_auth(web.auth)\n+\t\t, m_extra_headers(web.extra_headers)\n+\t\t, m_parser(http_parser::dont_parse_chunks)\n+\t\t, m_body_start(0)\n+\t{\n+\t\tTORRENT_ASSERT(&web.peer_info == pack.peerinfo);\n+\t\t// when going through a proxy, we don't necessarily have an endpoint here,\n+\t\t// since the proxy might be resolving the hostname, not us\n+\t\tTORRENT_ASSERT(web.endpoints.empty() || web.endpoints.front() == pack.endp);\n \n-\t// when we want to close the outgoing stream, we need to send the\n-\t// remaining nagle packet even though it won't fill a packet.\n-\tbool const force_flush_nagle = m_out_eof && m_write_buffer_size;\n+\t\tINVARIANT_CHECK;\n \n-\t// first see if we need to resend any packets\n+\t\tTORRENT_ASSERT(is_outgoing());\n \n-
    \tfor (int i = (m_acked_seq_nr + 1) & ACK_MASK; i != m_seq_nr; i = (i + 1) & ACK_MASK)\n-
    \t{\n-\t\tpacket* p = m_outbuf.at(aux::numeric_cast<packet_buffer::index_type>(i));\n-\t\tif (!p) continue;\n-\t\tif (!p->need_resend) continue;\n-\t\tif (!resend_packet(p))\n-\t\t{\n-\t\t\t// we couldn't resend the packet. It probably doesn't\n-\t\t\t// fit in our cwnd. If force is set, we need to continue\n-\t\t\t// to send our packet anyway, if we don't have force set,\n-\t\t\t// we might as well return\n-\t\t\tif (!force) return false;\n-\t\t\t// resend_packet might have failed\n-\t\t\tif (state() == state_t::error_wait || state() == state_t::deleting) return false;\n-\t\t\tif (m_stalled) return false;\n-\t\t\tbreak;\n-\t\t}\n+\t\tTORRENT_ASSERT(!m_torrent.lock()->is_upload_only());\n \n-\t\t// don't fast-resend this packet\n-\t\tif (m_fast_resend_seq_nr == i)\n-\t\t\tm_fast_resend_seq_nr = (m_fast_resend_seq_nr + 1) & ACK_MASK;\n-\t}\n+\t\t// we only want left-over bandwidth\n+
    \n+
    \t\tstd::string protocol;\n+\t\terror_code ec;\n+\t\tstd::tie(protocol, m_basic_auth, m_host, m_port, m_path)\n+\t\t\t= parse_url_components(web.url, ec);\n+\t\tTORRENT_ASSERT(!ec);\n \n-\t// MTU DISCOVERY\n+\t\tif (m_port == -1 && protocol == \"http\")\n+\t\t\tm_port = 80;\n \n-\t// under these conditions, the next packet we send should be an MTU probe.\n-\t// MTU probes get to use the mid-point packet size, whereas other packets\n-\t// use a conservative packet size of the largest known to work. The reason\n-\t// for the cwnd condition is to make sure the probe is surrounded by non-\n-\t// probes, to be able to distinguish a loss of the probe vs. just loss in\n-\t// general.\n-
    relevance 0../src/piece_picker.cpp:121find a better place for this

    find a better place for this

    ../src/piece_picker.cpp:121

    \t\t\tif (limit == 0)\n-\t\t\t{\n-\t\t\t\tstd::cerr << \" ...\";\n-\t\t\t\tbreak;\n-\t\t\t}\n-\t\t\tif (*i == -1) break;\n-\t\t\twhile (j != p.m_priority_boundaries.end() && *j <= index)\n-\t\t\t{\n-\t\t\t\tstd::cerr << \"| \";\n-\t\t\t\t++j;\n-\t\t\t}\n-\t\t\tstd::cerr << *i << \"(\" << p.m_piece_map[*i].index << \") \";\n-\t\t\t--limit;\n+#if TORRENT_USE_SSL\n+\t\tif (protocol == \"https\")\n+\t\t{\n+\t\t\tm_ssl = true;\n+\t\t\tif (m_port == -1) m_port = 443;\n \t\t}\n-\t\tstd::cerr << std::endl;\n-\t}\n-}\n-#endif // TORRENT_PICKER_LOG\n-namespace libtorrent {\n-\n-
    \tconst piece_block piece_block::invalid(\n-
    \t\tstd::numeric_limits<piece_index_t>::max()\n-\t\t, std::numeric_limits<int>::max());\n-\n-\tconstexpr prio_index_t piece_picker::piece_pos::we_have_index;\n-\n-\tconstexpr picker_options_t piece_picker::rarest_first;\n-\tconstexpr picker_options_t piece_picker::reverse;\n-\tconstexpr picker_options_t piece_picker::on_parole;\n-\tconstexpr picker_options_t piece_picker::prioritize_partials;\n-\tconstexpr picker_options_t piece_picker::sequential;\n-\tconstexpr picker_options_t piece_picker::align_expanded_pieces;\n-\tconstexpr picker_options_t piece_picker::piece_extent_affinity;\n+#endif\n \n-\tconstexpr download_queue_t piece_picker::piece_pos::piece_downloading;\n-\tconstexpr download_queue_t piece_picker::piece_pos::piece_full;\n-\tconstexpr download_queue_t piece_picker::piece_pos::piece_finished;\n-\tconstexpr download_queue_t piece_picker::piece_pos::piece_zero_prio;\n-\tconstexpr download_queue_t piece_picker::piece_pos::num_download_categories;\n-\tconstexpr download_queue_t piece_picker::piece_pos::piece_open;\n-\tconstexpr download_queue_t piece_picker::piece_pos::piece_downloading_reverse;\n-\tconstexpr download_queue_t piece_picker::piece_pos::piece_full_reverse;\n+\t\tif (!m_basic_auth.empty())\n+\t\t\tm_basic_auth = base64encode(m_basic_auth);\n \n-\t// the max number of blocks to create an affinity for\n-\tconstexpr int max_piece_affinity_extent = 4 * 1024 * 1024 / default_block_size;\n+\t\tm_server_string = m_host;\n+\t\taux::verify_encoding(m_server_string);\n+\t}\n \n-\tpiece_picker::piece_picker(std::int64_t const total_size, int const piece_size)\n-\t\t: m_priority_boundaries(1, m_pieces.end_index())\n+\tint web_connection_base::timeout() const\n \t{\n-\t\tTORRENT_ASSERT(total_size > 0);\n-\t\tTORRENT_ASSERT(piece_size > 0);\n-
    relevance 0../src/piece_picker.cpp:2067this could probably be optimized by incrementally calling partial_sort to sort one more element in the list. Because chances are that we'll just need a single piece, and once we've picked from it we're done. Sorting the rest of the list in that case is a waste of time.

    this could probably be optimized by incrementally\n-calling partial_sort to sort one more element in the list. Because\n-chances are that we'll just need a single piece, and once we've\n-picked from it we're done. Sorting the rest of the list in that\n-case is a waste of time.

    ../src/piece_picker.cpp:2067

    \t\t\t// now, copy over the pointers. We also apply a filter here to not\n-\t\t\t// include ineligible pieces in certain modes. For instance, a piece\n-\t\t\t// that the current peer doesn't have is not included.\n-\t\t\tfor (auto& dp : m_downloads[piece_pos::piece_downloading])\n-\t\t\t{\n-\t\t\t\tpc.inc_stats_counter(counters::piece_picker_partial_loops);\n-\n-\t\t\t\tif (!is_piece_free(dp.index, pieces)) continue;\n+\t\t// since this is a web seed, change the timeout\n+\t\t// according to the settings.\n+\t\treturn m_settings.get_int(settings_pack::urlseed_timeout);\n+\t}\n+
    relevance 0../src/ip_notifier.cpp:41simulator support

    simulator support

    ../src/ip_notifier.cpp:41

          from this software without specific prior written permission.\n \n-\t\t\t\tTORRENT_ASSERT(m_piece_map[dp.index].download_queue()\n-\t\t\t\t\t== piece_pos::piece_downloading);\n+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n+POSSIBILITY OF SUCH DAMAGE.\n \n-\t\t\t\tordered_partials[num_ordered_partials++] = &dp;\n-\t\t\t}\n+*/\n \n-\t\t\t// now, sort the list.\n-\t\t\tif (options & rarest_first)\n-\t\t\t{\n-\t\t\t\tret |= picker_log_alert::rarest_first_partials;\n+#include \"libtorrent/aux_/ip_notifier.hpp\"\n+#include \"libtorrent/assert.hpp\"\n \n-
    \t\t\t\tstd::sort(ordered_partials.begin(), ordered_partials.begin() + num_ordered_partials\n-
    \t\t\t\t\t, std::bind(&piece_picker::partial_compare_rarest_first, this\n-\t\t\t\t\t\t, _1, _2));\n-\t\t\t}\n+#if defined TORRENT_BUILD_SIMULATOR\n+
    #elif TORRENT_USE_NETLINK\n+
    #include \"libtorrent/netlink.hpp\"\n+#include \"libtorrent/socket.hpp\"\n+#include <array>\n+#include <unordered_map>\n+#elif TORRENT_USE_SYSTEMCONFIGURATION || TORRENT_USE_SC_NETWORK_REACHABILITY\n+#include <SystemConfiguration/SystemConfiguration.h>\n+#elif defined TORRENT_WINDOWS\n+#include \"libtorrent/aux_/throw.hpp\"\n+#include \"libtorrent/aux_/disable_warnings_push.hpp\"\n+#include <iphlpapi.h>\n+#ifdef TORRENT_WINRT\n+#include <netioapi.h>\n+#endif\n+#include <mutex>\n+#include \"libtorrent/aux_/disable_warnings_pop.hpp\"\n+#endif\n \n-\t\t\tfor (int i = 0; i < num_ordered_partials; ++i)\n-\t\t\t{\n-\t\t\t\tret |= picker_log_alert::prioritize_partials;\n+#include \"libtorrent/aux_/netlink_utils.hpp\"\n \n-\t\t\t\tnum_blocks = add_blocks_downloading(*ordered_partials[i], pieces\n-\t\t\t\t\t, interesting_blocks, backup_blocks, backup_blocks2\n-\t\t\t\t\t, num_blocks, prefer_contiguous_blocks, peer, options);\n-\t\t\t\tif (num_blocks <= 0) return ret;\n-\t\t\t\tif (int(backup_blocks.size()) >= num_blocks\n-\t\t\t\t\t&& int(backup_blocks2.size()) >= num_blocks)\n-\t\t\t\t\tbreak;\n-\t\t\t}\n+namespace libtorrent { namespace aux {\n \n-\t\t\tnum_blocks = append_blocks(interesting_blocks, backup_blocks\n-\t\t\t\t, num_blocks);\n-\t\t\tif (num_blocks <= 0) return ret;\n+namespace {\n \n-\t\t\tnum_blocks = append_blocks(interesting_blocks, backup_blocks2\n-\t\t\t\t, num_blocks);\n-\t\t\tif (num_blocks <= 0) return ret;\n-\t\t}\n+#if (TORRENT_USE_SYSTEMCONFIGURATION || TORRENT_USE_SC_NETWORK_REACHABILITY) && \\\n+\t!defined TORRENT_BUILD_SIMULATOR\n \n-\t\tif (!suggested_pieces.empty())\n-\t\t{\n-\t\t\tfor (piece_index_t i : suggested_pieces)\n-\t\t\t{\n-
    relevance 0../src/piece_picker.cpp:2211Is it a good idea that this affinity takes precedence over piece priority?

    Is it a good idea that this affinity takes precedence over\n-piece priority?

    ../src/piece_picker.cpp:2211

    \t\t\t\t\tprio_index_t const end = priority_end(i);\n-\t\t\t\t\tfor (prio_index_t p = prev(end); p >= start; --p)\n-\t\t\t\t\t{\n-\t\t\t\t\t\tpc.inc_stats_counter(counters::piece_picker_reverse_rare_loops);\n+// common utilities for Mac and iOS\n+template <typename T> void CFRefRetain(T h) { CFRetain(h); }\n+template <typename T> void CFRefRelease(T h) { CFRelease(h); }\n \n-\t\t\t\t\t\tif (!is_piece_free(m_pieces[p], pieces)) continue;\n+
    relevance 0../src/pe_crypto.cpp:60it would be nice to get the literal working

    it would be nice to get the literal working

    ../src/pe_crypto.cpp:60

    #include <algorithm>\n+#include <random>\n \n-\t\t\t\t\t\tret |= picker_log_alert::reverse_rarest_first;\n+#include \"libtorrent/aux_/disable_warnings_push.hpp\"\n \n-\t\t\t\t\t\tnum_blocks = add_blocks(m_pieces[p], pieces\n-\t\t\t\t\t\t\t, interesting_blocks, backup_blocks\n-\t\t\t\t\t\t\t, backup_blocks2, num_blocks\n-\t\t\t\t\t\t\t, prefer_contiguous_blocks, peer, ignored_pieces\n-\t\t\t\t\t\t\t, options);\n-\t\t\t\t\t\tif (num_blocks <= 0) return ret;\n-\t\t\t\t\t}\n-\t\t\t\t}\n-\t\t\t}\n-\t\t\telse\n-\t\t\t{\n-
    \t\t\t\tif (options & piece_extent_affinity)\n-
    \t\t\t\t{\n-\t\t\t\t\tint to_erase = -1;\n-\t\t\t\t\tint idx = -1;\n-\t\t\t\t\tfor (piece_extent_t const e : m_recent_extents)\n-\t\t\t\t\t{\n-\t\t\t\t\t\t++idx;\n-\t\t\t\t\t\tbool have_all = true;\n-\t\t\t\t\t\tfor (piece_index_t const p : extent_for(e))\n-\t\t\t\t\t\t{\n-\t\t\t\t\t\t\tif (!m_piece_map[p].have()) have_all = false;\n-\t\t\t\t\t\t\tif (!is_piece_free(p, pieces)) continue;\n+#include <boost/multiprecision/integer.hpp>\n+#include <boost/multiprecision/cpp_int.hpp>\n \n-\t\t\t\t\t\t\tret |= picker_log_alert::extent_affinity;\n+#include \"libtorrent/aux_/disable_warnings_pop.hpp\"\n \n-\t\t\t\t\t\t\tnum_blocks = add_blocks(p, pieces\n-\t\t\t\t\t\t\t\t, interesting_blocks, backup_blocks\n-\t\t\t\t\t\t\t\t, backup_blocks2, num_blocks\n-\t\t\t\t\t\t\t\t, prefer_contiguous_blocks, peer, ignored_pieces\n-\t\t\t\t\t\t\t\t, options);\n-\t\t\t\t\t\t\tif (num_blocks <= 0)\n-\t\t\t\t\t\t\t{\n-\t\t\t\t\t\t\t\t// if we have all pieces belonging to this extent, remove it\n-\t\t\t\t\t\t\t\tif (to_erase != -1) m_recent_extents.erase(m_recent_extents.begin() + to_erase);\n-\t\t\t\t\t\t\t\treturn ret;\n-\t\t\t\t\t\t\t}\n-\t\t\t\t\t\t}\n-\t\t\t\t\t\t// if we have all pieces belonging to this extent, remove it\n-\t\t\t\t\t\tif (have_all) to_erase = idx;\n-\t\t\t\t\t}\n-\t\t\t\t\tif (to_erase != -1) m_recent_extents.erase(m_recent_extents.begin() + to_erase);\n-
    relevance 0../src/piece_picker.cpp:2566when expanding pieces for cache stripe reasons, the !downloading condition doesn't make much sense

    when expanding pieces for cache stripe reasons,\n-the !downloading condition doesn't make much sense

    ../src/piece_picker.cpp:2566

    \t\tTORRENT_ASSERT(index < m_piece_map.end_index());\n-\t\tif (next(index) == m_piece_map.end_index())\n-\t\t\treturn m_blocks_in_last_piece;\n-\t\telse\n-\t\t\treturn blocks_per_piece();\n-\t}\n+#include \"libtorrent/random.hpp\"\n+#include \"libtorrent/aux_/alloca.hpp\"\n+#include \"libtorrent/pe_crypto.hpp\"\n+#include \"libtorrent/hasher.hpp\"\n \n-\tbool piece_picker::is_piece_free(piece_index_t const piece\n-\t\t, typed_bitfield<piece_index_t> const& bitmask) const\n-\t{\n-\t\treturn bitmask[piece]\n-\t\t\t&& !m_piece_map[piece].have()\n-\t\t\t&& !m_piece_map[piece].filtered();\n-\t}\n+namespace libtorrent {\n \n-\tbool piece_picker::can_pick(piece_index_t const piece\n-\t\t, typed_bitfield<piece_index_t> const& bitmask) const\n-\t{\n-\t\treturn bitmask[piece]\n-\t\t\t&& !m_piece_map[piece].have()\n-
    \t\t\t&& !m_piece_map[piece].downloading()\n-
    \t\t\t&& !m_piece_map[piece].filtered();\n-\t}\n+\tnamespace mp = boost::multiprecision;\n \n-#if TORRENT_USE_INVARIANT_CHECKS\n-\tvoid piece_picker::check_peers()\n-\t{\n-\t\tfor (auto const& b : m_block_info)\n-\t\t{\n-\t\t\tTORRENT_ASSERT(b.peer == nullptr || static_cast<torrent_peer*>(b.peer)->in_use);\n-\t\t}\n+\tnamespace {\n+
    \t\tkey_t const dh_prime\n+
    \t\t\t(\"0xFFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A63A36210000000000090563\");\n \t}\n-#endif\n \n-\tvoid piece_picker::clear_peer(torrent_peer* peer)\n+\tstd::array<char, 96> export_key(key_t const& k)\n \t{\n-\t\tfor (auto& b : m_block_info)\n-\t\t{\n-\t\t\tif (b.peer == peer) b.peer = nullptr;\n-\t\t}\n-\t}\n-\n-\t// the first bool is true if this is the only peer that has requested and downloaded\n-\t// blocks from this piece.\n-\t// the second bool is true if this is the only active peer that is requesting\n-\t// and downloading blocks from this piece. Active means having a connection.\n-
    relevance 0../src/piece_picker.cpp:3144should 5 be configurable?

    should 5 be configurable?

    ../src/piece_picker.cpp:3144

    \t\tbool have_all = true;\n-\n-\t\tfor (auto const piece : extent_for(this_extent))\n-\t\t{\n-\t\t\tif (piece == p) continue;\n-\n-\t\t\tif (!m_piece_map[piece].have()) have_all = false;\n+\t\tstd::array<char, 96> ret;\n+\t\tauto* begin = reinterpret_cast<std::uint8_t*>(ret.data());\n+\t\tstd::uint8_t* end = mp::export_bits(k, begin, 8);\n \n-\t\t\t// if at least one piece in this extent has a different priority than\n-\t\t\t// the one we just started downloading, don't create an affinity for\n-\t\t\t// adjacent pieces. This probably means the pieces belong to different\n-\t\t\t// files, or that some other mechanism determining the priority should\n-\t\t\t// take precedence.\n-\t\t\tif (piece_priority(piece) != this_prio) return;\n-\t\t}\n+
    relevance 0../src/pe_crypto.cpp:71it would be nice to be able to export to a fixed width field, so we wouldn't have to shift it later

    it would be nice to be able to export to a fixed width field, so\n+we wouldn't have to shift it later

    ../src/pe_crypto.cpp:71

    #include \"libtorrent/random.hpp\"\n+#include \"libtorrent/aux_/alloca.hpp\"\n+#include \"libtorrent/pe_crypto.hpp\"\n+#include \"libtorrent/hasher.hpp\"\n \n-\t\t// if we already have all the *other* pieces in this extent, there's no\n-\t\t// need to inflate their priorities\n-\t\tif (have_all) return;\n+namespace libtorrent {\n \n-
    \t\tif (m_recent_extents.size() < 5)\n-
    \t\t\tm_recent_extents.push_back(this_extent);\n+\tnamespace mp = boost::multiprecision;\n \n-\t\t// limit the number of extent affinities active at any given time to limit\n-\t\t// the cost of checking them. Also, don't replace them, commit to\n-\t\t// finishing them before starting another extent. This is analogous to\n-\t\t// limiting the number of partial pieces.\n+\tnamespace {\n+\t\tkey_t const dh_prime\n+\t\t\t(\"0xFFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A63A36210000000000090563\");\n \t}\n \n-\t// options may be 0 or piece_picker::reverse\n-\t// returns false if the block could not be marked as downloading\n-\tbool piece_picker::mark_as_downloading(piece_block const block\n-\t\t, torrent_peer* peer, picker_options_t const options)\n+\tstd::array<char, 96> export_key(key_t const& k)\n \t{\n-#ifdef TORRENT_PICKER_LOG\n-\t\tstd::cerr << \"[\" << this << \"] \" << \"mark_as_downloading( {\"\n-\t\t\t<< block.piece_index << \", \" << block.block_index << \"} )\" << std::endl;\n-#endif\n-\n-\t\tTORRENT_ASSERT(peer == nullptr || peer->in_use);\n-\t\tTORRENT_ASSERT(block.block_index != piece_block::invalid.block_index);\n-\t\tTORRENT_ASSERT(block.piece_index != piece_block::invalid.piece_index);\n-\t\tTORRENT_ASSERT(block.piece_index < m_piece_map.end_index());\n-\t\tTORRENT_ASSERT(block.block_index < blocks_in_piece(block.piece_index));\n-\t\tTORRENT_ASSERT(!m_piece_map[block.piece_index].have());\n+\t\tstd::array<char, 96> ret;\n+\t\tauto* begin = reinterpret_cast<std::uint8_t*>(ret.data());\n+\t\tstd::uint8_t* end = mp::export_bits(k, begin, 8);\n \n-\t\tpiece_pos& p = m_piece_map[block.piece_index];\n-\t\tif (p.download_queue() == piece_pos::piece_open)\n-\t\t{\n-#ifdef TORRENT_EXPENSIVE_INVARIANT_CHECKS\n-\t\t\tINVARIANT_CHECK;\n-
    relevance 0../src/load_torrent.cpp:121move the loading logic from torrent_info constructor into here

    move the loading logic from torrent_info constructor into here

    ../src/load_torrent.cpp:121

    \t\t\t\tmask.resize(std::size_t(full_size), false);\n-\t\t\t\tfor (int i = merkle_first_leaf(piece_layer_size)\n-\t\t\t\t\t, end = i + num_pieces; i < end; ++i)\n-\t\t\t\t{\n-\t\t\t\t\tmask[std::size_t(i)] = true;\n-\t\t\t\t}\n-\t\t\t}\n-\t\t\tti->free_piece_layers();\n+
    \t\tif (end < begin + 96)\n+
    \t\t{\n+\t\t\tint const len = int(end - begin);\n+#if defined __GNUC__ && __GNUC__ == 12\n+#pragma GCC diagnostic push\n+#pragma GCC diagnostic ignored \"-Wstringop-overflow\"\n+#endif\n+\t\t\tstd::memmove(begin + 96 - len, begin, aux::numeric_cast<std::size_t>(len));\n+#if defined __GNUC__ && __GNUC__ == 12\n+#pragma GCC diagnostic pop\n+#endif\n+\t\t\tstd::memset(begin, 0, aux::numeric_cast<std::size_t>(96 - len));\n \t\t}\n-\t\tatp.info_hashes = atp.ti->info_hashes();\n-\t}\n-}\n-\n-\tadd_torrent_params load_torrent_file(std::string const& filename)\n-\t{ return load_torrent_file(filename, load_torrent_limits{}); }\n-\tadd_torrent_params load_torrent_buffer(span<char const> buffer)\n-\t{ return load_torrent_buffer(buffer, load_torrent_limits{}); }\n-\tadd_torrent_params load_torrent_parsed(bdecode_node const& torrent_file)\n-\t{ return load_torrent_parsed(torrent_file, load_torrent_limits{}); }\n-\n-
    \tadd_torrent_params load_torrent_file(std::string const& filename, load_torrent_limits const& cfg)\n-
    \t{\n-\t\tadd_torrent_params ret;\n-\t\tret.ti = std::make_shared<torrent_info>(filename, cfg);\n-\t\tupdate_atp(ret);\n \t\treturn ret;\n \t}\n \n-\tadd_torrent_params load_torrent_buffer(span<char const> buffer, load_torrent_limits const& cfg)\n-\t{\n-\t\tadd_torrent_params ret;\n-\t\tret.ti = std::make_shared<torrent_info>(buffer, cfg, from_span);\n-\t\tupdate_atp(ret);\n-\t\treturn ret;\n-\t}\n+\tvoid rc4_init(const unsigned char* in, std::size_t len, rc4 *state);\n+\tstd::size_t rc4_encrypt(unsigned char *out, std::size_t outlen, rc4 *state);\n \n-\tadd_torrent_params load_torrent_parsed(bdecode_node const& torrent_file, load_torrent_limits const& cfg)\n+\t// Set the prime P and the generator, generate local public key\n+\tdh_key_exchange::dh_key_exchange()\n \t{\n-\t\tadd_torrent_params ret;\n-\t\tret.ti = std::make_shared<torrent_info>(torrent_file, cfg);\n-\t\tupdate_atp(ret);\n-\t\treturn ret;\n-\t}\n+\t\taux::array<std::uint8_t, 96> random_key;\n+\t\taux::random_bytes({reinterpret_cast<char*>(random_key.data())\n+\t\t\t, static_cast<std::ptrdiff_t>(random_key.size())});\n \n-}\n+\t\t// create local key (random)\n+\t\tmp::import_bits(m_dh_local_secret, random_key.begin(), random_key.end());\n \n+\t\t// key = (2 ^ secret) % prime\n+\t\tm_dh_local_key = mp::powm(key_t(2), m_dh_local_secret, dh_prime);\n
    relevance 0../src/kademlia/node.cpp:1177keep the returned value to pass as a limit to write_nodes_entries when implemented

    keep the returned value to pass as a limit\n to write_nodes_entries when implemented

    ../src/kademlia/node.cpp:1177

    \t\t}\n \t}\n \telse if (query == \"sample_infohashes\")\n \t{\n \t\tstatic key_desc_t const msg_desc[] = {\n \t\t\t{\"target\", bdecode_node::string_t, 20, 0},\n@@ -10050,15 +10050,117 @@\n \n \taddress_v4::bytes_type b4{};\n \taddress_v6::bytes_type b6{};\n \tif (ip_.is_v6())\n \t{\n \t\tb6 = ip_.to_v6().to_bytes();\n \t\tip = b6.data();\n-
    relevance 0../src/kademlia/routing_table.cpp:289This is temporary. For now, only report the largest routing table (of potentially multiple ones, for multi-homed systems) in next major version, break the ABI and support reporting all of them in the dht_stats_alert

    This is temporary. For now, only report the largest routing table\n+

    relevance 0../src/kademlia/dht_tracker.cpp:317pick the closest node rather than the first

    pick the closest node rather than the first

    ../src/kademlia/dht_tracker.cpp:317

    \n+#ifndef TORRENT_DISABLE_LOGGING\n+\t\tm_log->log(dht_logger::tracker, \"*** new write key*** %d nodes\"\n+\t\t\t, int(m_nodes.size()));\n+#endif\n+\t}\n+\n+\tvoid dht_tracker::update_storage_node_ids()\n+\t{\n+\t\tstd::vector<sha1_hash> ids;\n+\t\tfor (auto& n : m_nodes)\n+\t\t\tids.push_back(n.second.dht.nid());\n+\t\tm_storage.update_node_ids(ids);\n+\t}\n+\n+\tnode* dht_tracker::get_node(node_id const& id, std::string const& family_name)\n+\t{\n+\t\tTORRENT_UNUSED(id);\n+\t\tfor (auto& n : m_nodes)\n+\t\t{\n+
    \t\t\tif (n.second.dht.protocol_family_name() == family_name)\n+
    \t\t\t\treturn &n.second.dht;\n+\t\t}\n+\n+\t\treturn nullptr;\n+\t}\n+\n+\tvoid dht_tracker::get_peers(sha1_hash const& ih\n+\t\t, std::function<void(std::vector<tcp::endpoint> const&)> f)\n+\t{\n+\t\tfor (auto& n : m_nodes)\n+\t\t\tn.second.dht.get_peers(ih, f, {}, {});\n+\t}\n+\n+\tvoid dht_tracker::announce(sha1_hash const& ih, int listen_port\n+\t\t, announce_flags_t const flags\n+\t\t, std::function<void(std::vector<tcp::endpoint> const&)> f)\n+\t{\n+\t\tfor (auto& n : m_nodes)\n+\t\t\tn.second.dht.announce(ih, listen_port, flags, f);\n+\t}\n+\n+\tvoid dht_tracker::sample_infohashes(udp::endpoint const& ep, sha1_hash const& target\n+\t\t, std::function<void(node_id\n+\t\t\t, time_duration\n+\t\t\t, int, std::vector<sha1_hash>\n+\t\t\t, std::vector<std::pair<sha1_hash, udp::endpoint>>)> f)\n+\t{\n+\t\tfor (auto& n : m_nodes)\n+\t\t{\n+\t\t\tif (ep.protocol() != (n.first.get_external_address().is_v4() ? udp::v4() : udp::v6()))\n+
    relevance 0../src/kademlia/item.cpp:143implement ctor for entry from bdecode_node?

    implement ctor for entry from bdecode_node?

    ../src/kademlia/item.cpp:143

    \t, secret_key const& sk)\n+{\n+\tchar str[1200];\n+\tint const len = canonical_string(v, seq, salt, str);\n+\n+\treturn ed25519_sign({str, len}, pk, sk);\n+}\n+\n+item::item(public_key const& pk, span<char const> salt)\n+\t: m_salt(salt.data(), static_cast<std::size_t>(salt.size()))\n+\t, m_pk(pk)\n+\t, m_mutable(true)\n+{}\n+\n+item::item(entry v)\n+\t: m_value(std::move(v))\n+{}\n+\n+item::item(bdecode_node const& v)\n+{\n+
    \tm_value = v;\n+
    }\n+\n+item::item(entry v, span<char const> salt\n+\t, sequence_number const seq, public_key const& pk, secret_key const& sk)\n+{\n+\tassign(std::move(v), salt, seq, pk, sk);\n+}\n+\n+void item::assign(entry v)\n+{\n+\tm_mutable = false;\n+\tm_value = std::move(v);\n+}\n+\n+void item::assign(entry v, span<char const> salt\n+\t, sequence_number const seq, public_key const& pk, secret_key const& sk)\n+{\n+\tstd::array<char, 1000> buffer;\n+\tint const bsize = bencode(buffer.begin(), v);\n+\tTORRENT_ASSERT(bsize <= 1000);\n+\tm_sig = sign_mutable_item(span<char const>(buffer).first(bsize)\n+\t\t, salt, seq, pk, sk);\n+\tm_salt.assign(salt.data(), static_cast<std::size_t>(salt.size()));\n+\tm_pk = pk;\n+\tm_seq = seq;\n+\tm_mutable = true;\n+\tm_value = std::move(v);\n+}\n+\n+void item::assign(bdecode_node const& v)\n+
    relevance 0../src/kademlia/routing_table.cpp:289This is temporary. For now, only report the largest routing table (of potentially multiple ones, for multi-homed systems) in next major version, break the ABI and support reporting all of them in the dht_stats_alert

    This is temporary. For now, only report the largest routing table\n (of potentially multiple ones, for multi-homed systems)\n in next major version, break the ABI and support reporting all of them in\n the dht_stats_alert

    ../src/kademlia/routing_table.cpp:289

    \t, m_bucket_size(bucket_size)\n {\n \t// bucket sizes must be a power of 2\n \tTORRENT_ASSERT_VAL(((bucket_size - 1) & bucket_size) == 0, bucket_size);\n \tTORRENT_UNUSED(log);\n@@ -10085,15 +10187,15 @@\n \t\tb.num_nodes = int(i.live_nodes.size());\n \t\tb.num_replacements = int(i.replacements.size());\n \t\ts.push_back(b);\n \t}\n }\n \n #if TORRENT_ABI_VERSION == 1\n-
    relevance 0../src/kademlia/routing_table.cpp:314arvidn note when it's across IPv4 and IPv6, adding (dht_global_nodes) would make sense. in the future though, where we may have one DHT node per external interface (which may be multiple of the same address family), then it becomes a bit trickier

    arvidn note\n+

    relevance 0../src/kademlia/routing_table.cpp:314arvidn note when it's across IPv4 and IPv6, adding (dht_global_nodes) would make sense. in the future though, where we may have one DHT node per external interface (which may be multiple of the same address family), then it becomes a bit trickier

    arvidn note\n when it's across IPv4 and IPv6, adding (dht_global_nodes) would\n make sense. in the future though, where we may have one DHT node\n per external interface (which may be multiple of the same address\n family), then it becomes a bit trickier

    ../src/kademlia/routing_table.cpp:314

    \tif (s.size() > m_buckets.size()) return;\n \ts.clear();\n \tfor (auto const& i : m_buckets)\n \t{\n@@ -10140,15 +10242,15 @@\n \t\t\t, [](node_entry const& k) { return k.confirmed(); } ));\n \n \t\treplacements += int(i.replacements.size());\n \t}\n \treturn std::make_tuple(nodes, replacements, confirmed);\n }\n \n-
    relevance 0../src/kademlia/routing_table.cpp:518this need to take bucket \"prefix\" into account. It should be unified with add_node_impl()

    this need to take bucket \"prefix\" into account. It should be unified\n+

    relevance 0../src/kademlia/routing_table.cpp:518this need to take bucket \"prefix\" into account. It should be unified with add_node_impl()

    this need to take bucket \"prefix\" into account. It should be unified\n with add_node_impl()

    ../src/kademlia/routing_table.cpp:518

    {\n \tfor (auto i = m_buckets.begin() , end(m_buckets.end()); i != end; ++i)\n \t{\n \t\tfor (auto j = i->replacements.begin(); j != i->replacements.end(); ++j)\n \t\t{\n \t\t\tif (j->addr() != ep.address()) continue;\n \t\t\tif (j->port() != ep.port()) continue;\n@@ -10192,116 +10294,14 @@\n \t\t&& m_buckets.back().replacements.empty())\n \t{\n \t\tm_buckets.erase(m_buckets.end() - 1);\n \t}\n }\n \n void routing_table::remove_node(node_entry* n, bucket_t* b)\n-
    relevance 0../src/kademlia/item.cpp:143implement ctor for entry from bdecode_node?

    implement ctor for entry from bdecode_node?

    ../src/kademlia/item.cpp:143

    \t, secret_key const& sk)\n-{\n-\tchar str[1200];\n-\tint const len = canonical_string(v, seq, salt, str);\n-\n-\treturn ed25519_sign({str, len}, pk, sk);\n-}\n-\n-item::item(public_key const& pk, span<char const> salt)\n-\t: m_salt(salt.data(), static_cast<std::size_t>(salt.size()))\n-\t, m_pk(pk)\n-\t, m_mutable(true)\n-{}\n-\n-item::item(entry v)\n-\t: m_value(std::move(v))\n-{}\n-\n-item::item(bdecode_node const& v)\n-{\n-
    \tm_value = v;\n-
    }\n-\n-item::item(entry v, span<char const> salt\n-\t, sequence_number const seq, public_key const& pk, secret_key const& sk)\n-{\n-\tassign(std::move(v), salt, seq, pk, sk);\n-}\n-\n-void item::assign(entry v)\n-{\n-\tm_mutable = false;\n-\tm_value = std::move(v);\n-}\n-\n-void item::assign(entry v, span<char const> salt\n-\t, sequence_number const seq, public_key const& pk, secret_key const& sk)\n-{\n-\tstd::array<char, 1000> buffer;\n-\tint const bsize = bencode(buffer.begin(), v);\n-\tTORRENT_ASSERT(bsize <= 1000);\n-\tm_sig = sign_mutable_item(span<char const>(buffer).first(bsize)\n-\t\t, salt, seq, pk, sk);\n-\tm_salt.assign(salt.data(), static_cast<std::size_t>(salt.size()));\n-\tm_pk = pk;\n-\tm_seq = seq;\n-\tm_mutable = true;\n-\tm_value = std::move(v);\n-}\n-\n-void item::assign(bdecode_node const& v)\n-
    relevance 0../src/kademlia/dht_tracker.cpp:317pick the closest node rather than the first

    pick the closest node rather than the first

    ../src/kademlia/dht_tracker.cpp:317

    \n-#ifndef TORRENT_DISABLE_LOGGING\n-\t\tm_log->log(dht_logger::tracker, \"*** new write key*** %d nodes\"\n-\t\t\t, int(m_nodes.size()));\n-#endif\n-\t}\n-\n-\tvoid dht_tracker::update_storage_node_ids()\n-\t{\n-\t\tstd::vector<sha1_hash> ids;\n-\t\tfor (auto& n : m_nodes)\n-\t\t\tids.push_back(n.second.dht.nid());\n-\t\tm_storage.update_node_ids(ids);\n-\t}\n-\n-\tnode* dht_tracker::get_node(node_id const& id, std::string const& family_name)\n-\t{\n-\t\tTORRENT_UNUSED(id);\n-\t\tfor (auto& n : m_nodes)\n-\t\t{\n-
    \t\t\tif (n.second.dht.protocol_family_name() == family_name)\n-
    \t\t\t\treturn &n.second.dht;\n-\t\t}\n-\n-\t\treturn nullptr;\n-\t}\n-\n-\tvoid dht_tracker::get_peers(sha1_hash const& ih\n-\t\t, std::function<void(std::vector<tcp::endpoint> const&)> f)\n-\t{\n-\t\tfor (auto& n : m_nodes)\n-\t\t\tn.second.dht.get_peers(ih, f, {}, {});\n-\t}\n-\n-\tvoid dht_tracker::announce(sha1_hash const& ih, int listen_port\n-\t\t, announce_flags_t const flags\n-\t\t, std::function<void(std::vector<tcp::endpoint> const&)> f)\n-\t{\n-\t\tfor (auto& n : m_nodes)\n-\t\t\tn.second.dht.announce(ih, listen_port, flags, f);\n-\t}\n-\n-\tvoid dht_tracker::sample_infohashes(udp::endpoint const& ep, sha1_hash const& target\n-\t\t, std::function<void(node_id\n-\t\t\t, time_duration\n-\t\t\t, int, std::vector<sha1_hash>\n-\t\t\t, std::vector<std::pair<sha1_hash, udp::endpoint>>)> f)\n-\t{\n-\t\tfor (auto& n : m_nodes)\n-\t\t{\n-\t\t\tif (ep.protocol() != (n.first.get_external_address().is_v4() ? udp::v4() : udp::v6()))\n
    relevance 0../src/kademlia/put_data.cpp:92what if o is not an instance of put_data_observer? This need to be redesigned for better type safety.

    what if o is not an instance of put_data_observer? This need to be\n redesigned for better type safety.

    ../src/kademlia/put_data.cpp:92

    \t}\n }\n \n void put_data::done()\n {\n \tm_done = true;\n@@ -10340,49 +10340,244 @@\n \n \tm_node.stats_counters().inc_stats_counter(counters::dht_put_out);\n \n \treturn m_node.m_rpc.invoke(e, o->target_ep(), o);\n }\n \n } } // namespace libtorrent::dht\n-
    relevance 0../include/libtorrent/performance_counters.hpp:485some space could be saved here by making gauges 32 bits

    some space could be saved here by making gauges 32 bits

    ../include/libtorrent/performance_counters.hpp:485

    relevance 0../include/libtorrent/performance_counters.hpp:486restore these to regular integers. Instead have one copy of the counters per thread and collect them at convenient synchronization points

    restore these to regular integers. Instead have one copy\n-of the counters per thread and collect them at convenient\n-synchronization points

    ../include/libtorrent/performance_counters.hpp:486

    #ifdef ATOMIC_LLONG_LOCK_FREE\n-#define TORRENT_COUNTER_NOEXCEPT noexcept\n-#else\n-#define TORRENT_COUNTER_NOEXCEPT\n-#endif\n+
    relevance 0../include/libtorrent/proxy_base.hpp:227it would be nice to remember the bind port and bind once we know where the proxy is m_sock.bind(endpoint, ec);

    it would be nice to remember the bind port and bind once we know where the proxy is\n+m_sock.bind(endpoint, ec);

    ../include/libtorrent/proxy_base.hpp:227

    \t\tTORRENT_ASSERT(m_magic == 0x1337);\n+\t\tm_sock.cancel();\n+\t}\n \n-\t\tcounters() TORRENT_COUNTER_NOEXCEPT;\n+\tvoid cancel(error_code& ec)\n+\t{\n+\t\tTORRENT_ASSERT(m_magic == 0x1337);\n+\t\tm_sock.cancel(ec);\n+\t}\n \n-\t\tcounters(counters const&) TORRENT_COUNTER_NOEXCEPT;\n-\t\tcounters& operator=(counters const&) & TORRENT_COUNTER_NOEXCEPT;\n+\tvoid bind(endpoint_type const& /* endpoint */, error_code& /* ec */)\n+\t{\n+\t\tTORRENT_ASSERT(m_magic == 0x1337);\n+\t\t// the reason why we ignore binds here is because we don't\n+\t\t// (necessarily) yet know what address family the proxy\n+\t\t// will resolve to, and binding to the wrong one would\n+\t\t// break our connection attempt later. The caller here\n+\t\t// doesn't necessarily know that we're proxying, so this\n+\t\t// bind address is based on the final endpoint, not the\n+\t\t// proxy.\n+
    \t}\n+
    \n+#ifndef BOOST_NO_EXCEPTIONS\n+\tvoid open(protocol_type const&)\n+\t{\n+\t\tTORRENT_ASSERT(m_magic == 0x1337);\n+//\t\tm_sock.open(p);\n+\t}\n+#endif\n \n-\t\t// returns the new value\n-\t\tstd::int64_t inc_stats_counter(int c, std::int64_t value = 1) TORRENT_COUNTER_NOEXCEPT;\n-\t\tstd::int64_t operator[](int i) const TORRENT_COUNTER_NOEXCEPT;\n+\tvoid open(protocol_type const&, error_code&)\n+\t{\n+\t\tTORRENT_ASSERT(m_magic == 0x1337);\n+\t\t// we need to ignore this for the same reason as stated\n+\t\t// for ignoring bind()\n+//\t\tm_sock.open(p, ec);\n+\t}\n \n-\t\tvoid set_value(int c, std::int64_t value) TORRENT_COUNTER_NOEXCEPT;\n-\t\tvoid blend_stats_counter(int c, std::int64_t value, int ratio) TORRENT_COUNTER_NOEXCEPT;\n+#ifndef BOOST_NO_EXCEPTIONS\n+\tvoid close()\n+\t{\n+\t\tTORRENT_ASSERT(m_magic == 0x1337);\n+\t\tm_remote_endpoint = endpoint_type();\n+\t\tm_sock.close();\n+\t\tm_resolver.cancel();\n+\t}\n+#endif\n+\n+\tvoid close(error_code& ec)\n+\t{\n+\t\tTORRENT_ASSERT(m_magic == 0x1337);\n+
    relevance 0../include/libtorrent/piece_picker.hpp:823should this be allocated lazily?

    should this be allocated lazily?

    ../include/libtorrent/piece_picker.hpp:823

    \t\t// download list it may live in now\n+\t\tstd::vector<downloading_piece>::iterator update_piece_state(\n+\t\t\tstd::vector<downloading_piece>::iterator dp);\n \n \tprivate:\n \n-
    #ifdef ATOMIC_LLONG_LOCK_FREE\n-
    \t\taux::array<std::atomic<std::int64_t>, num_counters> m_stats_counter;\n-#else\n-\t\t// if the atomic type isn't lock-free, use a single lock instead, for\n-\t\t// the whole array\n-\t\tmutable std::mutex m_mutex;\n-\t\taux::array<std::int64_t, num_counters> m_stats_counter;\n+#if TORRENT_USE_ASSERTS || TORRENT_USE_INVARIANT_CHECKS\n+\t\tindex_range<download_queue_t> categories() const\n+\t\t{ return {{}, piece_picker::piece_pos::num_download_categories}; }\n #endif\n+\n+\t\t// the following vectors are mutable because they sometimes may\n+\t\t// be updated lazily, triggered by const functions\n+\n+\t\t// this maps indices to number of peers that has this piece and\n+\t\t// index into the m_piece_info vectors.\n+\t\t// piece_pos::we_have_index means that we have the piece, so it\n+\t\t// doesn't exist in the piece_info buckets\n+\t\t// pieces with the filtered flag set doesn't have entries in\n+\t\t// the m_piece_info buckets either\n+
    \t\tmutable aux::vector<piece_pos, piece_index_t> m_piece_map;\n+
    \n+\t\t// tracks the number of bytes in a specific piece that are part of a pad\n+\t\t// file. The padding is assumed to be at the end of the piece, and the\n+\t\t// blocks covered by the pad bytes are not picked by the piece picker\n+\t\tstd::unordered_map<piece_index_t, int> m_pads_in_piece;\n+\n+\t\t// when the adjacent_piece affinity is enabled, this contains the most\n+\t\t// recent \"extents\" of adjacent pieces that have been requested from\n+\t\t// this is mutable because it's updated by functions to pick pieces, which\n+\t\t// are const. That's an efficient place to update it, since it's being\n+\t\t// traversed already.\n+\t\tmutable std::vector<piece_extent_t> m_recent_extents;\n+\n+\t\t// the number of bytes of pad file set in this piece picker\n+\t\tstd::int64_t m_num_pad_bytes = 0;\n+\n+\t\t// the number of pad blocks that we already have\n+\t\tstd::int64_t m_have_pad_bytes = 0;\n+\n+\t\t// the number of pad blocks part of filtered pieces we don't have\n+\t\tstd::int64_t m_filtered_pad_bytes = 0;\n+\n+\t\t// the number of pad blocks we have that are also filtered\n+\t\tstd::int64_t m_have_filtered_pad_bytes = 0;\n+\n+\t\t// the number of seeds. These are not added to\n+\t\t// the availability counters of the pieces\n+\t\tint m_seeds = 0;\n+\n+\t\t// this vector contains all piece indices that are pickable\n+
    relevance 0../include/libtorrent/piece_picker.hpp:895it would be more intuitive to account \"wanted\" pieces instead of filtered

    it would be more intuitive to account \"wanted\" pieces\n+instead of filtered

    ../include/libtorrent/piece_picker.hpp:895

    \n+\t\t// this holds the information of the blocks in partially downloaded\n+\t\t// pieces. the downloading_piece::info index point into this vector for\n+\t\t// its storage\n+\t\taux::vector<block_info> m_block_info;\n+\n+\t\t// these are block ranges in m_block_info that are free. The numbers\n+\t\t// in here, when multiplied by blocks_per_piece is the index to the\n+\t\t// first block in the range that's free to use by a new downloading_piece.\n+\t\t// this is a free-list.\n+\t\tstd::vector<std::uint16_t> m_free_block_infos;\n+\n+\t\tstd::uint16_t m_blocks_in_last_piece = 0;\n+\t\tint m_piece_size = 0;\n+\t\tstd::int64_t m_total_size = 0;\n+\n+\t\t// the number of filtered pieces that we don't already\n+\t\t// have. total_number_of_pieces - number_of_pieces_we_have\n+\t\t// - num_filtered is supposed to the number of pieces\n+\t\t// we still want to download\n+
    \t\tint m_num_filtered = 0;\n+
    \n+\t\t// the number of pieces we have that also are filtered\n+\t\tint m_num_have_filtered = 0;\n+\n+\t\t// we have all pieces in the range [0, m_cursor)\n+\t\t// m_cursor is the first piece we don't have\n+\t\tpiece_index_t m_cursor{0};\n+\n+\t\t// we have all pieces in the range [m_reverse_cursor, end)\n+\t\t// m_reverse_cursor is the first piece where we also have\n+\t\t// all the subsequent pieces\n+\t\tpiece_index_t m_reverse_cursor{0};\n+\n+\t\t// the number of pieces we have (i.e. passed hash check).\n+\t\t// This includes pieces that we have filtered but still have\n+\t\tint m_num_have = 0;\n+\n+\t\t// if this is set to true, it means update_pieces()\n+\t\t// has to be called before accessing m_pieces.\n+\t\tmutable bool m_dirty = false;\n+\tpublic:\n+\n+\t\tenum { max_pieces = (std::numeric_limits<int>::max)() - 1 };\n+\n \t};\n }\n \n+#endif // TORRENT_PIECE_PICKER_HPP_INCLUDED\n+
    relevance 0../include/libtorrent/socket_type.hpp:60move to aux

    move to aux

    ../include/libtorrent/socket_type.hpp:60

    namespace libtorrent {\n+\n+// A type describing kinds of sockets involved in various operations or events.\n+enum class socket_type_t : std::uint8_t {\n+\ttcp,\n+\tsocks5,\n+\thttp,\n+\tutp,\n+\ti2p,\n+\ttcp_ssl,\n+\tsocks5_ssl,\n+\thttp_ssl,\n+\tutp_ssl,\n+\n+#if TORRENT_ABI_VERSION <= 2\n+\tudp TORRENT_DEPRECATED_ENUM = utp,\n+#endif\n+};\n+\n+// return a short human readable name for types of socket\n+
    char const* socket_type_name(socket_type_t);\n+
    \n+}\n+\n #endif\n-
    relevance 0../include/libtorrent/announce_entry.hpp:76include the number of peers received from this tracker, at last announce

    include the number of peers received from this tracker, at last\n+

    relevance 0../include/libtorrent/hash_picker.hpp:155support batched adding of block hashes for reduced overhead?

    support batched adding of block hashes for reduced overhead?

    ../include/libtorrent/hash_picker.hpp:155

    \t\t// the number of hashes in the range\n+\t\tint count = 0;\n+\t\tint proof_layers = 0;\n+\t};\n+\n+\t// validates the hash_request, to ensure its invariant as well as matching\n+\t// the torrent's file_storage and the number of hashes accompanying the\n+\t// request\n+\tTORRENT_EXTRA_EXPORT\n+\tbool validate_hash_request(hash_request const& hr, file_storage const& fs);\n+\n+\tclass TORRENT_EXTRA_EXPORT hash_picker\n+\t{\n+\tpublic:\n+\t\thash_picker(file_storage const& files\n+\t\t\t, aux::vector<aux::merkle_tree, file_index_t>& trees);\n+\n+\t\thash_request pick_hashes(typed_bitfield<piece_index_t> const& pieces);\n+\n+\t\tadd_hashes_result add_hashes(hash_request const& req, span<sha256_hash const> hashes);\n+
    \t\tset_block_hash_result set_block_hash(piece_index_t piece, int offset, sha256_hash const& h);\n+
    \t\tvoid hashes_rejected(hash_request const& req);\n+\t\tvoid verify_block_hashes(piece_index_t index);\n+\n+\t\t// do we know the piece layer hash for a piece\n+\t\tbool have_hash(piece_index_t index) const;\n+\t\t// do we know all the block hashes for a file?\n+\t\tbool have_all(file_index_t file) const;\n+\t\tbool have_all() const;\n+\t\tbool piece_verified(piece_index_t piece) const;\n+\n+\t\tint piece_layer() const { return m_piece_layer; }\n+\n+\tprivate:\n+\t\t// returns the number of proof layers needed to verify the node's hash\n+\t\tint layers_to_verify(node_index idx) const;\n+\t\tint file_num_layers(file_index_t idx) const;\n+\n+\t\tstruct piece_hash_request\n+\t\t{\n+\t\t\ttime_point last_request = min_time();\n+\t\t\tint num_requests = 0;\n+\t\t\tbool have = false;\n+\t\t};\n+\n+\t\tstruct priority_block_request\n+\t\t{\n+\t\t\tpriority_block_request(file_index_t const f, int const b)\n+\t\t\t\t: file(f), block(b) {}\n+\t\t\tfile_index_t file;\n+\t\t\tint block;\n+
    relevance 0../include/libtorrent/announce_entry.hpp:76include the number of peers received from this tracker, at last announce

    include the number of peers received from this tracker, at last\n announce

    ../include/libtorrent/announce_entry.hpp:76

    \n \tstruct TORRENT_EXPORT announce_infohash\n \t{\n \t\t// internal\n \t\tTORRENT_UNEXPORT announce_infohash();\n \n \t\t// if this tracker has returned an error or warning message\n@@ -10426,66 +10621,66 @@\n \t\t// set to true when we get a valid response from an announce\n \t\t// with event=started. If it is set, we won't send start in the subsequent\n \t\t// announces.\n \t\tbool start_sent : 1;\n \n \t\t// set to true when we send a event=completed.\n \t\tbool complete_sent : 1;\n-
    relevance 0../include/libtorrent/hash_picker.hpp:155support batched adding of block hashes for reduced overhead?

    support batched adding of block hashes for reduced overhead?

    ../include/libtorrent/hash_picker.hpp:155

    \t\t// the number of hashes in the range\n-\t\tint count = 0;\n-\t\tint proof_layers = 0;\n-\t};\n-\n-\t// validates the hash_request, to ensure its invariant as well as matching\n-\t// the torrent's file_storage and the number of hashes accompanying the\n-\t// request\n-\tTORRENT_EXTRA_EXPORT\n-\tbool validate_hash_request(hash_request const& hr, file_storage const& fs);\n+
    relevance 0../include/libtorrent/string_view.hpp:40replace this by the standard string_view in C++17

    replace this by the standard string_view in C++17

    ../include/libtorrent/string_view.hpp:40

    AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n+POSSIBILITY OF SUCH DAMAGE.\n \n-\tclass TORRENT_EXTRA_EXPORT hash_picker\n-\t{\n-\tpublic:\n-\t\thash_picker(file_storage const& files\n-\t\t\t, aux::vector<aux::merkle_tree, file_index_t>& trees);\n+*/\n \n-\t\thash_request pick_hashes(typed_bitfield<piece_index_t> const& pieces);\n+#ifndef TORRENT_STRING_VIEW_HPP_INCLUDED\n+#define TORRENT_STRING_VIEW_HPP_INCLUDED\n \n-\t\tadd_hashes_result add_hashes(hash_request const& req, span<sha256_hash const> hashes);\n-
    \t\tset_block_hash_result set_block_hash(piece_index_t piece, int offset, sha256_hash const& h);\n-
    \t\tvoid hashes_rejected(hash_request const& req);\n-\t\tvoid verify_block_hashes(piece_index_t index);\n+#include <boost/version.hpp>\n \n-\t\t// do we know the piece layer hash for a piece\n-\t\tbool have_hash(piece_index_t index) const;\n-\t\t// do we know all the block hashes for a file?\n-\t\tbool have_all(file_index_t file) const;\n-\t\tbool have_all() const;\n-\t\tbool piece_verified(piece_index_t piece) const;\n+#include \"libtorrent/aux_/disable_warnings_push.hpp\"\n \n-\t\tint piece_layer() const { return m_piece_layer; }\n+
    \n+
    #if BOOST_VERSION < 106100\n+#include <boost/utility/string_ref.hpp>\n+#include <cstring> // for strchr\n+namespace libtorrent {\n \n-\tprivate:\n-\t\t// returns the number of proof layers needed to verify the node's hash\n-\t\tint layers_to_verify(node_index idx) const;\n-\t\tint file_num_layers(file_index_t idx) const;\n+using string_view = boost::string_ref;\n+using wstring_view = boost::wstring_ref;\n \n-\t\tstruct piece_hash_request\n-\t\t{\n-\t\t\ttime_point last_request = min_time();\n-\t\t\tint num_requests = 0;\n-\t\t\tbool have = false;\n-\t\t};\n+// internal\n+inline string_view::size_type find_first_of(string_view const v, char const c\n+\t, string_view::size_type pos)\n+{\n+\twhile (pos < v.size())\n+\t{\n+\t\tif (v[pos] == c) return pos;\n+\t\t++pos;\n+\t}\n+\treturn string_view::npos;\n+}\n \n-\t\tstruct priority_block_request\n-\t\t{\n-\t\t\tpriority_block_request(file_index_t const f, int const b)\n-\t\t\t\t: file(f), block(b) {}\n-\t\t\tfile_index_t file;\n-\t\t\tint block;\n-
    relevance 0../include/libtorrent/identify_client.hpp:48hide this declaration when deprecated functions are disabled, and remove its internal use

    hide this declaration when deprecated functions are disabled, and\n+// internal\n+inline string_view::size_type find_first_of(string_view const v, char const* c\n+\t, string_view::size_type pos)\n+{\n+\twhile (pos < v.size())\n+\t{\n+\t\tif (std::strchr(c, v[pos]) != nullptr) return pos;\n+\t\t++pos;\n+\t}\n+\treturn string_view::npos;\n+

    relevance 0../include/libtorrent/identify_client.hpp:48hide this declaration when deprecated functions are disabled, and remove its internal use

    hide this declaration when deprecated functions are disabled, and\n remove its internal use

    ../include/libtorrent/identify_client.hpp:48

    CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n POSSIBILITY OF SUCH DAMAGE.\n \n */\n \n #ifndef TORRENT_IDENTIFY_CLIENT_HPP_INCLUDED\n@@ -10529,15 +10724,362 @@\n \t// not be able to identify peers with non- standard encodings. Only Azureus\n \t// style, Shadow's style and Mainline style.\n \tTORRENT_DEPRECATED_EXPORT\n \tboost::optional<fingerprint>\n \t\tclient_fingerprint(peer_id const& p);\n \n #include \"libtorrent/aux_/disable_warnings_pop.hpp\"\n-
    relevance 0../include/libtorrent/torrent.hpp:280make this a raw pointer. perhaps keep the shared_ptr around further down the object to maintain an owner

    make this a raw pointer. perhaps keep the shared_ptr\n+

    relevance 0../include/libtorrent/torrent_info.hpp:729change the type to std::shared_ptr in C++17 it is used as if immutable, it cannot be const for technical reasons right now.

    change the type to std::shared_ptr in C++17\n+it is used as if immutable, it cannot be const for technical reasons\n+right now.

    ../include/libtorrent/torrent_info.hpp:729

    \n+\t\t// these are the collections from outside of the info-dict. These are\n+\t\t// owning strings, since we only keep the info-section around, these\n+\t\t// cannot be pointers into that buffer.\n+\t\tstd::vector<std::string> m_owned_collections;\n+\n+#if TORRENT_ABI_VERSION <= 2\n+\t\t// if this is a merkle torrent, this is the merkle\n+\t\t// tree. It has space for merkle_num_nodes(merkle_num_leafs(num_pieces))\n+\t\t// hashes\n+\t\taux::vector<sha1_hash> m_merkle_tree;\n+#endif\n+\n+\t\t// v2 merkle tree for each file\n+\t\t// the actual hash buffers are always divisible by 32 (sha256_hash::size())\n+\t\taux::vector<aux::vector<char>, file_index_t> m_piece_layers;\n+\n+\t\t// this is a copy of the info section from the torrent.\n+\t\t// it use maintained in this flat format in order to\n+\t\t// make it available through the metadata extension\n+
    \t\tboost::shared_array<char> m_info_section;\n+
    \n+\t\t// if a comment is found in the torrent file\n+\t\t// this will be set to that comment\n+\t\tstd::string m_comment;\n+\n+\t\t// an optional string naming the software used\n+\t\t// to create the torrent file\n+\t\tstd::string m_created_by;\n+\n+\t\t// the info section parsed. points into m_info_section\n+\t\t// parsed lazily\n+\t\tmutable bdecode_node m_info_dict;\n+\n+\t\t// if a creation date is found in the torrent file\n+\t\t// this will be set to that, otherwise it'll be\n+\t\t// 1970, Jan 1\n+\t\tstd::time_t m_creation_date = 0;\n+\n+\t\t// the hash(es) that identify this torrent\n+\t\tinfo_hash_t m_info_hash;\n+\n+\t\t// this is the offset into the m_info_section buffer to the first byte of\n+\t\t// the first SHA-1 hash\n+\t\tstd::int32_t m_piece_hashes = 0;\n+\n+\t\t// the number of bytes in m_info_section\n+\t\tstd::int32_t m_info_section_size = 0;\n+\n+\t\t// this is used when creating a torrent. If there's\n+\t\t// only one file there are cases where it's impossible\n+
    relevance 0../include/libtorrent/socks5_stream.hpp:197we could bind the socket here, since we know what the target endpoint is of the proxy

    we could bind the socket here, since we know what the\n+target endpoint is of the proxy

    ../include/libtorrent/socks5_stream.hpp:197

    \t\t\t}, std::move(handler)));\n+\t}\n+\n+private:\n+\n+\ttemplate <typename Handler>\n+\tvoid name_lookup(error_code const& e, tcp::resolver::results_type ips\n+\t\t, Handler h)\n+\t{\n+\t\tCOMPLETE_ASYNC(\"socks5_stream::name_lookup\");\n+\t\tif (handle_error(e, std::move(h))) return;\n+\n+\t\tauto i = ips.begin();\n+\t\tif (!m_sock.is_open())\n+\t\t{\n+\t\t\terror_code ec;\n+\t\t\tm_sock.open(i->endpoint().protocol(), ec);\n+\t\t\tif (handle_error(ec, std::move(h))) return;\n+\t\t}\n+\n+
    \t\tADD_OUTSTANDING_ASYNC(\"socks5_stream::connected\");\n+
    \t\tm_sock.async_connect(i->endpoint(), wrap_allocator(\n+\t\t\t[this](error_code const& ec, Handler hn)\n+\t\t\t{ connected(ec, std::move(hn)); }, std::move(h)));\n+\t}\n+\n+\ttemplate <typename Handler>\n+\tvoid connected(error_code const& e, Handler h)\n+\t{\n+\t\tCOMPLETE_ASYNC(\"socks5_stream::connected\");\n+\t\tif (handle_error(e, std::move(h))) return;\n+\n+\t\tusing namespace libtorrent::aux;\n+\t\tif (m_version == 5)\n+\t\t{\n+\t\t\t// send SOCKS5 authentication methods\n+\t\t\tm_buffer.resize(m_user.empty()?3:4);\n+\t\t\tchar* p = &m_buffer[0];\n+\t\t\twrite_uint8(5, p); // SOCKS VERSION 5\n+\t\t\tif (m_user.empty())\n+\t\t\t{\n+\t\t\t\twrite_uint8(1, p); // 1 authentication method (no auth)\n+\t\t\t\twrite_uint8(0, p); // no authentication\n+\t\t\t}\n+\t\t\telse\n+\t\t\t{\n+\t\t\t\twrite_uint8(2, p); // 2 authentication methods\n+\t\t\t\twrite_uint8(0, p); // no authentication\n+\t\t\t\twrite_uint8(2, p); // username/password\n+\t\t\t}\n+\t\t\tADD_OUTSTANDING_ASYNC(\"socks5_stream::handshake1\");\n+
    relevance 0../include/libtorrent/peer_connection.hpp:218make this a raw pointer (to save size in the first cache line) and make the constructor take a raw pointer. torrent objects should always outlive their peers

    make this a raw pointer (to save size in\n+the first cache line) and make the constructor\n+take a raw pointer. torrent objects should always\n+outlive their peers

    ../include/libtorrent/peer_connection.hpp:218

    \t\t\t, m_snubbed(false)\n+\t\t\t, m_interesting(false)\n+\t\t\t, m_choked(true)\n+\t\t\t, m_ignore_stats(false)\n+\t\t{}\n+\n+\t\t// explicitly disallow assignment, to silence msvc warning\n+\t\tpeer_connection_hot_members& operator=(peer_connection_hot_members const&) = delete;\n+\n+\tprotected:\n+\n+\t\t// the pieces the other end have\n+\t\ttyped_bitfield<piece_index_t> m_have_piece;\n+\n+\t\t// this is the torrent this connection is\n+\t\t// associated with. If the connection is an\n+\t\t// incoming connection, this is set to zero\n+\t\t// until the info_hash is received. Then it's\n+\t\t// set to the torrent it belongs to.\n+\n+
    \t\tstd::weak_ptr<torrent> m_torrent;\n+
    \n+\tpublic:\n+\n+\t\t// a back reference to the session\n+\t\t// the peer belongs to.\n+\t\taux::session_interface& m_ses;\n+\n+\t\t// settings that apply to this peer\n+\t\taux::session_settings const& m_settings;\n+\n+\tprotected:\n+\n+\t\t// this is true if this connection has been added\n+\t\t// to the list of connections that will be closed.\n+\t\tbool m_disconnecting:1;\n+\n+\t\t// this is true until this socket has become\n+\t\t// writable for the first time (i.e. the\n+\t\t// connection completed). While connecting\n+\t\t// the timeout will not be triggered. This is\n+\t\t// because windows XP SP2 may delay connection\n+\t\t// attempts, which means that the connection\n+\t\t// may not even have been attempted when the\n+\t\t// time out is reached.\n+\t\tbool m_connecting:1;\n+\n+\t\t// this is set to true if the last time we tried to\n+\t\t// pick a piece to download, we could only find\n+\t\t// blocks that were already requested from other\n+\t\t// peers. In this case, we should not try to pick\n+
    relevance 0../include/libtorrent/peer_connection.hpp:1026factor this out into its own class with a virtual interface torrent and session should implement this interface

    factor this out into its own class with a virtual interface\n+torrent and session should implement this interface

    ../include/libtorrent/peer_connection.hpp:1026

    \n+\t\t// the local endpoint for this peer, i.e. our address\n+\t\t// and our port. If this is set for outgoing connections\n+\t\t// before the connection completes, it means we want to\n+\t\t// force the connection to be bound to the specified interface.\n+\t\t// if it ends up being bound to a different local IP, the connection\n+\t\t// is closed.\n+\t\ttcp::endpoint m_local;\n+\n+\t\t// remote peer's id\n+\t\tpeer_id m_peer_id;\n+\n+\tprotected:\n+\n+\t\ttemplate <typename Fun, typename... Args>\n+\t\tvoid wrap(Fun f, Args&&... a);\n+\n+\t\t// statistics about upload and download speeds\n+\t\t// and total amount of uploads and downloads for\n+\t\t// this peer\n+
    \t\tstat m_statistics;\n+
    \n+\t\t// the number of outstanding bytes expected\n+\t\t// to be received by extensions\n+\t\tint m_extension_outstanding_bytes = 0;\n+\n+\t\t// the number of time critical requests\n+\t\t// queued up in the m_request_queue that\n+\t\t// soon will be committed to the download\n+\t\t// queue. This is included in download_queue_time()\n+\t\t// so that it can be used while adding more\n+\t\t// requests and take the previous requests\n+\t\t// into account without submitting it all\n+\t\t// immediately\n+\t\tstd::uint16_t m_queued_time_critical = 0;\n+\n+\t\t// the number of bytes we are currently reading\n+\t\t// from disk, that will be added to the send\n+\t\t// buffer as soon as they complete\n+\t\tint m_reading_bytes = 0;\n+\n+\t\t// options used for the piece picker. These flags will\n+\t\t// be augmented with flags controlled by other settings\n+\t\t// like sequential download etc. These are here to\n+\t\t// let plugins control flags that should always be set\n+\t\tpicker_options_t m_picker_options{};\n+\n+\t\t// the number of invalid piece-requests\n+\t\t// we have got from this peer. If the request\n+\t\t// queue gets empty, and there have been\n+\t\t// invalid requests, we can assume the\n+
    relevance 0../include/libtorrent/upnp.hpp:162support using the windows API for UPnP operations as well

    support using the windows API for UPnP operations as well

    ../include/libtorrent/upnp.hpp:162

    {\n+\tbool in_error_code = false;\n+\tbool exit = false;\n+\tint error_code = -1;\n+};\n+\n+struct ip_address_parse_state: error_code_parse_state\n+{\n+\tbool in_ip_address = false;\n+\tstd::string ip_address;\n+};\n+\n+TORRENT_EXTRA_EXPORT void find_control_url(int type, string_view, parse_state& state);\n+\n+TORRENT_EXTRA_EXPORT void find_error_code(int type, string_view string\n+\t, error_code_parse_state& state);\n+\n+TORRENT_EXTRA_EXPORT void find_ip_address(int type, string_view string\n+\t, ip_address_parse_state& state);\n+\n+
    struct TORRENT_EXTRA_EXPORT upnp final\n+
    \t: std::enable_shared_from_this<upnp>\n+\t, single_threaded\n+{\n+\tupnp(io_context& ios\n+\t\t, aux::session_settings const& settings\n+\t\t, aux::portmap_callback& cb\n+\t\t, address_v4 listen_address\n+\t\t, address_v4 netmask\n+\t\t, std::string listen_device\n+\t\t, aux::listen_socket_handle ls);\n+\t~upnp();\n+\n+\tvoid start();\n+\n+\t// Attempts to add a port mapping for the specified protocol. Valid protocols are\n+\t// ``upnp::tcp`` and ``upnp::udp`` for the UPnP class and ``natpmp::tcp`` and\n+\t// ``natpmp::udp`` for the NAT-PMP class.\n+\t//\n+\t// ``external_port`` is the port on the external address that will be mapped. This\n+\t// is a hint, you are not guaranteed that this port will be available, and it may\n+\t// end up being something else. In the portmap_alert_ notification, the actual\n+\t// external port is reported.\n+\t//\n+\t// ``local_port`` is the port in the local machine that the mapping should forward\n+\t// to.\n+\t//\n+\t// The return value is an index that identifies this port mapping. This is used\n+\t// to refer to mappings that fails or succeeds in the portmap_error_alert_ and\n+\t// portmap_alert_ respectively. If The mapping fails immediately, the return value\n+\t// is -1, which means failure. There will not be any error alert notification for\n+
    relevance 0../include/libtorrent/i2p_stream.hpp:533make this a string_view

    make this a string_view

    ../include/libtorrent/i2p_stream.hpp:533

    \n+\t\tchar tmp[20];\n+\t\taux::random_bytes(tmp);\n+\t\tm_session_id.resize(sizeof(tmp)*2);\n+\t\taux::to_hex(tmp, &m_session_id[0]);\n+\n+\t\tm_sam_socket = std::make_shared<i2p_stream>(m_io_service);\n+\t\tm_sam_socket->set_proxy(m_hostname, m_port);\n+\t\tm_sam_socket->set_command(i2p_stream::cmd_create_session);\n+\t\tm_sam_socket->set_session_id(m_session_id.c_str());\n+\t\tm_sam_socket->set_session_options(session_options);\n+\n+\t\tADD_OUTSTANDING_ASYNC(\"i2p_stream::on_sam_connect\");\n+\t\tm_sam_socket->async_connect(tcp::endpoint(), wrap_allocator(\n+\t\t\t[this,s=m_sam_socket](error_code const& ec, Handler hn) {\n+\t\t\t\ton_sam_connect(ec, s, std::move(hn));\n+\t\t\t}, std::move(handler)));\n+\t}\n+\tvoid close(error_code&);\n+\n+
    \tchar const* session_id() const { return m_session_id.c_str(); }\n+
    \tstd::string const& local_endpoint() const { return m_i2p_local_endpoint; }\n+\n+\ttemplate <typename Handler>\n+\tvoid async_name_lookup(char const* name, Handler handler)\n+\t{\n+\t\tif (m_state == sam_idle && m_name_lookup.empty() && is_open())\n+\t\t\tdo_name_lookup(name, std::move(handler));\n+\t\telse\n+\t\t\tm_name_lookup.emplace_back(std::string(name)\n+\t\t\t\t, std::move(handler));\n+\t}\n+\n+private:\n+\n+\ttemplate <typename Handler>\n+\tvoid on_sam_connect(error_code const& ec, std::shared_ptr<i2p_stream>, Handler h)\n+\t{\n+\t\tCOMPLETE_ASYNC(\"i2p_stream::on_sam_connect\");\n+\t\tm_state = sam_idle;\n+\n+\t\tif (ec)\n+\t\t{\n+\t\t\th(ec);\n+\t\t\treturn;\n+\t\t}\n+\n+\t\tdo_name_lookup(\"ME\", wrap_allocator(\n+\t\t\t[this](error_code const& e, char const* dst, Handler hn) {\n+\t\t\t\tset_local_endpoint(e, dst, std::move(hn));\n+\t\t\t}, std::move(h)));\n+
    relevance 0../include/libtorrent/performance_counters.hpp:485some space could be saved here by making gauges 32 bits

    some space could be saved here by making gauges 32 bits

    ../include/libtorrent/performance_counters.hpp:485

    relevance 0../include/libtorrent/performance_counters.hpp:486restore these to regular integers. Instead have one copy of the counters per thread and collect them at convenient synchronization points

    restore these to regular integers. Instead have one copy\n+of the counters per thread and collect them at convenient\n+synchronization points

    ../include/libtorrent/performance_counters.hpp:486

    #ifdef ATOMIC_LLONG_LOCK_FREE\n+#define TORRENT_COUNTER_NOEXCEPT noexcept\n+#else\n+#define TORRENT_COUNTER_NOEXCEPT\n+#endif\n+\n+\t\tcounters() TORRENT_COUNTER_NOEXCEPT;\n+\n+\t\tcounters(counters const&) TORRENT_COUNTER_NOEXCEPT;\n+\t\tcounters& operator=(counters const&) & TORRENT_COUNTER_NOEXCEPT;\n+\n+\t\t// returns the new value\n+\t\tstd::int64_t inc_stats_counter(int c, std::int64_t value = 1) TORRENT_COUNTER_NOEXCEPT;\n+\t\tstd::int64_t operator[](int i) const TORRENT_COUNTER_NOEXCEPT;\n+\n+\t\tvoid set_value(int c, std::int64_t value) TORRENT_COUNTER_NOEXCEPT;\n+\t\tvoid blend_stats_counter(int c, std::int64_t value, int ratio) TORRENT_COUNTER_NOEXCEPT;\n+\n+\tprivate:\n+\n+
    #ifdef ATOMIC_LLONG_LOCK_FREE\n+
    \t\taux::array<std::atomic<std::int64_t>, num_counters> m_stats_counter;\n+#else\n+\t\t// if the atomic type isn't lock-free, use a single lock instead, for\n+\t\t// the whole array\n+\t\tmutable std::mutex m_mutex;\n+\t\taux::array<std::int64_t, num_counters> m_stats_counter;\n+#endif\n+\t};\n+}\n+\n+#endif\n+
    relevance 0../include/libtorrent/torrent.hpp:280make this a raw pointer. perhaps keep the shared_ptr around further down the object to maintain an owner

    make this a raw pointer. perhaps keep the shared_ptr\n around further down the object to maintain an owner

    ../include/libtorrent/torrent.hpp:280

    #endif\n \t};\n \n \tstruct TORRENT_EXTRA_EXPORT torrent_hot_members\n \t{\n \t\ttorrent_hot_members(aux::session_interface& ses\n \t\t\t, add_torrent_params const& p, bool session_paused);\n@@ -10581,15 +11123,15 @@\n \t\t// this is set to false as long as the connections\n \t\t// of this torrent haven't been initialized. If we\n \t\t// have metadata from the start, connections are\n \t\t// initialized immediately, if we didn't have metadata,\n \t\t// they are initialized right after files_checked().\n \t\t// valid_resume_data() will return false as long as\n \t\t// the connections aren't initialized, to avoid\n-
    relevance 0../include/libtorrent/torrent.hpp:463make graceful pause also finish all sending blocks before disconnecting

    make graceful pause also finish all sending blocks\n+

    relevance 0../include/libtorrent/torrent.hpp:463make graceful pause also finish all sending blocks before disconnecting

    make graceful pause also finish all sending blocks\n before disconnecting

    ../include/libtorrent/torrent.hpp:463

    \n \t\tvoid on_resume_data_checked(status_t status, storage_error const& error);\n \t\tvoid on_force_recheck(status_t status, storage_error const& error);\n \t\tvoid on_piece_hashed(aux::vector<sha256_hash> block_hashes\n \t\t\t, piece_index_t piece, sha1_hash const& piece_hash\n \t\t\t, storage_error const& error);\n \t\tvoid files_checked();\n@@ -10633,15 +11175,15 @@\n \t\tvoid read_piece(piece_index_t);\n \t\tvoid on_disk_read_complete(disk_buffer_holder, storage_error const&\n \t\t\t, peer_request const&, std::shared_ptr<read_piece_struct>);\n \n \t\tstorage_mode_t storage_mode() const;\n \n \t\t// this will flag the torrent as aborted. The main\n-
    relevance 0../include/libtorrent/torrent.hpp:600make this flag a combination of the other ones

    make this flag a combination\n+

    relevance 0../include/libtorrent/torrent.hpp:600make this flag a combination of the other ones

    make this flag a combination\n of the other ones

    ../include/libtorrent/torrent.hpp:600

    \t\tvoid do_pause(bool was_paused = false);\n \t\tvoid do_resume();\n \n \t\tseconds32 finished_time() const;\n \t\tseconds32 active_time() const;\n \t\tseconds32 seeding_time() const;\n \t\tseconds32 upload_mode_time() const;\n@@ -10685,15 +11227,15 @@\n \t\tvoid set_piece_priority(piece_index_t index, download_priority_t priority);\n \t\tdownload_priority_t piece_priority(piece_index_t index) const;\n \n \t\tvoid prioritize_pieces(aux::vector<download_priority_t, piece_index_t> const& pieces);\n \t\tvoid prioritize_piece_list(std::vector<std::pair<piece_index_t, download_priority_t>> const& pieces);\n \t\tvoid piece_priorities(aux::vector<download_priority_t, piece_index_t>*) const;\n \n-
    relevance 0../include/libtorrent/torrent.hpp:1381this wastes 5 bits per file

    this wastes 5 bits per file

    ../include/libtorrent/torrent.hpp:1381

    #ifndef TORRENT_DISABLE_EXTENSIONS\n+
    relevance 0../include/libtorrent/torrent.hpp:1381this wastes 5 bits per file

    this wastes 5 bits per file

    ../include/libtorrent/torrent.hpp:1381

    #ifndef TORRENT_DISABLE_EXTENSIONS\n \t\tstd::list<std::shared_ptr<torrent_plugin>> m_extensions;\n #endif\n \n \t\t// used for tracker announces\n \t\tdeadline_timer m_tracker_timer;\n \n \t\t// used to detect when we are active or inactive for long enough\n@@ -10736,15 +11278,15 @@\n #if TORRENT_ABI_VERSION == 1\n \t\t// deprecated in 1.1\n \t\tstd::string m_username;\n \t\tstd::string m_password;\n #endif\n \n \t\tstd::string m_save_path;\n-
    relevance 0../include/libtorrent/torrent.hpp:1696this member can probably be removed

    this member can probably be removed

    ../include/libtorrent/torrent.hpp:1696

    \t\tunsigned int m_num_uploads:24;\n+
    relevance 0../include/libtorrent/torrent.hpp:1696this member can probably be removed

    this member can probably be removed

    ../include/libtorrent/torrent.hpp:1696

    \t\tunsigned int m_num_uploads:24;\n \n \t\t// 4 unused bits\n \n \t\t// when this is true, this torrent supports peer exchange\n \t\tbool m_enable_pex:1;\n \n \t\t// set to true if the session IP filter applies to this\n@@ -10787,431 +11329,15 @@\n \t\t// remember that this is an SSL torrent, so that we don't\n \t\t// accidentally start seeding it without any authentication.\n \t\tbool m_ssl_torrent:1;\n \n \t\t// this is set to true if we're trying to delete the\n \t\t// files belonging to it. When set, don't write any\n \t\t// more blocks to disk!\n-
    relevance 0../include/libtorrent/upnp.hpp:162support using the windows API for UPnP operations as well

    support using the windows API for UPnP operations as well

    ../include/libtorrent/upnp.hpp:162

    {\n-\tbool in_error_code = false;\n-\tbool exit = false;\n-\tint error_code = -1;\n-};\n-\n-struct ip_address_parse_state: error_code_parse_state\n-{\n-\tbool in_ip_address = false;\n-\tstd::string ip_address;\n-};\n-\n-TORRENT_EXTRA_EXPORT void find_control_url(int type, string_view, parse_state& state);\n-\n-TORRENT_EXTRA_EXPORT void find_error_code(int type, string_view string\n-\t, error_code_parse_state& state);\n-\n-TORRENT_EXTRA_EXPORT void find_ip_address(int type, string_view string\n-\t, ip_address_parse_state& state);\n-\n-
    struct TORRENT_EXTRA_EXPORT upnp final\n-
    \t: std::enable_shared_from_this<upnp>\n-\t, single_threaded\n-{\n-\tupnp(io_context& ios\n-\t\t, aux::session_settings const& settings\n-\t\t, aux::portmap_callback& cb\n-\t\t, address_v4 listen_address\n-\t\t, address_v4 netmask\n-\t\t, std::string listen_device\n-\t\t, aux::listen_socket_handle ls);\n-\t~upnp();\n-\n-\tvoid start();\n-\n-\t// Attempts to add a port mapping for the specified protocol. Valid protocols are\n-\t// ``upnp::tcp`` and ``upnp::udp`` for the UPnP class and ``natpmp::tcp`` and\n-\t// ``natpmp::udp`` for the NAT-PMP class.\n-\t//\n-\t// ``external_port`` is the port on the external address that will be mapped. This\n-\t// is a hint, you are not guaranteed that this port will be available, and it may\n-\t// end up being something else. In the portmap_alert_ notification, the actual\n-\t// external port is reported.\n-\t//\n-\t// ``local_port`` is the port in the local machine that the mapping should forward\n-\t// to.\n-\t//\n-\t// The return value is an index that identifies this port mapping. This is used\n-\t// to refer to mappings that fails or succeeds in the portmap_error_alert_ and\n-\t// portmap_alert_ respectively. If The mapping fails immediately, the return value\n-\t// is -1, which means failure. There will not be any error alert notification for\n-
    relevance 0../include/libtorrent/proxy_base.hpp:227it would be nice to remember the bind port and bind once we know where the proxy is m_sock.bind(endpoint, ec);

    it would be nice to remember the bind port and bind once we know where the proxy is\n-m_sock.bind(endpoint, ec);

    ../include/libtorrent/proxy_base.hpp:227

    \t\tTORRENT_ASSERT(m_magic == 0x1337);\n-\t\tm_sock.cancel();\n-\t}\n-\n-\tvoid cancel(error_code& ec)\n-\t{\n-\t\tTORRENT_ASSERT(m_magic == 0x1337);\n-\t\tm_sock.cancel(ec);\n-\t}\n-\n-\tvoid bind(endpoint_type const& /* endpoint */, error_code& /* ec */)\n-\t{\n-\t\tTORRENT_ASSERT(m_magic == 0x1337);\n-\t\t// the reason why we ignore binds here is because we don't\n-\t\t// (necessarily) yet know what address family the proxy\n-\t\t// will resolve to, and binding to the wrong one would\n-\t\t// break our connection attempt later. The caller here\n-\t\t// doesn't necessarily know that we're proxying, so this\n-\t\t// bind address is based on the final endpoint, not the\n-\t\t// proxy.\n-
    \t}\n-
    \n-#ifndef BOOST_NO_EXCEPTIONS\n-\tvoid open(protocol_type const&)\n-\t{\n-\t\tTORRENT_ASSERT(m_magic == 0x1337);\n-//\t\tm_sock.open(p);\n-\t}\n-#endif\n-\n-\tvoid open(protocol_type const&, error_code&)\n-\t{\n-\t\tTORRENT_ASSERT(m_magic == 0x1337);\n-\t\t// we need to ignore this for the same reason as stated\n-\t\t// for ignoring bind()\n-//\t\tm_sock.open(p, ec);\n-\t}\n-\n-#ifndef BOOST_NO_EXCEPTIONS\n-\tvoid close()\n-\t{\n-\t\tTORRENT_ASSERT(m_magic == 0x1337);\n-\t\tm_remote_endpoint = endpoint_type();\n-\t\tm_sock.close();\n-\t\tm_resolver.cancel();\n-\t}\n-#endif\n-\n-\tvoid close(error_code& ec)\n-\t{\n-\t\tTORRENT_ASSERT(m_magic == 0x1337);\n-
    relevance 0../include/libtorrent/peer_connection.hpp:218make this a raw pointer (to save size in the first cache line) and make the constructor take a raw pointer. torrent objects should always outlive their peers

    make this a raw pointer (to save size in\n-the first cache line) and make the constructor\n-take a raw pointer. torrent objects should always\n-outlive their peers

    ../include/libtorrent/peer_connection.hpp:218

    \t\t\t, m_snubbed(false)\n-\t\t\t, m_interesting(false)\n-\t\t\t, m_choked(true)\n-\t\t\t, m_ignore_stats(false)\n-\t\t{}\n-\n-\t\t// explicitly disallow assignment, to silence msvc warning\n-\t\tpeer_connection_hot_members& operator=(peer_connection_hot_members const&) = delete;\n-\n-\tprotected:\n-\n-\t\t// the pieces the other end have\n-\t\ttyped_bitfield<piece_index_t> m_have_piece;\n-\n-\t\t// this is the torrent this connection is\n-\t\t// associated with. If the connection is an\n-\t\t// incoming connection, this is set to zero\n-\t\t// until the info_hash is received. Then it's\n-\t\t// set to the torrent it belongs to.\n-\n-
    \t\tstd::weak_ptr<torrent> m_torrent;\n-
    \n-\tpublic:\n-\n-\t\t// a back reference to the session\n-\t\t// the peer belongs to.\n-\t\taux::session_interface& m_ses;\n-\n-\t\t// settings that apply to this peer\n-\t\taux::session_settings const& m_settings;\n-\n-\tprotected:\n-\n-\t\t// this is true if this connection has been added\n-\t\t// to the list of connections that will be closed.\n-\t\tbool m_disconnecting:1;\n-\n-\t\t// this is true until this socket has become\n-\t\t// writable for the first time (i.e. the\n-\t\t// connection completed). While connecting\n-\t\t// the timeout will not be triggered. This is\n-\t\t// because windows XP SP2 may delay connection\n-\t\t// attempts, which means that the connection\n-\t\t// may not even have been attempted when the\n-\t\t// time out is reached.\n-\t\tbool m_connecting:1;\n-\n-\t\t// this is set to true if the last time we tried to\n-\t\t// pick a piece to download, we could only find\n-\t\t// blocks that were already requested from other\n-\t\t// peers. In this case, we should not try to pick\n-
    relevance 0../include/libtorrent/peer_connection.hpp:1026factor this out into its own class with a virtual interface torrent and session should implement this interface

    factor this out into its own class with a virtual interface\n-torrent and session should implement this interface

    ../include/libtorrent/peer_connection.hpp:1026

    \n-\t\t// the local endpoint for this peer, i.e. our address\n-\t\t// and our port. If this is set for outgoing connections\n-\t\t// before the connection completes, it means we want to\n-\t\t// force the connection to be bound to the specified interface.\n-\t\t// if it ends up being bound to a different local IP, the connection\n-\t\t// is closed.\n-\t\ttcp::endpoint m_local;\n-\n-\t\t// remote peer's id\n-\t\tpeer_id m_peer_id;\n-\n-\tprotected:\n-\n-\t\ttemplate <typename Fun, typename... Args>\n-\t\tvoid wrap(Fun f, Args&&... a);\n-\n-\t\t// statistics about upload and download speeds\n-\t\t// and total amount of uploads and downloads for\n-\t\t// this peer\n-
    \t\tstat m_statistics;\n-
    \n-\t\t// the number of outstanding bytes expected\n-\t\t// to be received by extensions\n-\t\tint m_extension_outstanding_bytes = 0;\n-\n-\t\t// the number of time critical requests\n-\t\t// queued up in the m_request_queue that\n-\t\t// soon will be committed to the download\n-\t\t// queue. This is included in download_queue_time()\n-\t\t// so that it can be used while adding more\n-\t\t// requests and take the previous requests\n-\t\t// into account without submitting it all\n-\t\t// immediately\n-\t\tstd::uint16_t m_queued_time_critical = 0;\n-\n-\t\t// the number of bytes we are currently reading\n-\t\t// from disk, that will be added to the send\n-\t\t// buffer as soon as they complete\n-\t\tint m_reading_bytes = 0;\n-\n-\t\t// options used for the piece picker. These flags will\n-\t\t// be augmented with flags controlled by other settings\n-\t\t// like sequential download etc. These are here to\n-\t\t// let plugins control flags that should always be set\n-\t\tpicker_options_t m_picker_options{};\n-\n-\t\t// the number of invalid piece-requests\n-\t\t// we have got from this peer. If the request\n-\t\t// queue gets empty, and there have been\n-\t\t// invalid requests, we can assume the\n-
    relevance 0../include/libtorrent/string_view.hpp:40replace this by the standard string_view in C++17

    replace this by the standard string_view in C++17

    ../include/libtorrent/string_view.hpp:40

    AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n-ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n-LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n-CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n-POSSIBILITY OF SUCH DAMAGE.\n-\n-*/\n-\n-#ifndef TORRENT_STRING_VIEW_HPP_INCLUDED\n-#define TORRENT_STRING_VIEW_HPP_INCLUDED\n-\n-#include <boost/version.hpp>\n-\n-#include \"libtorrent/aux_/disable_warnings_push.hpp\"\n-\n-
    \n-
    #if BOOST_VERSION < 106100\n-#include <boost/utility/string_ref.hpp>\n-#include <cstring> // for strchr\n-namespace libtorrent {\n-\n-using string_view = boost::string_ref;\n-using wstring_view = boost::wstring_ref;\n-\n-// internal\n-inline string_view::size_type find_first_of(string_view const v, char const c\n-\t, string_view::size_type pos)\n-{\n-\twhile (pos < v.size())\n-\t{\n-\t\tif (v[pos] == c) return pos;\n-\t\t++pos;\n-\t}\n-\treturn string_view::npos;\n-}\n-\n-// internal\n-inline string_view::size_type find_first_of(string_view const v, char const* c\n-\t, string_view::size_type pos)\n-{\n-\twhile (pos < v.size())\n-\t{\n-\t\tif (std::strchr(c, v[pos]) != nullptr) return pos;\n-\t\t++pos;\n-\t}\n-\treturn string_view::npos;\n-
    relevance 0../include/libtorrent/i2p_stream.hpp:533make this a string_view

    make this a string_view

    ../include/libtorrent/i2p_stream.hpp:533

    \n-\t\tchar tmp[20];\n-\t\taux::random_bytes(tmp);\n-\t\tm_session_id.resize(sizeof(tmp)*2);\n-\t\taux::to_hex(tmp, &m_session_id[0]);\n-\n-\t\tm_sam_socket = std::make_shared<i2p_stream>(m_io_service);\n-\t\tm_sam_socket->set_proxy(m_hostname, m_port);\n-\t\tm_sam_socket->set_command(i2p_stream::cmd_create_session);\n-\t\tm_sam_socket->set_session_id(m_session_id.c_str());\n-\t\tm_sam_socket->set_session_options(session_options);\n-\n-\t\tADD_OUTSTANDING_ASYNC(\"i2p_stream::on_sam_connect\");\n-\t\tm_sam_socket->async_connect(tcp::endpoint(), wrap_allocator(\n-\t\t\t[this,s=m_sam_socket](error_code const& ec, Handler hn) {\n-\t\t\t\ton_sam_connect(ec, s, std::move(hn));\n-\t\t\t}, std::move(handler)));\n-\t}\n-\tvoid close(error_code&);\n-\n-
    \tchar const* session_id() const { return m_session_id.c_str(); }\n-
    \tstd::string const& local_endpoint() const { return m_i2p_local_endpoint; }\n-\n-\ttemplate <typename Handler>\n-\tvoid async_name_lookup(char const* name, Handler handler)\n-\t{\n-\t\tif (m_state == sam_idle && m_name_lookup.empty() && is_open())\n-\t\t\tdo_name_lookup(name, std::move(handler));\n-\t\telse\n-\t\t\tm_name_lookup.emplace_back(std::string(name)\n-\t\t\t\t, std::move(handler));\n-\t}\n-\n-private:\n-\n-\ttemplate <typename Handler>\n-\tvoid on_sam_connect(error_code const& ec, std::shared_ptr<i2p_stream>, Handler h)\n-\t{\n-\t\tCOMPLETE_ASYNC(\"i2p_stream::on_sam_connect\");\n-\t\tm_state = sam_idle;\n-\n-\t\tif (ec)\n-\t\t{\n-\t\t\th(ec);\n-\t\t\treturn;\n-\t\t}\n-\n-\t\tdo_name_lookup(\"ME\", wrap_allocator(\n-\t\t\t[this](error_code const& e, char const* dst, Handler hn) {\n-\t\t\t\tset_local_endpoint(e, dst, std::move(hn));\n-\t\t\t}, std::move(h)));\n-
    relevance 0../include/libtorrent/socks5_stream.hpp:197we could bind the socket here, since we know what the target endpoint is of the proxy

    we could bind the socket here, since we know what the\n-target endpoint is of the proxy

    ../include/libtorrent/socks5_stream.hpp:197

    \t\t\t}, std::move(handler)));\n-\t}\n-\n-private:\n-\n-\ttemplate <typename Handler>\n-\tvoid name_lookup(error_code const& e, tcp::resolver::results_type ips\n-\t\t, Handler h)\n-\t{\n-\t\tCOMPLETE_ASYNC(\"socks5_stream::name_lookup\");\n-\t\tif (handle_error(e, std::move(h))) return;\n-\n-\t\tauto i = ips.begin();\n-\t\tif (!m_sock.is_open())\n-\t\t{\n-\t\t\terror_code ec;\n-\t\t\tm_sock.open(i->endpoint().protocol(), ec);\n-\t\t\tif (handle_error(ec, std::move(h))) return;\n-\t\t}\n-\n-
    \t\tADD_OUTSTANDING_ASYNC(\"socks5_stream::connected\");\n-
    \t\tm_sock.async_connect(i->endpoint(), wrap_allocator(\n-\t\t\t[this](error_code const& ec, Handler hn)\n-\t\t\t{ connected(ec, std::move(hn)); }, std::move(h)));\n-\t}\n-\n-\ttemplate <typename Handler>\n-\tvoid connected(error_code const& e, Handler h)\n-\t{\n-\t\tCOMPLETE_ASYNC(\"socks5_stream::connected\");\n-\t\tif (handle_error(e, std::move(h))) return;\n-\n-\t\tusing namespace libtorrent::aux;\n-\t\tif (m_version == 5)\n-\t\t{\n-\t\t\t// send SOCKS5 authentication methods\n-\t\t\tm_buffer.resize(m_user.empty()?3:4);\n-\t\t\tchar* p = &m_buffer[0];\n-\t\t\twrite_uint8(5, p); // SOCKS VERSION 5\n-\t\t\tif (m_user.empty())\n-\t\t\t{\n-\t\t\t\twrite_uint8(1, p); // 1 authentication method (no auth)\n-\t\t\t\twrite_uint8(0, p); // no authentication\n-\t\t\t}\n-\t\t\telse\n-\t\t\t{\n-\t\t\t\twrite_uint8(2, p); // 2 authentication methods\n-\t\t\t\twrite_uint8(0, p); // no authentication\n-\t\t\t\twrite_uint8(2, p); // username/password\n-\t\t\t}\n-\t\t\tADD_OUTSTANDING_ASYNC(\"socks5_stream::handshake1\");\n-
    relevance 0../include/libtorrent/torrent_info.hpp:729change the type to std::shared_ptr in C++17 it is used as if immutable, it cannot be const for technical reasons right now.

    change the type to std::shared_ptr in C++17\n-it is used as if immutable, it cannot be const for technical reasons\n-right now.

    ../include/libtorrent/torrent_info.hpp:729

    \n-\t\t// these are the collections from outside of the info-dict. These are\n-\t\t// owning strings, since we only keep the info-section around, these\n-\t\t// cannot be pointers into that buffer.\n-\t\tstd::vector<std::string> m_owned_collections;\n-\n-#if TORRENT_ABI_VERSION <= 2\n-\t\t// if this is a merkle torrent, this is the merkle\n-\t\t// tree. It has space for merkle_num_nodes(merkle_num_leafs(num_pieces))\n-\t\t// hashes\n-\t\taux::vector<sha1_hash> m_merkle_tree;\n-#endif\n-\n-\t\t// v2 merkle tree for each file\n-\t\t// the actual hash buffers are always divisible by 32 (sha256_hash::size())\n-\t\taux::vector<aux::vector<char>, file_index_t> m_piece_layers;\n-\n-\t\t// this is a copy of the info section from the torrent.\n-\t\t// it use maintained in this flat format in order to\n-\t\t// make it available through the metadata extension\n-
    \t\tboost::shared_array<char> m_info_section;\n-
    \n-\t\t// if a comment is found in the torrent file\n-\t\t// this will be set to that comment\n-\t\tstd::string m_comment;\n-\n-\t\t// an optional string naming the software used\n-\t\t// to create the torrent file\n-\t\tstd::string m_created_by;\n-\n-\t\t// the info section parsed. points into m_info_section\n-\t\t// parsed lazily\n-\t\tmutable bdecode_node m_info_dict;\n-\n-\t\t// if a creation date is found in the torrent file\n-\t\t// this will be set to that, otherwise it'll be\n-\t\t// 1970, Jan 1\n-\t\tstd::time_t m_creation_date = 0;\n-\n-\t\t// the hash(es) that identify this torrent\n-\t\tinfo_hash_t m_info_hash;\n-\n-\t\t// this is the offset into the m_info_section buffer to the first byte of\n-\t\t// the first SHA-1 hash\n-\t\tstd::int32_t m_piece_hashes = 0;\n-\n-\t\t// the number of bytes in m_info_section\n-\t\tstd::int32_t m_info_section_size = 0;\n-\n-\t\t// this is used when creating a torrent. If there's\n-\t\t// only one file there are cases where it's impossible\n-
    relevance 0../include/libtorrent/peer_connection_interface.hpp:51make this interface smaller!

    make this interface smaller!

    ../include/libtorrent/peer_connection_interface.hpp:51

    \n+
    relevance 0../include/libtorrent/peer_connection_interface.hpp:51make this interface smaller!

    make this interface smaller!

    ../include/libtorrent/peer_connection_interface.hpp:51

    \n */\n \n #ifndef TORRENT_PEER_CONNECTION_INTERFACE_HPP\n #define TORRENT_PEER_CONNECTION_INTERFACE_HPP\n \n #include \"libtorrent/fwd.hpp\"\n #include \"libtorrent/socket.hpp\"\n@@ -11254,140 +11380,14 @@\n \t\tvirtual stat const& statistics() const = 0;\n \t\tvirtual void get_peer_info(peer_info& p) const = 0;\n #ifndef TORRENT_DISABLE_LOGGING\n \t\tvirtual bool should_log(peer_log_alert::direction_t direction) const = 0;\n \t\tvirtual void peer_log(peer_log_alert::direction_t direction\n \t\t\t, char const* event, char const* fmt = \"\", ...) const noexcept TORRENT_FORMAT(4,5) = 0;\n #endif\n-
    relevance 0../include/libtorrent/socket_type.hpp:60move to aux

    move to aux

    ../include/libtorrent/socket_type.hpp:60

    namespace libtorrent {\n-\n-// A type describing kinds of sockets involved in various operations or events.\n-enum class socket_type_t : std::uint8_t {\n-\ttcp,\n-\tsocks5,\n-\thttp,\n-\tutp,\n-\ti2p,\n-\ttcp_ssl,\n-\tsocks5_ssl,\n-\thttp_ssl,\n-\tutp_ssl,\n-\n-#if TORRENT_ABI_VERSION <= 2\n-\tudp TORRENT_DEPRECATED_ENUM = utp,\n-#endif\n-};\n-\n-// return a short human readable name for types of socket\n-
    char const* socket_type_name(socket_type_t);\n-
    \n-}\n-\n-#endif\n-
    relevance 0../include/libtorrent/piece_picker.hpp:823should this be allocated lazily?

    should this be allocated lazily?

    ../include/libtorrent/piece_picker.hpp:823

    \t\t// download list it may live in now\n-\t\tstd::vector<downloading_piece>::iterator update_piece_state(\n-\t\t\tstd::vector<downloading_piece>::iterator dp);\n-\n-\tprivate:\n-\n-#if TORRENT_USE_ASSERTS || TORRENT_USE_INVARIANT_CHECKS\n-\t\tindex_range<download_queue_t> categories() const\n-\t\t{ return {{}, piece_picker::piece_pos::num_download_categories}; }\n-#endif\n-\n-\t\t// the following vectors are mutable because they sometimes may\n-\t\t// be updated lazily, triggered by const functions\n-\n-\t\t// this maps indices to number of peers that has this piece and\n-\t\t// index into the m_piece_info vectors.\n-\t\t// piece_pos::we_have_index means that we have the piece, so it\n-\t\t// doesn't exist in the piece_info buckets\n-\t\t// pieces with the filtered flag set doesn't have entries in\n-\t\t// the m_piece_info buckets either\n-
    \t\tmutable aux::vector<piece_pos, piece_index_t> m_piece_map;\n-
    \n-\t\t// tracks the number of bytes in a specific piece that are part of a pad\n-\t\t// file. The padding is assumed to be at the end of the piece, and the\n-\t\t// blocks covered by the pad bytes are not picked by the piece picker\n-\t\tstd::unordered_map<piece_index_t, int> m_pads_in_piece;\n-\n-\t\t// when the adjacent_piece affinity is enabled, this contains the most\n-\t\t// recent \"extents\" of adjacent pieces that have been requested from\n-\t\t// this is mutable because it's updated by functions to pick pieces, which\n-\t\t// are const. That's an efficient place to update it, since it's being\n-\t\t// traversed already.\n-\t\tmutable std::vector<piece_extent_t> m_recent_extents;\n-\n-\t\t// the number of bytes of pad file set in this piece picker\n-\t\tstd::int64_t m_num_pad_bytes = 0;\n-\n-\t\t// the number of pad blocks that we already have\n-\t\tstd::int64_t m_have_pad_bytes = 0;\n-\n-\t\t// the number of pad blocks part of filtered pieces we don't have\n-\t\tstd::int64_t m_filtered_pad_bytes = 0;\n-\n-\t\t// the number of pad blocks we have that are also filtered\n-\t\tstd::int64_t m_have_filtered_pad_bytes = 0;\n-\n-\t\t// the number of seeds. These are not added to\n-\t\t// the availability counters of the pieces\n-\t\tint m_seeds = 0;\n-\n-\t\t// this vector contains all piece indices that are pickable\n-
    relevance 0../include/libtorrent/piece_picker.hpp:895it would be more intuitive to account \"wanted\" pieces instead of filtered

    it would be more intuitive to account \"wanted\" pieces\n-instead of filtered

    ../include/libtorrent/piece_picker.hpp:895

    \n-\t\t// this holds the information of the blocks in partially downloaded\n-\t\t// pieces. the downloading_piece::info index point into this vector for\n-\t\t// its storage\n-\t\taux::vector<block_info> m_block_info;\n-\n-\t\t// these are block ranges in m_block_info that are free. The numbers\n-\t\t// in here, when multiplied by blocks_per_piece is the index to the\n-\t\t// first block in the range that's free to use by a new downloading_piece.\n-\t\t// this is a free-list.\n-\t\tstd::vector<std::uint16_t> m_free_block_infos;\n-\n-\t\tstd::uint16_t m_blocks_in_last_piece = 0;\n-\t\tint m_piece_size = 0;\n-\t\tstd::int64_t m_total_size = 0;\n-\n-\t\t// the number of filtered pieces that we don't already\n-\t\t// have. total_number_of_pieces - number_of_pieces_we_have\n-\t\t// - num_filtered is supposed to the number of pieces\n-\t\t// we still want to download\n-
    \t\tint m_num_filtered = 0;\n-
    \n-\t\t// the number of pieces we have that also are filtered\n-\t\tint m_num_have_filtered = 0;\n-\n-\t\t// we have all pieces in the range [0, m_cursor)\n-\t\t// m_cursor is the first piece we don't have\n-\t\tpiece_index_t m_cursor{0};\n-\n-\t\t// we have all pieces in the range [m_reverse_cursor, end)\n-\t\t// m_reverse_cursor is the first piece where we also have\n-\t\t// all the subsequent pieces\n-\t\tpiece_index_t m_reverse_cursor{0};\n-\n-\t\t// the number of pieces we have (i.e. passed hash check).\n-\t\t// This includes pieces that we have filtered but still have\n-\t\tint m_num_have = 0;\n-\n-\t\t// if this is set to true, it means update_pieces()\n-\t\t// has to be called before accessing m_pieces.\n-\t\tmutable bool m_dirty = false;\n-\tpublic:\n-\n-\t\tenum { max_pieces = (std::numeric_limits<int>::max)() - 1 };\n-\n-\t};\n-}\n-\n-#endif // TORRENT_PIECE_PICKER_HPP_INCLUDED\n
    relevance 0../include/libtorrent/kademlia/item.hpp:61since this is a public function, it should probably be moved out of this header and into one with other public functions.

    since this is a public function, it should probably be moved\n out of this header and into one with other public functions.

    ../include/libtorrent/kademlia/item.hpp:61

    #include <libtorrent/span.hpp>\n #include <libtorrent/kademlia/types.hpp>\n \n namespace libtorrent {\n namespace dht {\n \n@@ -11621,66 +11621,107 @@\n \t\t\tint m_peak_up_rate = 0;\n #endif\n \n \t\t\tvoid on_tick(error_code const& e);\n \n \t\t\tvoid try_connect_more_peers();\n \t\t\tvoid auto_manage_checking_torrents(std::vector<torrent*>& list\n-
    relevance 0../include/libtorrent/aux_/allocating_handler.hpp:316in C++17, Handler and Storage could just use \"auto\"

    in C++17, Handler and Storage could just use \"auto\"

    ../include/libtorrent/aux_/allocating_handler.hpp:316

    \n-\tprivate:\n+
    relevance 0../include/libtorrent/aux_/deprecated.hpp:47figure out which version of clang this is supported in

    figure out which version of clang this is supported in

    ../include/libtorrent/aux_/deprecated.hpp:47

    CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n+POSSIBILITY OF SUCH DAMAGE.\n \n-\t\tHandler handler;\n-\t\thandler_storage<Size, Name>* storage;\n-#ifndef BOOST_NO_EXCEPTIONS\n-\t\terror_handler_interface* error_handler;\n+*/\n+\n+#ifndef TORRENT_DEPRECATED_HPP_INCLUDED\n+#define TORRENT_DEPRECATED_HPP_INCLUDED\n+\n+#if !defined TORRENT_BUILDING_LIBRARY\n+# define TORRENT_DEPRECATED [[deprecated]]\n+#else\n+# define TORRENT_DEPRECATED\n #endif\n-\t};\n \n-\ttemplate <class Handler, size_t Size, HandlerName Name>\n-\taux::allocating_handler<Handler, Size, Name>\n-\tmake_handler(Handler handler\n-\t\t, handler_storage<Size, Name>& storage\n-\t\t, error_handler_interface& err_handler)\n-\t{\n-\t\treturn aux::allocating_handler<Handler, Size, Name>(\n-\t\t\tstd::forward<Handler>(handler), &storage, &err_handler);\n-\t}\n+#if defined __clang__\n \n-
    \ttemplate <typename T\n-
    \t\t, typename HandlerType\n-\t\t, HandlerType Handler\n-\t\t, void (T::*ErrorHandler)(error_code const&)\n-\t\t, void (T::*ExceptHandler)(std::exception const&)\n-\t\t, typename StorageType\n-\t\t, StorageType T::* Storage>\n-\tstruct handler\n-\t{\n-\t\texplicit handler(std::shared_ptr<T> p) : ptr_(std::move(p)) {}\n+// ====== CLANG ========\n \n-\t\tstd::shared_ptr<T> ptr_;\n+# if !defined TORRENT_BUILDING_LIBRARY\n+
    # define TORRENT_DEPRECATED_ENUM __attribute__ ((deprecated))\n+
    # endif\n \n-\t\ttemplate <class... A>\n-\t\tvoid operator()(A&&... a)\n-\t\t{\n-#ifdef BOOST_NO_EXCEPTIONS\n-\t\t\t(ptr_.get()->*Handler)(std::forward<A>(a)...);\n-#else\n-\t\t\ttry\n-\t\t\t{\n-\t\t\t\t(ptr_.get()->*Handler)(std::forward<A>(a)...);\n-\t\t\t}\n-\t\t\tcatch (system_error const& e)\n-\t\t\t{\n-\t\t\t\t(ptr_.get()->*ErrorHandler)(e.code());\n-\t\t\t}\n-\t\t\tcatch (std::exception const& e)\n-\t\t\t{\n-\t\t\t\t(ptr_.get()->*ExceptHandler)(e);\n-\t\t\t}\n-
    relevance 0../include/libtorrent/aux_/announce_entry.hpp:74include the number of peers received from this tracker, at last announce

    include the number of peers received from this tracker, at last\n+#elif defined __GNUC__\n+\n+// ======== GCC ========\n+\n+// deprecation markup is only enabled when libtorrent\n+// headers are included by clients, not while building\n+// libtorrent itself\n+# if __GNUC__ >= 6 && !defined TORRENT_BUILDING_LIBRARY\n+# define TORRENT_DEPRECATED_ENUM __attribute__ ((deprecated))\n+# endif\n+\n+#endif\n+\n+#ifndef TORRENT_DEPRECATED_ENUM\n+#define TORRENT_DEPRECATED_ENUM\n+#endif\n+\n+#endif\n+

    relevance 0../include/libtorrent/aux_/session_interface.hpp:212it would be nice to not have this be part of session_interface

    it would be nice to not have this be part of session_interface

    ../include/libtorrent/aux_/session_interface.hpp:212

    \t\tvirtual void deferred_submit_jobs() = 0;\n+\n+\t\tvirtual std::uint16_t listen_port() const = 0;\n+\t\tvirtual std::uint16_t ssl_listen_port() const = 0;\n+\n+\t\tvirtual int listen_port(aux::transport ssl, address const& local_addr) = 0;\n+\n+\t\tvirtual void for_each_listen_socket(std::function<void(aux::listen_socket_handle const&)> f) = 0;\n+\n+\t\t// ask for which interface and port to bind outgoing peer connections on\n+\t\tvirtual tcp::endpoint bind_outgoing_socket(socket_type& s, address const&\n+\t\t\tremote_address, error_code& ec) const = 0;\n+\t\tvirtual bool verify_bound_address(address const& addr, bool utp\n+\t\t\t, error_code& ec) = 0;\n+\n+#ifndef TORRENT_DISABLE_MUTABLE_TORRENTS\n+\t\tvirtual std::vector<std::shared_ptr<torrent>> find_collection(\n+\t\t\tstd::string const& collection) const = 0;\n+#endif\n+\n+
    \t\tvirtual proxy_settings proxy() const = 0;\n+
    \n+#if TORRENT_USE_I2P\n+\t\tvirtual char const* i2p_session() const = 0;\n+\t\tvirtual std::string const& local_i2p_endpoint() const = 0;\n+#endif\n+\n+\t\tvirtual void prioritize_connections(std::weak_ptr<torrent> t) = 0;\n+\n+\t\tvirtual void trigger_auto_manage() = 0;\n+\n+\t\tvirtual void apply_settings_pack(std::shared_ptr<settings_pack> pack) = 0;\n+\t\tvirtual session_settings const& settings() const = 0;\n+\n+\t\tvirtual void queue_tracker_request(tracker_request req\n+\t\t\t, std::weak_ptr<request_callback> c) = 0;\n+\n+\t\t// peer-classes\n+\t\tvirtual void set_peer_classes(peer_class_set* s, address const& a, socket_type_t st) = 0;\n+\t\tvirtual peer_class_pool const& peer_classes() const = 0;\n+\t\tvirtual peer_class_pool& peer_classes() = 0;\n+\t\tvirtual bool ignore_unchoke_slots_set(peer_class_set const& set) const = 0;\n+\t\tvirtual int copy_pertinent_channels(peer_class_set const& set\n+\t\t\t, int channel, bandwidth_channel** dst, int m) = 0;\n+\t\tvirtual int use_quota_overhead(peer_class_set& set, int amount_down, int amount_up) = 0;\n+\n+\t\tvirtual bandwidth_manager* get_bandwidth_manager(int channel) = 0;\n+\n+\t\tvirtual void sent_bytes(int bytes_payload, int bytes_protocol) = 0;\n+\t\tvirtual void received_bytes(int bytes_payload, int bytes_protocol) = 0;\n+\t\tvirtual void trancieve_ip_packet(int bytes, bool ipv6) = 0;\n+
    relevance 0../include/libtorrent/aux_/announce_entry.hpp:74include the number of peers received from this tracker, at last announce

    include the number of peers received from this tracker, at last\n announce

    ../include/libtorrent/aux_/announce_entry.hpp:74

    namespace aux {\n \n \tstruct TORRENT_EXTRA_EXPORT announce_infohash\n \t{\n \t\tannounce_infohash();\n \n \t\t// if this tracker has returned an error or warning message\n@@ -11724,15 +11765,66 @@\n \t\t// set to true when we get a valid response from an announce\n \t\t// with event=started. If it is set, we won't send start in the subsequent\n \t\t// announces.\n \t\tbool start_sent : 1;\n \n \t\t// set to true when we send a event=completed.\n \t\tbool complete_sent : 1;\n-
    relevance 0../include/libtorrent/aux_/pool.hpp:49ensure the alignment is good here

    ensure the alignment is good here

    ../include/libtorrent/aux_/pool.hpp:49

    POSSIBILITY OF SUCH DAMAGE.\n+
    relevance 0../include/libtorrent/aux_/allocating_handler.hpp:316in C++17, Handler and Storage could just use \"auto\"

    in C++17, Handler and Storage could just use \"auto\"

    ../include/libtorrent/aux_/allocating_handler.hpp:316

    \n+\tprivate:\n+\n+\t\tHandler handler;\n+\t\thandler_storage<Size, Name>* storage;\n+#ifndef BOOST_NO_EXCEPTIONS\n+\t\terror_handler_interface* error_handler;\n+#endif\n+\t};\n+\n+\ttemplate <class Handler, size_t Size, HandlerName Name>\n+\taux::allocating_handler<Handler, Size, Name>\n+\tmake_handler(Handler handler\n+\t\t, handler_storage<Size, Name>& storage\n+\t\t, error_handler_interface& err_handler)\n+\t{\n+\t\treturn aux::allocating_handler<Handler, Size, Name>(\n+\t\t\tstd::forward<Handler>(handler), &storage, &err_handler);\n+\t}\n+\n+
    \ttemplate <typename T\n+
    \t\t, typename HandlerType\n+\t\t, HandlerType Handler\n+\t\t, void (T::*ErrorHandler)(error_code const&)\n+\t\t, void (T::*ExceptHandler)(std::exception const&)\n+\t\t, typename StorageType\n+\t\t, StorageType T::* Storage>\n+\tstruct handler\n+\t{\n+\t\texplicit handler(std::shared_ptr<T> p) : ptr_(std::move(p)) {}\n+\n+\t\tstd::shared_ptr<T> ptr_;\n+\n+\t\ttemplate <class... A>\n+\t\tvoid operator()(A&&... a)\n+\t\t{\n+#ifdef BOOST_NO_EXCEPTIONS\n+\t\t\t(ptr_.get()->*Handler)(std::forward<A>(a)...);\n+#else\n+\t\t\ttry\n+\t\t\t{\n+\t\t\t\t(ptr_.get()->*Handler)(std::forward<A>(a)...);\n+\t\t\t}\n+\t\t\tcatch (system_error const& e)\n+\t\t\t{\n+\t\t\t\t(ptr_.get()->*ErrorHandler)(e.code());\n+\t\t\t}\n+\t\t\tcatch (std::exception const& e)\n+\t\t\t{\n+\t\t\t\t(ptr_.get()->*ExceptHandler)(e);\n+\t\t\t}\n+
    relevance 0../include/libtorrent/aux_/pool.hpp:49ensure the alignment is good here

    ensure the alignment is good here

    ../include/libtorrent/aux_/pool.hpp:49

    POSSIBILITY OF SUCH DAMAGE.\n \n */\n \n #ifndef TORRENT_POOL_HPP\n #define TORRENT_POOL_HPP\n \n #include \"libtorrent/aux_/disable_warnings_push.hpp\"\n@@ -11759,15 +11851,66 @@\n template <typename T>\n using object_pool = boost::object_pool<T, allocator_new_delete>;\n \n }\n }\n \n #endif\n-
    relevance 0../include/libtorrent/aux_/merkle_tree.hpp:85remove this constructor. Don't support \"uninitialized\" trees. This also requires not constructing these for pad-files and small files as well. So, a sparse hash list in torrent_info

    remove this constructor. Don't support \"uninitialized\" trees. This\n+

    relevance 0../include/libtorrent/aux_/utp_stream.hpp:693it would be nice to make this private

    it would be nice to make this private

    ../include/libtorrent/aux_/utp_stream.hpp:693

    \tbool consume_incoming_data(\n+\t\tutp_header const* ph, std::uint8_t const* ptr, int payload_size, time_point now);\n+\tvoid update_mtu_limits();\n+\tvoid experienced_loss(std::uint32_t seq_nr, time_point now);\n+\n+\tvoid send_deferred_ack();\n+\tvoid socket_drained();\n+\n+\tvoid set_userdata(utp_stream* s) { m_userdata = s; }\n+\tvoid abort();\n+\tudp::endpoint remote_endpoint() const;\n+\n+\tstd::uint16_t receive_id() const { return m_recv_id; }\n+\tbool match(udp::endpoint const& ep, std::uint16_t id) const;\n+\n+\t// non-copyable\n+\tutp_socket_impl(utp_socket_impl const&) = delete;\n+\tutp_socket_impl const& operator=(utp_socket_impl const&) = delete;\n+\n+\t// The underlying UDP socket this uTP socket is bound to\n+
    \tstd::weak_ptr<utp_socket_interface> m_sock;\n+
    \n+\tvoid add_write_buffer(void const* buf, int len);\n+\tvoid add_read_buffer(void* buf, int len);\n+\n+\tint send_delay() const { return m_send_delay; }\n+\tint recv_delay() const { return m_recv_delay; }\n+\n+\tvoid issue_read();\n+\tvoid issue_write();\n+\tvoid subscribe_writeable();\n+\n+\tbool check_fin_sent() const;\n+\n+\tvoid do_connect(tcp::endpoint const& ep);\n+\n+\tstd::size_t read_some(bool const clear_buffers, error_code& ec);\n+\tstd::size_t write_some(bool const clear_buffers); // Warning: non-blocking\n+\tint receive_buffer_size() const { return m_receive_buffer_size; }\n+\n+\tbool null_buffers() const { return m_null_buffers; }\n+\n+private:\n+\n+\t// it's important that these match the enums in performance_counters for\n+\t// num_utp_idle etc.\n+\tenum class state_t {\n+\t\t// not yet connected\n+\t\tnone,\n+\t\t// sent a syn packet, not received any acks\n+\t\tsyn_sent,\n+
    relevance 0../include/libtorrent/aux_/merkle_tree.hpp:85remove this constructor. Don't support \"uninitialized\" trees. This also requires not constructing these for pad-files and small files as well. So, a sparse hash list in torrent_info

    remove this constructor. Don't support \"uninitialized\" trees. This\n also requires not constructing these for pad-files and small files as\n well. So, a sparse hash list in torrent_info

    ../include/libtorrent/aux_/merkle_tree.hpp:85

    // The invariant of the tree is that all interior nodes (i.e. all but the very\n // bottom leaf nodes, representing block hashes) are either set and valid, or\n // clear. No invalid hashes are allowed, and they can only be added by also\n // providing proof of being valid.\n \n // The leaf blocks on the other hand, MAY be invalid. For instance, when adding\n@@ -11812,15 +11955,15 @@\n \n \t// returns true if the entire tree is known and verified\n \tbool is_complete() const;\n \n \t// returns true if all block hashes in the specified range have been verified\n \tbool blocks_verified(int block_idx, int num_blocks) const;\n \n-
    relevance 0../include/libtorrent/aux_/merkle_tree.hpp:175make this a std::unique_ptr

    make this a std::unique_ptr

    ../include/libtorrent/aux_/merkle_tree.hpp:175

    \n+
    relevance 0../include/libtorrent/aux_/merkle_tree.hpp:175make this a std::unique_ptr

    make this a std::unique_ptr

    ../include/libtorrent/aux_/merkle_tree.hpp:175

    \n \tint blocks_per_piece() const { return 1 << m_blocks_per_piece_log; }\n \t// the number tree levels per piece. This is 0 if the block layer is also\n \t// the piece layer.\n \tint piece_levels() const { return m_blocks_per_piece_log; }\n \n \tint block_layer_start() const;\n \tint piece_layer_start() const;\n@@ -11863,151 +12006,8 @@\n \t\t// we don't have any hashes in this tree. m_tree should be empty\n \t\t// an empty tree still always have the root hash (available as root())\n \t\tempty_tree,\n \n \t\t// in this mode, m_tree represents the full tree, including padding.\n \t\tfull_tree,\n \n-
    relevance 0../include/libtorrent/aux_/session_interface.hpp:212it would be nice to not have this be part of session_interface

    it would be nice to not have this be part of session_interface

    ../include/libtorrent/aux_/session_interface.hpp:212

    \t\tvirtual void deferred_submit_jobs() = 0;\n-\n-\t\tvirtual std::uint16_t listen_port() const = 0;\n-\t\tvirtual std::uint16_t ssl_listen_port() const = 0;\n-\n-\t\tvirtual int listen_port(aux::transport ssl, address const& local_addr) = 0;\n-\n-\t\tvirtual void for_each_listen_socket(std::function<void(aux::listen_socket_handle const&)> f) = 0;\n-\n-\t\t// ask for which interface and port to bind outgoing peer connections on\n-\t\tvirtual tcp::endpoint bind_outgoing_socket(socket_type& s, address const&\n-\t\t\tremote_address, error_code& ec) const = 0;\n-\t\tvirtual bool verify_bound_address(address const& addr, bool utp\n-\t\t\t, error_code& ec) = 0;\n-\n-#ifndef TORRENT_DISABLE_MUTABLE_TORRENTS\n-\t\tvirtual std::vector<std::shared_ptr<torrent>> find_collection(\n-\t\t\tstd::string const& collection) const = 0;\n-#endif\n-\n-
    \t\tvirtual proxy_settings proxy() const = 0;\n-
    \n-#if TORRENT_USE_I2P\n-\t\tvirtual char const* i2p_session() const = 0;\n-\t\tvirtual std::string const& local_i2p_endpoint() const = 0;\n-#endif\n-\n-\t\tvirtual void prioritize_connections(std::weak_ptr<torrent> t) = 0;\n-\n-\t\tvirtual void trigger_auto_manage() = 0;\n-\n-\t\tvirtual void apply_settings_pack(std::shared_ptr<settings_pack> pack) = 0;\n-\t\tvirtual session_settings const& settings() const = 0;\n-\n-\t\tvirtual void queue_tracker_request(tracker_request req\n-\t\t\t, std::weak_ptr<request_callback> c) = 0;\n-\n-\t\t// peer-classes\n-\t\tvirtual void set_peer_classes(peer_class_set* s, address const& a, socket_type_t st) = 0;\n-\t\tvirtual peer_class_pool const& peer_classes() const = 0;\n-\t\tvirtual peer_class_pool& peer_classes() = 0;\n-\t\tvirtual bool ignore_unchoke_slots_set(peer_class_set const& set) const = 0;\n-\t\tvirtual int copy_pertinent_channels(peer_class_set const& set\n-\t\t\t, int channel, bandwidth_channel** dst, int m) = 0;\n-\t\tvirtual int use_quota_overhead(peer_class_set& set, int amount_down, int amount_up) = 0;\n-\n-\t\tvirtual bandwidth_manager* get_bandwidth_manager(int channel) = 0;\n-\n-\t\tvirtual void sent_bytes(int bytes_payload, int bytes_protocol) = 0;\n-\t\tvirtual void received_bytes(int bytes_payload, int bytes_protocol) = 0;\n-\t\tvirtual void trancieve_ip_packet(int bytes, bool ipv6) = 0;\n-
    relevance 0../include/libtorrent/aux_/utp_stream.hpp:693it would be nice to make this private

    it would be nice to make this private

    ../include/libtorrent/aux_/utp_stream.hpp:693

    \tbool consume_incoming_data(\n-\t\tutp_header const* ph, std::uint8_t const* ptr, int payload_size, time_point now);\n-\tvoid update_mtu_limits();\n-\tvoid experienced_loss(std::uint32_t seq_nr, time_point now);\n-\n-\tvoid send_deferred_ack();\n-\tvoid socket_drained();\n-\n-\tvoid set_userdata(utp_stream* s) { m_userdata = s; }\n-\tvoid abort();\n-\tudp::endpoint remote_endpoint() const;\n-\n-\tstd::uint16_t receive_id() const { return m_recv_id; }\n-\tbool match(udp::endpoint const& ep, std::uint16_t id) const;\n-\n-\t// non-copyable\n-\tutp_socket_impl(utp_socket_impl const&) = delete;\n-\tutp_socket_impl const& operator=(utp_socket_impl const&) = delete;\n-\n-\t// The underlying UDP socket this uTP socket is bound to\n-
    \tstd::weak_ptr<utp_socket_interface> m_sock;\n-
    \n-\tvoid add_write_buffer(void const* buf, int len);\n-\tvoid add_read_buffer(void* buf, int len);\n-\n-\tint send_delay() const { return m_send_delay; }\n-\tint recv_delay() const { return m_recv_delay; }\n-\n-\tvoid issue_read();\n-\tvoid issue_write();\n-\tvoid subscribe_writeable();\n-\n-\tbool check_fin_sent() const;\n-\n-\tvoid do_connect(tcp::endpoint const& ep);\n-\n-\tstd::size_t read_some(bool const clear_buffers, error_code& ec);\n-\tstd::size_t write_some(bool const clear_buffers); // Warning: non-blocking\n-\tint receive_buffer_size() const { return m_receive_buffer_size; }\n-\n-\tbool null_buffers() const { return m_null_buffers; }\n-\n-private:\n-\n-\t// it's important that these match the enums in performance_counters for\n-\t// num_utp_idle etc.\n-\tenum class state_t {\n-\t\t// not yet connected\n-\t\tnone,\n-\t\t// sent a syn packet, not received any acks\n-\t\tsyn_sent,\n-
    relevance 0../include/libtorrent/aux_/deprecated.hpp:47figure out which version of clang this is supported in

    figure out which version of clang this is supported in

    ../include/libtorrent/aux_/deprecated.hpp:47

    CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n-POSSIBILITY OF SUCH DAMAGE.\n-\n-*/\n-\n-#ifndef TORRENT_DEPRECATED_HPP_INCLUDED\n-#define TORRENT_DEPRECATED_HPP_INCLUDED\n-\n-#if !defined TORRENT_BUILDING_LIBRARY\n-# define TORRENT_DEPRECATED [[deprecated]]\n-#else\n-# define TORRENT_DEPRECATED\n-#endif\n-\n-#if defined __clang__\n-\n-// ====== CLANG ========\n-\n-# if !defined TORRENT_BUILDING_LIBRARY\n-
    # define TORRENT_DEPRECATED_ENUM __attribute__ ((deprecated))\n-
    # endif\n-\n-#elif defined __GNUC__\n-\n-// ======== GCC ========\n-\n-// deprecation markup is only enabled when libtorrent\n-// headers are included by clients, not while building\n-// libtorrent itself\n-# if __GNUC__ >= 6 && !defined TORRENT_BUILDING_LIBRARY\n-# define TORRENT_DEPRECATED_ENUM __attribute__ ((deprecated))\n-# endif\n-\n-#endif\n-\n-#ifndef TORRENT_DEPRECATED_ENUM\n-#define TORRENT_DEPRECATED_ENUM\n-#endif\n-\n-#endif\n
    \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -454,14 +454,318 @@\n | |\n |\tauto o = rpc.allocate_observer(std::move(algo), source, node_id()); |\n |#if TORRENT_USE_ASSERTS |\n |\to->m_in_constructor = false; |\n |#endif |\n |\to->flags |= observer::flag_queried; |\n |_\b\t_\br_\bp_\bc_\b._\bi_\bn_\bv_\bo_\bk_\be_\b(_\br_\be_\bq_\b,_\b _\bs_\bo_\bu_\br_\bc_\be_\b,_\b _\bo_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b3_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b4_\b1_\b9_\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bw_\be_\b _\bc_\bo_\bu_\bl_\bd_\b _\bp_\br_\bo_\bb_\ba_\bb_\bl_\by_\b _\bg_\be_\bt_\b _\ba_\bw_\ba_\by_\b _\bw_\bi_\bt_\bh_\b _\bj_\bu_\bs_\bt_\b _\bs_\ba_\bv_\bi_\bn_\bg_\b _\ba_\b _\bf_\be_\bw_\b _\bf_\bi_\be_\bl_\bd_\bs_\b _\bh_\be_\br_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* w\bwe\be c\bco\bou\bul\bld\bd p\bpr\bro\bob\bba\bab\bbl\bly\by g\bge\bet\bt a\baw\bwa\bay\by w\bwi\bit\bth\bh j\bju\bus\bst\bt s\bsa\bav\bvi\bin\bng\bg a\ba f\bfe\bew\bw f\bfi\bie\bel\bld\bds\bs h\bhe\ber\bre\be *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:4\b41\b19\b9 *\b**\b**\b* |\n+|// --- V2 HASHES --- |\n+| |\n+|\t\tif (m_torrent_file->is_valid() && m_torrent_file->info_hashes().has_v2()) |\n+|\t\t{ |\n+|\t\t\tif (!p.merkle_trees.empty()) |\n+|\t\t\t\tload_merkle_trees( |\n+|\t\t\t\t\tstd::move(p.merkle_trees) |\n+|\t\t\t\t\t, std::move(p.merkle_tree_mask) |\n+|\t\t\t\t\t, std::move(p.verified_leaf_hashes)); |\n+| |\n+|\t\t\t// we really don't want to store extra copies of the trees |\n+|\t\t\tTORRENT_ASSERT(p.merkle_trees.empty()); |\n+|\t\t} |\n+| |\n+|\t\tif (valid_metadata()) |\n+|\t\t{ |\n+|\t\t\tinc_stats_counter(counters::num_total_pieces_added |\n+|\t\t\t\t, m_torrent_file->num_pieces()); |\n+|\t\t} |\n+| |\n+|m_add_torrent_params = std::make_unique(std::move(p)); |\n+|} |\n+| |\n+|\tvoid torrent::load_merkle_trees( |\n+|\t\taux::vector, file_index_t> trees_import |\n+|\t\t, aux::vector, file_index_t> mask |\n+|\t\t, aux::vector, file_index_t> verified) |\n+|\t{ |\n+|\t\tauto const& fs = m_torrent_file->orig_files(); |\n+| |\n+|\t\tstd::vector const empty_verified; |\n+|\t\tfor (file_index_t i{0}; i < fs.end_file(); ++i) |\n+|\t\t{ |\n+|\t\t\tif (fs.pad_file_at(i) || fs.file_size(i) == 0) |\n+|\t\t\t\tcontinue; |\n+| |\n+|\t\t\tif (i >= trees_import.end_index()) break; |\n+|\t\t\tstd::vector const& verified_bitmask = (i >= verified.end_index()) ? empty_verified : verified[i]; |\n+|\t\t\tif (i < mask.end_index() && !mask[i].empty()) |\n+|\t\t\t{ |\n+|\t\t\t\tmask[i].resize(m_merkle_trees[i].size(), false); |\n+|\t\t\t\tm_merkle_trees[i].load_sparse_tree(trees_import[i], mask[i], verified_bitmask); |\n+|\t\t\t} |\n+|\t\t\telse |\n+|\t\t\t{ |\n+|\t\t\t\tm_merkle_trees[i].load_tree(trees_import[i], verified_bitmask); |\n+|\t\t\t} |\n+|\t\t} |\n+|\t} |\n+| |\n+|_\b\t_\bv_\bo_\bi_\bd_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\b:_\b:_\bi_\bn_\bc_\b__\bs_\bt_\ba_\bt_\bs_\b__\bc_\bo_\bu_\bn_\bt_\be_\br_\b(_\bi_\bn_\bt_\b _\bc_\b,_\b _\bi_\bn_\bt_\b _\bv_\ba_\bl_\bu_\be_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b3_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b7_\b1_\b5_\b _\b _\b _\b _\b _\b _\b _\b _\b|_\ba_\bs_\bs_\be_\br_\bt_\b _\bt_\bh_\be_\br_\be_\b _\ba_\br_\be_\b _\bn_\bo_\b _\bo_\bu_\bt_\bs_\bt_\ba_\bn_\bd_\bi_\bn_\bg_\b _\ba_\bs_\by_\bn_\bc_\b _\bo_\bp_\be_\br_\ba_\bt_\bi_\bo_\bn_\bs_\b _\bo_\bn_\b _\bt_\bh_\bi_\bs_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* a\bas\bss\bse\ber\brt\bt t\bth\bhe\ber\bre\be a\bar\bre\be n\bno\bo o\bou\but\bts\bst\bta\ban\bnd\bdi\bin\bng\bg a\bas\bsy\byn\bnc\bc o\bop\bpe\ber\bra\bat\bti\bio\bon\bns\bs o\bon\bn t\bth\bhi\bis\bs t\bto\bor\brr\bre\ben\bnt\bt *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:7\b71\b15\b5 *\b**\b**\b* |\n+|#endif |\n+| |\n+|\t\tif (!m_ses.dht()) return false; |\n+|\t\tif (m_torrent_file->is_valid() && !m_files_checked) return false; |\n+|\t\tif (!m_announce_to_dht) return false; |\n+|\t\tif (m_paused) return false; |\n+| |\n+|\t\t// don't announce private torrents |\n+|\t\tif (m_torrent_file->is_valid() && m_torrent_file->priv()) return false; |\n+|\t\tif (m_trackers.empty()) return true; |\n+|\t\tif (!settings().get_bool(settings_pack::use_dht_as_fallback)) return true; |\n+| |\n+|\t\treturn std::none_of(m_trackers.begin(), m_trackers.end() |\n+|\t\t\t, [](aux::announce_entry const& tr) { return bool(tr.verified); }); |\n+|\t} |\n+| |\n+|#endif |\n+| |\n+|\ttorrent::~torrent() |\n+|\t{ |\n+| |\n+|#if TORRENT_USE_ASSERTS |\n+|\t\tfor (torrent_list_index_t i{}; i != m_links.end_index(); ++i) |\n+|\t\t{ |\n+|\t\t\tif (!m_links[i].in_list()) continue; |\n+|\t\t\tm_links[i].unlink(m_ses.torrent_list(i), i); |\n+|\t\t} |\n+|#endif |\n+| |\n+|\t\t// The invariant can't be maintained here, since the torrent |\n+|\t\t// is being destructed, all weak references to it have been |\n+|\t\t// reset, which means that all its peers already have an |\n+|\t\t// invalidated torrent pointer (so it cannot be verified to be correct) |\n+| |\n+|\t\t// i.e. the invariant can only be maintained if all connections have |\n+|\t\t// been closed by the time the torrent is destructed. And they are |\n+|\t\t// supposed to be closed. So we can still do the invariant check. |\n+| |\n+|\t\t// however, the torrent object may be destructed from the main |\n+|\t\t// thread when shutting down, if the disk cache has references to it. |\n+|\t\t// this means that the invariant check that this is called from the |\n+|\t\t// network thread cannot be maintained |\n+| |\n+|\t\tTORRENT_ASSERT(m_peer_class == peer_class_t{0}); |\n+|\t\tTORRENT_ASSERT(m_connections.empty()); |\n+|\t\t// just in case, make sure the session accounting is kept right |\n+|\t\tfor (auto p : m_connections) |\n+|\t\t\tm_ses.close_connection(p); |\n+|\t} |\n+| |\n+|_\b\t_\bv_\bo_\bi_\bd_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\b:_\b:_\br_\be_\ba_\bd_\b__\bp_\bi_\be_\bc_\be_\b(_\bp_\bi_\be_\bc_\be_\b__\bi_\bn_\bd_\be_\bx_\b__\bt_\b _\bc_\bo_\bn_\bs_\bt_\b _\bp_\bi_\be_\bc_\be_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b3_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b1_\b3_\b3_\b1_\b _\b _\b _\b _\b _\b _\b _\b|_\bt_\bh_\be_\br_\be_\b'_\bs_\b _\bs_\bo_\bm_\be_\b _\bd_\bu_\bp_\bl_\bi_\bc_\ba_\bt_\bi_\bo_\bn_\b _\bb_\be_\bt_\bw_\be_\be_\bn_\b _\bt_\bh_\bi_\bs_\b _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn_\b _\ba_\bn_\bd_\b _\bp_\be_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b:_\b:_\bi_\bn_\bc_\bo_\bm_\bi_\bn_\bg_\b__\bp_\bi_\be_\bc_\be_\b(_\b)_\b._\b _\bi_\bs_\b _\bt_\bh_\be_\br_\be_\b _\ba_\b _\bw_\ba_\by_\b _\bt_\bo_\b _\bm_\be_\br_\bg_\be_\b _\bs_\bo_\bm_\be_\bt_\bh_\bi_\bn_\bg_\b?_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bth\bhe\ber\bre\be'\b's\bs s\bso\bom\bme\be d\bdu\bup\bpl\bli\bic\bca\bat\bti\bio\bon\bn b\bbe\bet\btw\bwe\bee\ben\bn t\bth\bhi\bis\bs f\bfu\bun\bnc\bct\bti\bio\bon\bn a\ban\bnd\bd p\bpe\bee\ber\br_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn:\b::\b:i\bin\bnc\bco\bom\bmi\bin\bng\bg_\b_p\bpi\bie\bec\bce\be(\b()\b).\b. i\bis\bs t\bth\bhe\ber\bre\be a\ba w\bwa\bay\by t\bto\bo m\bme\ber\brg\bge\be s\bso\bom\bme\bet\bth\bhi\bin\bng\bg?\b? *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:1\b13\b33\b31\b1 *\b**\b**\b* |\n+|piece_index_t m_piece; |\n+|\t\tbool m_armed = true; |\n+|\t}; |\n+| |\n+|\tvoid torrent::add_piece_async(piece_index_t const piece |\n+|\t\t, std::vector data, add_piece_flags_t const flags) |\n+|\t{ |\n+|\t\tTORRENT_ASSERT(is_single_thread()); |\n+| |\n+|\t\t// make sure the piece index is correct |\n+|\t\tif (piece >= torrent_file().end_piece()) |\n+|\t\t\treturn; |\n+| |\n+|\t\t// make sure the piece size is correct |\n+|\t\tif (data.size() != std::size_t(m_torrent_file->piece_size(piece))) |\n+|\t\t\treturn; |\n+| |\n+|\t\tadd_piece(piece, data.data(), flags); |\n+|\t} |\n+| |\n+|void torrent::add_piece(piece_index_t const piece, char const* data |\n+|, add_piece_flags_t const flags) |\n+|\t{ |\n+|\t\tTORRENT_ASSERT(is_single_thread()); |\n+| |\n+|\t\t// make sure the piece index is correct |\n+|\t\tif (piece >= torrent_file().end_piece()) |\n+|\t\t\treturn; |\n+| |\n+|\t\tint const piece_size = m_torrent_file->piece_size(piece); |\n+|\t\tint const blocks_in_piece = (piece_size + block_size() - 1) / block_size(); |\n+| |\n+|\t\tif (m_deleted) return; |\n+| |\n+|\t\t// avoid crash trying to access the picker when there is none |\n+|\t\tif (m_have_all && !has_picker()) return; |\n+| |\n+|\t\t// we don't support clobbering the piece picker while checking the |\n+|\t\t// files. We may end up having the same piece multiple times |\n+|\t\tTORRENT_ASSERT_PRECOND(state() != torrent_status::checking_files |\n+|\t\t\t&& state() != torrent_status::checking_resume_data); |\n+|\t\tif (state() == torrent_status::checking_files |\n+|\t\t\t|| state() == torrent_status::checking_resume_data) |\n+|\t\t\treturn; |\n+| |\n+|\t\tneed_picker(); |\n+| |\n+|\t\tif (picker().have_piece(piece) |\n+|\t\t\t&& !(flags & torrent_handle::overwrite_existing)) |\n+|_\b\t_\b\t_\b\t_\br_\be_\bt_\bu_\br_\bn_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b3_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b3_\b9_\b6_\b6_\b _\b _\b _\b _\b _\b _\b _\b|_\bt_\bh_\bi_\bs_\b _\bc_\bo_\bu_\bl_\bd_\b _\bp_\br_\bo_\bb_\ba_\bb_\bl_\by_\b _\bb_\be_\b _\bp_\bu_\bl_\bl_\be_\bd_\b _\bo_\bu_\bt_\b _\bi_\bn_\bt_\bo_\b _\ba_\b _\bf_\br_\be_\be_\b _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs c\bco\bou\bul\bld\bd p\bpr\bro\bob\bba\bab\bbl\bly\by b\bbe\be p\bpu\bul\bll\ble\bed\bd o\bou\but\bt i\bin\bnt\bto\bo a\ba f\bfr\bre\bee\be f\bfu\bun\bnc\bct\bti\bio\bon\bn *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:3\b39\b96\b66\b6 *\b**\b**\b* |\n+|std::int64_t calc_bytes(file_storage const& fs, piece_count const& pc) |\n+|\t{ |\n+|\t\t// it's an impossible combination to have 0 pieces, but still have one of them be the last piece |\n+|\t\tTORRENT_ASSERT(!(pc.num_pieces == 0 && pc.last_piece == true)); |\n+| |\n+|\t\t// if we have 0 pieces, we can't have any pad blocks either |\n+|\t\tTORRENT_ASSERT(!(pc.num_pieces == 0 && pc.pad_bytes > 0)); |\n+| |\n+|\t\t// if we have all pieces, we must also have the last one |\n+|\t\tTORRENT_ASSERT(!(pc.num_pieces == fs.num_pieces() && pc.last_piece == false)); |\n+| |\n+|\t\t// every block should not be a pad block |\n+|\t\tTORRENT_ASSERT(pc.pad_bytes <= std::int64_t(pc.num_pieces) * fs.piece_length()); |\n+| |\n+|\t\treturn std::int64_t(pc.num_pieces) * fs.piece_length() |\n+|\t\t\t- (pc.last_piece ? fs.piece_length() - fs.piece_size(fs.last_piece()) : 0) |\n+|\t\t\t- std::int64_t(pc.pad_bytes); |\n+|\t} |\n+| |\n+|\t// fills in total_wanted, total_wanted_done and total_done |\n+|void torrent::bytes_done(torrent_status& st, status_flags_t const flags) const |\n+|{ |\n+|\t\tINVARIANT_CHECK; |\n+| |\n+|\t\tst.total_done = 0; |\n+|\t\tst.total_wanted_done = 0; |\n+|\t\tst.total_wanted = m_size_on_disk; |\n+| |\n+|\t\tTORRENT_ASSERT(st.total_wanted <= m_torrent_file->total_size()); |\n+|\t\tTORRENT_ASSERT(st.total_wanted >= 0); |\n+| |\n+|\t\tTORRENT_ASSERT(!valid_metadata() || m_torrent_file->num_pieces() > 0); |\n+|\t\tif (!valid_metadata()) return; |\n+| |\n+|\t\tif (m_seed_mode || is_seed()) |\n+|\t\t{ |\n+|\t\t\t// once we're a seed and remove the piece picker, we stop tracking |\n+|\t\t\t// piece- and file priority. We consider everything as being |\n+|\t\t\t// \"wanted\" |\n+|\t\t\tst.total_done = m_torrent_file->total_size() - m_padding_bytes; |\n+|\t\t\tst.total_wanted_done = m_size_on_disk; |\n+|\t\t\tst.total_wanted = m_size_on_disk; |\n+|\t\t\tTORRENT_ASSERT(st.total_wanted <= st.total_done); |\n+|\t\t\tTORRENT_ASSERT(st.total_wanted_done <= st.total_wanted); |\n+|\t\t\tTORRENT_ASSERT(st.total_done <= m_torrent_file->total_size()); |\n+|\t\t\treturn; |\n+|\t\t} |\n+|\t\telse if (!has_picker()) |\n+|\t\t{ |\n+|\t\t\tst.total_done = 0; |\n+|_\b\t_\b\t_\b\t_\bs_\bt_\b._\bt_\bo_\bt_\ba_\bl_\b__\bw_\ba_\bn_\bt_\be_\bd_\b__\bd_\bo_\bn_\be_\b _\b=_\b _\b0_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b3_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b4_\b9_\b0_\b5_\b _\b _\b _\b _\b _\b _\b _\b|_\bs_\bh_\bo_\bu_\bl_\bd_\b _\bt_\bh_\bi_\bs_\b _\ba_\bl_\be_\br_\bt_\b _\bh_\ba_\bv_\be_\b _\ba_\bn_\b _\be_\br_\br_\bo_\br_\b _\bc_\bo_\bd_\be_\b _\bi_\bn_\b _\bi_\bt_\b?_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* s\bsh\bho\bou\bul\bld\bd t\bth\bhi\bis\bs a\bal\ble\ber\brt\bt h\bha\bav\bve\be a\ban\bn e\ber\brr\bro\bor\br c\bco\bod\bde\be i\bin\bn i\bit\bt?\b? *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:4\b49\b90\b05\b5 *\b**\b**\b* |\n+|on_remove_peers(); |\n+|\t\tTORRENT_ASSERT(m_connections.empty()); |\n+| |\n+|\t\t// post a message to the main thread to destruct |\n+|\t\t// the torrent object from there |\n+|\t\tif (m_storage) |\n+|\t\t{ |\n+|\t\t\ttry { |\n+|\t\t\t\tm_ses.disk_thread().async_stop_torrent(m_storage |\n+|\t\t\t\t\t, std::bind(&torrent::on_torrent_aborted, shared_from_this())); |\n+|\t\t\t} |\n+|\t\t\tcatch (std::exception const& e) |\n+|\t\t\t{ |\n+|\t\t\t\tTORRENT_UNUSED(e); |\n+|\t\t\t\tm_storage.reset(); |\n+|#ifndef TORRENT_DISABLE_LOGGING |\n+|\t\t\t\tdebug_log(\"Failed to flush disk cache: %s\", e.what()); |\n+|#endif |\n+|\t\t\t\t// clients may rely on this alert to be posted, so it's probably a |\n+|\t\t\t\t// good idea to post it here, even though we failed |\n+|if (alerts().should_post()) |\n+|alerts().emplace_alert(get_handle()); |\n+|\t\t\t} |\n+|\t\t\tm_ses.deferred_submit_jobs(); |\n+|\t\t} |\n+|\t\telse |\n+|\t\t{ |\n+|\t\t\tif (alerts().should_post()) |\n+|\t\t\t\talerts().emplace_alert(get_handle()); |\n+|\t\t\talerts().emplace_alert(get_handle() |\n+|\t\t\t\t, info_hash(), get_userdata()); |\n+|_\b\t_\b\t_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b3_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b4_\b9_\b7_\b5_\b _\b _\b _\b _\b _\b _\b _\b|_\bt_\bh_\bi_\bs_\b _\bs_\bh_\bo_\bu_\bl_\bd_\b _\br_\be_\bt_\bu_\br_\bn_\b _\bo_\bp_\bt_\bi_\bo_\bn_\ba_\bl_\b<_\b>_\b._\b _\bp_\bi_\be_\bc_\be_\b _\bi_\bn_\bd_\be_\bx_\b _\b-_\b1_\b _\bs_\bh_\bo_\bu_\bl_\bd_\b _\bn_\bo_\bt_\b _\bb_\be_\b _\ba_\bl_\bl_\bo_\bw_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs s\bsh\bho\bou\bul\bld\bd r\bre\bet\btu\bur\brn\bn o\bop\bpt\bti\bio\bon\bna\bal\bl<\b<>\b>.\b. p\bpi\bie\bec\bce\be i\bin\bnd\bde\bex\bx -\b-1\b1 s\bsh\bho\bou\bul\bld\bd n\bno\bot\bt b\bbe\be a\bal\bll\blo\bow\bwe\bed\bd *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:4\b49\b97\b75\b5 *\b**\b**\b* |\n+|} |\n+| |\n+|#ifndef TORRENT_DISABLE_SUPERSEEDING |\n+|\tvoid torrent::set_super_seeding(bool const on) |\n+|\t{ |\n+|\t\tif (on == m_super_seeding) return; |\n+| |\n+|\t\tm_super_seeding = on; |\n+|\t\tset_need_save_resume(torrent_handle::if_state_changed); |\n+|\t\tstate_updated(); |\n+| |\n+|\t\tif (m_super_seeding) return; |\n+| |\n+|\t\t// disable super seeding for all peers |\n+|\t\tfor (auto pc : *this) |\n+|\t\t{ |\n+|\t\t\tpc->superseed_piece(piece_index_t(-1), piece_index_t(-1)); |\n+|\t\t} |\n+|\t} |\n+| |\n+|piece_index_t torrent::get_piece_to_super_seed(typed_bitfield const& bits) |\n+|{ |\n+|\t\t// return a piece with low availability that is not in |\n+|\t\t// the bitfield and that is not currently being super |\n+|\t\t// seeded by any peer |\n+|\t\tTORRENT_ASSERT(m_super_seeding); |\n+| |\n+|\t\t// do a linear search from the first piece |\n+|\t\tint min_availability = 9999; |\n+|\t\tstd::vector avail_vec; |\n+|\t\tfor (auto const i : m_torrent_file->piece_range()) |\n+|\t\t{ |\n+|\t\t\tif (bits[i]) continue; |\n+| |\n+|\t\t\tint availability = 0; |\n+|\t\t\tfor (auto pc : *this) |\n+|\t\t\t{ |\n+|\t\t\t\tif (pc->super_seeded_piece(i)) |\n+|\t\t\t\t{ |\n+|\t\t\t\t\t// avoid super-seeding the same piece to more than one |\n+|\t\t\t\t\t// peer if we can avoid it. Do this by artificially |\n+|\t\t\t\t\t// increase the availability |\n+|\t\t\t\t\tavailability = 999; |\n+|\t\t\t\t\tbreak; |\n+|\t\t\t\t} |\n+|\t\t\t\tif (pc->has_piece(i)) ++availability; |\n+|\t\t\t} |\n+|\t\t\tif (availability > min_availability) continue; |\n+|\t\t\tif (availability == min_availability) |\n+|\t\t\t{ |\n+|_\b\t_\b\t_\b\t_\b\t_\ba_\bv_\ba_\bi_\bl_\b__\bv_\be_\bc_\b._\bp_\bu_\bs_\bh_\b__\bb_\ba_\bc_\bk_\b(_\bi_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |relevance\u00a03|_\b._\b._\b/_\bs_\br_\bc_\b/ |this should be an optional, piece index -1 should not be allowed |\n |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bw_\be_\bb_\b__\bp_\be_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b._\bc_\bp_\bp_\b:_\b1_\b9_\b9_\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs s\bsh\bho\bou\bul\bld\bd b\bbe\be a\ban\bn o\bop\bpt\bti\bio\bon\bna\bal\bl,\b, p\bpi\bie\bec\bce\be i\bin\bnd\bde\bex\bx -\b-1\b1 s\bsh\bho\bou\bul\bld\bd n\bno\bot\bt b\bbe\be a\bal\bll\blo\bow\bwe\bed\bd *\b**\b**\b**\b**\b* |\n |*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/w\bwe\beb\bb_\b_p\bpe\bee\ber\br_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn.\b.c\bcp\bpp\bp:\b:1\b19\b99\b9 *\b**\b**\b* |\n |\t\t\tauto const range = aux::file_piece_range_inclusive(fs, i); |\n |\t\t\tfor (piece_index_t k = std::get<0>(range); k < std::get<1>(range); ++k) |\n |\t\t\t\thave.clear_bit(k); |\n@@ -1038,318 +1342,14 @@\n |\t\t\t\talerts.emplace_alert(pk.bytes, sig.bytes |\n |\t\t\t\t\t, std::move(salt), seq.value, num); |\n |\t\t\t} |\n |\t\t} |\n | |\n |\t\tvoid put_mutable_callback(dht::item& i |\n |_\b\t_\b\t_\b\t_\b,_\b _\bs_\bt_\bd_\b:_\b:_\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn_\b<_\bv_\bo_\bi_\bd_\b(_\be_\bn_\bt_\br_\by_\b&_\b,_\b _\bs_\bt_\bd_\b:_\b:_\ba_\br_\br_\ba_\by_\b<_\bc_\bh_\ba_\br_\b,_\b _\b6_\b4_\b>_\b&_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b3_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b4_\b1_\b9_\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bw_\be_\b _\bc_\bo_\bu_\bl_\bd_\b _\bp_\br_\bo_\bb_\ba_\bb_\bl_\by_\b _\bg_\be_\bt_\b _\ba_\bw_\ba_\by_\b _\bw_\bi_\bt_\bh_\b _\bj_\bu_\bs_\bt_\b _\bs_\ba_\bv_\bi_\bn_\bg_\b _\ba_\b _\bf_\be_\bw_\b _\bf_\bi_\be_\bl_\bd_\bs_\b _\bh_\be_\br_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* w\bwe\be c\bco\bou\bul\bld\bd p\bpr\bro\bob\bba\bab\bbl\bly\by g\bge\bet\bt a\baw\bwa\bay\by w\bwi\bit\bth\bh j\bju\bus\bst\bt s\bsa\bav\bvi\bin\bng\bg a\ba f\bfe\bew\bw f\bfi\bie\bel\bld\bds\bs h\bhe\ber\bre\be *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:4\b41\b19\b9 *\b**\b**\b* |\n-|// --- V2 HASHES --- |\n-| |\n-|\t\tif (m_torrent_file->is_valid() && m_torrent_file->info_hashes().has_v2()) |\n-|\t\t{ |\n-|\t\t\tif (!p.merkle_trees.empty()) |\n-|\t\t\t\tload_merkle_trees( |\n-|\t\t\t\t\tstd::move(p.merkle_trees) |\n-|\t\t\t\t\t, std::move(p.merkle_tree_mask) |\n-|\t\t\t\t\t, std::move(p.verified_leaf_hashes)); |\n-| |\n-|\t\t\t// we really don't want to store extra copies of the trees |\n-|\t\t\tTORRENT_ASSERT(p.merkle_trees.empty()); |\n-|\t\t} |\n-| |\n-|\t\tif (valid_metadata()) |\n-|\t\t{ |\n-|\t\t\tinc_stats_counter(counters::num_total_pieces_added |\n-|\t\t\t\t, m_torrent_file->num_pieces()); |\n-|\t\t} |\n-| |\n-|m_add_torrent_params = std::make_unique(std::move(p)); |\n-|} |\n-| |\n-|\tvoid torrent::load_merkle_trees( |\n-|\t\taux::vector, file_index_t> trees_import |\n-|\t\t, aux::vector, file_index_t> mask |\n-|\t\t, aux::vector, file_index_t> verified) |\n-|\t{ |\n-|\t\tauto const& fs = m_torrent_file->orig_files(); |\n-| |\n-|\t\tstd::vector const empty_verified; |\n-|\t\tfor (file_index_t i{0}; i < fs.end_file(); ++i) |\n-|\t\t{ |\n-|\t\t\tif (fs.pad_file_at(i) || fs.file_size(i) == 0) |\n-|\t\t\t\tcontinue; |\n-| |\n-|\t\t\tif (i >= trees_import.end_index()) break; |\n-|\t\t\tstd::vector const& verified_bitmask = (i >= verified.end_index()) ? empty_verified : verified[i]; |\n-|\t\t\tif (i < mask.end_index() && !mask[i].empty()) |\n-|\t\t\t{ |\n-|\t\t\t\tmask[i].resize(m_merkle_trees[i].size(), false); |\n-|\t\t\t\tm_merkle_trees[i].load_sparse_tree(trees_import[i], mask[i], verified_bitmask); |\n-|\t\t\t} |\n-|\t\t\telse |\n-|\t\t\t{ |\n-|\t\t\t\tm_merkle_trees[i].load_tree(trees_import[i], verified_bitmask); |\n-|\t\t\t} |\n-|\t\t} |\n-|\t} |\n-| |\n-|_\b\t_\bv_\bo_\bi_\bd_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\b:_\b:_\bi_\bn_\bc_\b__\bs_\bt_\ba_\bt_\bs_\b__\bc_\bo_\bu_\bn_\bt_\be_\br_\b(_\bi_\bn_\bt_\b _\bc_\b,_\b _\bi_\bn_\bt_\b _\bv_\ba_\bl_\bu_\be_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b3_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b7_\b1_\b5_\b _\b _\b _\b _\b _\b _\b _\b _\b|_\ba_\bs_\bs_\be_\br_\bt_\b _\bt_\bh_\be_\br_\be_\b _\ba_\br_\be_\b _\bn_\bo_\b _\bo_\bu_\bt_\bs_\bt_\ba_\bn_\bd_\bi_\bn_\bg_\b _\ba_\bs_\by_\bn_\bc_\b _\bo_\bp_\be_\br_\ba_\bt_\bi_\bo_\bn_\bs_\b _\bo_\bn_\b _\bt_\bh_\bi_\bs_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* a\bas\bss\bse\ber\brt\bt t\bth\bhe\ber\bre\be a\bar\bre\be n\bno\bo o\bou\but\bts\bst\bta\ban\bnd\bdi\bin\bng\bg a\bas\bsy\byn\bnc\bc o\bop\bpe\ber\bra\bat\bti\bio\bon\bns\bs o\bon\bn t\bth\bhi\bis\bs t\bto\bor\brr\bre\ben\bnt\bt *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:7\b71\b15\b5 *\b**\b**\b* |\n-|#endif |\n-| |\n-|\t\tif (!m_ses.dht()) return false; |\n-|\t\tif (m_torrent_file->is_valid() && !m_files_checked) return false; |\n-|\t\tif (!m_announce_to_dht) return false; |\n-|\t\tif (m_paused) return false; |\n-| |\n-|\t\t// don't announce private torrents |\n-|\t\tif (m_torrent_file->is_valid() && m_torrent_file->priv()) return false; |\n-|\t\tif (m_trackers.empty()) return true; |\n-|\t\tif (!settings().get_bool(settings_pack::use_dht_as_fallback)) return true; |\n-| |\n-|\t\treturn std::none_of(m_trackers.begin(), m_trackers.end() |\n-|\t\t\t, [](aux::announce_entry const& tr) { return bool(tr.verified); }); |\n-|\t} |\n-| |\n-|#endif |\n-| |\n-|\ttorrent::~torrent() |\n-|\t{ |\n-| |\n-|#if TORRENT_USE_ASSERTS |\n-|\t\tfor (torrent_list_index_t i{}; i != m_links.end_index(); ++i) |\n-|\t\t{ |\n-|\t\t\tif (!m_links[i].in_list()) continue; |\n-|\t\t\tm_links[i].unlink(m_ses.torrent_list(i), i); |\n-|\t\t} |\n-|#endif |\n-| |\n-|\t\t// The invariant can't be maintained here, since the torrent |\n-|\t\t// is being destructed, all weak references to it have been |\n-|\t\t// reset, which means that all its peers already have an |\n-|\t\t// invalidated torrent pointer (so it cannot be verified to be correct) |\n-| |\n-|\t\t// i.e. the invariant can only be maintained if all connections have |\n-|\t\t// been closed by the time the torrent is destructed. And they are |\n-|\t\t// supposed to be closed. So we can still do the invariant check. |\n-| |\n-|\t\t// however, the torrent object may be destructed from the main |\n-|\t\t// thread when shutting down, if the disk cache has references to it. |\n-|\t\t// this means that the invariant check that this is called from the |\n-|\t\t// network thread cannot be maintained |\n-| |\n-|\t\tTORRENT_ASSERT(m_peer_class == peer_class_t{0}); |\n-|\t\tTORRENT_ASSERT(m_connections.empty()); |\n-|\t\t// just in case, make sure the session accounting is kept right |\n-|\t\tfor (auto p : m_connections) |\n-|\t\t\tm_ses.close_connection(p); |\n-|\t} |\n-| |\n-|_\b\t_\bv_\bo_\bi_\bd_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\b:_\b:_\br_\be_\ba_\bd_\b__\bp_\bi_\be_\bc_\be_\b(_\bp_\bi_\be_\bc_\be_\b__\bi_\bn_\bd_\be_\bx_\b__\bt_\b _\bc_\bo_\bn_\bs_\bt_\b _\bp_\bi_\be_\bc_\be_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b3_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b1_\b3_\b3_\b1_\b _\b _\b _\b _\b _\b _\b _\b|_\bt_\bh_\be_\br_\be_\b'_\bs_\b _\bs_\bo_\bm_\be_\b _\bd_\bu_\bp_\bl_\bi_\bc_\ba_\bt_\bi_\bo_\bn_\b _\bb_\be_\bt_\bw_\be_\be_\bn_\b _\bt_\bh_\bi_\bs_\b _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn_\b _\ba_\bn_\bd_\b _\bp_\be_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b:_\b:_\bi_\bn_\bc_\bo_\bm_\bi_\bn_\bg_\b__\bp_\bi_\be_\bc_\be_\b(_\b)_\b._\b _\bi_\bs_\b _\bt_\bh_\be_\br_\be_\b _\ba_\b _\bw_\ba_\by_\b _\bt_\bo_\b _\bm_\be_\br_\bg_\be_\b _\bs_\bo_\bm_\be_\bt_\bh_\bi_\bn_\bg_\b?_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bth\bhe\ber\bre\be'\b's\bs s\bso\bom\bme\be d\bdu\bup\bpl\bli\bic\bca\bat\bti\bio\bon\bn b\bbe\bet\btw\bwe\bee\ben\bn t\bth\bhi\bis\bs f\bfu\bun\bnc\bct\bti\bio\bon\bn a\ban\bnd\bd p\bpe\bee\ber\br_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn:\b::\b:i\bin\bnc\bco\bom\bmi\bin\bng\bg_\b_p\bpi\bie\bec\bce\be(\b()\b).\b. i\bis\bs t\bth\bhe\ber\bre\be a\ba w\bwa\bay\by t\bto\bo m\bme\ber\brg\bge\be s\bso\bom\bme\bet\bth\bhi\bin\bng\bg?\b? *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:1\b13\b33\b31\b1 *\b**\b**\b* |\n-|piece_index_t m_piece; |\n-|\t\tbool m_armed = true; |\n-|\t}; |\n-| |\n-|\tvoid torrent::add_piece_async(piece_index_t const piece |\n-|\t\t, std::vector data, add_piece_flags_t const flags) |\n-|\t{ |\n-|\t\tTORRENT_ASSERT(is_single_thread()); |\n-| |\n-|\t\t// make sure the piece index is correct |\n-|\t\tif (piece >= torrent_file().end_piece()) |\n-|\t\t\treturn; |\n-| |\n-|\t\t// make sure the piece size is correct |\n-|\t\tif (data.size() != std::size_t(m_torrent_file->piece_size(piece))) |\n-|\t\t\treturn; |\n-| |\n-|\t\tadd_piece(piece, data.data(), flags); |\n-|\t} |\n-| |\n-|void torrent::add_piece(piece_index_t const piece, char const* data |\n-|, add_piece_flags_t const flags) |\n-|\t{ |\n-|\t\tTORRENT_ASSERT(is_single_thread()); |\n-| |\n-|\t\t// make sure the piece index is correct |\n-|\t\tif (piece >= torrent_file().end_piece()) |\n-|\t\t\treturn; |\n-| |\n-|\t\tint const piece_size = m_torrent_file->piece_size(piece); |\n-|\t\tint const blocks_in_piece = (piece_size + block_size() - 1) / block_size(); |\n-| |\n-|\t\tif (m_deleted) return; |\n-| |\n-|\t\t// avoid crash trying to access the picker when there is none |\n-|\t\tif (m_have_all && !has_picker()) return; |\n-| |\n-|\t\t// we don't support clobbering the piece picker while checking the |\n-|\t\t// files. We may end up having the same piece multiple times |\n-|\t\tTORRENT_ASSERT_PRECOND(state() != torrent_status::checking_files |\n-|\t\t\t&& state() != torrent_status::checking_resume_data); |\n-|\t\tif (state() == torrent_status::checking_files |\n-|\t\t\t|| state() == torrent_status::checking_resume_data) |\n-|\t\t\treturn; |\n-| |\n-|\t\tneed_picker(); |\n-| |\n-|\t\tif (picker().have_piece(piece) |\n-|\t\t\t&& !(flags & torrent_handle::overwrite_existing)) |\n-|_\b\t_\b\t_\b\t_\br_\be_\bt_\bu_\br_\bn_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b3_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b3_\b9_\b6_\b6_\b _\b _\b _\b _\b _\b _\b _\b|_\bt_\bh_\bi_\bs_\b _\bc_\bo_\bu_\bl_\bd_\b _\bp_\br_\bo_\bb_\ba_\bb_\bl_\by_\b _\bb_\be_\b _\bp_\bu_\bl_\bl_\be_\bd_\b _\bo_\bu_\bt_\b _\bi_\bn_\bt_\bo_\b _\ba_\b _\bf_\br_\be_\be_\b _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs c\bco\bou\bul\bld\bd p\bpr\bro\bob\bba\bab\bbl\bly\by b\bbe\be p\bpu\bul\bll\ble\bed\bd o\bou\but\bt i\bin\bnt\bto\bo a\ba f\bfr\bre\bee\be f\bfu\bun\bnc\bct\bti\bio\bon\bn *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:3\b39\b96\b66\b6 *\b**\b**\b* |\n-|std::int64_t calc_bytes(file_storage const& fs, piece_count const& pc) |\n-|\t{ |\n-|\t\t// it's an impossible combination to have 0 pieces, but still have one of them be the last piece |\n-|\t\tTORRENT_ASSERT(!(pc.num_pieces == 0 && pc.last_piece == true)); |\n-| |\n-|\t\t// if we have 0 pieces, we can't have any pad blocks either |\n-|\t\tTORRENT_ASSERT(!(pc.num_pieces == 0 && pc.pad_bytes > 0)); |\n-| |\n-|\t\t// if we have all pieces, we must also have the last one |\n-|\t\tTORRENT_ASSERT(!(pc.num_pieces == fs.num_pieces() && pc.last_piece == false)); |\n-| |\n-|\t\t// every block should not be a pad block |\n-|\t\tTORRENT_ASSERT(pc.pad_bytes <= std::int64_t(pc.num_pieces) * fs.piece_length()); |\n-| |\n-|\t\treturn std::int64_t(pc.num_pieces) * fs.piece_length() |\n-|\t\t\t- (pc.last_piece ? fs.piece_length() - fs.piece_size(fs.last_piece()) : 0) |\n-|\t\t\t- std::int64_t(pc.pad_bytes); |\n-|\t} |\n-| |\n-|\t// fills in total_wanted, total_wanted_done and total_done |\n-|void torrent::bytes_done(torrent_status& st, status_flags_t const flags) const |\n-|{ |\n-|\t\tINVARIANT_CHECK; |\n-| |\n-|\t\tst.total_done = 0; |\n-|\t\tst.total_wanted_done = 0; |\n-|\t\tst.total_wanted = m_size_on_disk; |\n-| |\n-|\t\tTORRENT_ASSERT(st.total_wanted <= m_torrent_file->total_size()); |\n-|\t\tTORRENT_ASSERT(st.total_wanted >= 0); |\n-| |\n-|\t\tTORRENT_ASSERT(!valid_metadata() || m_torrent_file->num_pieces() > 0); |\n-|\t\tif (!valid_metadata()) return; |\n-| |\n-|\t\tif (m_seed_mode || is_seed()) |\n-|\t\t{ |\n-|\t\t\t// once we're a seed and remove the piece picker, we stop tracking |\n-|\t\t\t// piece- and file priority. We consider everything as being |\n-|\t\t\t// \"wanted\" |\n-|\t\t\tst.total_done = m_torrent_file->total_size() - m_padding_bytes; |\n-|\t\t\tst.total_wanted_done = m_size_on_disk; |\n-|\t\t\tst.total_wanted = m_size_on_disk; |\n-|\t\t\tTORRENT_ASSERT(st.total_wanted <= st.total_done); |\n-|\t\t\tTORRENT_ASSERT(st.total_wanted_done <= st.total_wanted); |\n-|\t\t\tTORRENT_ASSERT(st.total_done <= m_torrent_file->total_size()); |\n-|\t\t\treturn; |\n-|\t\t} |\n-|\t\telse if (!has_picker()) |\n-|\t\t{ |\n-|\t\t\tst.total_done = 0; |\n-|_\b\t_\b\t_\b\t_\bs_\bt_\b._\bt_\bo_\bt_\ba_\bl_\b__\bw_\ba_\bn_\bt_\be_\bd_\b__\bd_\bo_\bn_\be_\b _\b=_\b _\b0_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b3_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b4_\b9_\b0_\b5_\b _\b _\b _\b _\b _\b _\b _\b|_\bs_\bh_\bo_\bu_\bl_\bd_\b _\bt_\bh_\bi_\bs_\b _\ba_\bl_\be_\br_\bt_\b _\bh_\ba_\bv_\be_\b _\ba_\bn_\b _\be_\br_\br_\bo_\br_\b _\bc_\bo_\bd_\be_\b _\bi_\bn_\b _\bi_\bt_\b?_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* s\bsh\bho\bou\bul\bld\bd t\bth\bhi\bis\bs a\bal\ble\ber\brt\bt h\bha\bav\bve\be a\ban\bn e\ber\brr\bro\bor\br c\bco\bod\bde\be i\bin\bn i\bit\bt?\b? *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:4\b49\b90\b05\b5 *\b**\b**\b* |\n-|on_remove_peers(); |\n-|\t\tTORRENT_ASSERT(m_connections.empty()); |\n-| |\n-|\t\t// post a message to the main thread to destruct |\n-|\t\t// the torrent object from there |\n-|\t\tif (m_storage) |\n-|\t\t{ |\n-|\t\t\ttry { |\n-|\t\t\t\tm_ses.disk_thread().async_stop_torrent(m_storage |\n-|\t\t\t\t\t, std::bind(&torrent::on_torrent_aborted, shared_from_this())); |\n-|\t\t\t} |\n-|\t\t\tcatch (std::exception const& e) |\n-|\t\t\t{ |\n-|\t\t\t\tTORRENT_UNUSED(e); |\n-|\t\t\t\tm_storage.reset(); |\n-|#ifndef TORRENT_DISABLE_LOGGING |\n-|\t\t\t\tdebug_log(\"Failed to flush disk cache: %s\", e.what()); |\n-|#endif |\n-|\t\t\t\t// clients may rely on this alert to be posted, so it's probably a |\n-|\t\t\t\t// good idea to post it here, even though we failed |\n-|if (alerts().should_post()) |\n-|alerts().emplace_alert(get_handle()); |\n-|\t\t\t} |\n-|\t\t\tm_ses.deferred_submit_jobs(); |\n-|\t\t} |\n-|\t\telse |\n-|\t\t{ |\n-|\t\t\tif (alerts().should_post()) |\n-|\t\t\t\talerts().emplace_alert(get_handle()); |\n-|\t\t\talerts().emplace_alert(get_handle() |\n-|\t\t\t\t, info_hash(), get_userdata()); |\n-|_\b\t_\b\t_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b3_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b4_\b9_\b7_\b5_\b _\b _\b _\b _\b _\b _\b _\b|_\bt_\bh_\bi_\bs_\b _\bs_\bh_\bo_\bu_\bl_\bd_\b _\br_\be_\bt_\bu_\br_\bn_\b _\bo_\bp_\bt_\bi_\bo_\bn_\ba_\bl_\b<_\b>_\b._\b _\bp_\bi_\be_\bc_\be_\b _\bi_\bn_\bd_\be_\bx_\b _\b-_\b1_\b _\bs_\bh_\bo_\bu_\bl_\bd_\b _\bn_\bo_\bt_\b _\bb_\be_\b _\ba_\bl_\bl_\bo_\bw_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs s\bsh\bho\bou\bul\bld\bd r\bre\bet\btu\bur\brn\bn o\bop\bpt\bti\bio\bon\bna\bal\bl<\b<>\b>.\b. p\bpi\bie\bec\bce\be i\bin\bnd\bde\bex\bx -\b-1\b1 s\bsh\bho\bou\bul\bld\bd n\bno\bot\bt b\bbe\be a\bal\bll\blo\bow\bwe\bed\bd *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:4\b49\b97\b75\b5 *\b**\b**\b* |\n-|} |\n-| |\n-|#ifndef TORRENT_DISABLE_SUPERSEEDING |\n-|\tvoid torrent::set_super_seeding(bool const on) |\n-|\t{ |\n-|\t\tif (on == m_super_seeding) return; |\n-| |\n-|\t\tm_super_seeding = on; |\n-|\t\tset_need_save_resume(torrent_handle::if_state_changed); |\n-|\t\tstate_updated(); |\n-| |\n-|\t\tif (m_super_seeding) return; |\n-| |\n-|\t\t// disable super seeding for all peers |\n-|\t\tfor (auto pc : *this) |\n-|\t\t{ |\n-|\t\t\tpc->superseed_piece(piece_index_t(-1), piece_index_t(-1)); |\n-|\t\t} |\n-|\t} |\n-| |\n-|piece_index_t torrent::get_piece_to_super_seed(typed_bitfield const& bits) |\n-|{ |\n-|\t\t// return a piece with low availability that is not in |\n-|\t\t// the bitfield and that is not currently being super |\n-|\t\t// seeded by any peer |\n-|\t\tTORRENT_ASSERT(m_super_seeding); |\n-| |\n-|\t\t// do a linear search from the first piece |\n-|\t\tint min_availability = 9999; |\n-|\t\tstd::vector avail_vec; |\n-|\t\tfor (auto const i : m_torrent_file->piece_range()) |\n-|\t\t{ |\n-|\t\t\tif (bits[i]) continue; |\n-| |\n-|\t\t\tint availability = 0; |\n-|\t\t\tfor (auto pc : *this) |\n-|\t\t\t{ |\n-|\t\t\t\tif (pc->super_seeded_piece(i)) |\n-|\t\t\t\t{ |\n-|\t\t\t\t\t// avoid super-seeding the same piece to more than one |\n-|\t\t\t\t\t// peer if we can avoid it. Do this by artificially |\n-|\t\t\t\t\t// increase the availability |\n-|\t\t\t\t\tavailability = 999; |\n-|\t\t\t\t\tbreak; |\n-|\t\t\t\t} |\n-|\t\t\t\tif (pc->has_piece(i)) ++availability; |\n-|\t\t\t} |\n-|\t\t\tif (availability > min_availability) continue; |\n-|\t\t\tif (availability == min_availability) |\n-|\t\t\t{ |\n-|_\b\t_\b\t_\b\t_\b\t_\ba_\bv_\ba_\bi_\bl_\b__\bv_\be_\bc_\b._\bp_\bu_\bs_\bh_\b__\bb_\ba_\bc_\bk_\b(_\bi_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b3_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bh_\ba_\bn_\bd_\bl_\be_\b._\bc_\bp_\bp_\b:_\b6_\b9_\b1_\b _\b|_\be_\bx_\bp_\bo_\bs_\be_\b _\bt_\bh_\be_\b _\bs_\be_\bq_\bu_\be_\bn_\bc_\be_\b__\bn_\bu_\bm_\bb_\be_\br_\b,_\b _\bp_\bu_\bb_\bl_\bi_\bc_\b__\bk_\be_\by_\b,_\b _\bs_\be_\bc_\br_\be_\bt_\b__\bk_\be_\by_\b _\ba_\bn_\bd_\b _\bs_\bi_\bg_\bn_\ba_\bt_\bu_\br_\be_\b _\bt_\by_\bp_\be_\bs_\b _\bt_\bo_\b _\bt_\bh_\be_\b _\bc_\bl_\bi_\be_\bn_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |*\b**\b**\b**\b**\b* e\bex\bxp\bpo\bos\bse\be t\bth\bhe\be s\bse\beq\bqu\bue\ben\bnc\bce\be_\b_n\bnu\bum\bmb\bbe\ber\br,\b, p\bpu\bub\bbl\bli\bic\bc_\b_k\bke\bey\by,\b, s\bse\bec\bcr\bre\bet\bt_\b_k\bke\bey\by a\ban\bnd\bd s\bsi\big\bgn\bna\bat\btu\bur\bre\be t\bty\byp\bpe\bes\bs t\bto\bo t\bth\bhe\be c\bcl\bli\bie\ben\bnt\bt *\b**\b**\b**\b**\b* |\n |*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/s\bse\bes\bss\bsi\bio\bon\bn_\b_h\bha\ban\bnd\bdl\ble\be.\b.c\bcp\bpp\bp:\b:6\b69\b91\b1 *\b**\b**\b* |\n |void session_handle::dht_get_item(sha1_hash const& target) |\n |\t{ |\n |#ifndef TORRENT_DISABLE_DHT |\n |\t\tasync_call(&session_impl::dht_get_immutable_item, target); |\n@@ -1650,14 +1650,68 @@\n |\t} |\n |\telse |\n |\t{ |\n |\t\tflags &= ~flag_ipv6_address; |\n |\t\tm_addr.v4 = ep.address().to_v4().to_bytes(); |\n |\t} |\n |_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a03|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |dh_key_exchange should probably move into its own file |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bp_\be_\b__\bc_\br_\by_\bp_\bt_\bo_\b._\bh_\bp_\bp_\b:_\b7_\b2_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* d\bdh\bh_\b_k\bke\bey\by_\b_e\bex\bxc\bch\bha\ban\bng\bge\be s\bsh\bho\bou\bul\bld\bd p\bpr\bro\bob\bba\bab\bbl\bly\by m\bmo\bov\bve\be i\bin\bnt\bto\bo i\bit\bts\bs o\bow\bwn\bn f\bfi\bil\ble\be *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/p\bpe\be_\b_c\bcr\bry\byp\bpt\bto\bo.\b.h\bhp\bpp\bp:\b:7\b72\b2 *\b**\b**\b* |\n+|#include |\n+|#include |\n+|#include |\n+| |\n+|namespace libtorrent { |\n+| |\n+|\tnamespace mp = boost::multiprecision; |\n+| |\n+|\tusing key_t = mp::number>; |\n+| |\n+|\tTORRENT_EXTRA_EXPORT std::array export_key(key_t const& k); |\n+| |\n+|\t// RC4 state from libtomcrypt |\n+|\tstruct rc4 { |\n+|\t\tint x; |\n+|\t\tint y; |\n+|\t\taux::array buf; |\n+|\t}; |\n+| |\n+|class TORRENT_EXTRA_EXPORT dh_key_exchange |\n+|{ |\n+|\tpublic: |\n+|\t\tdh_key_exchange(); |\n+| |\n+|\t\t// Get local public key |\n+|\t\tkey_t const& get_local_key() const { return m_dh_local_key; } |\n+| |\n+|\t\t// read remote_pubkey, generate and store shared secret in |\n+|\t\t// m_dh_shared_secret. |\n+|\t\tvoid compute_secret(std::uint8_t const* remote_pubkey); |\n+|\t\tvoid compute_secret(key_t const& remote_pubkey); |\n+| |\n+|\t\tkey_t const& get_secret() const { return m_dh_shared_secret; } |\n+| |\n+|\t\tsha1_hash const& get_hash_xor_mask() const { return m_xor_mask; } |\n+| |\n+|\tprivate: |\n+| |\n+|\t\tkey_t m_dh_local_key; |\n+|\t\tkey_t m_dh_local_secret; |\n+|\t\tkey_t m_dh_shared_secret; |\n+|\t\tsha1_hash m_xor_mask; |\n+|\t}; |\n+| |\n+|\tstruct TORRENT_EXTRA_EXPORT encryption_handler |\n+|\t{ |\n+|\t\tstd::tuple>> |\n+|\t\tencrypt(span> iovec); |\n+| |\n+|_\b\t_\b\t_\bi_\bn_\bt_\b _\bd_\be_\bc_\br_\by_\bp_\bt_\b(_\ba_\bu_\bx_\b:_\b:_\bc_\br_\by_\bp_\bt_\bo_\b__\br_\be_\bc_\be_\bi_\bv_\be_\b__\bb_\bu_\bf_\bf_\be_\br_\b&_\b _\br_\be_\bc_\bv_\b__\bb_\bu_\bf_\bf_\be_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |relevance\u00a03|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |everything but payload counters and rates could probably be removed from here |\n |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bs_\bt_\ba_\bt_\b._\bh_\bp_\bp_\b:_\b2_\b5_\b7_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |*\b**\b**\b**\b**\b* e\bev\bve\ber\bry\byt\bth\bhi\bin\bng\bg b\bbu\but\bt p\bpa\bay\byl\blo\boa\bad\bd c\bco\bou\bun\bnt\bte\ber\brs\bs a\ban\bnd\bd r\bra\bat\bte\bes\bs c\bco\bou\bul\bld\bd p\bpr\bro\bob\bba\bab\bbl\bly\by b\bbe\be r\bre\bem\bmo\bov\bve\bed\bd f\bfr\bro\bom\bm h\bhe\ber\bre\be *\b**\b**\b**\b**\b* |\n |*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/s\bst\bta\bat\bt.\b.h\bhp\bpp\bp:\b:2\b25\b57\b7 *\b**\b**\b* |\n |// peer_connection is opened and have some previous |\n |\t\t// transfers from earlier connections. |\n |\t\tvoid add_stat(std::int64_t downloaded, std::int64_t uploaded) |\n@@ -1703,178 +1757,14 @@\n | |\n |\t\tstat_channel m_stat[num_channels]; |\n |\t}; |\n | |\n |} |\n | |\n |_\b#_\be_\bn_\bd_\bi_\bf_\b _\b/_\b/_\b _\bT_\bO_\bR_\bR_\bE_\bN_\bT_\b__\bS_\bT_\bA_\bT_\b__\bH_\bP_\bP_\b__\bI_\bN_\bC_\bL_\bU_\bD_\bE_\bD_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a03|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |factor out predictive pieces and all operations on it into a separate class (to use as member here instead) |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bh_\bp_\bp_\b:_\b1_\b4_\b2_\b3_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* f\bfa\bac\bct\bto\bor\br o\bou\but\bt p\bpr\bre\bed\bdi\bic\bct\bti\biv\bve\be p\bpi\bie\bec\bce\bes\bs a\ban\bnd\bd a\bal\bll\bl o\bop\bpe\ber\bra\bat\bti\bio\bon\bns\bs o\bon\bn i\bit\bt i\bin\bnt\bto\bo a\ba s\bse\bep\bpa\bar\bra\bat\bte\be c\bcl\bla\bas\bss\bs (\b(t\bto\bo u\bus\bse\be a\bas\bs m\bme\bem\bmb\bbe\ber\br h\bhe\ber\bre\be i\bin\bns\bst\bte\bea\bad\bd)\b) *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.h\bhp\bpp\bp:\b:1\b14\b42\b23\b3 *\b**\b**\b* |\n-|#endif |\n-| |\n-|\t\tstd::string m_trackerid; |\n-|#if TORRENT_ABI_VERSION == 1 |\n-|\t\t// deprecated in 1.1 |\n-|\t\tstd::string m_username; |\n-|\t\tstd::string m_password; |\n-|#endif |\n-| |\n-|\t\tstd::string m_save_path; |\n-| |\n-|#ifndef TORRENT_DISABLE_PREDICTIVE_PIECES |\n-|\t\t// this is a list of all pieces that we have announced |\n-|\t\t// as having, without actually having yet. If we receive |\n-|\t\t// a request for a piece in this list, we need to hold off |\n-|\t\t// on responding until we have completed the piece and |\n-|\t\t// verified its hash. If the hash fails, send reject to |\n-|\t\t// peers with outstanding requests, and dont_have to other |\n-|\t\t// peers. This vector is ordered, to make lookups fast. |\n-| |\n-|std::vector m_predictive_pieces; |\n-|#endif |\n-| |\n-|\t\t// v2 merkle tree for each file |\n-|\t\taux::vector m_merkle_trees; |\n-| |\n-|\t\t// the performance counters of this session |\n-|\t\tcounters& m_stats_counters; |\n-| |\n-|\t\t// each bit represents a piece. a set bit means |\n-|\t\t// the piece has had its hash verified. This |\n-|\t\t// is only used in seed mode (when m_seed_mode |\n-|\t\t// is true) |\n-|\t\ttyped_bitfield m_verified; |\n-| |\n-|\t\t// this means there is an outstanding, async, operation |\n-|\t\t// to verify each piece that has a 1 |\n-|\t\ttyped_bitfield m_verifying; |\n-| |\n-|\t\t// set if there's an error on this torrent |\n-|\t\terror_code m_error; |\n-| |\n-|\t\t// used if there is any resume data. Some of the information from the |\n-|\t\t// add_torrent_params struct are needed later in the torrent object's life |\n-|\t\t// cycle, and not in the constructor. So we need to save if away here |\n-|\t\tstd::unique_ptr m_add_torrent_params; |\n-| |\n-|\t\t// if the torrent is started without metadata, it may |\n-|\t\t// still be given a name until the metadata is received |\n-|\t\t// once the metadata is received this field will no |\n-|_\b\t_\b\t_\b/_\b/_\b _\bl_\bo_\bn_\bg_\be_\br_\b _\bb_\be_\b _\bu_\bs_\be_\bd_\b _\ba_\bn_\bd_\b _\bw_\bi_\bl_\bl_\b _\bb_\be_\b _\br_\be_\bs_\be_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a03|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |factor out the links (as well as update_list() to a separate class that torrent can inherit) |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bh_\bp_\bp_\b:_\b1_\b4_\b8_\b3_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* f\bfa\bac\bct\bto\bor\br o\bou\but\bt t\bth\bhe\be l\bli\bin\bnk\bks\bs (\b(a\bas\bs w\bwe\bel\bll\bl a\bas\bs u\bup\bpd\bda\bat\bte\be_\b_l\bli\bis\bst\bt(\b()\b) t\bto\bo a\ba s\bse\bep\bpa\bar\bra\bat\bte\be c\bcl\bla\bas\bss\bs t\bth\bha\bat\bt t\bto\bor\brr\bre\ben\bnt\bt c\bca\ban\bn i\bin\bnh\bhe\ber\bri\bit\bt)\b) *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.h\bhp\bpp\bp:\b:1\b14\b48\b83\b3 *\b**\b**\b* |\n-|\t\t// this was the last time _we_ saw a seed in this swarm |\n-|\t\tstd::time_t m_last_seen_complete = 0; |\n-| |\n-|\t\t// this is the time last any of our peers saw a seed |\n-|\t\t// in this swarm |\n-|\t\tstd::time_t m_swarm_last_seen_complete = 0; |\n-| |\n-|\t\t// keep a copy if the info-hash here, so it can be accessed from multiple |\n-|\t\t// threads, and be cheap to access from the client |\n-|\t\tinfo_hash_t m_info_hash; |\n-| |\n-|\tpublic: |\n-|\t\t// these are the lists this torrent belongs to. For more |\n-|\t\t// details about each list, see session_impl.hpp. Each list |\n-|\t\t// represents a group this torrent belongs to and makes it |\n-|\t\t// efficient to enumerate only torrents belonging to a specific |\n-|\t\t// group. Such as torrents that want peer connections or want |\n-|\t\t// to be ticked etc. |\n-| |\n-|aux::array |\n-|m_links; |\n-| |\n-|\tprivate: |\n-| |\n-|\t\t// m_num_verified = m_verified.count() |\n-|\t\tstd::uint32_t m_num_verified = 0; |\n-| |\n-|\t\t// if this torrent is running, this was the time |\n-|\t\t// when it was started. This is used to have a |\n-|\t\t// bias towards keeping seeding torrents that |\n-|\t\t// recently was started, to avoid oscillation |\n-|\t\t// this is specified at a second granularity |\n-|\t\ttime_point32 m_started = aux::time_now32(); |\n-| |\n-|\t\t// if we're a seed, this is the timestamp of when we became one |\n-|\t\ttime_point32 m_became_seed = aux::time_now32(); |\n-| |\n-|\t\t// if we're finished, this is the timestamp of when we finished |\n-|\t\ttime_point32 m_became_finished = aux::time_now32(); |\n-| |\n-|\t\t// when checking, this is the first piece we have not |\n-|\t\t// issued a hash job for |\n-|\t\tpiece_index_t m_checking_piece{0}; |\n-| |\n-|\t\t// the number of pieces we completed the check of |\n-|\t\tpiece_index_t m_num_checked_pieces{0}; |\n-| |\n-|\t\t// if the error occurred on a file, this is the index of that file |\n-|\t\t// there are a few special cases, when this is negative. See |\n-|_\b\t_\b\t_\b/_\b/_\b _\bs_\be_\bt_\b__\be_\br_\br_\bo_\br_\b(_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a03|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |use string_view for device_name |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\be_\bn_\bu_\bm_\b__\bn_\be_\bt_\b._\bh_\bp_\bp_\b:_\b1_\b6_\b4_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* u\bus\bse\be s\bst\btr\bri\bin\bng\bg_\b_v\bvi\bie\bew\bw f\bfo\bor\br d\bde\bev\bvi\bic\bce\be_\b_n\bna\bam\bme\be *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/e\ben\bnu\bum\bm_\b_n\bne\bet\bt.\b.h\bhp\bpp\bp:\b:1\b16\b64\b4 *\b**\b**\b* |\n-|// return nullopt. |\n-|\tTORRENT_EXTRA_EXPORT boost::optional
    get_gateway( |\n-|\t\tip_interface const& iface, span routes); |\n-| |\n-|\t// returns whether there is a route to the specified device for for any global |\n-|\t// internet address of the specified address family. |\n-|\tTORRENT_EXTRA_EXPORT bool has_internet_route(string_view device, int family |\n-|\t\t, span routes); |\n-| |\n-|\t// returns whether there are *any* routes to the internet in the routing |\n-|\t// table. This can be used to determine if the routing table is fully |\n-|\t// populated or not. |\n-|\tTORRENT_EXTRA_EXPORT bool has_any_internet_route(span routes); |\n-| |\n-|\t// attempt to bind socket to the device with the specified name. For systems |\n-|\t// that don't support SO_BINDTODEVICE the socket will be bound to one of the |\n-|\t// IP addresses of the specified device. In this case it is necessary to |\n-|\t// verify the local endpoint of the socket once the connection is established. |\n-|\t// the returned address is the ip the socket was bound to (or address_v4::any() |\n-|\t// in case SO_BINDTODEVICE succeeded and we don't need to verify it). |\n-|template |\n-|address bind_socket_to_device(io_context& ios, Socket& sock |\n-|\t\t, tcp const& protocol |\n-|\t\t, char const* device_name, int port, error_code& ec) |\n-|\t{ |\n-|\t\ttcp::endpoint bind_ep(address_v4::any(), std::uint16_t(port)); |\n-| |\n-|\t\taddress ip = make_address(device_name, ec); |\n-|\t\tif (!ec) |\n-|\t\t{ |\n-|\t\t\t// this is to cover the case where \"0.0.0.0\" is considered any IPv4 or |\n-|\t\t\t// IPv6 address. If we're asking to be bound to an IPv6 address and |\n-|\t\t\t// providing 0.0.0.0 as the device, turn it into \"::\" |\n-|\t\t\tif (ip == address_v4::any() && protocol == boost::asio::ip::tcp::v6()) |\n-|\t\t\t\tip = address_v6::any(); |\n-|\t\t\tbind_ep.address(ip); |\n-|\t\t\t// it appears to be an IP. Just bind to that address |\n-|\t\t\tsock.bind(bind_ep, ec); |\n-|\t\t\treturn bind_ep.address(); |\n-|\t\t} |\n-| |\n-|\t\tec.clear(); |\n-| |\n-|#if TORRENT_HAS_BINDTODEVICE |\n-|\t\t// try to use SO_BINDTODEVICE here, if that exists. If it fails, |\n-|\t\t// fall back to the mechanism we have below |\n-|\t\taux::bind_device(sock, device_name, ec); |\n-|\t\tif (ec) |\n-|#endif |\n-|\t\t{ |\n-|_\b\t_\b\t_\b\t_\be_\bc_\b._\bc_\bl_\be_\ba_\br_\b(_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |relevance\u00a03|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |unify url_seed and http_seed with just web_seed, using the web_seed_entry. |\n |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be_\b._\bh_\bp_\bp_\b:_\b5_\b3_\b5_\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |*\b**\b**\b**\b**\b* u\bun\bni\bif\bfy\by u\bur\brl\bl_\b_s\bse\bee\bed\bd a\ban\bnd\bd h\bht\btt\btp\bp_\b_s\bse\bee\bed\bd w\bwi\bit\bth\bh j\bju\bus\bst\bt w\bwe\beb\bb_\b_s\bse\bee\bed\bd,\b, u\bus\bsi\bin\bng\bg t\bth\bhe\be w\bwe\beb\bb_\b_s\bse\bee\bed\bd_\b_e\ben\bnt\btr\bry\by.\b. *\b**\b**\b**\b**\b* |\n |*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/t\bto\bor\brr\bre\ben\bnt\bt_\b_h\bha\ban\bnd\bdl\ble\be.\b.h\bhp\bpp\bp:\b:5\b53\b35\b5 *\b**\b**\b* |\n |// one returned from ``trackers()`` and will replace it. If you want an |\n |\t\t// immediate effect, you have to call force_reannounce(). See |\n |\t\t// announce_entry. |\n@@ -1972,68 +1862,178 @@\n |\t\t// the number of responses we've received so far on |\n |\t\t// this connection |\n |\t\tint m_num_responses; |\n |\t}; |\n |} |\n | |\n |_\b#_\be_\bn_\bd_\bi_\bf_\b _\b/_\b/_\b _\bT_\bO_\bR_\bR_\bE_\bN_\bT_\b__\bW_\bE_\bB_\b__\bP_\bE_\bE_\bR_\b__\bC_\bO_\bN_\bN_\bE_\bC_\bT_\bI_\bO_\bN_\b__\bH_\bP_\bP_\b__\bI_\bN_\bC_\bL_\bU_\bD_\bE_\bD_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a03|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |dh_key_exchange should probably move into its own file |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bp_\be_\b__\bc_\br_\by_\bp_\bt_\bo_\b._\bh_\bp_\bp_\b:_\b7_\b2_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* d\bdh\bh_\b_k\bke\bey\by_\b_e\bex\bxc\bch\bha\ban\bng\bge\be s\bsh\bho\bou\bul\bld\bd p\bpr\bro\bob\bba\bab\bbl\bly\by m\bmo\bov\bve\be i\bin\bnt\bto\bo i\bit\bts\bs o\bow\bwn\bn f\bfi\bil\ble\be *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/p\bpe\be_\b_c\bcr\bry\byp\bpt\bto\bo.\b.h\bhp\bpp\bp:\b:7\b72\b2 *\b**\b**\b* |\n-|#include |\n-|#include |\n-|#include |\n+|relevance\u00a03|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |use string_view for device_name |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\be_\bn_\bu_\bm_\b__\bn_\be_\bt_\b._\bh_\bp_\bp_\b:_\b1_\b6_\b4_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* u\bus\bse\be s\bst\btr\bri\bin\bng\bg_\b_v\bvi\bie\bew\bw f\bfo\bor\br d\bde\bev\bvi\bic\bce\be_\b_n\bna\bam\bme\be *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/e\ben\bnu\bum\bm_\b_n\bne\bet\bt.\b.h\bhp\bpp\bp:\b:1\b16\b64\b4 *\b**\b**\b* |\n+|// return nullopt. |\n+|\tTORRENT_EXTRA_EXPORT boost::optional
    get_gateway( |\n+|\t\tip_interface const& iface, span routes); |\n | |\n-|namespace libtorrent { |\n+|\t// returns whether there is a route to the specified device for for any global |\n+|\t// internet address of the specified address family. |\n+|\tTORRENT_EXTRA_EXPORT bool has_internet_route(string_view device, int family |\n+|\t\t, span routes); |\n | |\n-|\tnamespace mp = boost::multiprecision; |\n+|\t// returns whether there are *any* routes to the internet in the routing |\n+|\t// table. This can be used to determine if the routing table is fully |\n+|\t// populated or not. |\n+|\tTORRENT_EXTRA_EXPORT bool has_any_internet_route(span routes); |\n | |\n-|\tusing key_t = mp::number>; |\n+|\t// attempt to bind socket to the device with the specified name. For systems |\n+|\t// that don't support SO_BINDTODEVICE the socket will be bound to one of the |\n+|\t// IP addresses of the specified device. In this case it is necessary to |\n+|\t// verify the local endpoint of the socket once the connection is established. |\n+|\t// the returned address is the ip the socket was bound to (or address_v4::any() |\n+|\t// in case SO_BINDTODEVICE succeeded and we don't need to verify it). |\n+|template |\n+|address bind_socket_to_device(io_context& ios, Socket& sock |\n+|\t\t, tcp const& protocol |\n+|\t\t, char const* device_name, int port, error_code& ec) |\n+|\t{ |\n+|\t\ttcp::endpoint bind_ep(address_v4::any(), std::uint16_t(port)); |\n | |\n-|\tTORRENT_EXTRA_EXPORT std::array export_key(key_t const& k); |\n+|\t\taddress ip = make_address(device_name, ec); |\n+|\t\tif (!ec) |\n+|\t\t{ |\n+|\t\t\t// this is to cover the case where \"0.0.0.0\" is considered any IPv4 or |\n+|\t\t\t// IPv6 address. If we're asking to be bound to an IPv6 address and |\n+|\t\t\t// providing 0.0.0.0 as the device, turn it into \"::\" |\n+|\t\t\tif (ip == address_v4::any() && protocol == boost::asio::ip::tcp::v6()) |\n+|\t\t\t\tip = address_v6::any(); |\n+|\t\t\tbind_ep.address(ip); |\n+|\t\t\t// it appears to be an IP. Just bind to that address |\n+|\t\t\tsock.bind(bind_ep, ec); |\n+|\t\t\treturn bind_ep.address(); |\n+|\t\t} |\n | |\n-|\t// RC4 state from libtomcrypt |\n-|\tstruct rc4 { |\n-|\t\tint x; |\n-|\t\tint y; |\n-|\t\taux::array buf; |\n-|\t}; |\n+|\t\tec.clear(); |\n | |\n-|class TORRENT_EXTRA_EXPORT dh_key_exchange |\n-|{ |\n-|\tpublic: |\n-|\t\tdh_key_exchange(); |\n+|#if TORRENT_HAS_BINDTODEVICE |\n+|\t\t// try to use SO_BINDTODEVICE here, if that exists. If it fails, |\n+|\t\t// fall back to the mechanism we have below |\n+|\t\taux::bind_device(sock, device_name, ec); |\n+|\t\tif (ec) |\n+|#endif |\n+|\t\t{ |\n+|_\b\t_\b\t_\b\t_\be_\bc_\b._\bc_\bl_\be_\ba_\br_\b(_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a03|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |factor out predictive pieces and all operations on it into a separate class (to use as member here instead) |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bh_\bp_\bp_\b:_\b1_\b4_\b2_\b3_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* f\bfa\bac\bct\bto\bor\br o\bou\but\bt p\bpr\bre\bed\bdi\bic\bct\bti\biv\bve\be p\bpi\bie\bec\bce\bes\bs a\ban\bnd\bd a\bal\bll\bl o\bop\bpe\ber\bra\bat\bti\bio\bon\bns\bs o\bon\bn i\bit\bt i\bin\bnt\bto\bo a\ba s\bse\bep\bpa\bar\bra\bat\bte\be c\bcl\bla\bas\bss\bs (\b(t\bto\bo u\bus\bse\be a\bas\bs m\bme\bem\bmb\bbe\ber\br h\bhe\ber\bre\be i\bin\bns\bst\bte\bea\bad\bd)\b) *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.h\bhp\bpp\bp:\b:1\b14\b42\b23\b3 *\b**\b**\b* |\n+|#endif |\n | |\n-|\t\t// Get local public key |\n-|\t\tkey_t const& get_local_key() const { return m_dh_local_key; } |\n+|\t\tstd::string m_trackerid; |\n+|#if TORRENT_ABI_VERSION == 1 |\n+|\t\t// deprecated in 1.1 |\n+|\t\tstd::string m_username; |\n+|\t\tstd::string m_password; |\n+|#endif |\n | |\n-|\t\t// read remote_pubkey, generate and store shared secret in |\n-|\t\t// m_dh_shared_secret. |\n-|\t\tvoid compute_secret(std::uint8_t const* remote_pubkey); |\n-|\t\tvoid compute_secret(key_t const& remote_pubkey); |\n+|\t\tstd::string m_save_path; |\n | |\n-|\t\tkey_t const& get_secret() const { return m_dh_shared_secret; } |\n+|#ifndef TORRENT_DISABLE_PREDICTIVE_PIECES |\n+|\t\t// this is a list of all pieces that we have announced |\n+|\t\t// as having, without actually having yet. If we receive |\n+|\t\t// a request for a piece in this list, we need to hold off |\n+|\t\t// on responding until we have completed the piece and |\n+|\t\t// verified its hash. If the hash fails, send reject to |\n+|\t\t// peers with outstanding requests, and dont_have to other |\n+|\t\t// peers. This vector is ordered, to make lookups fast. |\n | |\n-|\t\tsha1_hash const& get_hash_xor_mask() const { return m_xor_mask; } |\n+|std::vector m_predictive_pieces; |\n+|#endif |\n+| |\n+|\t\t// v2 merkle tree for each file |\n+|\t\taux::vector m_merkle_trees; |\n+| |\n+|\t\t// the performance counters of this session |\n+|\t\tcounters& m_stats_counters; |\n+| |\n+|\t\t// each bit represents a piece. a set bit means |\n+|\t\t// the piece has had its hash verified. This |\n+|\t\t// is only used in seed mode (when m_seed_mode |\n+|\t\t// is true) |\n+|\t\ttyped_bitfield m_verified; |\n+| |\n+|\t\t// this means there is an outstanding, async, operation |\n+|\t\t// to verify each piece that has a 1 |\n+|\t\ttyped_bitfield m_verifying; |\n+| |\n+|\t\t// set if there's an error on this torrent |\n+|\t\terror_code m_error; |\n+| |\n+|\t\t// used if there is any resume data. Some of the information from the |\n+|\t\t// add_torrent_params struct are needed later in the torrent object's life |\n+|\t\t// cycle, and not in the constructor. So we need to save if away here |\n+|\t\tstd::unique_ptr m_add_torrent_params; |\n+| |\n+|\t\t// if the torrent is started without metadata, it may |\n+|\t\t// still be given a name until the metadata is received |\n+|\t\t// once the metadata is received this field will no |\n+|_\b\t_\b\t_\b/_\b/_\b _\bl_\bo_\bn_\bg_\be_\br_\b _\bb_\be_\b _\bu_\bs_\be_\bd_\b _\ba_\bn_\bd_\b _\bw_\bi_\bl_\bl_\b _\bb_\be_\b _\br_\be_\bs_\be_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a03|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |factor out the links (as well as update_list() to a separate class that torrent can inherit) |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bh_\bp_\bp_\b:_\b1_\b4_\b8_\b3_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* f\bfa\bac\bct\bto\bor\br o\bou\but\bt t\bth\bhe\be l\bli\bin\bnk\bks\bs (\b(a\bas\bs w\bwe\bel\bll\bl a\bas\bs u\bup\bpd\bda\bat\bte\be_\b_l\bli\bis\bst\bt(\b()\b) t\bto\bo a\ba s\bse\bep\bpa\bar\bra\bat\bte\be c\bcl\bla\bas\bss\bs t\bth\bha\bat\bt t\bto\bor\brr\bre\ben\bnt\bt c\bca\ban\bn i\bin\bnh\bhe\ber\bri\bit\bt)\b) *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.h\bhp\bpp\bp:\b:1\b14\b48\b83\b3 *\b**\b**\b* |\n+|\t\t// this was the last time _we_ saw a seed in this swarm |\n+|\t\tstd::time_t m_last_seen_complete = 0; |\n+| |\n+|\t\t// this is the time last any of our peers saw a seed |\n+|\t\t// in this swarm |\n+|\t\tstd::time_t m_swarm_last_seen_complete = 0; |\n+| |\n+|\t\t// keep a copy if the info-hash here, so it can be accessed from multiple |\n+|\t\t// threads, and be cheap to access from the client |\n+|\t\tinfo_hash_t m_info_hash; |\n+| |\n+|\tpublic: |\n+|\t\t// these are the lists this torrent belongs to. For more |\n+|\t\t// details about each list, see session_impl.hpp. Each list |\n+|\t\t// represents a group this torrent belongs to and makes it |\n+|\t\t// efficient to enumerate only torrents belonging to a specific |\n+|\t\t// group. Such as torrents that want peer connections or want |\n+|\t\t// to be ticked etc. |\n+| |\n+|aux::array |\n+|m_links; |\n | |\n |\tprivate: |\n | |\n-|\t\tkey_t m_dh_local_key; |\n-|\t\tkey_t m_dh_local_secret; |\n-|\t\tkey_t m_dh_shared_secret; |\n-|\t\tsha1_hash m_xor_mask; |\n-|\t}; |\n+|\t\t// m_num_verified = m_verified.count() |\n+|\t\tstd::uint32_t m_num_verified = 0; |\n | |\n-|\tstruct TORRENT_EXTRA_EXPORT encryption_handler |\n-|\t{ |\n-|\t\tstd::tuple>> |\n-|\t\tencrypt(span> iovec); |\n+|\t\t// if this torrent is running, this was the time |\n+|\t\t// when it was started. This is used to have a |\n+|\t\t// bias towards keeping seeding torrents that |\n+|\t\t// recently was started, to avoid oscillation |\n+|\t\t// this is specified at a second granularity |\n+|\t\ttime_point32 m_started = aux::time_now32(); |\n | |\n-|_\b\t_\b\t_\bi_\bn_\bt_\b _\bd_\be_\bc_\br_\by_\bp_\bt_\b(_\ba_\bu_\bx_\b:_\b:_\bc_\br_\by_\bp_\bt_\bo_\b__\br_\be_\bc_\be_\bi_\bv_\be_\b__\bb_\bu_\bf_\bf_\be_\br_\b&_\b _\br_\be_\bc_\bv_\b__\bb_\bu_\bf_\bf_\be_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|\t\t// if we're a seed, this is the timestamp of when we became one |\n+|\t\ttime_point32 m_became_seed = aux::time_now32(); |\n+| |\n+|\t\t// if we're finished, this is the timestamp of when we finished |\n+|\t\ttime_point32 m_became_finished = aux::time_now32(); |\n+| |\n+|\t\t// when checking, this is the first piece we have not |\n+|\t\t// issued a hash job for |\n+|\t\tpiece_index_t m_checking_piece{0}; |\n+| |\n+|\t\t// the number of pieces we completed the check of |\n+|\t\tpiece_index_t m_num_checked_pieces{0}; |\n+| |\n+|\t\t// if the error occurred on a file, this is the index of that file |\n+|\t\t// there are a few special cases, when this is negative. See |\n+|_\b\t_\b\t_\b/_\b/_\b _\bs_\be_\bt_\b__\be_\br_\br_\bo_\br_\b(_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |relevance\u00a03|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |to improve memory locality and scanning performance, turn the routing table into a single vector with boundaries for the nodes |\n |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bk_\ba_\bd_\be_\bm_\bl_\bi_\ba_\b/_\br_\bo_\bu_\bt_\bi_\bn_\bg_\b__\bt_\ba_\bb_\bl_\be_\b._\bh_\bp_\bp_\b:_\b1_\b5_\b3_\b|_\bi_\bn_\bs_\bt_\be_\ba_\bd_\b._\b _\bP_\be_\br_\bh_\ba_\bp_\bs_\b _\br_\be_\bp_\bl_\ba_\bc_\be_\bm_\be_\bn_\bt_\b _\bn_\bo_\bd_\be_\bs_\b _\bs_\bh_\bo_\bu_\bl_\bd_\b _\bb_\be_\b _\bi_\bn_\b _\ba_\b _\bs_\be_\bp_\ba_\br_\ba_\bt_\be_\b _\bv_\be_\bc_\bt_\bo_\br_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |*\b**\b**\b**\b**\b* t\bto\bo i\bim\bmp\bpr\bro\bov\bve\be m\bme\bem\bmo\bor\bry\by l\blo\boc\bca\bal\bli\bit\bty\by a\ban\bnd\bd s\bsc\bca\ban\bnn\bni\bin\bng\bg p\bpe\ber\brf\bfo\bor\brm\bma\ban\bnc\bce\be,\b, t\btu\bur\brn\bn t\bth\bhe\be r\bro\bou\but\bti\bin\bng\bg t\bta\bab\bbl\ble\be i\bin\bnt\bto\bo a\ba s\bsi\bin\bng\bgl\ble\be v\bve\bec\bct\bto\bor\br w\bwi\bit\bth\bh b\bbo\bou\bun\bnd\bda\bar\bri\bie\bes\bs f\bfo\bor\br t\bth\bhe\be n\bno\bod\bde\bes\bs i\bin\bns\bst\bte\bea\bad\bd.\b. P\bPe\ber\brh\bha\bap\bps\bs r\bre\bep\bpl\bla\bac\bce\bem\bme\ben\bnt\bt n\bno\bod\bde\bes\bs s\bsh\bho\bou\bul\bld\bd |\n |b\bbe\be i\bin\bn a\ba s\bse\bep\bpa\bar\bra\bat\bte\be v\bve\bec\bct\bto\bor\br.\b. *\b**\b**\b**\b**\b* |\n |*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/k\bka\bad\bde\bem\bml\bli\bia\ba/\b/r\bro\bou\but\bti\bin\bng\bg_\b_t\bta\bab\bbl\ble\be.\b.h\bhp\bpp\bp:\b:1\b15\b53\b3 *\b**\b**\b* |\n |// * Nodes are not marked as being stale, they keep a counter |\n |// \tthat tells how many times in a row they have failed. When |\n@@ -2136,14 +2136,68 @@\n |\t\t, move_flags_t flags, storage_error& ec); |\n | |\n |\t// deletes the files on fs from save_path according to options. Options may |\n |\t// opt to only delete the partfile |\n |\tTORRENT_EXTRA_EXPORT void |\n |\tdelete_files(file_storage const& fs, std::string const& save_path |\n |_\b\t_\b\t_\b,_\b _\bs_\bt_\bd_\b:_\b:_\bs_\bt_\br_\bi_\bn_\bg_\b _\bc_\bo_\bn_\bs_\bt_\b&_\b _\bp_\ba_\br_\bt_\b__\bf_\bi_\bl_\be_\b__\bn_\ba_\bm_\be_\b,_\b _\br_\be_\bm_\bo_\bv_\be_\b__\bf_\bl_\ba_\bg_\bs_\b__\bt_\b _\bo_\bp_\bt_\bi_\bo_\bn_\bs_\b,_\b _\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\be_\br_\br_\bo_\br_\b&_\b _\be_\bc_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b2_\b|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b._\bc_\bp_\bp_\b:_\b7_\b6_\b9_\b _\b _\b|_\bs_\bp_\bl_\bi_\bt_\b _\bt_\bh_\bi_\bs_\b _\bt_\be_\bs_\bt_\b _\bu_\bp_\b _\bi_\bn_\bt_\bo_\b _\bs_\bm_\ba_\bl_\bl_\be_\br_\b _\bp_\ba_\br_\bt_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* s\bsp\bpl\bli\bit\bt t\bth\bhi\bis\bs t\bte\bes\bst\bt u\bup\bp i\bin\bnt\bto\bo s\bsm\bma\bal\bll\ble\ber\br p\bpa\bar\brt\bts\bs *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/t\bte\bes\bst\bt/\b/t\bte\bes\bst\bt_\b_s\bst\bto\bor\bra\bag\bge\be.\b.c\bcp\bpp\bp:\b:7\b76\b69\b9 *\b**\b**\b* |\n+|io->submit_jobs(); |\n+|\tios.restart(); |\n+|\trun_until(ios, done); |\n+| |\n+|\tTEST_EQUAL(oversized, bool(flags & test_oversized)); |\n+| |\n+|\tfor (auto const i : info->piece_range()) |\n+|\t{ |\n+|\t\tdone = false; |\n+|\t\tio->async_hash(st, i, {} |\n+|\t\t\t, disk_interface::sequential_access | disk_interface::volatile_read | disk_interface::v1_hash |\n+|\t\t\t, std::bind(&on_piece_checked, _1, _2, _3, &done)); |\n+|\t\tio->submit_jobs(); |\n+|\t\tios.restart(); |\n+|\t\trun_until(ios, done); |\n+|\t} |\n+| |\n+|\tio->abort(true); |\n+|} |\n+| |\n+|template |\n+|void run_test() |\n+|{ |\n+|\tstd::string const test_path = current_working_directory(); |\n+|\tstd::cout << \"\\n=== \" << test_path << \" ===\\n\" << std::endl; |\n+| |\n+|\tstd::shared_ptr info; |\n+| |\n+|\tstd::vector piece0 = new_piece(piece_size); |\n+|\tstd::vector piece1 = new_piece(piece_size); |\n+|\tstd::vector piece2 = new_piece(piece_size); |\n+|\tstd::vector piece3 = new_piece(piece_size); |\n+| |\n+|\tdelete_dirs(\"temp_storage\"); |\n+| |\n+|\tfile_storage fs; |\n+|\tfs.add_file(\"temp_storage/test1.tmp\", 17); |\n+|\tfs.add_file(\"temp_storage/test2.tmp\", 612); |\n+|\tfs.add_file(\"temp_storage/test3.tmp\", 0); |\n+|\tfs.add_file(\"temp_storage/test4.tmp\", 0); |\n+|\tfs.add_file(\"temp_storage/test5.tmp\", 3253); |\n+|\tfs.add_file(\"temp_storage/test6.tmp\", 841); |\n+|\tint const last_file_size = 4 * int(piece_size) - int(fs.total_size()); |\n+|\tfs.add_file(\"temp_storage/test7.tmp\", last_file_size); |\n+| |\n+|\t// File layout |\n+|\t// +-+--+++-------+-------+----------------------------------------------------------------------------------------+ |\n+|\t// |1| 2||| file5 | file6 | file7 | |\n+|\t// +-+--+++-------+-------+----------------------------------------------------------------------------------------+ |\n+|\t// | | | | | |\n+|_\b\t_\b/_\b/_\b _\b|_\b _\bp_\bi_\be_\bc_\be_\b _\b0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\bp_\bi_\be_\bc_\be_\b _\b1_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\bp_\bi_\be_\bc_\be_\b _\b2_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\bp_\bi_\be_\bc_\be_\b _\b3_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |relevance\u00a02|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bp_\bi_\be_\bc_\be_\b__\bp_\bi_\bc_\bk_\be_\br_\b._\bc_\bp_\bp_\b:|test picking with partial pieces and other peers present so that both backup_pieces and backup_pieces2 are used |\n |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b2_\b8_\b7_\b0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |*\b**\b**\b**\b**\b* t\bte\bes\bst\bt p\bpi\bic\bck\bki\bin\bng\bg w\bwi\bit\bth\bh p\bpa\bar\brt\bti\bia\bal\bl p\bpi\bie\bec\bce\bes\bs a\ban\bnd\bd o\bot\bth\bhe\ber\br p\bpe\bee\ber\brs\bs p\bpr\bre\bes\bse\ben\bnt\bt s\bso\bo t\bth\bha\bat\bt b\bbo\bot\bth\bh b\bba\bac\bck\bku\bup\bp_\b_p\bpi\bie\bec\bce\bes\bs a\ban\bnd\bd b\bba\bac\bck\bku\bup\bp_\b_p\bpi\bie\bec\bce\bes\bs2\b2 a\bar\bre\be u\bus\bse\bed\bd *\b**\b**\b**\b**\b* |\n |_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bp\bp_\bi\bi_\be\be_\bc\bc_\be\be_\b_\b__\bp\bp_\bi\bi_\bc\bc_\bk\bk_\be\be_\br\br_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b2\b2_\b8\b8_\b7\b7_\b0\b0_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b2_\b|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bd_\bh_\bt_\b._\bc_\bp_\bp_\b:_\b1_\b6_\b4_\b2_\b _\b _\b _\b _\b _\b|_\bt_\be_\bs_\bt_\b _\bn_\bu_\bm_\b__\bg_\bl_\bo_\bb_\ba_\bl_\b__\bn_\bo_\bd_\be_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |*\b**\b**\b**\b**\b* t\bte\bes\bst\bt n\bnu\bum\bm_\b_g\bgl\blo\bob\bba\bal\bl_\b_n\bno\bod\bde\bes\bs *\b**\b**\b**\b**\b* |\n |_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bd\bd_\bh\bh_\bt\bt_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b1\b1_\b6\b6_\b4\b4_\b2\b2_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n@@ -2248,234 +2302,446 @@\n |\tbool ret = verify_message(ent, msg_desc, msg_keys, error_string); |\n |\tTEST_CHECK(ret); |\n |\tTEST_CHECK(msg_keys[0]); |\n |\tif (msg_keys[0]) TEST_EQUAL(msg_keys[0].string_value(), \"test\"); |\n |\tTEST_CHECK(msg_keys[1]); |\n |\tTEST_CHECK(msg_keys[2]); |\n |_\b\t_\bi_\bf_\b _\b(_\bm_\bs_\bg_\b__\bk_\be_\by_\bs_\b[_\b2_\b]_\b)_\b _\bT_\bE_\bS_\bT_\b__\bE_\bQ_\bU_\bA_\bL_\b(_\bm_\bs_\bg_\b__\bk_\be_\by_\bs_\b[_\b2_\b]_\b._\bs_\bt_\br_\bi_\bn_\bg_\b__\bv_\ba_\bl_\bu_\be_\b(_\b)_\b,_\b _\b\"_\bt_\be_\bs_\bt_\b2_\b\"_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b2_\b|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b._\bc_\bp_\bp_\b:_\b7_\b6_\b9_\b _\b _\b|_\bs_\bp_\bl_\bi_\bt_\b _\bt_\bh_\bi_\bs_\b _\bt_\be_\bs_\bt_\b _\bu_\bp_\b _\bi_\bn_\bt_\bo_\b _\bs_\bm_\ba_\bl_\bl_\be_\br_\b _\bp_\ba_\br_\bt_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* s\bsp\bpl\bli\bit\bt t\bth\bhi\bis\bs t\bte\bes\bst\bt u\bup\bp i\bin\bnt\bto\bo s\bsm\bma\bal\bll\ble\ber\br p\bpa\bar\brt\bts\bs *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/t\bte\bes\bst\bt/\b/t\bte\bes\bst\bt_\b_s\bst\bto\bor\bra\bag\bge\be.\b.c\bcp\bpp\bp:\b:7\b76\b69\b9 *\b**\b**\b* |\n-|io->submit_jobs(); |\n-|\tios.restart(); |\n-|\trun_until(ios, done); |\n-| |\n-|\tTEST_EQUAL(oversized, bool(flags & test_oversized)); |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b2_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bu_\bp_\bn_\bp_\b._\bc_\bp_\bp_\b:_\b1_\b0_\b6_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bu_\bs_\be_\b _\bb_\bo_\bo_\bs_\bt_\b:_\b:_\ba_\bs_\bi_\bo_\b:_\b:_\bi_\bp_\b:_\b:_\bn_\be_\bt_\bw_\bo_\br_\bk_\b _\bi_\bn_\bs_\bt_\be_\ba_\bd_\b _\bo_\bf_\b _\bn_\be_\bt_\bm_\ba_\bs_\bk_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* u\bus\bse\be b\bbo\boo\bos\bst\bt:\b::\b:a\bas\bsi\bio\bo:\b::\b:i\bip\bp:\b::\b:n\bne\bet\btw\bwo\bor\brk\bk i\bin\bns\bst\bte\bea\bad\bd o\bof\bf n\bne\bet\btm\bma\bas\bsk\bk *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/u\bup\bpn\bnp\bp.\b.c\bcp\bpp\bp:\b:1\b10\b06\b6 *\b**\b**\b* |\n+|static error_code ignore_error; |\n | |\n-|\tfor (auto const i : info->piece_range()) |\n-|\t{ |\n-|\t\tdone = false; |\n-|\t\tio->async_hash(st, i, {} |\n-|\t\t\t, disk_interface::sequential_access | disk_interface::volatile_read | disk_interface::v1_hash |\n-|\t\t\t, std::bind(&on_piece_checked, _1, _2, _3, &done)); |\n-|\t\tio->submit_jobs(); |\n-|\t\tios.restart(); |\n-|\t\trun_until(ios, done); |\n-|\t} |\n+|upnp::rootdevice::rootdevice() = default; |\n | |\n-|\tio->abort(true); |\n+|#if TORRENT_USE_ASSERTS |\n+|upnp::rootdevice::~rootdevice() |\n+|{ |\n+|\tTORRENT_ASSERT(magic == 1337); |\n+|\tmagic = 0; |\n |} |\n+|#else |\n+|upnp::rootdevice::~rootdevice() = default; |\n+|#endif |\n | |\n-|template |\n-|void run_test() |\n+|upnp::rootdevice::rootdevice(rootdevice const&) = default; |\n+|upnp::rootdevice& upnp::rootdevice::operator=(rootdevice const&) & = default; |\n+|upnp::rootdevice::rootdevice(rootdevice&&) noexcept = default; |\n+|upnp::rootdevice& upnp::rootdevice::operator=(rootdevice&&) & = default; |\n+| |\n+|upnp::upnp(io_context& ios |\n+|, aux::session_settings const& settings |\n+|\t, aux::portmap_callback& cb |\n+|\t, address_v4 const listen_address |\n+|\t, address_v4 const netmask |\n+|\t, std::string listen_device |\n+|\t, listen_socket_handle ls) |\n+|\t: m_settings(settings) |\n+|\t, m_callback(cb) |\n+|\t, m_io_service(ios) |\n+|\t, m_resolver(ios) |\n+|\t, m_multicast(ios) |\n+|\t, m_unicast(ios) |\n+|\t, m_broadcast_timer(ios) |\n+|\t, m_refresh_timer(ios) |\n+|\t, m_map_timer(ios) |\n+|\t, m_listen_address(listen_address) |\n+|\t, m_netmask(netmask) |\n+|\t, m_device(std::move(listen_device)) |\n+|#if TORRENT_USE_SSL |\n+|\t, m_ssl_ctx(ssl::context::sslv23_client) |\n+|#endif |\n+|\t, m_listen_handle(std::move(ls)) |\n |{ |\n-|\tstd::string const test_path = current_working_directory(); |\n-|\tstd::cout << \"\\n=== \" << test_path << \" ===\\n\" << std::endl; |\n+|#if TORRENT_USE_SSL |\n+|\tm_ssl_ctx.set_verify_mode(ssl::context::verify_none); |\n+|#endif |\n+|} |\n | |\n-|\tstd::shared_ptr info; |\n+|void upnp::start() |\n+|_\b{_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a02|_\b._\b._\b/_\bs_\br_\bc_\b/ |peer_connection and tracker_connection should probably be flags |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bi_\bn_\bs_\bt_\ba_\bn_\bt_\bi_\ba_\bt_\be_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b._\bc_\bp_\bp_\b:_\b4_\b4_\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* p\bpe\bee\ber\br_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn a\ban\bnd\bd t\btr\bra\bac\bck\bke\ber\br_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn s\bsh\bho\bou\bul\bld\bd p\bpr\bro\bob\bba\bab\bbl\bly\by b\bbe\be f\bfl\bla\bag\bgs\bs *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/i\bin\bns\bst\bta\ban\bnt\bti\bia\bat\bte\be_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn.\b.c\bcp\bpp\bp:\b:4\b44\b4 *\b**\b**\b* |\n+|ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |\n+|LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |\n+|CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |\n+|SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |\n+|INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |\n+|CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |\n+|ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |\n+|POSSIBILITY OF SUCH DAMAGE. |\n | |\n-|\tstd::vector piece0 = new_piece(piece_size); |\n-|\tstd::vector piece1 = new_piece(piece_size); |\n-|\tstd::vector piece2 = new_piece(piece_size); |\n-|\tstd::vector piece3 = new_piece(piece_size); |\n+|*/ |\n | |\n-|\tdelete_dirs(\"temp_storage\"); |\n+|#include \"libtorrent/socket.hpp\" |\n+|#include \"libtorrent/aux_/socket_type.hpp\" |\n+|#include \"libtorrent/aux_/utp_socket_manager.hpp\" |\n+|#include \"libtorrent/aux_/instantiate_connection.hpp\" |\n+|#include \"libtorrent/aux_/utp_stream.hpp\" |\n+|#include \"libtorrent/ssl_stream.hpp\" |\n | |\n-|\tfile_storage fs; |\n-|\tfs.add_file(\"temp_storage/test1.tmp\", 17); |\n-|\tfs.add_file(\"temp_storage/test2.tmp\", 612); |\n-|\tfs.add_file(\"temp_storage/test3.tmp\", 0); |\n-|\tfs.add_file(\"temp_storage/test4.tmp\", 0); |\n-|\tfs.add_file(\"temp_storage/test5.tmp\", 3253); |\n-|\tfs.add_file(\"temp_storage/test6.tmp\", 841); |\n-|\tint const last_file_size = 4 * int(piece_size) - int(fs.total_size()); |\n-|\tfs.add_file(\"temp_storage/test7.tmp\", last_file_size); |\n+|namespace libtorrent { namespace aux { |\n | |\n-|\t// File layout |\n-|\t// +-+--+++-------+-------+----------------------------------------------------------------------------------------+ |\n-|\t// |1| 2||| file5 | file6 | file7 | |\n-|\t// +-+--+++-------+-------+----------------------------------------------------------------------------------------+ |\n-|\t// | | | | | |\n-|_\b\t_\b/_\b/_\b _\b|_\b _\bp_\bi_\be_\bc_\be_\b _\b0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\bp_\bi_\be_\bc_\be_\b _\b1_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\bp_\bi_\be_\bc_\be_\b _\b2_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\bp_\bi_\be_\bc_\be_\b _\b3_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a02|_\b._\b._\b/_\bs_\br_\bc_\b/ |just make this peer not have the pieces associated with the file we just requested. Only when it doesn't have any of the file do the|\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bw_\be_\bb_\b__\bp_\be_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b._\bc_\bp_\bp_\b:_\b6_\b2_\b6_\b _\b _\b _\b|_\bf_\bo_\bl_\bl_\bo_\bw_\bi_\bn_\bg_\b _\bp_\ba_\bd_\b _\bf_\bi_\bl_\be_\bs_\b _\bw_\bi_\bl_\bl_\b _\bm_\ba_\bk_\be_\b _\bi_\bt_\b _\bc_\bo_\bm_\bp_\bl_\bi_\bc_\ba_\bt_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* j\bju\bus\bst\bt m\bma\bak\bke\be t\bth\bhi\bis\bs p\bpe\bee\ber\br n\bno\bot\bt h\bha\bav\bve\be t\bth\bhe\be p\bpi\bie\bec\bce\bes\bs a\bas\bss\bso\boc\bci\bia\bat\bte\bed\bd w\bwi\bit\bth\bh t\bth\bhe\be f\bfi\bil\ble\be w\bwe\be j\bju\bus\bst\bt r\bre\beq\bqu\bue\bes\bst\bte\bed\bd.\b. O\bOn\bnl\bly\by w\bwh\bhe\ben\bn i\bit\bt d\bdo\boe\bes\bsn\bn'\b't\bt h\bha\bav\bve\be a\ban\bny\by o\bof\bf t\bth\bhe\be f\bfi\bil\ble\be d\bdo\bo t\bth\bhe\be f\bfo\bol\bll\blo\bow\bwi\bin\bng\bg p\bpa\bad\bd f\bfi\bil\ble\bes\bs w\bwi\bil\bll\bl m\bma\bak\bke\be i\bit\bt |\n-|c\bco\bom\bmp\bpl\bli\bic\bca\bat\bte\bed\bd *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/w\bwe\beb\bb_\b_p\bpe\bee\ber\br_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn.\b.c\bcp\bpp\bp:\b:6\b62\b26\b6 *\b**\b**\b* |\n-|\tpeer_connection::received_invalid_data(index, single_peer); |\n+|aux::socket_type instantiate_connection(io_context& ios |\n+|, aux::proxy_settings const& ps |\n+|\t\t, void* ssl_context |\n+|\t\t, utp_socket_manager* sm |\n+|\t\t, bool peer_connection |\n+|\t\t, bool tracker_connection) |\n+|\t{ |\n+|#if !TORRENT_USE_SSL |\n+|\t\tTORRENT_UNUSED(ssl_context); |\n+|#endif |\n | |\n-|\t// if we don't think we have any of the files, allow banning the web seed |\n-|\tif (num_have_pieces() == 0) return true; |\n+|\t\tif (sm) |\n+|\t\t{ |\n+|#if TORRENT_USE_SSL |\n+|\t\t\tif (ssl_context) |\n+|\t\t\t{ |\n+|\t\t\t\tssl_stream s(ios, *static_cast(ssl_context)); |\n+|\t\t\t\ts.next_layer().set_impl(sm->new_utp_socket(&s.next_layer())); |\n+|\t\t\t\treturn socket_type(std::move(s)); |\n+|\t\t\t} |\n+|\t\t\telse |\n+|#endif |\n+|\t\t\t{ |\n+|\t\t\t\tutp_stream s(ios); |\n+|\t\t\t\ts.set_impl(sm->new_utp_socket(&s)); |\n+|\t\t\t\treturn socket_type(std::move(s)); |\n+|\t\t\t} |\n+|\t\t} |\n+|#if TORRENT_USE_I2P |\n+|\t\telse if (ps.type == settings_pack::i2p_proxy) |\n+|_\b\t_\b\t_\b{_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b2_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bp_\ba_\bt_\bh_\b._\bc_\bp_\bp_\b:_\b4_\b2_\b9_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bt_\be_\bs_\bt_\b _\bt_\bh_\bi_\bs_\b _\bo_\bn_\b _\ba_\b _\bF_\bA_\bT_\b _\bv_\bo_\bl_\bu_\bm_\be_\b _\bt_\bo_\b _\bs_\be_\be_\b _\bw_\bh_\ba_\bt_\b _\be_\br_\br_\bo_\br_\b _\bw_\be_\b _\bg_\be_\bt_\b!_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bte\bes\bst\bt t\bth\bhi\bis\bs o\bon\bn a\ba F\bFA\bAT\bT v\bvo\bol\blu\bum\bme\be t\bto\bo s\bse\bee\be w\bwh\bha\bat\bt e\ber\brr\bro\bor\br w\bwe\be g\bge\bet\bt!\b! *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/p\bpa\bat\bth\bh.\b.c\bcp\bpp\bp:\b:4\b42\b29\b9 *\b**\b**\b* |\n+|// it's possible CreateHardLink will copy the file internally too, |\n+|\t\t\t// if the filesystem does not support it. |\n+|\t\t\tec.assign(GetLastError(), system_category()); |\n+|\t\t\treturn; |\n+|\t\t} |\n | |\n-|\t// don't disconnect, we won't request anything from this file again |\n-|\treturn false; |\n-|} |\n+|\t\t// fall back to making a copy |\n+|#endif |\n+|#else |\n+|\t\t// assume posix's link() function exists |\n+|\t\tint ret = ::link(n_exist.c_str(), n_link.c_str()); |\n | |\n-|void web_peer_connection::on_receive_padfile() |\n-|{ |\n-|\thandle_padfile(); |\n-|} |\n+|\t\tif (ret == 0) |\n+|\t\t{ |\n+|\t\t\tec.clear(); |\n+|\t\t\treturn; |\n+|\t\t} |\n | |\n-|void web_peer_connection::handle_error(int const bytes_left) |\n-|{ |\n-|\tstd::shared_ptr t = associated_torrent().lock(); |\n-|\tTORRENT_ASSERT(t); |\n+|\t\t// most errors are passed through, except for the ones that indicate that |\n+|\t\t// hard links are not supported and require a copy. |\n+|if (errno != EMLINK |\n+|&& errno != EXDEV |\n+|#ifdef TORRENT_BEOS |\n+|\t\t\t// haiku returns EPERM when the filesystem doesn't support hard link |\n+|\t\t\t&& errno != EPERM |\n+|#endif |\n+|\t\t\t) |\n+|\t\t{ |\n+|\t\t\t// some error happened, report up to the caller |\n+|\t\t\tec.assign(errno, system_category()); |\n+|\t\t\treturn; |\n+|\t\t} |\n | |\n+|\t\t// fall back to making a copy |\n | |\n-|// temporarily unavailable, retry later |\n-|\tt->retry_web_seed(this, m_parser.header_duration(\"retry-after\")); |\n-|\tif (t->alerts().should_post()) |\n-|\t{ |\n-|\t\tstd::string const error_msg = to_string(m_parser.status_code()).data() |\n-|\t\t\t+ (\" \" + m_parser.message()); |\n-|\t\tt->alerts().emplace_alert(t->get_handle(), m_url |\n-|\t\t\t, error_msg); |\n+|#endif |\n+| |\n+|\t\t// if we get here, we should copy the file |\n+|\t\tstorage_error se; |\n+|\t\taux::copy_file(file, link, se); |\n+|\t\tec = se.ec; |\n |\t} |\n-|\treceived_bytes(0, bytes_left); |\n-|\tdisconnect(error_code(m_parser.status_code(), http_category()), operation_t::bittorrent, failure); |\n-|} |\n | |\n-|void web_peer_connection::disable(error_code const& ec) |\n-|{ |\n-|\t// we should not try this server again. |\n-|\tm_web->disabled = true; |\n-|\tdisconnect(ec, operation_t::bittorrent, peer_error); |\n-|\tif (m_web->ephemeral) |\n+|\tbool is_directory(std::string const& f, error_code& ec) |\n |\t{ |\n-|\t\tstd::shared_ptr t = associated_torrent().lock(); |\n-|\t\tTORRENT_ASSERT(t); |\n-|\t\tt->remove_web_seed_conn(this); |\n+|\t\tec.clear(); |\n+|\t\terror_code e; |\n+|\t\tfile_status s; |\n+|\t\tstat_file(f, &s, e); |\n+|\t\tif (!e && s.mode & file_status::directory) return true; |\n+|_\b\t_\b\t_\be_\bc_\b _\b=_\b _\be_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b2_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b5_\b0_\b4_\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bp_\bo_\bs_\bt_\b _\ba_\bl_\be_\br_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* p\bpo\bos\bst\bt a\bal\ble\ber\brt\bt *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:5\b50\b04\b4 *\b**\b**\b* |\n+|if (m_current_gauge_state != no_gauge_state) |\n+|\t\t\tinc_stats_counter(m_current_gauge_state + counters::num_checking_torrents, -1); |\n+|\t\tif (new_gauge_state != no_gauge_state) |\n+|\t\t\tinc_stats_counter(new_gauge_state + counters::num_checking_torrents, 1); |\n+| |\n+|\t\tTORRENT_ASSERT(new_gauge_state >= 0); |\n+|\t\tTORRENT_ASSERT(new_gauge_state <= no_gauge_state); |\n+|\t\tm_current_gauge_state = static_cast(new_gauge_state); |\n |\t} |\n-|\tm_web = nullptr; |\n-|\tTORRENT_ASSERT(is_disconnecting()); |\n-|} |\n | |\n-|void web_peer_connection::handle_redirect(int const bytes_left) |\n-|_\b{_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a02|_\b._\b._\b/_\bs_\br_\bc_\b/ |support authentication here. tracker_req().auth |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bu_\bd_\bp_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b._\bc_\bp_\bp_\b:_\b8_\b1_\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* s\bsu\bup\bpp\bpo\bor\brt\bt a\bau\but\bth\bhe\ben\bnt\bti\bic\bca\bat\bti\bio\bon\bn h\bhe\ber\bre\be.\b. t\btr\bra\bac\bck\bke\ber\br_\b_r\bre\beq\bq(\b()\b).\b.a\bau\but\bth\bh *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/u\bud\bdp\bp_\b_t\btr\bra\bac\bck\bke\ber\br_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn.\b.c\bcp\bpp\bp:\b:8\b81\b1 *\b**\b**\b* |\n-|udp_tracker_connection::m_connection_cache; |\n+|\tvoid torrent::leave_seed_mode(seed_mode_t const checking) |\n+|\t{ |\n+|\t\tif (!m_seed_mode) return; |\n | |\n-|\tstd::mutex udp_tracker_connection::m_cache_mutex; |\n+|\t\tif (checking == seed_mode_t::check_files) |\n+|\t\t{ |\n+|\t\t\t// this means the user promised we had all the |\n+|\t\t\t// files, but it turned out we didn't. This is |\n+|\t\t\t// an error. |\n | |\n-|\tudp_tracker_connection::udp_tracker_connection( |\n-|\t\tio_context& ios |\n-|\t\t, tracker_manager& man |\n-|\t\t, tracker_request const& req |\n-|\t\t, std::weak_ptr c) |\n-|\t\t: tracker_connection(man, req, ios, std::move(c)) |\n-|\t\t, m_transaction_id(0) |\n-|\t\t, m_attempts(0) |\n-|\t\t, m_state(action_t::error) |\n-|\t\t, m_abort(false) |\n-|\t{ |\n-|\t\tupdate_transaction_id(); |\n+| |\n+|#ifndef TORRENT_DISABLE_LOGGING |\n+|\t\t\tdebug_log(\"*** FAILED SEED MODE, rechecking\"); |\n+|#endif |\n+|\t\t} |\n+| |\n+|#ifndef TORRENT_DISABLE_LOGGING |\n+|\t\tdebug_log(\"*** LEAVING SEED MODE (%s)\" |\n+|\t\t\t, checking == seed_mode_t::skip_checking ? \"as seed\" : \"as non-seed\"); |\n+|#endif |\n+|\t\tm_seed_mode = false; |\n+|\t\t// seed is false if we turned out not |\n+|\t\t// to be a seed after all |\n+|\t\tif (checking == seed_mode_t::check_files |\n+|\t\t\t&& state() != torrent_status::checking_resume_data) |\n+|\t\t{ |\n+|\t\t\tm_have_all = false; |\n+|\t\t\tset_state(torrent_status::downloading); |\n+|\t\t\tforce_recheck(); |\n+|\t\t} |\n+|\t\tm_num_verified = 0; |\n+|\t\tm_verified.clear(); |\n+|\t\tm_verifying.clear(); |\n+| |\n+|\t\tset_need_save_resume(torrent_handle::if_state_changed); |\n |\t} |\n | |\n-|\tvoid udp_tracker_connection::start() |\n+|\tvoid torrent::verified(piece_index_t const piece) |\n |\t{ |\n-|std::string hostname; |\n-|std::string protocol; |\n-|\t\tint port; |\n-|\t\terror_code ec; |\n+|\t\tTORRENT_ASSERT(!m_verified.get_bit(piece)); |\n+|_\b\t_\b\t_\b+_\b+_\bm_\b__\bn_\bu_\bm_\b__\bv_\be_\br_\bi_\bf_\bi_\be_\bd_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b2_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b1_\b8_\b5_\b2_\b _\b _\b _\b _\b _\b _\b _\b|_\ba_\bd_\bd_\b _\ba_\b _\bu_\bn_\bi_\bt_\b _\bt_\be_\bs_\bt_\b _\bw_\bh_\be_\br_\be_\b _\bw_\be_\b _\bd_\bo_\bn_\b'_\bt_\b _\bh_\ba_\bv_\be_\b _\bm_\be_\bt_\ba_\bd_\ba_\bt_\ba_\b,_\b _\bc_\bo_\bn_\bn_\be_\bc_\bt_\b _\bt_\bo_\b _\ba_\b _\bp_\be_\be_\br_\b _\bt_\bh_\ba_\bt_\b _\bs_\be_\bn_\bd_\bs_\b _\ba_\b _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd_\b _\bt_\bh_\ba_\bt_\b'_\bs_\b _\bt_\bo_\bo_\b _\bl_\ba_\br_\bg_\be_\b,_\b _\bt_\bh_\be_\bn_\b _\bw_\be_\b _\bg_\be_\bt_\b _\bt_\bh_\be_\b _\bm_\be_\bt_\ba_\bd_\ba_\bt_\ba_\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* a\bad\bdd\bd a\ba u\bun\bni\bit\bt t\bte\bes\bst\bt w\bwh\bhe\ber\bre\be w\bwe\be d\bdo\bon\bn'\b't\bt h\bha\bav\bve\be m\bme\bet\bta\bad\bda\bat\bta\ba,\b, c\bco\bon\bnn\bne\bec\bct\bt t\bto\bo a\ba p\bpe\bee\ber\br t\bth\bha\bat\bt s\bse\ben\bnd\bds\bs a\ba b\bbi\bit\btf\bfi\bie\bel\bld\bd t\bth\bha\bat\bt'\b's\bs t\bto\boo\bo l\bla\bar\brg\bge\be,\b, t\bth\bhe\ben\bn w\bwe\be g\bge\bet\bt t\bth\bhe\be m\bme\bet\bta\bad\bda\bat\bta\ba *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:1\b18\b85\b52\b2 *\b**\b**\b* |\n+|for (auto const& f : m_add_torrent_params->renamed_files) |\n+|\t\t\t{ |\n+|\t\t\t\tif (f.first < file_index_t(0) || f.first >= fs.end_file()) continue; |\n+|\t\t\t\tm_torrent_file->rename_file(file_index_t(f.first), f.second); |\n+|\t\t\t} |\n+|\t\t} |\n | |\n-|\t\tstd::tie(protocol, std::ignore, hostname, port, std::ignore) |\n-|\t\t\t= parse_url_components(tracker_req().url, ec); |\n-|\t\tif (port == -1) port = protocol == \"http\" ? 80 : 443; |\n+|\t\tconstruct_storage(); |\n | |\n-|\t\tif (ec) |\n+|#ifndef TORRENT_DISABLE_SHARE_MODE |\n+|\t\tif (m_share_mode && valid_metadata()) |\n |\t\t{ |\n-|\t\t\ttracker_connection::fail(ec, operation_t::parse_address); |\n-|\t\t\treturn; |\n+|\t\t\t// in share mode, all pieces have their priorities initialized to 0 |\n+|\t\t\tm_file_priority.clear(); |\n+|\t\t\tm_file_priority.resize(m_torrent_file->num_files(), dont_download); |\n |\t\t} |\n+|#endif |\n | |\n-|\t\taux::session_settings const& settings = m_man.settings(); |\n-| |\n-|\t\tint const proxy_type = settings.get_int(settings_pack::proxy_type); |\n+|\t\t// it's important to initialize the peers early, because this is what will |\n+|\t\t// fix up their have-bitmasks to have the correct size |\n+|if (!m_connections_initialized) |\n+|{ |\n+|\t\t\tm_connections_initialized = true; |\n+|\t\t\t// all peer connections have to initialize themselves now that the metadata |\n+|\t\t\t// is available |\n+|\t\t\t// copy the peer list since peers may disconnect and invalidate |\n+|\t\t\t// m_connections as we initialize them |\n+|\t\t\tfor (auto c : m_connections) |\n+|\t\t\t{ |\n+|\t\t\t\tauto pc = c->self(); |\n+|\t\t\t\tif (pc->is_disconnecting()) continue; |\n+|\t\t\t\tpc->on_metadata_impl(); |\n+|\t\t\t\tif (pc->is_disconnecting()) continue; |\n+|\t\t\t\tpc->init(); |\n+|\t\t\t} |\n+|\t\t} |\n | |\n-|\t\tif (settings.get_bool(settings_pack::proxy_hostnames) |\n-|\t\t\t&& (proxy_type == settings_pack::socks5 |\n-|\t\t\t\t|| proxy_type == settings_pack::socks5_pw)) |\n+|\t\t// in case file priorities were passed in via the add_torrent_params |\n+|\t\t// and also in the case of share mode, we need to update the priorities |\n+|\t\t// this has to be applied before piece priority |\n+|\t\tif (!m_file_priority.empty()) |\n |\t\t{ |\n-|\t\t\tm_hostname = hostname; |\n-|\t\t\tm_target.port(std::uint16_t(port)); |\n-|\t\t\tstart_announce(); |\n+|\t\t\t// m_file_priority was loaded from the resume data, this doesn't |\n+|\t\t\t// alter any state that needs to be saved in the resume data |\n+|\t\t\tauto const ns = m_need_save_resume_data; |\n+|\t\t\tupdate_piece_priorities(m_file_priority); |\n+|\t\t\tm_need_save_resume_data = ns; |\n |\t\t} |\n-|\t\telse |\n-|\t\t{ |\n-|\t\t\tusing namespace std::placeholders; |\n-|_\b\t_\b\t_\b\t_\bA_\bD_\bD_\b__\bO_\bU_\bT_\bS_\bT_\bA_\bN_\bD_\bI_\bN_\bG_\b__\bA_\bS_\bY_\bN_\bC_\b(_\b\"_\bu_\bd_\bp_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b:_\b:_\bn_\ba_\bm_\be_\b__\bl_\bo_\bo_\bk_\bu_\bp_\b\"_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a02|_\b._\b._\b/_\bs_\br_\bc_\b/_\bp_\be_\be_\br_\b__\bl_\bi_\bs_\bt_\b._\bc_\bp_\bp_\b:_\b5_\b3_\b9 |it would be nice if there was a way to iterate over these torrent_peer objects in the order they are allocated in the pool instead. |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bI_\bt_\b _\bw_\bo_\bu_\bl_\bd_\b _\bp_\br_\bo_\bb_\ba_\bb_\bl_\by_\b _\bb_\be_\b _\bm_\bo_\br_\be_\b _\be_\bf_\bf_\bi_\bc_\bi_\be_\bn_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* i\bit\bt w\bwo\bou\bul\bld\bd b\bbe\be n\bni\bic\bce\be i\bif\bf t\bth\bhe\ber\bre\be w\bwa\bas\bs a\ba w\bwa\bay\by t\bto\bo i\bit\bte\ber\bra\bat\bte\be o\bov\bve\ber\br t\bth\bhe\bes\bse\be t\bto\bor\brr\bre\ben\bnt\bt_\b_p\bpe\bee\ber\br o\bob\bbj\bje\bec\bct\bts\bs i\bin\bn t\bth\bhe\be o\bor\brd\bde\ber\br t\bth\bhe\bey\by a\bar\bre\be a\bal\bll\blo\boc\bca\bat\bte\bed\bd i\bin\bn t\bth\bhe\be p\bpo\boo\bol\bl i\bin\bns\bst\bte\bea\bad\bd.\b. I\bIt\bt w\bwo\bou\bul\bld\bd p\bpr\bro\bob\bba\bab\bbl\bly\by b\bbe\be m\bmo\bor\bre\be e\bef\bff\bfi\bic\bci\bie\ben\bnt\bt |\n-|*\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/p\bpe\bee\ber\br_\b_l\bli\bis\bst\bt.\b.c\bcp\bpp\bp:\b:5\b53\b39\b9 *\b**\b**\b* |\n-|, int session_time, torrent_state* state) |\n-|\t{ |\n-|\t\tTORRENT_ASSERT(is_single_thread()); |\n-|\t\tINVARIANT_CHECK; |\n | |\n-|\t\tconst int candidate_count = 10; |\n-|\t\tpeers.reserve(candidate_count); |\n+|\t\tif (m_add_torrent_params) |\n+|_\b\t_\b\t_\b{_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b2_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b4_\b4_\b9_\b2_\b _\b _\b _\b _\b _\b _\b _\b|_\bu_\bs_\be_\b _\bc_\bh_\br_\bo_\bn_\bo_\b _\bt_\by_\bp_\be_\b _\bf_\bo_\br_\b _\bt_\bi_\bm_\be_\b _\bd_\bu_\br_\ba_\bt_\bi_\bo_\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* u\bus\bse\be c\bch\bhr\bro\bon\bno\bo t\bty\byp\bpe\be f\bfo\bor\br t\bti\bim\bme\be d\bdu\bur\bra\bat\bti\bio\bon\bn *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:4\b44\b49\b92\b2 *\b**\b**\b* |\n+|} |\n | |\n-|\t\tint erase_candidate = -1; |\n+|\t\tm_picker->piece_passed(index); |\n+|\t\tupdate_gauge(); |\n+|\t\twe_have(index); |\n | |\n-|\t\tif (bool(m_finished) != state->is_finished) |\n-|\t\t\trecalculate_connect_candidates(state); |\n+|#ifndef TORRENT_DISABLE_LOGGING |\n+|\t\tif (should_log()) |\n+|\t\t\tdebug_log(\"we_have(%d) (num_have: %d)\", int(index), num_have()); |\n+|#endif |\n+|#ifndef TORRENT_DISABLE_STREAMING |\n+|\t\tremove_time_critical_piece(index, true); |\n+|#endif |\n+|\t} |\n | |\n-|\t\texternal_ip const& external = state->ip; |\n-|\t\tint external_port = state->port; |\n+|#ifndef TORRENT_DISABLE_PREDICTIVE_PIECES |\n+|\t// we believe we will complete this piece very soon |\n+|\t// announce it to peers ahead of time to eliminate the |\n+|\t// round-trip times involved in announcing it, requesting it |\n+|\t// and sending it |\n+|void torrent::predicted_have_piece(piece_index_t const index, int const milliseconds) |\n+|{ |\n+|\t\tauto const i = std::lower_bound(m_predictive_pieces.begin() |\n+|\t\t\t, m_predictive_pieces.end(), index); |\n+|\t\tif (i != m_predictive_pieces.end() && *i == index) return; |\n | |\n-|\t\tif (m_round_robin >= int(m_peers.size())) m_round_robin = 0; |\n+|\t\tfor (auto p : m_connections) |\n+|\t\t{ |\n+|\t\t\tTORRENT_INCREMENT(m_iterating_connections); |\n+|#ifndef TORRENT_DISABLE_LOGGING |\n+|\t\t\tp->peer_log(peer_log_alert::outgoing, \"PREDICTIVE_HAVE\", \"piece: %d expected in %d ms\" |\n+|\t\t\t\t, static_cast(index), milliseconds); |\n+|#else |\n+|\t\t\tTORRENT_UNUSED(milliseconds); |\n+|#endif |\n+|\t\t\tp->announce_piece(index); |\n+|\t\t} |\n | |\n-|\t\tint max_peerlist_size = state->max_peerlist_size; |\n+|\t\tm_predictive_pieces.insert(i, index); |\n+|\t} |\n+|#endif |\n | |\n-|for (int iterations = std::min(int(m_peers.size()), 300); |\n-|iterations > 0; --iterations) |\n+|\t// blocks may contain the block indices of the blocks that failed (if this is |\n+|\t// a v2 torrent). |\n+|\tvoid torrent::piece_failed(piece_index_t const index, std::vector blocks) |\n+|\t{ |\n+|\t\t// if the last piece fails the peer connection will still |\n+|\t\t// think that it has received all of it until this function |\n+|\t\t// resets the download queue. So, we cannot do the |\n+|\t\t// invariant check here since it assumes: |\n+|_\b\t_\b\t_\b/_\b/_\b _\b(_\bt_\bo_\bt_\ba_\bl_\b__\bd_\bo_\bn_\be_\b _\b=_\b=_\b _\bm_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bi_\bl_\be_\b-_\b>_\bt_\bo_\bt_\ba_\bl_\b__\bs_\bi_\bz_\be_\b(_\b)_\b)_\b _\b=_\b>_\b _\bi_\bs_\b__\bs_\be_\be_\bd_\b(_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b2_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b4_\b9_\b1_\b9_\b _\b _\b _\b _\b _\b _\b _\b|_\ba_\bb_\bo_\br_\bt_\b _\bl_\bo_\bo_\bk_\bu_\bp_\bs_\b _\bt_\bh_\bi_\bs_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\b _\bh_\ba_\bs_\b _\bm_\ba_\bd_\be_\b _\bv_\bi_\ba_\b _\bt_\bh_\be_\b _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b _\bh_\bo_\bs_\bt_\b _\br_\be_\bs_\bo_\bl_\bv_\be_\br_\b _\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* a\bab\bbo\bor\brt\bt l\blo\boo\bok\bku\bup\bps\bs t\bth\bhi\bis\bs t\bto\bor\brr\bre\ben\bnt\bt h\bha\bas\bs m\bma\bad\bde\be v\bvi\bia\ba t\bth\bhe\be s\bse\bes\bss\bsi\bio\bon\bn h\bho\bos\bst\bt r\bre\bes\bso\bol\blv\bve\ber\br i\bin\bnt\bte\ber\brf\bfa\bac\bce\be *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:4\b49\b91\b19\b9 *\b**\b**\b* |\n+|TORRENT_UNUSED(e); |\n+|\t\t\t\tm_storage.reset(); |\n+|#ifndef TORRENT_DISABLE_LOGGING |\n+|\t\t\t\tdebug_log(\"Failed to flush disk cache: %s\", e.what()); |\n+|#endif |\n+|\t\t\t\t// clients may rely on this alert to be posted, so it's probably a |\n+|\t\t\t\t// good idea to post it here, even though we failed |\n+|\t\t\t\tif (alerts().should_post()) |\n+|\t\t\t\t\talerts().emplace_alert(get_handle()); |\n+|\t\t\t} |\n+|\t\t\tm_ses.deferred_submit_jobs(); |\n+|\t\t} |\n+|\t\telse |\n |\t\t{ |\n-|\t\t\t++state->loop_counter; |\n+|\t\t\tif (alerts().should_post()) |\n+|\t\t\t\talerts().emplace_alert(get_handle()); |\n+|\t\t\talerts().emplace_alert(get_handle() |\n+|\t\t\t\t, info_hash(), get_userdata()); |\n+|\t\t} |\n | |\n-|\t\t\tif (m_round_robin >= int(m_peers.size())) m_round_robin = 0; |\n | |\n-|\t\t\ttorrent_peer& pe = *m_peers[m_round_robin]; |\n-|\t\t\tTORRENT_ASSERT(pe.in_use); |\n-|\t\t\tint current = m_round_robin; |\n+|if (!m_apply_ip_filter) |\n+|\t\t{ |\n+|\t\t\tinc_stats_counter(counters::non_filter_torrents, -1); |\n+|\t\t\tm_apply_ip_filter = true; |\n+|\t\t} |\n | |\n-|\t\t\t// if the number of peers is growing large |\n-|\t\t\t// we need to start weeding. |\n+|\t\tm_paused = false; |\n+|\t\tm_auto_managed = false; |\n+|\t\tupdate_state_list(); |\n+|\t\tfor (torrent_list_index_t i{}; i != m_links.end_index(); ++i) |\n+|\t\t{ |\n+|\t\t\tif (!m_links[i].in_list()) continue; |\n+|\t\t\tm_links[i].unlink(m_ses.torrent_list(i), i); |\n+|\t\t} |\n+|\t\t// don't re-add this torrent to the state-update list |\n+|\t\tm_state_subscription = false; |\n+|\t} |\n | |\n-|\t\t\tif (int(m_peers.size()) >= max_peerlist_size * 0.95 |\n-|\t\t\t\t&& max_peerlist_size > 0) |\n+|\t// this is called when we're destructing non-gracefully. i.e. we're _just_ |\n+|\t// destructing everything. |\n+|\tvoid torrent::panic() |\n+|\t{ |\n+|\t\tm_storage.reset(); |\n+|\t\t// if there are any other peers allocated still, we need to clear them |\n+|\t\t// now. They can't be cleared later because the allocator will already |\n+|\t\t// have been destructed |\n+|\t\tif (m_peer_list) m_peer_list->clear(); |\n+|\t\tm_connections.clear(); |\n+|\t\tm_outgoing_pids.clear(); |\n+|_\b\t_\b\t_\bm_\b__\bp_\be_\be_\br_\bs_\b__\bt_\bo_\b__\bd_\bi_\bs_\bc_\bo_\bn_\bn_\be_\bc_\bt_\b._\bc_\bl_\be_\ba_\br_\b(_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a02|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b8_\b0_\b3_\b2 |if peer is a really good peer, maybe we shouldn't disconnect it perhaps this logic should be disabled if we have too many idle peers|\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b(_\bw_\bi_\bt_\bh_\b _\bs_\bo_\bm_\be_\b _\bd_\be_\bf_\bi_\bn_\bi_\bt_\bi_\bo_\bn_\b _\bo_\bf_\b _\bi_\bd_\bl_\be_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* i\bif\bf p\bpe\bee\ber\br i\bis\bs a\ba r\bre\bea\bal\bll\bly\by g\bgo\boo\bod\bd p\bpe\bee\ber\br,\b, m\bma\bay\byb\bbe\be w\bwe\be s\bsh\bho\bou\bul\bld\bdn\bn'\b't\bt d\bdi\bis\bsc\bco\bon\bnn\bne\bec\bct\bt i\bit\bt p\bpe\ber\brh\bha\bap\bps\bs t\bth\bhi\bis\bs l\blo\bog\bgi\bic\bc s\bsh\bho\bou\bul\bld\bd b\bbe\be d\bdi\bis\bsa\bab\bbl\ble\bed\bd i\bif\bf w\bwe\be h\bha\bav\bve\be t\bto\boo\bo m\bma\ban\bny\by i\bid\bdl\ble\be p\bpe\bee\ber\brs\bs (\b(w\bwi\bit\bth\bh s\bso\bom\bme\be d\bde\bef\bfi\bin\bni\bit\bti\bio\bon\bn o\bof\bf i\bid\bdl\ble\be)\b) *\b**\b**\b**\b**\b*|\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:8\b80\b03\b32\b2 *\b**\b**\b* |\n+|\t\tm_peers_to_disconnect.reserve(m_connections.size() + 1); |\n+|\t\tm_connections.reserve(m_connections.size() + 1); |\n+| |\n+|#if TORRENT_USE_ASSERTS |\n+|\t\terror_code ec; |\n+|\t\tTORRENT_ASSERT(p->remote() == p->get_socket().remote_endpoint(ec) || ec); |\n+|#endif |\n+| |\n+|\t\tTORRENT_ASSERT(p->peer_info_struct() != nullptr); |\n+| |\n+|\t\t// we need to do this after we've added the peer to the peer_list |\n+|\t\t// since that's when the peer is assigned its peer_info object, |\n+|\t\t// which holds the rank |\n+|\t\tif (maybe_replace_peer) |\n+|\t\t{ |\n+|\t\t\t// now, find the lowest rank peer and disconnect that |\n+|\t\t\t// if it's lower rank than the incoming connection |\n+|\t\t\tpeer_connection* peer = find_lowest_ranking_peer(); |\n+| |\n+|if (peer != nullptr && peer->peer_rank() < p->peer_rank()) |\n+|{ |\n+|#ifndef TORRENT_DISABLE_LOGGING |\n+|\t\t\t\tif (should_log()) |\n+|\t\t\t\t{ |\n+|\t\t\t\t\tdebug_log(\"CLOSING CONNECTION \\\"%s\\\" peer list full (low peer rank) \" |\n+|\t\t\t\t\t\t\"connections: %d limit: %d\" |\n+|\t\t\t\t\t\t, print_endpoint(peer->remote()).c_str() |\n+|\t\t\t\t\t\t, num_peers() |\n+|\t\t\t\t\t\t, m_max_connections); |\n+|\t\t\t\t} |\n+|#endif |\n+|\t\t\t\tpeer->disconnect(errors::too_many_connections, operation_t::bittorrent); |\n+|\t\t\t\tp->peer_disconnected_other(); |\n+|\t\t\t} |\n+|\t\t\telse |\n |\t\t\t{ |\n-|\t\t\t\tif (is_erase_candidate(pe) |\n-|\t\t\t\t\t&& (erase_candidate == -1 |\n-|\t\t\t\t\t\t|| !compare_peer_erase(*m_peers[erase_candidate], pe))) |\n+|#ifndef TORRENT_DISABLE_LOGGING |\n+|\t\t\t\tif (should_log()) |\n |\t\t\t\t{ |\n-|\t\t\t\t\tif (should_erase_immediately(pe)) |\n-|\t\t\t\t\t{ |\n-|\t\t\t\t\t\tif (erase_candidate > current) --erase_candidate; |\n-|\t\t\t\t\t\terase_peer(m_peers.begin() + current, state); |\n-|\t\t\t\t\t\tcontinue; |\n-|\t\t\t\t\t} |\n-|\t\t\t\t\telse |\n-|\t\t\t\t\t{ |\n-|\t\t\t\t\t\terase_candidate = current; |\n-|_\b\t_\b\t_\b\t_\b\t_\b\t_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|\t\t\t\t\tdebug_log(\"CLOSING CONNECTION \\\"%s\\\" peer list full (low peer rank) \" |\n+|\t\t\t\t\t\t\"connections: %d limit: %d\" |\n+|\t\t\t\t\t\t, print_endpoint(p->remote()).c_str() |\n+|\t\t\t\t\t\t, num_peers() |\n+|\t\t\t\t\t\t, m_max_connections); |\n+|\t\t\t\t} |\n+|#endif |\n+|\t\t\t\tp->disconnect(errors::too_many_connections, operation_t::bittorrent); |\n+|\t\t\t\t// we have to do this here because from the peer's point of view |\n+|\t\t\t\t// it wasn't really attached to the torrent, but we do need |\n+|_\b\t_\b\t_\b\t_\b\t_\b/_\b/_\b _\bt_\bo_\b _\bl_\be_\bt_\b _\bp_\be_\be_\br_\b__\bl_\bi_\bs_\bt_\b _\bk_\bn_\bo_\bw_\b _\bw_\be_\b'_\br_\be_\b _\br_\be_\bm_\bo_\bv_\bi_\bn_\bg_\b _\bi_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n | | |technically, this is where the transaction of moving the files is completed. This is where the new save_path should be committed. If|\n |relevance\u00a02|_\b._\b._\b/_\bs_\br_\bc_\b/_\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bu_\bt_\bi_\bl_\bs_\b._\bc_\bp_\bp_\b:_\b2_\b9_\b4 |there is an error in the code below, that should not prevent the new save path to be set. Maybe it would make sense to make the |\n |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bs_\ba_\bv_\be_\b__\bp_\ba_\bt_\bh_\b _\ba_\bn_\b _\bi_\bn_\b-_\bo_\bu_\bt_\b _\bp_\ba_\br_\ba_\bm_\be_\bt_\be_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |*\b**\b**\b**\b**\b* t\bte\bec\bch\bhn\bni\bic\bca\bal\bll\bly\by,\b, t\bth\bhi\bis\bs i\bis\bs w\bwh\bhe\ber\bre\be t\bth\bhe\be t\btr\bra\ban\bns\bsa\bac\bct\bti\bio\bon\bn o\bof\bf m\bmo\bov\bvi\bin\bng\bg t\bth\bhe\be f\bfi\bil\ble\bes\bs i\bis\bs c\bco\bom\bmp\bpl\ble\bet\bte\bed\bd.\b. T\bTh\bhi\bis\bs i\bis\bs w\bwh\bhe\ber\bre\be t\bth\bhe\be n\bne\bew\bw s\bsa\bav\bve\be_\b_p\bpa\bat\bth\bh s\bsh\bho\bou\bul\bld\bd b\bbe\be c\bco\bom\bmm\bmi\bit\btt\bte\bed\bd.\b. I\bIf\bf t\bth\bhe\ber\bre\be i\bis\bs a\ban\bn e\ber\brr\bro\bor\br i\bin\bn t\bth\bhe\be c\bco\bod\bde\be b\bbe\bel\blo\bow\bw,\b,|\n |t\bth\bha\bat\bt s\bsh\bho\bou\bul\bld\bd n\bno\bot\bt p\bpr\bre\bev\bve\ben\bnt\bt t\bth\bhe\be n\bne\bew\bw s\bsa\bav\bve\be p\bpa\bat\bth\bh t\bto\bo b\bbe\be s\bse\bet\bt.\b. M\bMa\bay\byb\bbe\be i\bit\bt w\bwo\bou\bul\bld\bd m\bma\bak\bke\be s\bse\ben\bns\bse\be t\bto\bo m\bma\bak\bke\be t\bth\bhe\be s\bsa\bav\bve\be_\b_p\bpa\bat\bth\bh a\ban\bn i\bin\bn-\b-o\bou\but\bt p\bpa\bar\bra\bam\bme\bet\bte\ber\br *\b**\b**\b**\b**\b* |\n |*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/s\bst\bto\bor\bra\bag\bge\be_\b_u\but\bti\bil\bls\bs.\b.c\bcp\bpp\bp:\b:2\b29\b94\b4 *\b**\b**\b* |\n |while (--file_index >= file_index_t(0)) |\n@@ -2579,14 +2845,342 @@\n |\t\t\t\t// files with priority zero may not have been saved to disk at their |\n |\t\t\t\t// expected location, but is likely to be in a partfile. Just exempt it |\n |\t\t\t\t// from checking |\n |\t\t\t\tif (file_index < file_priority.end_index() |\n |\t\t\t\t\t&& file_priority[file_index] == dont_download |\n |\t\t\t\t\t&& !(rd.flags & torrent_flags::seed_mode)) |\n |_\b\t_\b\t_\b\t_\b\t_\b\t_\bc_\bo_\bn_\bt_\bi_\bn_\bu_\be_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b2_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\be_\bs_\bc_\ba_\bp_\be_\b__\bs_\bt_\br_\bi_\bn_\bg_\b._\bc_\bp_\bp_\b:_\b1_\b9_\b4_\b _\b _\b|_\bt_\bh_\bi_\bs_\b _\bs_\bh_\bo_\bu_\bl_\bd_\b _\bp_\br_\bo_\bb_\ba_\bb_\bl_\by_\b _\bb_\be_\b _\bm_\bo_\bv_\be_\bd_\b _\bi_\bn_\bt_\bo_\b _\bs_\bt_\br_\bi_\bn_\bg_\b__\bu_\bt_\bi_\bl_\b._\bc_\bp_\bp_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs s\bsh\bho\bou\bul\bld\bd p\bpr\bro\bob\bba\bab\bbl\bly\by b\bbe\be m\bmo\bov\bve\bed\bd i\bin\bnt\bto\bo s\bst\btr\bri\bin\bng\bg_\b_u\but\bti\bil\bl.\b.c\bcp\bpp\bp *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/e\bes\bsc\bca\bap\bpe\be_\b_s\bst\btr\bri\bin\bng\bg.\b.c\bcp\bpp\bp:\b:1\b19\b94\b4 *\b**\b**\b* |\n+|{ |\n+|\t\treturn escape_string_impl(str.data(), int(str.size()), 10); |\n+|\t} |\n+| |\n+|\tbool need_encoding(char const* str, int const len) |\n+|\t{ |\n+|\t\tfor (int i = 0; i < len; ++i) |\n+|\t\t{ |\n+|\t\t\tif (std::strchr(unreserved_chars, *str) == nullptr || *str == 0) |\n+|\t\t\t\treturn true; |\n+|\t\t\t++str; |\n+|\t\t} |\n+|\t\treturn false; |\n+|\t} |\n+| |\n+|\tvoid convert_path_to_posix(std::string& path) |\n+|\t{ |\n+|\t\tstd::replace(path.begin(), path.end(), '\\\\', '/'); |\n+|\t} |\n+| |\n+|std::string read_until(char const*& str, char const delim, char const* end) |\n+|{ |\n+|\t\tTORRENT_ASSERT(str <= end); |\n+| |\n+|\t\tstd::string ret; |\n+|\t\twhile (str != end && *str != delim) |\n+|\t\t{ |\n+|\t\t\tret += *str; |\n+|\t\t\t++str; |\n+|\t\t} |\n+|\t\t// skip the delimiter as well |\n+|\t\twhile (str != end && *str == delim) ++str; |\n+|\t\treturn ret; |\n+|\t} |\n+| |\n+|\tstd::string maybe_url_encode(std::string const& url) |\n+|\t{ |\n+|\t\tstd::string protocol, host, auth, path; |\n+|\t\tint port; |\n+|\t\terror_code ec; |\n+|\t\tstd::tie(protocol, auth, host, port, path) = parse_url_components(url, ec); |\n+|\t\tif (ec) return url; |\n+| |\n+|\t\t// first figure out if this url contains unencoded characters |\n+|\t\tif (!need_encoding(path.c_str(), int(path.size()))) |\n+|\t\t\treturn url; |\n+| |\n+|\t\tstd::string msg; |\n+|\t\tstd::string escaped_path { escape_path(path) }; |\n+|\t\t// reserve enough space so further append will |\n+|_\b\t_\b\t_\b/_\b/_\b _\bo_\bn_\bl_\by_\b _\bc_\bo_\bp_\by_\b _\bv_\ba_\bl_\bu_\be_\bs_\b _\bt_\bo_\b _\be_\bx_\bi_\bs_\bt_\bi_\bn_\bg_\b _\bl_\bo_\bc_\ba_\bt_\bi_\bo_\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b2_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bp_\bi_\be_\bc_\be_\b__\bp_\bi_\bc_\bk_\be_\br_\b._\bc_\bp_\bp_\b:_\b1_\b9_\b9_\b6_\b _\b _\b|_\bm_\ba_\bk_\be_\b _\bt_\bh_\be_\b _\b2_\b0_\b4_\b8_\b _\bl_\bi_\bm_\bi_\bt_\b _\bc_\bo_\bn_\bf_\bi_\bg_\bu_\br_\ba_\bb_\bl_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* m\bma\bak\bke\be t\bth\bhe\be 2\b20\b04\b48\b8 l\bli\bim\bmi\bit\bt c\bco\bon\bnf\bfi\big\bgu\bur\bra\bab\bbl\ble\be *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/p\bpi\bie\bec\bce\be_\b_p\bpi\bic\bck\bke\ber\br.\b.c\bcp\bpp\bp:\b:1\b19\b99\b96\b6 *\b**\b**\b* |\n+|// indicating which path thought the picker we took to arrive at the |\n+|\t// returned block picks. |\n+|\tpicker_flags_t piece_picker::pick_pieces(typed_bitfield const& pieces |\n+|\t\t, std::vector& interesting_blocks, int num_blocks |\n+|\t\t, int prefer_contiguous_blocks, torrent_peer* peer |\n+|\t\t, picker_options_t options, std::vector const& suggested_pieces |\n+|\t\t, int num_peers |\n+|\t\t, counters& pc |\n+|\t\t) const |\n+|\t{ |\n+|\t\tTORRENT_ASSERT(peer == nullptr || peer->in_use); |\n+|\t\tpicker_flags_t ret; |\n+| |\n+|\t\t// prevent the number of partial pieces to grow indefinitely |\n+|\t\t// make this scale by the number of peers we have. For large |\n+|\t\t// scale clients, we would have more peers, and allow a higher |\n+|\t\t// threshold for the number of partials |\n+|\t\t// the second condition is to make sure we cap the number of partial |\n+|\t\t// _bytes_. The larger the pieces are, the fewer partial pieces we want. |\n+|\t\t// 2048 corresponds to 32 MiB |\n+|const int num_partials = int(m_downloads[piece_pos::piece_downloading].size()); |\n+|if (num_partials > num_peers * 3 / 2 |\n+|\t\t\t|| num_partials * blocks_per_piece() > 2048) |\n+|\t\t{ |\n+|\t\t\t// if we have too many partial pieces, prioritize completing |\n+|\t\t\t// them. In order for this to have an affect, also disable |\n+|\t\t\t// prefer whole pieces (otherwise partial pieces would be de-prioritized) |\n+|\t\t\toptions |= prioritize_partials; |\n+|\t\t\tprefer_contiguous_blocks = 0; |\n+| |\n+|\t\t\tret |= picker_log_alert::partial_ratio; |\n+|\t\t} |\n+| |\n+|\t\tif (prefer_contiguous_blocks) ret |= picker_log_alert::prefer_contiguous; |\n+| |\n+|\t\t// only one of rarest_first and sequential can be set. |\n+|\t\tTORRENT_ASSERT(((options & rarest_first) ? 1 : 0) |\n+|\t\t\t+ ((options & sequential) ? 1 : 0) <= 1); |\n+|#ifdef TORRENT_EXPENSIVE_INVARIANT_CHECKS |\n+|\t\tINVARIANT_CHECK; |\n+|#endif |\n+|\t\tTORRENT_ASSERT(num_blocks > 0); |\n+|\t\tTORRENT_ASSERT(pieces.size() == int(m_piece_map.size())); |\n+| |\n+|\t\tTORRENT_ASSERT(!m_priority_boundaries.empty() || m_dirty); |\n+| |\n+|\t\t// this will be filled with blocks that we should not request |\n+|\t\t// unless we can't find num_blocks among the other ones. |\n+|\t\tstd::vector backup_blocks; |\n+|\t\tstd::vector backup_blocks2; |\n+|_\b\t_\b\t_\bs_\bt_\bd_\b:_\b:_\bv_\be_\bc_\bt_\bo_\br_\b<_\bp_\bi_\be_\bc_\be_\b__\bi_\bn_\bd_\be_\bx_\b__\bt_\b>_\b _\bi_\bg_\bn_\bo_\br_\be_\bd_\b__\bp_\bi_\be_\bc_\be_\bs_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b2_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bp_\bi_\be_\bc_\be_\b__\bp_\bi_\bc_\bk_\be_\br_\b._\bc_\bp_\bp_\b:_\b2_\b5_\b9_\b4_\b _\b _\b|_\bt_\bh_\be_\b _\bf_\bi_\br_\bs_\bt_\b__\bb_\bl_\bo_\bc_\bk_\b _\br_\be_\bt_\bu_\br_\bn_\be_\bd_\b _\bh_\be_\br_\be_\b _\bi_\bs_\b _\bt_\bh_\be_\b _\bl_\ba_\br_\bg_\be_\bs_\bt_\b _\bf_\br_\be_\be_\b _\br_\ba_\bn_\bg_\be_\b,_\b _\bn_\bo_\bt_\b _\bt_\bh_\be_\b _\bf_\bi_\br_\bs_\bt_\b-_\bf_\bi_\bt_\b _\br_\ba_\bn_\bg_\be_\b,_\b _\bw_\bh_\bi_\bc_\bh_\b _\bw_\bo_\bu_\bl_\bd_\b _\bb_\be_\b _\bb_\be_\bt_\bt_\be_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bth\bhe\be f\bfi\bir\brs\bst\bt_\b_b\bbl\blo\boc\bck\bk r\bre\bet\btu\bur\brn\bne\bed\bd h\bhe\ber\bre\be i\bis\bs t\bth\bhe\be l\bla\bar\brg\bge\bes\bst\bt f\bfr\bre\bee\be r\bra\ban\bng\bge\be,\b, n\bno\bot\bt t\bth\bhe\be f\bfi\bir\brs\bst\bt-\b-f\bfi\bit\bt r\bra\ban\bng\bge\be,\b, w\bwh\bhi\bic\bch\bh w\bwo\bou\bul\bld\bd b\bbe\be b\bbe\bet\btt\bte\ber\br *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/p\bpi\bie\bec\bce\be_\b_p\bpi\bic\bck\bke\ber\br.\b.c\bcp\bpp\bp:\b:2\b25\b59\b94\b4 *\b**\b**\b* |\n+|{ |\n+|\t\tfor (auto const& b : m_block_info) |\n+|\t\t{ |\n+|\t\t\tTORRENT_ASSERT(b.peer == nullptr || static_cast(b.peer)->in_use); |\n+|\t\t} |\n+|\t} |\n+|#endif |\n+| |\n+|\tvoid piece_picker::clear_peer(torrent_peer* peer) |\n+|\t{ |\n+|\t\tfor (auto& b : m_block_info) |\n+|\t\t{ |\n+|\t\t\tif (b.peer == peer) b.peer = nullptr; |\n+|\t\t} |\n+|\t} |\n+| |\n+|\t// the first bool is true if this is the only peer that has requested and downloaded |\n+|\t// blocks from this piece. |\n+|\t// the second bool is true if this is the only active peer that is requesting |\n+|\t// and downloading blocks from this piece. Active means having a connection. |\n+|std::tuple piece_picker::requested_from( |\n+|piece_picker::downloading_piece const& p |\n+|\t\t, int const num_blocks_in_piece, torrent_peer* peer) const |\n+|\t{ |\n+|\t\tbool exclusive = true; |\n+|\t\tbool exclusive_active = true; |\n+|\t\tint contiguous_blocks = 0; |\n+|\t\tint max_contiguous = 0; |\n+|\t\tint first_block = 0; |\n+|\t\tint idx = -1; |\n+|\t\tfor (auto const& info : blocks_for_piece(p)) |\n+|\t\t{ |\n+|\t\t\t++idx; |\n+|\t\t\tTORRENT_ASSERT(info.peer == nullptr || info.peer->in_use); |\n+|\t\t\tTORRENT_ASSERT(info.piece_index == p.index); |\n+|\t\t\tif (info.state == piece_picker::block_info::state_none) |\n+|\t\t\t{ |\n+|\t\t\t\t++contiguous_blocks; |\n+|\t\t\t\tcontinue; |\n+|\t\t\t} |\n+|\t\t\tif (contiguous_blocks > max_contiguous) |\n+|\t\t\t{ |\n+|\t\t\t\tmax_contiguous = contiguous_blocks; |\n+|\t\t\t\tfirst_block = idx - contiguous_blocks; |\n+|\t\t\t} |\n+|\t\t\tcontiguous_blocks = 0; |\n+|\t\t\tif (info.peer != peer) |\n+|\t\t\t{ |\n+|\t\t\t\texclusive = false; |\n+|\t\t\t\tif (info.state == piece_picker::block_info::state_requested |\n+|_\b\t_\b\t_\b\t_\b\t_\b\t_\b&_\b&_\b _\bi_\bn_\bf_\bo_\b._\bp_\be_\be_\br_\b _\b!_\b=_\b _\bn_\bu_\bl_\bl_\bp_\bt_\br_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+| | |it would be nice if this could be folded into lock_piece() the main distinction is that this also maintains the m_num_have counter |\n+|relevance\u00a02|_\b._\b._\b/_\bs_\br_\bc_\b/_\bp_\bi_\be_\bc_\be_\b__\bp_\bi_\bc_\bk_\be_\br_\b._\bc_\bp_\bp_\b:_\b3_\b4_\b7_\b8 |and the passed_hash_check member Is there ever a case where we call write failed without also locking the piece? Perhaps |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bw_\br_\bi_\bt_\be_\b__\bf_\ba_\bi_\bl_\be_\bd_\b(_\b)_\b _\bs_\bh_\bo_\bu_\bl_\bd_\b _\bi_\bm_\bp_\bl_\by_\b _\bl_\bo_\bc_\bk_\bi_\bn_\bg_\b _\bi_\bt_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* i\bit\bt w\bwo\bou\bul\bld\bd b\bbe\be n\bni\bic\bce\be i\bif\bf t\bth\bhi\bis\bs c\bco\bou\bul\bld\bd b\bbe\be f\bfo\bol\bld\bde\bed\bd i\bin\bnt\bto\bo l\blo\boc\bck\bk_\b_p\bpi\bie\bec\bce\be(\b()\b) t\bth\bhe\be m\bma\bai\bin\bn d\bdi\bis\bst\bti\bin\bnc\bct\bti\bio\bon\bn i\bis\bs t\bth\bha\bat\bt t\bth\bhi\bis\bs a\bal\bls\bso\bo m\bma\bai\bin\bnt\bta\bai\bin\bns\bs t\bth\bhe\be m\bm_\b_n\bnu\bum\bm_\b_h\bha\bav\bve\be c\bco\bou\bun\bnt\bte\ber\br a\ban\bnd\bd t\bth\bhe\be p\bpa\bas\bss\bse\bed\bd_\b_h\bha\bas\bsh\bh_\b_c\bch\bhe\bec\bck\bk m\bme\bem\bmb\bbe\ber\br I\bIs\bs |\n+|t\bth\bhe\ber\bre\be e\bev\bve\ber\br a\ba c\bca\bas\bse\be w\bwh\bhe\ber\bre\be w\bwe\be c\bca\bal\bll\bl w\bwr\bri\bit\bte\be f\bfa\bai\bil\ble\bed\bd w\bwi\bit\bth\bho\bou\but\bt a\bal\bls\bso\bo l\blo\boc\bck\bki\bin\bng\bg t\bth\bhe\be p\bpi\bie\bec\bce\be?\b? P\bPe\ber\brh\bha\bap\bps\bs w\bwr\bri\bit\bte\be_\b_f\bfa\bai\bil\ble\bed\bd(\b()\b) s\bsh\bho\bou\bul\bld\bd i\bim\bmp\bpl\bly\by l\blo\boc\bck\bki\bin\bng\bg i\bit\bt.\b. *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/p\bpi\bie\bec\bce\be_\b_p\bpi\bic\bck\bke\ber\br.\b.c\bcp\bpp\bp:\b:3\b34\b47\b78\b8 *\b**\b**\b* |\n+|\t\tauto const state = m_piece_map[piece].download_queue(); |\n+|\t\tif (state == piece_pos::piece_open) return; |\n+|\t\tauto const i = find_dl_piece(state, piece); |\n+|\t\tif (i == m_downloads[state].end()) return; |\n+| |\n+|\t\tTORRENT_ASSERT(i->passed_hash_check == false); |\n+|\t\tif (i->passed_hash_check) |\n+|\t\t{ |\n+|\t\t\t// it's not clear why this would happen, |\n+|\t\t\t// but it seems reasonable to not break the |\n+|\t\t\t// accounting over it. |\n+|\t\t\ti->passed_hash_check = false; |\n+|\t\t\taccount_lost(piece); |\n+|\t\t} |\n+| |\n+|\t\t// prevent this piece from being picked until it's restored |\n+|\t\ti->locked = true; |\n+|\t} |\n+| |\n+|void piece_picker::write_failed(piece_block const block) |\n+|{ |\n+|\t\tINVARIANT_CHECK; |\n+| |\n+|#if TORRENT_USE_INVARIANT_CHECKS |\n+|\t\tcheck_piece_state(); |\n+|#endif |\n+| |\n+|#ifdef TORRENT_PICKER_LOG |\n+|\t\tstd::cerr << \"[\" << this << \"] \" << \"write_failed( {\" << block.piece_index << \", \" << block.block_index << \"} )\" << std::endl; |\n+|#endif |\n+| |\n+|\t\tauto const state = m_piece_map[block.piece_index].download_queue(); |\n+|\t\tif (state == piece_pos::piece_open) return; |\n+|\t\tauto i = find_dl_piece(state, block.piece_index); |\n+|\t\tif (i == m_downloads[state].end()) return; |\n+| |\n+|\t\tauto const binfo = mutable_blocks_for_piece(*i); |\n+|\t\tblock_info& info = binfo[block.block_index]; |\n+|\t\tTORRENT_ASSERT(&info >= &m_block_info[0]); |\n+|\t\tTORRENT_ASSERT(&info < &m_block_info[0] + m_block_info.size()); |\n+|\t\tTORRENT_ASSERT(info.piece_index == block.piece_index); |\n+|\t\tTORRENT_ASSERT(info.state == block_info::state_writing); |\n+|\t\tTORRENT_ASSERT(info.num_peers == 0); |\n+| |\n+|\t\tTORRENT_ASSERT(i->writing > 0); |\n+|\t\tTORRENT_ASSERT(info.state == block_info::state_writing); |\n+| |\n+|\t\tif (info.state == block_info::state_finished) return; |\n+|_\b\t_\b\t_\bi_\bf_\b _\b(_\bi_\bn_\bf_\bo_\b._\bs_\bt_\ba_\bt_\be_\b _\b=_\b=_\b _\bb_\bl_\bo_\bc_\bk_\b__\bi_\bn_\bf_\bo_\b:_\b:_\bs_\bt_\ba_\bt_\be_\b__\bw_\br_\bi_\bt_\bi_\bn_\bg_\b)_\b _\b-_\b-_\bi_\b-_\b>_\bw_\br_\bi_\bt_\bi_\bn_\bg_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a02|_\b._\b._\b/_\bs_\br_\bc_\b/ |just make this peer not have the pieces associated with the file we just requested. Only when it doesn't have any of the file do the|\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bw_\be_\bb_\b__\bp_\be_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b._\bc_\bp_\bp_\b:_\b6_\b2_\b6_\b _\b _\b _\b|_\bf_\bo_\bl_\bl_\bo_\bw_\bi_\bn_\bg_\b _\bp_\ba_\bd_\b _\bf_\bi_\bl_\be_\bs_\b _\bw_\bi_\bl_\bl_\b _\bm_\ba_\bk_\be_\b _\bi_\bt_\b _\bc_\bo_\bm_\bp_\bl_\bi_\bc_\ba_\bt_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* j\bju\bus\bst\bt m\bma\bak\bke\be t\bth\bhi\bis\bs p\bpe\bee\ber\br n\bno\bot\bt h\bha\bav\bve\be t\bth\bhe\be p\bpi\bie\bec\bce\bes\bs a\bas\bss\bso\boc\bci\bia\bat\bte\bed\bd w\bwi\bit\bth\bh t\bth\bhe\be f\bfi\bil\ble\be w\bwe\be j\bju\bus\bst\bt r\bre\beq\bqu\bue\bes\bst\bte\bed\bd.\b. O\bOn\bnl\bly\by w\bwh\bhe\ben\bn i\bit\bt d\bdo\boe\bes\bsn\bn'\b't\bt h\bha\bav\bve\be a\ban\bny\by o\bof\bf t\bth\bhe\be f\bfi\bil\ble\be d\bdo\bo t\bth\bhe\be f\bfo\bol\bll\blo\bow\bwi\bin\bng\bg p\bpa\bad\bd f\bfi\bil\ble\bes\bs w\bwi\bil\bll\bl m\bma\bak\bke\be i\bit\bt |\n+|c\bco\bom\bmp\bpl\bli\bic\bca\bat\bte\bed\bd *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/w\bwe\beb\bb_\b_p\bpe\bee\ber\br_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn.\b.c\bcp\bpp\bp:\b:6\b62\b26\b6 *\b**\b**\b* |\n+|\tpeer_connection::received_invalid_data(index, single_peer); |\n+| |\n+|\t// if we don't think we have any of the files, allow banning the web seed |\n+|\tif (num_have_pieces() == 0) return true; |\n+| |\n+|\t// don't disconnect, we won't request anything from this file again |\n+|\treturn false; |\n+|} |\n+| |\n+|void web_peer_connection::on_receive_padfile() |\n+|{ |\n+|\thandle_padfile(); |\n+|} |\n+| |\n+|void web_peer_connection::handle_error(int const bytes_left) |\n+|{ |\n+|\tstd::shared_ptr t = associated_torrent().lock(); |\n+|\tTORRENT_ASSERT(t); |\n+| |\n+| |\n+|// temporarily unavailable, retry later |\n+|\tt->retry_web_seed(this, m_parser.header_duration(\"retry-after\")); |\n+|\tif (t->alerts().should_post()) |\n+|\t{ |\n+|\t\tstd::string const error_msg = to_string(m_parser.status_code()).data() |\n+|\t\t\t+ (\" \" + m_parser.message()); |\n+|\t\tt->alerts().emplace_alert(t->get_handle(), m_url |\n+|\t\t\t, error_msg); |\n+|\t} |\n+|\treceived_bytes(0, bytes_left); |\n+|\tdisconnect(error_code(m_parser.status_code(), http_category()), operation_t::bittorrent, failure); |\n+|} |\n+| |\n+|void web_peer_connection::disable(error_code const& ec) |\n+|{ |\n+|\t// we should not try this server again. |\n+|\tm_web->disabled = true; |\n+|\tdisconnect(ec, operation_t::bittorrent, peer_error); |\n+|\tif (m_web->ephemeral) |\n+|\t{ |\n+|\t\tstd::shared_ptr t = associated_torrent().lock(); |\n+|\t\tTORRENT_ASSERT(t); |\n+|\t\tt->remove_web_seed_conn(this); |\n+|\t} |\n+|\tm_web = nullptr; |\n+|\tTORRENT_ASSERT(is_disconnecting()); |\n+|} |\n+| |\n+|void web_peer_connection::handle_redirect(int const bytes_left) |\n+|_\b{_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+| |_\b._\b._\b/_\bs_\br_\bc_\b/ | |\n+|relevance\u00a02|_\bh_\bt_\bt_\bp_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b._\bc_\bp_\bp_\b: |returning a bool here is redundant. Instead this function should return the peer_entry |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b4_\b7_\b9_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* r\bre\bet\btu\bur\brn\bni\bin\bng\bg a\ba b\bbo\boo\bol\bl h\bhe\ber\bre\be i\bis\bs r\bre\bed\bdu\bun\bnd\bda\ban\bnt\bt.\b. I\bIn\bns\bst\bte\bea\bad\bd t\bth\bhi\bis\bs f\bfu\bun\bnc\bct\bti\bio\bon\bn s\bsh\bho\bou\bul\bld\bd r\bre\bet\btu\bur\brn\bn t\bth\bhe\be p\bpe\bee\ber\br_\b_e\ben\bnt\btr\bry\by *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/h\bht\btt\btp\bp_\b_t\btr\bra\bac\bck\bke\ber\br_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn.\b.c\bcp\bpp\bp:\b:4\b47\b79\b9 *\b**\b**\b* |\n+|{ |\n+|\t\t\tcb->tracker_scrape_response(tracker_req(), resp.complete |\n+|\t\t\t\t, resp.incomplete, resp.downloaded, resp.downloaders); |\n+|\t\t} |\n+|\t\telse |\n+|\t\t{ |\n+|\t\t\tstd::list
    ip_list; |\n+|\t\t\tif (m_tracker_connection) |\n+|\t\t\t{ |\n+|\t\t\t\tfor (auto const& endp : m_tracker_connection->endpoints()) |\n+|\t\t\t\t{ |\n+|\t\t\t\t\tip_list.push_back(endp.address()); |\n+|\t\t\t\t} |\n+|\t\t\t} |\n+| |\n+|\t\t\tcb->tracker_response(tracker_req(), m_tracker_ip, ip_list, resp); |\n+|\t\t} |\n+|\t\tclose(); |\n+|\t} |\n+| |\n+|bool extract_peer_info(bdecode_node const& info, peer_entry& ret, error_code& ec) |\n+|{ |\n+|\t\t// extract peer id (if any) |\n+|\t\tif (info.type() != bdecode_node::dict_t) |\n+|\t\t{ |\n+|\t\t\tec = errors::invalid_peer_dict; |\n+|\t\t\treturn false; |\n+|\t\t} |\n+|\t\tbdecode_node i = info.dict_find_string(\"peer id\"); |\n+|\t\tif (i && i.string_length() == 20) |\n+|\t\t{ |\n+|\t\t\tstd::copy(i.string_ptr(), i.string_ptr() + 20, ret.pid.begin()); |\n+|\t\t} |\n+|\t\telse |\n+|\t\t{ |\n+|\t\t\t// if there's no peer_id, just initialize it to a bunch of zeroes |\n+|\t\t\tret.pid.clear(); |\n+|\t\t} |\n+| |\n+|\t\t// extract ip |\n+|\t\ti = info.dict_find_string(\"ip\"); |\n+|\t\tif (!i) |\n+|\t\t{ |\n+|\t\t\tec = errors::invalid_tracker_response; |\n+|\t\t\treturn false; |\n+|\t\t} |\n+|\t\tret.hostname = i.string_value().to_string(); |\n+| |\n+|\t\t// extract port |\n+|\t\ti = info.dict_find_int(\"port\"); |\n+|_\b\t_\b\t_\bi_\bf_\b _\b(_\b!_\bi_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b2_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bi_\bm_\bp_\bl_\b._\bc_\bp_\bp_\b:_\b5_\b9_\b9_\b _\b _\b _\b|_\bi_\bs_\b _\bt_\bh_\be_\br_\be_\b _\ba_\b _\br_\be_\ba_\bs_\bo_\bn_\b _\bn_\bo_\bt_\b _\bt_\bo_\b _\bm_\bo_\bv_\be_\b _\ba_\bl_\bl_\b _\bo_\bf_\b _\bt_\bh_\bi_\bs_\b _\bi_\bn_\bt_\bo_\b _\bi_\bn_\bi_\bt_\b(_\b)_\b?_\b _\ba_\bn_\bd_\b _\bj_\bu_\bs_\bt_\b _\bp_\bo_\bs_\bt_\b _\bi_\bt_\b _\bt_\bo_\b _\bt_\bh_\be_\b _\bi_\bo_\b__\bc_\bo_\bn_\bt_\be_\bx_\bt_\b?_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |*\b**\b**\b**\b**\b* i\bis\bs t\bth\bhe\ber\bre\be a\ba r\bre\bea\bas\bso\bon\bn n\bno\bot\bt t\bto\bo m\bmo\bov\bve\be a\bal\bll\bl o\bof\bf t\bth\bhi\bis\bs i\bin\bnt\bto\bo i\bin\bni\bit\bt(\b()\b)?\b? a\ban\bnd\bd j\bju\bus\bst\bt p\bpo\bos\bst\bt i\bit\bt t\bto\bo t\bth\bhe\be i\bio\bo_\b_c\bco\bon\bnt\bte\bex\bxt\bt?\b? *\b**\b**\b**\b**\b* |\n |*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/s\bse\bes\bss\bsi\bio\bon\bn_\b_i\bim\bmp\bpl\bl.\b.c\bcp\bpp\bp:\b:5\b59\b99\b9 *\b**\b**\b* |\n |try |\n |#endif |\n |\t{ |\n |\t\t(this->*f)(std::forward(a)...); |\n@@ -2887,664 +3481,14 @@\n | |\n |#ifndef TORRENT_DISABLE_LOGGING |\n |\t\t\t\tif (should_log()) |\n |\t\t\t\t{ |\n |\t\t\t\t\tsession_log(\">>> SET_DSCP [ udp (%s %d) value: %x e: %s ]\" |\n |\t\t\t\t\t\t, l->udp_sock->sock.local_endpoint().address().to_string().c_str() |\n |_\b\t_\b\t_\b\t_\b\t_\b\t_\b\t_\b,_\b _\bl_\b-_\b>_\bu_\bd_\bp_\b__\bs_\bo_\bc_\bk_\b-_\b>_\bs_\bo_\bc_\bk_\b._\bl_\bo_\bc_\ba_\bl_\b__\bp_\bo_\br_\bt_\b(_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b2_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\be_\bs_\bc_\ba_\bp_\be_\b__\bs_\bt_\br_\bi_\bn_\bg_\b._\bc_\bp_\bp_\b:_\b1_\b9_\b4_\b _\b _\b|_\bt_\bh_\bi_\bs_\b _\bs_\bh_\bo_\bu_\bl_\bd_\b _\bp_\br_\bo_\bb_\ba_\bb_\bl_\by_\b _\bb_\be_\b _\bm_\bo_\bv_\be_\bd_\b _\bi_\bn_\bt_\bo_\b _\bs_\bt_\br_\bi_\bn_\bg_\b__\bu_\bt_\bi_\bl_\b._\bc_\bp_\bp_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs s\bsh\bho\bou\bul\bld\bd p\bpr\bro\bob\bba\bab\bbl\bly\by b\bbe\be m\bmo\bov\bve\bed\bd i\bin\bnt\bto\bo s\bst\btr\bri\bin\bng\bg_\b_u\but\bti\bil\bl.\b.c\bcp\bpp\bp *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/e\bes\bsc\bca\bap\bpe\be_\b_s\bst\btr\bri\bin\bng\bg.\b.c\bcp\bpp\bp:\b:1\b19\b94\b4 *\b**\b**\b* |\n-|{ |\n-|\t\treturn escape_string_impl(str.data(), int(str.size()), 10); |\n-|\t} |\n-| |\n-|\tbool need_encoding(char const* str, int const len) |\n-|\t{ |\n-|\t\tfor (int i = 0; i < len; ++i) |\n-|\t\t{ |\n-|\t\t\tif (std::strchr(unreserved_chars, *str) == nullptr || *str == 0) |\n-|\t\t\t\treturn true; |\n-|\t\t\t++str; |\n-|\t\t} |\n-|\t\treturn false; |\n-|\t} |\n-| |\n-|\tvoid convert_path_to_posix(std::string& path) |\n-|\t{ |\n-|\t\tstd::replace(path.begin(), path.end(), '\\\\', '/'); |\n-|\t} |\n-| |\n-|std::string read_until(char const*& str, char const delim, char const* end) |\n-|{ |\n-|\t\tTORRENT_ASSERT(str <= end); |\n-| |\n-|\t\tstd::string ret; |\n-|\t\twhile (str != end && *str != delim) |\n-|\t\t{ |\n-|\t\t\tret += *str; |\n-|\t\t\t++str; |\n-|\t\t} |\n-|\t\t// skip the delimiter as well |\n-|\t\twhile (str != end && *str == delim) ++str; |\n-|\t\treturn ret; |\n-|\t} |\n-| |\n-|\tstd::string maybe_url_encode(std::string const& url) |\n-|\t{ |\n-|\t\tstd::string protocol, host, auth, path; |\n-|\t\tint port; |\n-|\t\terror_code ec; |\n-|\t\tstd::tie(protocol, auth, host, port, path) = parse_url_components(url, ec); |\n-|\t\tif (ec) return url; |\n-| |\n-|\t\t// first figure out if this url contains unencoded characters |\n-|\t\tif (!need_encoding(path.c_str(), int(path.size()))) |\n-|\t\t\treturn url; |\n-| |\n-|\t\tstd::string msg; |\n-|\t\tstd::string escaped_path { escape_path(path) }; |\n-|\t\t// reserve enough space so further append will |\n-|_\b\t_\b\t_\b/_\b/_\b _\bo_\bn_\bl_\by_\b _\bc_\bo_\bp_\by_\b _\bv_\ba_\bl_\bu_\be_\bs_\b _\bt_\bo_\b _\be_\bx_\bi_\bs_\bt_\bi_\bn_\bg_\b _\bl_\bo_\bc_\ba_\bt_\bi_\bo_\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-| |_\b._\b._\b/_\bs_\br_\bc_\b/ | |\n-|relevance\u00a02|_\bh_\bt_\bt_\bp_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b._\bc_\bp_\bp_\b: |returning a bool here is redundant. Instead this function should return the peer_entry |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b4_\b7_\b9_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* r\bre\bet\btu\bur\brn\bni\bin\bng\bg a\ba b\bbo\boo\bol\bl h\bhe\ber\bre\be i\bis\bs r\bre\bed\bdu\bun\bnd\bda\ban\bnt\bt.\b. I\bIn\bns\bst\bte\bea\bad\bd t\bth\bhi\bis\bs f\bfu\bun\bnc\bct\bti\bio\bon\bn s\bsh\bho\bou\bul\bld\bd r\bre\bet\btu\bur\brn\bn t\bth\bhe\be p\bpe\bee\ber\br_\b_e\ben\bnt\btr\bry\by *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/h\bht\btt\btp\bp_\b_t\btr\bra\bac\bck\bke\ber\br_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn.\b.c\bcp\bpp\bp:\b:4\b47\b79\b9 *\b**\b**\b* |\n-|{ |\n-|\t\t\tcb->tracker_scrape_response(tracker_req(), resp.complete |\n-|\t\t\t\t, resp.incomplete, resp.downloaded, resp.downloaders); |\n-|\t\t} |\n-|\t\telse |\n-|\t\t{ |\n-|\t\t\tstd::list
    ip_list; |\n-|\t\t\tif (m_tracker_connection) |\n-|\t\t\t{ |\n-|\t\t\t\tfor (auto const& endp : m_tracker_connection->endpoints()) |\n-|\t\t\t\t{ |\n-|\t\t\t\t\tip_list.push_back(endp.address()); |\n-|\t\t\t\t} |\n-|\t\t\t} |\n-| |\n-|\t\t\tcb->tracker_response(tracker_req(), m_tracker_ip, ip_list, resp); |\n-|\t\t} |\n-|\t\tclose(); |\n-|\t} |\n-| |\n-|bool extract_peer_info(bdecode_node const& info, peer_entry& ret, error_code& ec) |\n-|{ |\n-|\t\t// extract peer id (if any) |\n-|\t\tif (info.type() != bdecode_node::dict_t) |\n-|\t\t{ |\n-|\t\t\tec = errors::invalid_peer_dict; |\n-|\t\t\treturn false; |\n-|\t\t} |\n-|\t\tbdecode_node i = info.dict_find_string(\"peer id\"); |\n-|\t\tif (i && i.string_length() == 20) |\n-|\t\t{ |\n-|\t\t\tstd::copy(i.string_ptr(), i.string_ptr() + 20, ret.pid.begin()); |\n-|\t\t} |\n-|\t\telse |\n-|\t\t{ |\n-|\t\t\t// if there's no peer_id, just initialize it to a bunch of zeroes |\n-|\t\t\tret.pid.clear(); |\n-|\t\t} |\n-| |\n-|\t\t// extract ip |\n-|\t\ti = info.dict_find_string(\"ip\"); |\n-|\t\tif (!i) |\n-|\t\t{ |\n-|\t\t\tec = errors::invalid_tracker_response; |\n-|\t\t\treturn false; |\n-|\t\t} |\n-|\t\tret.hostname = i.string_value().to_string(); |\n-| |\n-|\t\t// extract port |\n-|\t\ti = info.dict_find_int(\"port\"); |\n-|_\b\t_\b\t_\bi_\bf_\b _\b(_\b!_\bi_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b2_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bu_\bp_\bn_\bp_\b._\bc_\bp_\bp_\b:_\b1_\b0_\b6_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bu_\bs_\be_\b _\bb_\bo_\bo_\bs_\bt_\b:_\b:_\ba_\bs_\bi_\bo_\b:_\b:_\bi_\bp_\b:_\b:_\bn_\be_\bt_\bw_\bo_\br_\bk_\b _\bi_\bn_\bs_\bt_\be_\ba_\bd_\b _\bo_\bf_\b _\bn_\be_\bt_\bm_\ba_\bs_\bk_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* u\bus\bse\be b\bbo\boo\bos\bst\bt:\b::\b:a\bas\bsi\bio\bo:\b::\b:i\bip\bp:\b::\b:n\bne\bet\btw\bwo\bor\brk\bk i\bin\bns\bst\bte\bea\bad\bd o\bof\bf n\bne\bet\btm\bma\bas\bsk\bk *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/u\bup\bpn\bnp\bp.\b.c\bcp\bpp\bp:\b:1\b10\b06\b6 *\b**\b**\b* |\n-|static error_code ignore_error; |\n-| |\n-|upnp::rootdevice::rootdevice() = default; |\n-| |\n-|#if TORRENT_USE_ASSERTS |\n-|upnp::rootdevice::~rootdevice() |\n-|{ |\n-|\tTORRENT_ASSERT(magic == 1337); |\n-|\tmagic = 0; |\n-|} |\n-|#else |\n-|upnp::rootdevice::~rootdevice() = default; |\n-|#endif |\n-| |\n-|upnp::rootdevice::rootdevice(rootdevice const&) = default; |\n-|upnp::rootdevice& upnp::rootdevice::operator=(rootdevice const&) & = default; |\n-|upnp::rootdevice::rootdevice(rootdevice&&) noexcept = default; |\n-|upnp::rootdevice& upnp::rootdevice::operator=(rootdevice&&) & = default; |\n-| |\n-|upnp::upnp(io_context& ios |\n-|, aux::session_settings const& settings |\n-|\t, aux::portmap_callback& cb |\n-|\t, address_v4 const listen_address |\n-|\t, address_v4 const netmask |\n-|\t, std::string listen_device |\n-|\t, listen_socket_handle ls) |\n-|\t: m_settings(settings) |\n-|\t, m_callback(cb) |\n-|\t, m_io_service(ios) |\n-|\t, m_resolver(ios) |\n-|\t, m_multicast(ios) |\n-|\t, m_unicast(ios) |\n-|\t, m_broadcast_timer(ios) |\n-|\t, m_refresh_timer(ios) |\n-|\t, m_map_timer(ios) |\n-|\t, m_listen_address(listen_address) |\n-|\t, m_netmask(netmask) |\n-|\t, m_device(std::move(listen_device)) |\n-|#if TORRENT_USE_SSL |\n-|\t, m_ssl_ctx(ssl::context::sslv23_client) |\n-|#endif |\n-|\t, m_listen_handle(std::move(ls)) |\n-|{ |\n-|#if TORRENT_USE_SSL |\n-|\tm_ssl_ctx.set_verify_mode(ssl::context::verify_none); |\n-|#endif |\n-|} |\n-| |\n-|void upnp::start() |\n-|_\b{_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a02|_\b._\b._\b/_\bs_\br_\bc_\b/ |peer_connection and tracker_connection should probably be flags |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bi_\bn_\bs_\bt_\ba_\bn_\bt_\bi_\ba_\bt_\be_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b._\bc_\bp_\bp_\b:_\b4_\b4_\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* p\bpe\bee\ber\br_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn a\ban\bnd\bd t\btr\bra\bac\bck\bke\ber\br_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn s\bsh\bho\bou\bul\bld\bd p\bpr\bro\bob\bba\bab\bbl\bly\by b\bbe\be f\bfl\bla\bag\bgs\bs *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/i\bin\bns\bst\bta\ban\bnt\bti\bia\bat\bte\be_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn.\b.c\bcp\bpp\bp:\b:4\b44\b4 *\b**\b**\b* |\n-|ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |\n-|LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |\n-|CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |\n-|SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |\n-|INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |\n-|CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |\n-|ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |\n-|POSSIBILITY OF SUCH DAMAGE. |\n-| |\n-|*/ |\n-| |\n-|#include \"libtorrent/socket.hpp\" |\n-|#include \"libtorrent/aux_/socket_type.hpp\" |\n-|#include \"libtorrent/aux_/utp_socket_manager.hpp\" |\n-|#include \"libtorrent/aux_/instantiate_connection.hpp\" |\n-|#include \"libtorrent/aux_/utp_stream.hpp\" |\n-|#include \"libtorrent/ssl_stream.hpp\" |\n-| |\n-|namespace libtorrent { namespace aux { |\n-| |\n-|aux::socket_type instantiate_connection(io_context& ios |\n-|, aux::proxy_settings const& ps |\n-|\t\t, void* ssl_context |\n-|\t\t, utp_socket_manager* sm |\n-|\t\t, bool peer_connection |\n-|\t\t, bool tracker_connection) |\n-|\t{ |\n-|#if !TORRENT_USE_SSL |\n-|\t\tTORRENT_UNUSED(ssl_context); |\n-|#endif |\n-| |\n-|\t\tif (sm) |\n-|\t\t{ |\n-|#if TORRENT_USE_SSL |\n-|\t\t\tif (ssl_context) |\n-|\t\t\t{ |\n-|\t\t\t\tssl_stream s(ios, *static_cast(ssl_context)); |\n-|\t\t\t\ts.next_layer().set_impl(sm->new_utp_socket(&s.next_layer())); |\n-|\t\t\t\treturn socket_type(std::move(s)); |\n-|\t\t\t} |\n-|\t\t\telse |\n-|#endif |\n-|\t\t\t{ |\n-|\t\t\t\tutp_stream s(ios); |\n-|\t\t\t\ts.set_impl(sm->new_utp_socket(&s)); |\n-|\t\t\t\treturn socket_type(std::move(s)); |\n-|\t\t\t} |\n-|\t\t} |\n-|#if TORRENT_USE_I2P |\n-|\t\telse if (ps.type == settings_pack::i2p_proxy) |\n-|_\b\t_\b\t_\b{_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b2_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b5_\b0_\b4_\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bp_\bo_\bs_\bt_\b _\ba_\bl_\be_\br_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* p\bpo\bos\bst\bt a\bal\ble\ber\brt\bt *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:5\b50\b04\b4 *\b**\b**\b* |\n-|if (m_current_gauge_state != no_gauge_state) |\n-|\t\t\tinc_stats_counter(m_current_gauge_state + counters::num_checking_torrents, -1); |\n-|\t\tif (new_gauge_state != no_gauge_state) |\n-|\t\t\tinc_stats_counter(new_gauge_state + counters::num_checking_torrents, 1); |\n-| |\n-|\t\tTORRENT_ASSERT(new_gauge_state >= 0); |\n-|\t\tTORRENT_ASSERT(new_gauge_state <= no_gauge_state); |\n-|\t\tm_current_gauge_state = static_cast(new_gauge_state); |\n-|\t} |\n-| |\n-|\tvoid torrent::leave_seed_mode(seed_mode_t const checking) |\n-|\t{ |\n-|\t\tif (!m_seed_mode) return; |\n-| |\n-|\t\tif (checking == seed_mode_t::check_files) |\n-|\t\t{ |\n-|\t\t\t// this means the user promised we had all the |\n-|\t\t\t// files, but it turned out we didn't. This is |\n-|\t\t\t// an error. |\n-| |\n-| |\n-|#ifndef TORRENT_DISABLE_LOGGING |\n-|\t\t\tdebug_log(\"*** FAILED SEED MODE, rechecking\"); |\n-|#endif |\n-|\t\t} |\n-| |\n-|#ifndef TORRENT_DISABLE_LOGGING |\n-|\t\tdebug_log(\"*** LEAVING SEED MODE (%s)\" |\n-|\t\t\t, checking == seed_mode_t::skip_checking ? \"as seed\" : \"as non-seed\"); |\n-|#endif |\n-|\t\tm_seed_mode = false; |\n-|\t\t// seed is false if we turned out not |\n-|\t\t// to be a seed after all |\n-|\t\tif (checking == seed_mode_t::check_files |\n-|\t\t\t&& state() != torrent_status::checking_resume_data) |\n-|\t\t{ |\n-|\t\t\tm_have_all = false; |\n-|\t\t\tset_state(torrent_status::downloading); |\n-|\t\t\tforce_recheck(); |\n-|\t\t} |\n-|\t\tm_num_verified = 0; |\n-|\t\tm_verified.clear(); |\n-|\t\tm_verifying.clear(); |\n-| |\n-|\t\tset_need_save_resume(torrent_handle::if_state_changed); |\n-|\t} |\n-| |\n-|\tvoid torrent::verified(piece_index_t const piece) |\n-|\t{ |\n-|\t\tTORRENT_ASSERT(!m_verified.get_bit(piece)); |\n-|_\b\t_\b\t_\b+_\b+_\bm_\b__\bn_\bu_\bm_\b__\bv_\be_\br_\bi_\bf_\bi_\be_\bd_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b2_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b1_\b8_\b5_\b2_\b _\b _\b _\b _\b _\b _\b _\b|_\ba_\bd_\bd_\b _\ba_\b _\bu_\bn_\bi_\bt_\b _\bt_\be_\bs_\bt_\b _\bw_\bh_\be_\br_\be_\b _\bw_\be_\b _\bd_\bo_\bn_\b'_\bt_\b _\bh_\ba_\bv_\be_\b _\bm_\be_\bt_\ba_\bd_\ba_\bt_\ba_\b,_\b _\bc_\bo_\bn_\bn_\be_\bc_\bt_\b _\bt_\bo_\b _\ba_\b _\bp_\be_\be_\br_\b _\bt_\bh_\ba_\bt_\b _\bs_\be_\bn_\bd_\bs_\b _\ba_\b _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd_\b _\bt_\bh_\ba_\bt_\b'_\bs_\b _\bt_\bo_\bo_\b _\bl_\ba_\br_\bg_\be_\b,_\b _\bt_\bh_\be_\bn_\b _\bw_\be_\b _\bg_\be_\bt_\b _\bt_\bh_\be_\b _\bm_\be_\bt_\ba_\bd_\ba_\bt_\ba_\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* a\bad\bdd\bd a\ba u\bun\bni\bit\bt t\bte\bes\bst\bt w\bwh\bhe\ber\bre\be w\bwe\be d\bdo\bon\bn'\b't\bt h\bha\bav\bve\be m\bme\bet\bta\bad\bda\bat\bta\ba,\b, c\bco\bon\bnn\bne\bec\bct\bt t\bto\bo a\ba p\bpe\bee\ber\br t\bth\bha\bat\bt s\bse\ben\bnd\bds\bs a\ba b\bbi\bit\btf\bfi\bie\bel\bld\bd t\bth\bha\bat\bt'\b's\bs t\bto\boo\bo l\bla\bar\brg\bge\be,\b, t\bth\bhe\ben\bn w\bwe\be g\bge\bet\bt t\bth\bhe\be m\bme\bet\bta\bad\bda\bat\bta\ba *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:1\b18\b85\b52\b2 *\b**\b**\b* |\n-|for (auto const& f : m_add_torrent_params->renamed_files) |\n-|\t\t\t{ |\n-|\t\t\t\tif (f.first < file_index_t(0) || f.first >= fs.end_file()) continue; |\n-|\t\t\t\tm_torrent_file->rename_file(file_index_t(f.first), f.second); |\n-|\t\t\t} |\n-|\t\t} |\n-| |\n-|\t\tconstruct_storage(); |\n-| |\n-|#ifndef TORRENT_DISABLE_SHARE_MODE |\n-|\t\tif (m_share_mode && valid_metadata()) |\n-|\t\t{ |\n-|\t\t\t// in share mode, all pieces have their priorities initialized to 0 |\n-|\t\t\tm_file_priority.clear(); |\n-|\t\t\tm_file_priority.resize(m_torrent_file->num_files(), dont_download); |\n-|\t\t} |\n-|#endif |\n-| |\n-|\t\t// it's important to initialize the peers early, because this is what will |\n-|\t\t// fix up their have-bitmasks to have the correct size |\n-|if (!m_connections_initialized) |\n-|{ |\n-|\t\t\tm_connections_initialized = true; |\n-|\t\t\t// all peer connections have to initialize themselves now that the metadata |\n-|\t\t\t// is available |\n-|\t\t\t// copy the peer list since peers may disconnect and invalidate |\n-|\t\t\t// m_connections as we initialize them |\n-|\t\t\tfor (auto c : m_connections) |\n-|\t\t\t{ |\n-|\t\t\t\tauto pc = c->self(); |\n-|\t\t\t\tif (pc->is_disconnecting()) continue; |\n-|\t\t\t\tpc->on_metadata_impl(); |\n-|\t\t\t\tif (pc->is_disconnecting()) continue; |\n-|\t\t\t\tpc->init(); |\n-|\t\t\t} |\n-|\t\t} |\n-| |\n-|\t\t// in case file priorities were passed in via the add_torrent_params |\n-|\t\t// and also in the case of share mode, we need to update the priorities |\n-|\t\t// this has to be applied before piece priority |\n-|\t\tif (!m_file_priority.empty()) |\n-|\t\t{ |\n-|\t\t\t// m_file_priority was loaded from the resume data, this doesn't |\n-|\t\t\t// alter any state that needs to be saved in the resume data |\n-|\t\t\tauto const ns = m_need_save_resume_data; |\n-|\t\t\tupdate_piece_priorities(m_file_priority); |\n-|\t\t\tm_need_save_resume_data = ns; |\n-|\t\t} |\n-| |\n-|\t\tif (m_add_torrent_params) |\n-|_\b\t_\b\t_\b{_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b2_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b4_\b4_\b9_\b2_\b _\b _\b _\b _\b _\b _\b _\b|_\bu_\bs_\be_\b _\bc_\bh_\br_\bo_\bn_\bo_\b _\bt_\by_\bp_\be_\b _\bf_\bo_\br_\b _\bt_\bi_\bm_\be_\b _\bd_\bu_\br_\ba_\bt_\bi_\bo_\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* u\bus\bse\be c\bch\bhr\bro\bon\bno\bo t\bty\byp\bpe\be f\bfo\bor\br t\bti\bim\bme\be d\bdu\bur\bra\bat\bti\bio\bon\bn *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:4\b44\b49\b92\b2 *\b**\b**\b* |\n-|} |\n-| |\n-|\t\tm_picker->piece_passed(index); |\n-|\t\tupdate_gauge(); |\n-|\t\twe_have(index); |\n-| |\n-|#ifndef TORRENT_DISABLE_LOGGING |\n-|\t\tif (should_log()) |\n-|\t\t\tdebug_log(\"we_have(%d) (num_have: %d)\", int(index), num_have()); |\n-|#endif |\n-|#ifndef TORRENT_DISABLE_STREAMING |\n-|\t\tremove_time_critical_piece(index, true); |\n-|#endif |\n-|\t} |\n-| |\n-|#ifndef TORRENT_DISABLE_PREDICTIVE_PIECES |\n-|\t// we believe we will complete this piece very soon |\n-|\t// announce it to peers ahead of time to eliminate the |\n-|\t// round-trip times involved in announcing it, requesting it |\n-|\t// and sending it |\n-|void torrent::predicted_have_piece(piece_index_t const index, int const milliseconds) |\n-|{ |\n-|\t\tauto const i = std::lower_bound(m_predictive_pieces.begin() |\n-|\t\t\t, m_predictive_pieces.end(), index); |\n-|\t\tif (i != m_predictive_pieces.end() && *i == index) return; |\n-| |\n-|\t\tfor (auto p : m_connections) |\n-|\t\t{ |\n-|\t\t\tTORRENT_INCREMENT(m_iterating_connections); |\n-|#ifndef TORRENT_DISABLE_LOGGING |\n-|\t\t\tp->peer_log(peer_log_alert::outgoing, \"PREDICTIVE_HAVE\", \"piece: %d expected in %d ms\" |\n-|\t\t\t\t, static_cast(index), milliseconds); |\n-|#else |\n-|\t\t\tTORRENT_UNUSED(milliseconds); |\n-|#endif |\n-|\t\t\tp->announce_piece(index); |\n-|\t\t} |\n-| |\n-|\t\tm_predictive_pieces.insert(i, index); |\n-|\t} |\n-|#endif |\n-| |\n-|\t// blocks may contain the block indices of the blocks that failed (if this is |\n-|\t// a v2 torrent). |\n-|\tvoid torrent::piece_failed(piece_index_t const index, std::vector blocks) |\n-|\t{ |\n-|\t\t// if the last piece fails the peer connection will still |\n-|\t\t// think that it has received all of it until this function |\n-|\t\t// resets the download queue. So, we cannot do the |\n-|\t\t// invariant check here since it assumes: |\n-|_\b\t_\b\t_\b/_\b/_\b _\b(_\bt_\bo_\bt_\ba_\bl_\b__\bd_\bo_\bn_\be_\b _\b=_\b=_\b _\bm_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bi_\bl_\be_\b-_\b>_\bt_\bo_\bt_\ba_\bl_\b__\bs_\bi_\bz_\be_\b(_\b)_\b)_\b _\b=_\b>_\b _\bi_\bs_\b__\bs_\be_\be_\bd_\b(_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b2_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b4_\b9_\b1_\b9_\b _\b _\b _\b _\b _\b _\b _\b|_\ba_\bb_\bo_\br_\bt_\b _\bl_\bo_\bo_\bk_\bu_\bp_\bs_\b _\bt_\bh_\bi_\bs_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\b _\bh_\ba_\bs_\b _\bm_\ba_\bd_\be_\b _\bv_\bi_\ba_\b _\bt_\bh_\be_\b _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b _\bh_\bo_\bs_\bt_\b _\br_\be_\bs_\bo_\bl_\bv_\be_\br_\b _\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* a\bab\bbo\bor\brt\bt l\blo\boo\bok\bku\bup\bps\bs t\bth\bhi\bis\bs t\bto\bor\brr\bre\ben\bnt\bt h\bha\bas\bs m\bma\bad\bde\be v\bvi\bia\ba t\bth\bhe\be s\bse\bes\bss\bsi\bio\bon\bn h\bho\bos\bst\bt r\bre\bes\bso\bol\blv\bve\ber\br i\bin\bnt\bte\ber\brf\bfa\bac\bce\be *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:4\b49\b91\b19\b9 *\b**\b**\b* |\n-|TORRENT_UNUSED(e); |\n-|\t\t\t\tm_storage.reset(); |\n-|#ifndef TORRENT_DISABLE_LOGGING |\n-|\t\t\t\tdebug_log(\"Failed to flush disk cache: %s\", e.what()); |\n-|#endif |\n-|\t\t\t\t// clients may rely on this alert to be posted, so it's probably a |\n-|\t\t\t\t// good idea to post it here, even though we failed |\n-|\t\t\t\tif (alerts().should_post()) |\n-|\t\t\t\t\talerts().emplace_alert(get_handle()); |\n-|\t\t\t} |\n-|\t\t\tm_ses.deferred_submit_jobs(); |\n-|\t\t} |\n-|\t\telse |\n-|\t\t{ |\n-|\t\t\tif (alerts().should_post()) |\n-|\t\t\t\talerts().emplace_alert(get_handle()); |\n-|\t\t\talerts().emplace_alert(get_handle() |\n-|\t\t\t\t, info_hash(), get_userdata()); |\n-|\t\t} |\n-| |\n-| |\n-|if (!m_apply_ip_filter) |\n-|\t\t{ |\n-|\t\t\tinc_stats_counter(counters::non_filter_torrents, -1); |\n-|\t\t\tm_apply_ip_filter = true; |\n-|\t\t} |\n-| |\n-|\t\tm_paused = false; |\n-|\t\tm_auto_managed = false; |\n-|\t\tupdate_state_list(); |\n-|\t\tfor (torrent_list_index_t i{}; i != m_links.end_index(); ++i) |\n-|\t\t{ |\n-|\t\t\tif (!m_links[i].in_list()) continue; |\n-|\t\t\tm_links[i].unlink(m_ses.torrent_list(i), i); |\n-|\t\t} |\n-|\t\t// don't re-add this torrent to the state-update list |\n-|\t\tm_state_subscription = false; |\n-|\t} |\n-| |\n-|\t// this is called when we're destructing non-gracefully. i.e. we're _just_ |\n-|\t// destructing everything. |\n-|\tvoid torrent::panic() |\n-|\t{ |\n-|\t\tm_storage.reset(); |\n-|\t\t// if there are any other peers allocated still, we need to clear them |\n-|\t\t// now. They can't be cleared later because the allocator will already |\n-|\t\t// have been destructed |\n-|\t\tif (m_peer_list) m_peer_list->clear(); |\n-|\t\tm_connections.clear(); |\n-|\t\tm_outgoing_pids.clear(); |\n-|_\b\t_\b\t_\bm_\b__\bp_\be_\be_\br_\bs_\b__\bt_\bo_\b__\bd_\bi_\bs_\bc_\bo_\bn_\bn_\be_\bc_\bt_\b._\bc_\bl_\be_\ba_\br_\b(_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a02|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b8_\b0_\b3_\b2 |if peer is a really good peer, maybe we shouldn't disconnect it perhaps this logic should be disabled if we have too many idle peers|\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b(_\bw_\bi_\bt_\bh_\b _\bs_\bo_\bm_\be_\b _\bd_\be_\bf_\bi_\bn_\bi_\bt_\bi_\bo_\bn_\b _\bo_\bf_\b _\bi_\bd_\bl_\be_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* i\bif\bf p\bpe\bee\ber\br i\bis\bs a\ba r\bre\bea\bal\bll\bly\by g\bgo\boo\bod\bd p\bpe\bee\ber\br,\b, m\bma\bay\byb\bbe\be w\bwe\be s\bsh\bho\bou\bul\bld\bdn\bn'\b't\bt d\bdi\bis\bsc\bco\bon\bnn\bne\bec\bct\bt i\bit\bt p\bpe\ber\brh\bha\bap\bps\bs t\bth\bhi\bis\bs l\blo\bog\bgi\bic\bc s\bsh\bho\bou\bul\bld\bd b\bbe\be d\bdi\bis\bsa\bab\bbl\ble\bed\bd i\bif\bf w\bwe\be h\bha\bav\bve\be t\bto\boo\bo m\bma\ban\bny\by i\bid\bdl\ble\be p\bpe\bee\ber\brs\bs (\b(w\bwi\bit\bth\bh s\bso\bom\bme\be d\bde\bef\bfi\bin\bni\bit\bti\bio\bon\bn o\bof\bf i\bid\bdl\ble\be)\b) *\b**\b**\b**\b**\b*|\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:8\b80\b03\b32\b2 *\b**\b**\b* |\n-|\t\tm_peers_to_disconnect.reserve(m_connections.size() + 1); |\n-|\t\tm_connections.reserve(m_connections.size() + 1); |\n-| |\n-|#if TORRENT_USE_ASSERTS |\n-|\t\terror_code ec; |\n-|\t\tTORRENT_ASSERT(p->remote() == p->get_socket().remote_endpoint(ec) || ec); |\n-|#endif |\n-| |\n-|\t\tTORRENT_ASSERT(p->peer_info_struct() != nullptr); |\n-| |\n-|\t\t// we need to do this after we've added the peer to the peer_list |\n-|\t\t// since that's when the peer is assigned its peer_info object, |\n-|\t\t// which holds the rank |\n-|\t\tif (maybe_replace_peer) |\n-|\t\t{ |\n-|\t\t\t// now, find the lowest rank peer and disconnect that |\n-|\t\t\t// if it's lower rank than the incoming connection |\n-|\t\t\tpeer_connection* peer = find_lowest_ranking_peer(); |\n-| |\n-|if (peer != nullptr && peer->peer_rank() < p->peer_rank()) |\n-|{ |\n-|#ifndef TORRENT_DISABLE_LOGGING |\n-|\t\t\t\tif (should_log()) |\n-|\t\t\t\t{ |\n-|\t\t\t\t\tdebug_log(\"CLOSING CONNECTION \\\"%s\\\" peer list full (low peer rank) \" |\n-|\t\t\t\t\t\t\"connections: %d limit: %d\" |\n-|\t\t\t\t\t\t, print_endpoint(peer->remote()).c_str() |\n-|\t\t\t\t\t\t, num_peers() |\n-|\t\t\t\t\t\t, m_max_connections); |\n-|\t\t\t\t} |\n-|#endif |\n-|\t\t\t\tpeer->disconnect(errors::too_many_connections, operation_t::bittorrent); |\n-|\t\t\t\tp->peer_disconnected_other(); |\n-|\t\t\t} |\n-|\t\t\telse |\n-|\t\t\t{ |\n-|#ifndef TORRENT_DISABLE_LOGGING |\n-|\t\t\t\tif (should_log()) |\n-|\t\t\t\t{ |\n-|\t\t\t\t\tdebug_log(\"CLOSING CONNECTION \\\"%s\\\" peer list full (low peer rank) \" |\n-|\t\t\t\t\t\t\"connections: %d limit: %d\" |\n-|\t\t\t\t\t\t, print_endpoint(p->remote()).c_str() |\n-|\t\t\t\t\t\t, num_peers() |\n-|\t\t\t\t\t\t, m_max_connections); |\n-|\t\t\t\t} |\n-|#endif |\n-|\t\t\t\tp->disconnect(errors::too_many_connections, operation_t::bittorrent); |\n-|\t\t\t\t// we have to do this here because from the peer's point of view |\n-|\t\t\t\t// it wasn't really attached to the torrent, but we do need |\n-|_\b\t_\b\t_\b\t_\b\t_\b/_\b/_\b _\bt_\bo_\b _\bl_\be_\bt_\b _\bp_\be_\be_\br_\b__\bl_\bi_\bs_\bt_\b _\bk_\bn_\bo_\bw_\b _\bw_\be_\b'_\br_\be_\b _\br_\be_\bm_\bo_\bv_\bi_\bn_\bg_\b _\bi_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b2_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bb_\bd_\be_\bc_\bo_\bd_\be_\b._\bc_\bp_\bp_\b:_\b8_\b2_\b6_\b _\b _\b _\b _\b _\b _\b _\b _\b|_\ba_\bt_\bt_\be_\bm_\bp_\bt_\b _\bt_\bo_\b _\bs_\bi_\bm_\bp_\bl_\bi_\bf_\by_\b _\bt_\bh_\bi_\bs_\b _\bi_\bm_\bp_\bl_\be_\bm_\be_\bn_\bt_\ba_\bt_\bi_\bo_\bn_\b _\bb_\by_\b _\be_\bm_\bb_\br_\ba_\bc_\bi_\bn_\bg_\b _\bt_\bh_\be_\b _\bs_\bp_\ba_\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* a\bat\btt\bte\bem\bmp\bpt\bt t\bto\bo s\bsi\bim\bmp\bpl\bli\bif\bfy\by t\bth\bhi\bis\bs i\bim\bmp\bpl\ble\bem\bme\ben\bnt\bta\bat\bti\bio\bon\bn b\bby\by e\bem\bmb\bbr\bra\bac\bci\bin\bng\bg t\bth\bhe\be s\bsp\bpa\ban\bn *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/b\bbd\bde\bec\bco\bod\bde\be.\b.c\bcp\bpp\bp:\b:8\b82\b26\b6 *\b**\b**\b* |\n-|} |\n-| |\n-|\tbdecode_node bdecode(span buffer |\n-|\t\t, error_code& ec, int* error_pos, int depth_limit, int token_limit) |\n-|\t{ |\n-|\t\tbdecode_node ret; |\n-|\t\tec.clear(); |\n-| |\n-|\t\tif (buffer.size() > bdecode_token::max_offset) |\n-|\t\t{ |\n-|\t\t\tif (error_pos) *error_pos = 0; |\n-|\t\t\tec = bdecode_errors::limit_exceeded; |\n-|\t\t\treturn ret; |\n-|\t\t} |\n-| |\n-|\t\t// this is the stack of bdecode_token indices, into m_tokens. |\n-|\t\t// sp is the stack pointer, as index into the array, stack |\n-|\t\tint sp = 0; |\n-|\t\tTORRENT_ALLOCA(stack, stack_frame, depth_limit); |\n-| |\n-|char const* start = buffer.data(); |\n-|char const* end = start + buffer.size(); |\n-|\t\tchar const* const orig_start = start; |\n-| |\n-|\t\tif (start == end) |\n-|\t\t\tTORRENT_FAIL_BDECODE(bdecode_errors::unexpected_eof); |\n-| |\n-|\t\twhile (start <= end) |\n-|\t\t{ |\n-|\t\t\tif (start >= end) TORRENT_FAIL_BDECODE(bdecode_errors::unexpected_eof); |\n-| |\n-|\t\t\tif (sp >= depth_limit) |\n-|\t\t\t\tTORRENT_FAIL_BDECODE(bdecode_errors::depth_exceeded); |\n-| |\n-|\t\t\t--token_limit; |\n-|\t\t\tif (token_limit < 0) |\n-|\t\t\t\tTORRENT_FAIL_BDECODE(bdecode_errors::limit_exceeded); |\n-| |\n-|\t\t\t// look for a new token |\n-|\t\t\tchar const t = *start; |\n-| |\n-|\t\t\tint const current_frame = sp; |\n-| |\n-|\t\t\t// if we're currently parsing a dictionary, assert that |\n-|\t\t\t// every other node is a string. |\n-|\t\t\tif (current_frame > 0 |\n-|\t\t\t\t&& ret.m_tokens[stack[current_frame - 1].token].type == bdecode_token::dict) |\n-|\t\t\t{ |\n-|\t\t\t\tif (stack[current_frame - 1].state == 0) |\n-|\t\t\t\t{ |\n-|_\b\t_\b\t_\b\t_\b\t_\b\t_\b/_\b/_\b _\bt_\bh_\be_\b _\bc_\bu_\br_\br_\be_\bn_\bt_\b _\bp_\ba_\br_\be_\bn_\bt_\b _\bi_\bs_\b _\ba_\b _\bd_\bi_\bc_\bt_\b _\ba_\bn_\bd_\b _\bw_\be_\b _\ba_\br_\be_\b _\bp_\ba_\br_\bs_\bi_\bn_\bg_\b _\ba_\b _\bk_\be_\by_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b2_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bp_\ba_\bt_\bh_\b._\bc_\bp_\bp_\b:_\b4_\b2_\b9_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bt_\be_\bs_\bt_\b _\bt_\bh_\bi_\bs_\b _\bo_\bn_\b _\ba_\b _\bF_\bA_\bT_\b _\bv_\bo_\bl_\bu_\bm_\be_\b _\bt_\bo_\b _\bs_\be_\be_\b _\bw_\bh_\ba_\bt_\b _\be_\br_\br_\bo_\br_\b _\bw_\be_\b _\bg_\be_\bt_\b!_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bte\bes\bst\bt t\bth\bhi\bis\bs o\bon\bn a\ba F\bFA\bAT\bT v\bvo\bol\blu\bum\bme\be t\bto\bo s\bse\bee\be w\bwh\bha\bat\bt e\ber\brr\bro\bor\br w\bwe\be g\bge\bet\bt!\b! *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/p\bpa\bat\bth\bh.\b.c\bcp\bpp\bp:\b:4\b42\b29\b9 *\b**\b**\b* |\n-|// it's possible CreateHardLink will copy the file internally too, |\n-|\t\t\t// if the filesystem does not support it. |\n-|\t\t\tec.assign(GetLastError(), system_category()); |\n-|\t\t\treturn; |\n-|\t\t} |\n-| |\n-|\t\t// fall back to making a copy |\n-|#endif |\n-|#else |\n-|\t\t// assume posix's link() function exists |\n-|\t\tint ret = ::link(n_exist.c_str(), n_link.c_str()); |\n-| |\n-|\t\tif (ret == 0) |\n-|\t\t{ |\n-|\t\t\tec.clear(); |\n-|\t\t\treturn; |\n-|\t\t} |\n-| |\n-|\t\t// most errors are passed through, except for the ones that indicate that |\n-|\t\t// hard links are not supported and require a copy. |\n-|if (errno != EMLINK |\n-|&& errno != EXDEV |\n-|#ifdef TORRENT_BEOS |\n-|\t\t\t// haiku returns EPERM when the filesystem doesn't support hard link |\n-|\t\t\t&& errno != EPERM |\n-|#endif |\n-|\t\t\t) |\n-|\t\t{ |\n-|\t\t\t// some error happened, report up to the caller |\n-|\t\t\tec.assign(errno, system_category()); |\n-|\t\t\treturn; |\n-|\t\t} |\n-| |\n-|\t\t// fall back to making a copy |\n-| |\n-|#endif |\n-| |\n-|\t\t// if we get here, we should copy the file |\n-|\t\tstorage_error se; |\n-|\t\taux::copy_file(file, link, se); |\n-|\t\tec = se.ec; |\n-|\t} |\n-| |\n-|\tbool is_directory(std::string const& f, error_code& ec) |\n-|\t{ |\n-|\t\tec.clear(); |\n-|\t\terror_code e; |\n-|\t\tfile_status s; |\n-|\t\tstat_file(f, &s, e); |\n-|\t\tif (!e && s.mode & file_status::directory) return true; |\n-|_\b\t_\b\t_\be_\bc_\b _\b=_\b _\be_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b2_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\ba_\bl_\be_\br_\bt_\b._\bc_\bp_\bp_\b:_\b2_\b0_\b2_\b1_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bt_\bh_\be_\b _\bs_\ba_\bl_\bt_\b _\bh_\be_\br_\be_\b _\bi_\bs_\b _\ba_\bl_\bl_\bo_\bc_\ba_\bt_\be_\bd_\b _\bo_\bn_\b _\bt_\bh_\be_\b _\bh_\be_\ba_\bp_\b._\b _\bI_\bt_\b _\bw_\bo_\bu_\bl_\bd_\b _\bb_\be_\b _\bn_\bi_\bc_\be_\b _\bt_\bo_\b _\ba_\bl_\bl_\bo_\bc_\ba_\bt_\be_\b _\bi_\bn_\b _\bt_\bh_\be_\b _\bs_\bt_\ba_\bc_\bk_\b__\ba_\bl_\bl_\bo_\bc_\ba_\bt_\bo_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bth\bhe\be s\bsa\bal\blt\bt h\bhe\ber\bre\be i\bis\bs a\bal\bll\blo\boc\bca\bat\bte\bed\bd o\bon\bn t\bth\bhe\be h\bhe\bea\bap\bp.\b. I\bIt\bt w\bwo\bou\bul\bld\bd b\bbe\be n\bni\bic\bce\be t\bto\bo a\bal\bll\blo\boc\bca\bat\bte\be i\bin\bn t\bth\bhe\be s\bst\bta\bac\bck\bk_\b_a\bal\bll\blo\boc\bca\bat\bto\bor\br *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/a\bal\ble\ber\brt\bt.\b.c\bcp\bpp\bp:\b:2\b20\b02\b21\b1 *\b**\b**\b* |\n-|} |\n-| |\n-|\tdht_immutable_item_alert::dht_immutable_item_alert(aux::stack_allocator& |\n-|\t\t, sha1_hash const& t, entry i) |\n-|\t\t: target(t), item(std::move(i)) |\n-|\t{} |\n-| |\n-|\tstd::string dht_immutable_item_alert::message() const |\n-|\t{ |\n-|#ifdef TORRENT_DISABLE_ALERT_MSG |\n-|\t\treturn {}; |\n-|#else |\n-|\t\tchar msg[1050]; |\n-|\t\tstd::snprintf(msg, sizeof(msg), \"DHT immutable item %s [ %s ]\" |\n-|\t\t\t, aux::to_hex(target).c_str() |\n-|\t\t\t, item.to_string().c_str()); |\n-|\t\treturn msg; |\n-|#endif |\n-|\t} |\n-| |\n-|dht_mutable_item_alert::dht_mutable_item_alert(aux::stack_allocator& |\n-|, std::array const& k |\n-|\t\t, std::array const& sig |\n-|\t\t, std::int64_t sequence |\n-|\t\t, string_view s |\n-|\t\t, entry i |\n-|\t\t, bool a) |\n-|\t\t: key(k), signature(sig), seq(sequence), salt(s), item(std::move(i)), authoritative(a) |\n-|\t{} |\n-| |\n-|\tstd::string dht_mutable_item_alert::message() const |\n-|\t{ |\n-|#ifdef TORRENT_DISABLE_ALERT_MSG |\n-|\t\treturn {}; |\n-|#else |\n-|\t\tchar msg[1050]; |\n-|\t\tstd::snprintf(msg, sizeof(msg), \"DHT mutable item (key=%s salt=%s seq=%\" PRId64 \" %s) [ %s ]\" |\n-|\t\t\t, aux::to_hex(key).c_str() |\n-|\t\t\t, salt.c_str() |\n-|\t\t\t, seq |\n-|\t\t\t, authoritative ? \"auth\" : \"non-auth\" |\n-|\t\t\t, item.to_string().c_str()); |\n-|\t\treturn msg; |\n-|#endif |\n-|\t} |\n-| |\n-|\tdht_put_alert::dht_put_alert(aux::stack_allocator&, sha1_hash const& t, int n) |\n-|\t\t: target(t) |\n-|\t\t, public_key() |\n-|\t\t, signature() |\n-|_\b\t_\b\t_\b,_\b _\bs_\ba_\bl_\bt_\b(_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |relevance\u00a02|_\b._\b._\b/_\bs_\br_\bc_\b/_\bp_\be_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b._\bc_\bp_\bp_\b: |this should probably be based on time instead of number of request messages. For a very high throughput connection, 300 may be a |\n |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b2_\b5_\b6_\b2_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bl_\be_\bg_\bi_\bt_\bi_\bm_\ba_\bt_\be_\b _\bn_\bu_\bm_\bb_\be_\br_\b _\bo_\bf_\b _\br_\be_\bq_\bu_\be_\bs_\bt_\bs_\b _\bt_\bo_\b _\bh_\ba_\bv_\be_\b _\bi_\bn_\b _\bf_\bl_\bi_\bg_\bh_\bt_\b _\bw_\bh_\be_\bn_\b _\bg_\be_\bt_\bt_\bi_\bn_\bg_\b _\bc_\bh_\bo_\bk_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs s\bsh\bho\bou\bul\bld\bd p\bpr\bro\bob\bba\bab\bbl\bly\by b\bbe\be b\bba\bas\bse\bed\bd o\bon\bn t\bti\bim\bme\be i\bin\bns\bst\bte\bea\bad\bd o\bof\bf n\bnu\bum\bmb\bbe\ber\br o\bof\bf r\bre\beq\bqu\bue\bes\bst\bt m\bme\bes\bss\bsa\bag\bge\bes\bs.\b. F\bFo\bor\br a\ba v\bve\ber\bry\by h\bhi\big\bgh\bh t\bth\bhr\bro\bou\bug\bgh\bhp\bpu\but\bt c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn,\b, 3\b30\b00\b0 m\bma\bay\by b\bbe\be a\ba l\ble\beg\bgi\bit\bti\bim\bma\bat\bte\be n\bnu\bum\bmb\bbe\ber\br o\bof\bf r\bre\beq\bqu\bue\bes\bst\bts\bs t\bto\bo h\bha\bav\bve\be i\bin\bn|\n |f\bfl\bli\big\bgh\bht\bt w\bwh\bhe\ben\bn g\bge\bet\btt\bti\bin\bng\bg c\bch\bho\bok\bke\bed\bd *\b**\b**\b**\b**\b* |\n |*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/p\bpe\bee\ber\br_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn.\b.c\bcp\bpp\bp:\b:2\b25\b56\b62\b2 *\b**\b**\b* |\n |} |\n |#endif |\n@@ -3705,177 +3649,14 @@\n |#endif |\n |\t\t\tdisconnect(errors::timed_out_no_handshake, operation_t::bittorrent); |\n |\t\t\treturn; |\n |\t\t} |\n | |\n |\t\t// disconnect peers that we unchoked, but they didn't send a request in |\n |_\b\t_\b\t_\b/_\b/_\b _\bt_\bh_\be_\b _\bl_\ba_\bs_\bt_\b _\b6_\b0_\b _\bs_\be_\bc_\bo_\bn_\bd_\bs_\b,_\b _\ba_\bn_\bd_\b _\bw_\be_\b _\bh_\ba_\bv_\be_\bn_\b'_\bt_\b _\bb_\be_\be_\bn_\b _\bw_\bo_\br_\bk_\bi_\bn_\bg_\b _\bo_\bn_\b _\bs_\be_\br_\bv_\bi_\bc_\bi_\bn_\bg_\b _\ba_\b _\br_\be_\bq_\bu_\be_\bs_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b2_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bp_\bi_\be_\bc_\be_\b__\bp_\bi_\bc_\bk_\be_\br_\b._\bc_\bp_\bp_\b:_\b1_\b9_\b9_\b6_\b _\b _\b|_\bm_\ba_\bk_\be_\b _\bt_\bh_\be_\b _\b2_\b0_\b4_\b8_\b _\bl_\bi_\bm_\bi_\bt_\b _\bc_\bo_\bn_\bf_\bi_\bg_\bu_\br_\ba_\bb_\bl_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* m\bma\bak\bke\be t\bth\bhe\be 2\b20\b04\b48\b8 l\bli\bim\bmi\bit\bt c\bco\bon\bnf\bfi\big\bgu\bur\bra\bab\bbl\ble\be *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/p\bpi\bie\bec\bce\be_\b_p\bpi\bic\bck\bke\ber\br.\b.c\bcp\bpp\bp:\b:1\b19\b99\b96\b6 *\b**\b**\b* |\n-|// indicating which path thought the picker we took to arrive at the |\n-|\t// returned block picks. |\n-|\tpicker_flags_t piece_picker::pick_pieces(typed_bitfield const& pieces |\n-|\t\t, std::vector& interesting_blocks, int num_blocks |\n-|\t\t, int prefer_contiguous_blocks, torrent_peer* peer |\n-|\t\t, picker_options_t options, std::vector const& suggested_pieces |\n-|\t\t, int num_peers |\n-|\t\t, counters& pc |\n-|\t\t) const |\n-|\t{ |\n-|\t\tTORRENT_ASSERT(peer == nullptr || peer->in_use); |\n-|\t\tpicker_flags_t ret; |\n-| |\n-|\t\t// prevent the number of partial pieces to grow indefinitely |\n-|\t\t// make this scale by the number of peers we have. For large |\n-|\t\t// scale clients, we would have more peers, and allow a higher |\n-|\t\t// threshold for the number of partials |\n-|\t\t// the second condition is to make sure we cap the number of partial |\n-|\t\t// _bytes_. The larger the pieces are, the fewer partial pieces we want. |\n-|\t\t// 2048 corresponds to 32 MiB |\n-|const int num_partials = int(m_downloads[piece_pos::piece_downloading].size()); |\n-|if (num_partials > num_peers * 3 / 2 |\n-|\t\t\t|| num_partials * blocks_per_piece() > 2048) |\n-|\t\t{ |\n-|\t\t\t// if we have too many partial pieces, prioritize completing |\n-|\t\t\t// them. In order for this to have an affect, also disable |\n-|\t\t\t// prefer whole pieces (otherwise partial pieces would be de-prioritized) |\n-|\t\t\toptions |= prioritize_partials; |\n-|\t\t\tprefer_contiguous_blocks = 0; |\n-| |\n-|\t\t\tret |= picker_log_alert::partial_ratio; |\n-|\t\t} |\n-| |\n-|\t\tif (prefer_contiguous_blocks) ret |= picker_log_alert::prefer_contiguous; |\n-| |\n-|\t\t// only one of rarest_first and sequential can be set. |\n-|\t\tTORRENT_ASSERT(((options & rarest_first) ? 1 : 0) |\n-|\t\t\t+ ((options & sequential) ? 1 : 0) <= 1); |\n-|#ifdef TORRENT_EXPENSIVE_INVARIANT_CHECKS |\n-|\t\tINVARIANT_CHECK; |\n-|#endif |\n-|\t\tTORRENT_ASSERT(num_blocks > 0); |\n-|\t\tTORRENT_ASSERT(pieces.size() == int(m_piece_map.size())); |\n-| |\n-|\t\tTORRENT_ASSERT(!m_priority_boundaries.empty() || m_dirty); |\n-| |\n-|\t\t// this will be filled with blocks that we should not request |\n-|\t\t// unless we can't find num_blocks among the other ones. |\n-|\t\tstd::vector backup_blocks; |\n-|\t\tstd::vector backup_blocks2; |\n-|_\b\t_\b\t_\bs_\bt_\bd_\b:_\b:_\bv_\be_\bc_\bt_\bo_\br_\b<_\bp_\bi_\be_\bc_\be_\b__\bi_\bn_\bd_\be_\bx_\b__\bt_\b>_\b _\bi_\bg_\bn_\bo_\br_\be_\bd_\b__\bp_\bi_\be_\bc_\be_\bs_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b2_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bp_\bi_\be_\bc_\be_\b__\bp_\bi_\bc_\bk_\be_\br_\b._\bc_\bp_\bp_\b:_\b2_\b5_\b9_\b4_\b _\b _\b|_\bt_\bh_\be_\b _\bf_\bi_\br_\bs_\bt_\b__\bb_\bl_\bo_\bc_\bk_\b _\br_\be_\bt_\bu_\br_\bn_\be_\bd_\b _\bh_\be_\br_\be_\b _\bi_\bs_\b _\bt_\bh_\be_\b _\bl_\ba_\br_\bg_\be_\bs_\bt_\b _\bf_\br_\be_\be_\b _\br_\ba_\bn_\bg_\be_\b,_\b _\bn_\bo_\bt_\b _\bt_\bh_\be_\b _\bf_\bi_\br_\bs_\bt_\b-_\bf_\bi_\bt_\b _\br_\ba_\bn_\bg_\be_\b,_\b _\bw_\bh_\bi_\bc_\bh_\b _\bw_\bo_\bu_\bl_\bd_\b _\bb_\be_\b _\bb_\be_\bt_\bt_\be_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bth\bhe\be f\bfi\bir\brs\bst\bt_\b_b\bbl\blo\boc\bck\bk r\bre\bet\btu\bur\brn\bne\bed\bd h\bhe\ber\bre\be i\bis\bs t\bth\bhe\be l\bla\bar\brg\bge\bes\bst\bt f\bfr\bre\bee\be r\bra\ban\bng\bge\be,\b, n\bno\bot\bt t\bth\bhe\be f\bfi\bir\brs\bst\bt-\b-f\bfi\bit\bt r\bra\ban\bng\bge\be,\b, w\bwh\bhi\bic\bch\bh w\bwo\bou\bul\bld\bd b\bbe\be b\bbe\bet\btt\bte\ber\br *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/p\bpi\bie\bec\bce\be_\b_p\bpi\bic\bck\bke\ber\br.\b.c\bcp\bpp\bp:\b:2\b25\b59\b94\b4 *\b**\b**\b* |\n-|{ |\n-|\t\tfor (auto const& b : m_block_info) |\n-|\t\t{ |\n-|\t\t\tTORRENT_ASSERT(b.peer == nullptr || static_cast(b.peer)->in_use); |\n-|\t\t} |\n-|\t} |\n-|#endif |\n-| |\n-|\tvoid piece_picker::clear_peer(torrent_peer* peer) |\n-|\t{ |\n-|\t\tfor (auto& b : m_block_info) |\n-|\t\t{ |\n-|\t\t\tif (b.peer == peer) b.peer = nullptr; |\n-|\t\t} |\n-|\t} |\n-| |\n-|\t// the first bool is true if this is the only peer that has requested and downloaded |\n-|\t// blocks from this piece. |\n-|\t// the second bool is true if this is the only active peer that is requesting |\n-|\t// and downloading blocks from this piece. Active means having a connection. |\n-|std::tuple piece_picker::requested_from( |\n-|piece_picker::downloading_piece const& p |\n-|\t\t, int const num_blocks_in_piece, torrent_peer* peer) const |\n-|\t{ |\n-|\t\tbool exclusive = true; |\n-|\t\tbool exclusive_active = true; |\n-|\t\tint contiguous_blocks = 0; |\n-|\t\tint max_contiguous = 0; |\n-|\t\tint first_block = 0; |\n-|\t\tint idx = -1; |\n-|\t\tfor (auto const& info : blocks_for_piece(p)) |\n-|\t\t{ |\n-|\t\t\t++idx; |\n-|\t\t\tTORRENT_ASSERT(info.peer == nullptr || info.peer->in_use); |\n-|\t\t\tTORRENT_ASSERT(info.piece_index == p.index); |\n-|\t\t\tif (info.state == piece_picker::block_info::state_none) |\n-|\t\t\t{ |\n-|\t\t\t\t++contiguous_blocks; |\n-|\t\t\t\tcontinue; |\n-|\t\t\t} |\n-|\t\t\tif (contiguous_blocks > max_contiguous) |\n-|\t\t\t{ |\n-|\t\t\t\tmax_contiguous = contiguous_blocks; |\n-|\t\t\t\tfirst_block = idx - contiguous_blocks; |\n-|\t\t\t} |\n-|\t\t\tcontiguous_blocks = 0; |\n-|\t\t\tif (info.peer != peer) |\n-|\t\t\t{ |\n-|\t\t\t\texclusive = false; |\n-|\t\t\t\tif (info.state == piece_picker::block_info::state_requested |\n-|_\b\t_\b\t_\b\t_\b\t_\b\t_\b&_\b&_\b _\bi_\bn_\bf_\bo_\b._\bp_\be_\be_\br_\b _\b!_\b=_\b _\bn_\bu_\bl_\bl_\bp_\bt_\br_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-| | |it would be nice if this could be folded into lock_piece() the main distinction is that this also maintains the m_num_have counter |\n-|relevance\u00a02|_\b._\b._\b/_\bs_\br_\bc_\b/_\bp_\bi_\be_\bc_\be_\b__\bp_\bi_\bc_\bk_\be_\br_\b._\bc_\bp_\bp_\b:_\b3_\b4_\b7_\b8 |and the passed_hash_check member Is there ever a case where we call write failed without also locking the piece? Perhaps |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bw_\br_\bi_\bt_\be_\b__\bf_\ba_\bi_\bl_\be_\bd_\b(_\b)_\b _\bs_\bh_\bo_\bu_\bl_\bd_\b _\bi_\bm_\bp_\bl_\by_\b _\bl_\bo_\bc_\bk_\bi_\bn_\bg_\b _\bi_\bt_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* i\bit\bt w\bwo\bou\bul\bld\bd b\bbe\be n\bni\bic\bce\be i\bif\bf t\bth\bhi\bis\bs c\bco\bou\bul\bld\bd b\bbe\be f\bfo\bol\bld\bde\bed\bd i\bin\bnt\bto\bo l\blo\boc\bck\bk_\b_p\bpi\bie\bec\bce\be(\b()\b) t\bth\bhe\be m\bma\bai\bin\bn d\bdi\bis\bst\bti\bin\bnc\bct\bti\bio\bon\bn i\bis\bs t\bth\bha\bat\bt t\bth\bhi\bis\bs a\bal\bls\bso\bo m\bma\bai\bin\bnt\bta\bai\bin\bns\bs t\bth\bhe\be m\bm_\b_n\bnu\bum\bm_\b_h\bha\bav\bve\be c\bco\bou\bun\bnt\bte\ber\br a\ban\bnd\bd t\bth\bhe\be p\bpa\bas\bss\bse\bed\bd_\b_h\bha\bas\bsh\bh_\b_c\bch\bhe\bec\bck\bk m\bme\bem\bmb\bbe\ber\br I\bIs\bs |\n-|t\bth\bhe\ber\bre\be e\bev\bve\ber\br a\ba c\bca\bas\bse\be w\bwh\bhe\ber\bre\be w\bwe\be c\bca\bal\bll\bl w\bwr\bri\bit\bte\be f\bfa\bai\bil\ble\bed\bd w\bwi\bit\bth\bho\bou\but\bt a\bal\bls\bso\bo l\blo\boc\bck\bki\bin\bng\bg t\bth\bhe\be p\bpi\bie\bec\bce\be?\b? P\bPe\ber\brh\bha\bap\bps\bs w\bwr\bri\bit\bte\be_\b_f\bfa\bai\bil\ble\bed\bd(\b()\b) s\bsh\bho\bou\bul\bld\bd i\bim\bmp\bpl\bly\by l\blo\boc\bck\bki\bin\bng\bg i\bit\bt.\b. *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/p\bpi\bie\bec\bce\be_\b_p\bpi\bic\bck\bke\ber\br.\b.c\bcp\bpp\bp:\b:3\b34\b47\b78\b8 *\b**\b**\b* |\n-|\t\tauto const state = m_piece_map[piece].download_queue(); |\n-|\t\tif (state == piece_pos::piece_open) return; |\n-|\t\tauto const i = find_dl_piece(state, piece); |\n-|\t\tif (i == m_downloads[state].end()) return; |\n-| |\n-|\t\tTORRENT_ASSERT(i->passed_hash_check == false); |\n-|\t\tif (i->passed_hash_check) |\n-|\t\t{ |\n-|\t\t\t// it's not clear why this would happen, |\n-|\t\t\t// but it seems reasonable to not break the |\n-|\t\t\t// accounting over it. |\n-|\t\t\ti->passed_hash_check = false; |\n-|\t\t\taccount_lost(piece); |\n-|\t\t} |\n-| |\n-|\t\t// prevent this piece from being picked until it's restored |\n-|\t\ti->locked = true; |\n-|\t} |\n-| |\n-|void piece_picker::write_failed(piece_block const block) |\n-|{ |\n-|\t\tINVARIANT_CHECK; |\n-| |\n-|#if TORRENT_USE_INVARIANT_CHECKS |\n-|\t\tcheck_piece_state(); |\n-|#endif |\n-| |\n-|#ifdef TORRENT_PICKER_LOG |\n-|\t\tstd::cerr << \"[\" << this << \"] \" << \"write_failed( {\" << block.piece_index << \", \" << block.block_index << \"} )\" << std::endl; |\n-|#endif |\n-| |\n-|\t\tauto const state = m_piece_map[block.piece_index].download_queue(); |\n-|\t\tif (state == piece_pos::piece_open) return; |\n-|\t\tauto i = find_dl_piece(state, block.piece_index); |\n-|\t\tif (i == m_downloads[state].end()) return; |\n-| |\n-|\t\tauto const binfo = mutable_blocks_for_piece(*i); |\n-|\t\tblock_info& info = binfo[block.block_index]; |\n-|\t\tTORRENT_ASSERT(&info >= &m_block_info[0]); |\n-|\t\tTORRENT_ASSERT(&info < &m_block_info[0] + m_block_info.size()); |\n-|\t\tTORRENT_ASSERT(info.piece_index == block.piece_index); |\n-|\t\tTORRENT_ASSERT(info.state == block_info::state_writing); |\n-|\t\tTORRENT_ASSERT(info.num_peers == 0); |\n-| |\n-|\t\tTORRENT_ASSERT(i->writing > 0); |\n-|\t\tTORRENT_ASSERT(info.state == block_info::state_writing); |\n-| |\n-|\t\tif (info.state == block_info::state_finished) return; |\n-|_\b\t_\b\t_\bi_\bf_\b _\b(_\bi_\bn_\bf_\bo_\b._\bs_\bt_\ba_\bt_\be_\b _\b=_\b=_\b _\bb_\bl_\bo_\bc_\bk_\b__\bi_\bn_\bf_\bo_\b:_\b:_\bs_\bt_\ba_\bt_\be_\b__\bw_\br_\bi_\bt_\bi_\bn_\bg_\b)_\b _\b-_\b-_\bi_\b-_\b>_\bw_\br_\bi_\bt_\bi_\bn_\bg_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b2_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\ba_\bl_\be_\br_\bt_\b__\bm_\ba_\bn_\ba_\bg_\be_\br_\b._\bc_\bp_\bp_\b:_\b8_\b0_\b _\b _\b _\b|_\bk_\be_\be_\bp_\b _\ba_\b _\bc_\bo_\bu_\bn_\bt_\b _\bo_\bf_\b _\bt_\bh_\be_\b _\bn_\bu_\bm_\bb_\be_\br_\b _\bo_\bf_\b _\bt_\bh_\br_\be_\ba_\bd_\bs_\b _\bw_\ba_\bi_\bt_\bi_\bn_\bg_\b._\b _\bO_\bn_\bl_\by_\b _\bi_\bf_\b _\bi_\bt_\b'_\bs_\b _\b>_\b _\b0_\b _\bn_\bo_\bt_\bi_\bf_\by_\b _\bt_\bh_\be_\bm_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |*\b**\b**\b**\b**\b* k\bke\bee\bep\bp a\ba c\bco\bou\bun\bnt\bt o\bof\bf t\bth\bhe\be n\bnu\bum\bmb\bbe\ber\br o\bof\bf t\bth\bhr\bre\bea\bad\bds\bs w\bwa\bai\bit\bti\bin\bng\bg.\b. O\bOn\bnl\bly\by i\bif\bf i\bit\bt'\b's\bs >\b> 0\b0 n\bno\bot\bti\bif\bfy\by t\bth\bhe\bem\bm *\b**\b**\b**\b**\b* |\n |*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/a\bal\ble\ber\brt\bt_\b_m\bma\ban\bna\bag\bge\ber\br.\b.c\bcp\bpp\bp:\b:8\b80\b0 *\b**\b**\b* |\n |return m_alerts[m_generation].front(); |\n | |\n |\t\t// this call can be interrupted prematurely by other signals |\n |\t\tm_condition.wait_for(lock, max_wait); |\n@@ -3922,14 +3703,68 @@\n |\t\tm_ses_extensions.push_back(std::move(ext)); |\n |\t} |\n |#endif |\n | |\n |\tvoid alert_manager::get_all(std::vector& alerts) |\n |\t{ |\n |_\b\t_\b\t_\bs_\bt_\bd_\b:_\b:_\bl_\bo_\bc_\bk_\b__\bg_\bu_\ba_\br_\bd_\b<_\bs_\bt_\bd_\b:_\b:_\br_\be_\bc_\bu_\br_\bs_\bi_\bv_\be_\b__\bm_\bu_\bt_\be_\bx_\b>_\b _\bl_\bo_\bc_\bk_\b(_\bm_\b__\bm_\bu_\bt_\be_\bx_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b2_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bb_\bd_\be_\bc_\bo_\bd_\be_\b._\bc_\bp_\bp_\b:_\b8_\b2_\b6_\b _\b _\b _\b _\b _\b _\b _\b _\b|_\ba_\bt_\bt_\be_\bm_\bp_\bt_\b _\bt_\bo_\b _\bs_\bi_\bm_\bp_\bl_\bi_\bf_\by_\b _\bt_\bh_\bi_\bs_\b _\bi_\bm_\bp_\bl_\be_\bm_\be_\bn_\bt_\ba_\bt_\bi_\bo_\bn_\b _\bb_\by_\b _\be_\bm_\bb_\br_\ba_\bc_\bi_\bn_\bg_\b _\bt_\bh_\be_\b _\bs_\bp_\ba_\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* a\bat\btt\bte\bem\bmp\bpt\bt t\bto\bo s\bsi\bim\bmp\bpl\bli\bif\bfy\by t\bth\bhi\bis\bs i\bim\bmp\bpl\ble\bem\bme\ben\bnt\bta\bat\bti\bio\bon\bn b\bby\by e\bem\bmb\bbr\bra\bac\bci\bin\bng\bg t\bth\bhe\be s\bsp\bpa\ban\bn *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/b\bbd\bde\bec\bco\bod\bde\be.\b.c\bcp\bpp\bp:\b:8\b82\b26\b6 *\b**\b**\b* |\n+|} |\n+| |\n+|\tbdecode_node bdecode(span buffer |\n+|\t\t, error_code& ec, int* error_pos, int depth_limit, int token_limit) |\n+|\t{ |\n+|\t\tbdecode_node ret; |\n+|\t\tec.clear(); |\n+| |\n+|\t\tif (buffer.size() > bdecode_token::max_offset) |\n+|\t\t{ |\n+|\t\t\tif (error_pos) *error_pos = 0; |\n+|\t\t\tec = bdecode_errors::limit_exceeded; |\n+|\t\t\treturn ret; |\n+|\t\t} |\n+| |\n+|\t\t// this is the stack of bdecode_token indices, into m_tokens. |\n+|\t\t// sp is the stack pointer, as index into the array, stack |\n+|\t\tint sp = 0; |\n+|\t\tTORRENT_ALLOCA(stack, stack_frame, depth_limit); |\n+| |\n+|char const* start = buffer.data(); |\n+|char const* end = start + buffer.size(); |\n+|\t\tchar const* const orig_start = start; |\n+| |\n+|\t\tif (start == end) |\n+|\t\t\tTORRENT_FAIL_BDECODE(bdecode_errors::unexpected_eof); |\n+| |\n+|\t\twhile (start <= end) |\n+|\t\t{ |\n+|\t\t\tif (start >= end) TORRENT_FAIL_BDECODE(bdecode_errors::unexpected_eof); |\n+| |\n+|\t\t\tif (sp >= depth_limit) |\n+|\t\t\t\tTORRENT_FAIL_BDECODE(bdecode_errors::depth_exceeded); |\n+| |\n+|\t\t\t--token_limit; |\n+|\t\t\tif (token_limit < 0) |\n+|\t\t\t\tTORRENT_FAIL_BDECODE(bdecode_errors::limit_exceeded); |\n+| |\n+|\t\t\t// look for a new token |\n+|\t\t\tchar const t = *start; |\n+| |\n+|\t\t\tint const current_frame = sp; |\n+| |\n+|\t\t\t// if we're currently parsing a dictionary, assert that |\n+|\t\t\t// every other node is a string. |\n+|\t\t\tif (current_frame > 0 |\n+|\t\t\t\t&& ret.m_tokens[stack[current_frame - 1].token].type == bdecode_token::dict) |\n+|\t\t\t{ |\n+|\t\t\t\tif (stack[current_frame - 1].state == 0) |\n+|\t\t\t\t{ |\n+|_\b\t_\b\t_\b\t_\b\t_\b\t_\b/_\b/_\b _\bt_\bh_\be_\b _\bc_\bu_\br_\br_\be_\bn_\bt_\b _\bp_\ba_\br_\be_\bn_\bt_\b _\bi_\bs_\b _\ba_\b _\bd_\bi_\bc_\bt_\b _\ba_\bn_\bd_\b _\bw_\be_\b _\ba_\br_\be_\b _\bp_\ba_\br_\bs_\bi_\bn_\bg_\b _\ba_\b _\bk_\be_\by_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b2_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\br_\ba_\bc_\bk_\be_\br_\b__\bm_\ba_\bn_\ba_\bg_\be_\br_\b._\bc_\bp_\bp_\b:_\b3_\b6_\b9_\b|_\bi_\bm_\bp_\bl_\be_\bm_\be_\bn_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |*\b**\b**\b**\b**\b* i\bim\bmp\bpl\ble\bem\bme\ben\bnt\bt *\b**\b**\b**\b**\b* |\n |*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\btr\bra\bac\bck\bke\ber\br_\b_m\bma\ban\bna\bag\bge\ber\br.\b.c\bcp\bpp\bp:\b:3\b36\b69\b9 *\b**\b**\b* |\n |#ifndef TORRENT_DISABLE_LOGGING |\n |\t\t\tif (m_ses.should_log()) |\n |\t\t\t{ |\n |\t\t\t\tm_ses.session_log(\"incoming UDP tracker packet from %s has invalid \" |\n@@ -3976,14 +3811,234 @@\n |\t\t\t\t\"transaction ID (%x)\", std::string(hostname).c_str(), int(transaction)); |\n |#endif |\n |\t\t\treturn false; |\n |\t\t} |\n | |\n |\t\tstd::shared_ptr const p = i->second; |\n |_\b\t_\b\t_\b/_\b/_\b _\bo_\bn_\b__\br_\be_\bc_\be_\bi_\bv_\be_\b(_\b)_\b _\bm_\ba_\by_\b _\br_\be_\bm_\bo_\bv_\be_\b _\bt_\bh_\be_\b _\bt_\br_\ba_\bc_\bk_\be_\br_\b _\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b _\bf_\br_\bo_\bm_\b _\bt_\bh_\be_\b _\bl_\bi_\bs_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b2_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\ba_\bl_\be_\br_\bt_\b._\bc_\bp_\bp_\b:_\b2_\b0_\b2_\b1_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bt_\bh_\be_\b _\bs_\ba_\bl_\bt_\b _\bh_\be_\br_\be_\b _\bi_\bs_\b _\ba_\bl_\bl_\bo_\bc_\ba_\bt_\be_\bd_\b _\bo_\bn_\b _\bt_\bh_\be_\b _\bh_\be_\ba_\bp_\b._\b _\bI_\bt_\b _\bw_\bo_\bu_\bl_\bd_\b _\bb_\be_\b _\bn_\bi_\bc_\be_\b _\bt_\bo_\b _\ba_\bl_\bl_\bo_\bc_\ba_\bt_\be_\b _\bi_\bn_\b _\bt_\bh_\be_\b _\bs_\bt_\ba_\bc_\bk_\b__\ba_\bl_\bl_\bo_\bc_\ba_\bt_\bo_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bth\bhe\be s\bsa\bal\blt\bt h\bhe\ber\bre\be i\bis\bs a\bal\bll\blo\boc\bca\bat\bte\bed\bd o\bon\bn t\bth\bhe\be h\bhe\bea\bap\bp.\b. I\bIt\bt w\bwo\bou\bul\bld\bd b\bbe\be n\bni\bic\bce\be t\bto\bo a\bal\bll\blo\boc\bca\bat\bte\be i\bin\bn t\bth\bhe\be s\bst\bta\bac\bck\bk_\b_a\bal\bll\blo\boc\bca\bat\bto\bor\br *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/a\bal\ble\ber\brt\bt.\b.c\bcp\bpp\bp:\b:2\b20\b02\b21\b1 *\b**\b**\b* |\n+|} |\n+| |\n+|\tdht_immutable_item_alert::dht_immutable_item_alert(aux::stack_allocator& |\n+|\t\t, sha1_hash const& t, entry i) |\n+|\t\t: target(t), item(std::move(i)) |\n+|\t{} |\n+| |\n+|\tstd::string dht_immutable_item_alert::message() const |\n+|\t{ |\n+|#ifdef TORRENT_DISABLE_ALERT_MSG |\n+|\t\treturn {}; |\n+|#else |\n+|\t\tchar msg[1050]; |\n+|\t\tstd::snprintf(msg, sizeof(msg), \"DHT immutable item %s [ %s ]\" |\n+|\t\t\t, aux::to_hex(target).c_str() |\n+|\t\t\t, item.to_string().c_str()); |\n+|\t\treturn msg; |\n+|#endif |\n+|\t} |\n+| |\n+|dht_mutable_item_alert::dht_mutable_item_alert(aux::stack_allocator& |\n+|, std::array const& k |\n+|\t\t, std::array const& sig |\n+|\t\t, std::int64_t sequence |\n+|\t\t, string_view s |\n+|\t\t, entry i |\n+|\t\t, bool a) |\n+|\t\t: key(k), signature(sig), seq(sequence), salt(s), item(std::move(i)), authoritative(a) |\n+|\t{} |\n+| |\n+|\tstd::string dht_mutable_item_alert::message() const |\n+|\t{ |\n+|#ifdef TORRENT_DISABLE_ALERT_MSG |\n+|\t\treturn {}; |\n+|#else |\n+|\t\tchar msg[1050]; |\n+|\t\tstd::snprintf(msg, sizeof(msg), \"DHT mutable item (key=%s salt=%s seq=%\" PRId64 \" %s) [ %s ]\" |\n+|\t\t\t, aux::to_hex(key).c_str() |\n+|\t\t\t, salt.c_str() |\n+|\t\t\t, seq |\n+|\t\t\t, authoritative ? \"auth\" : \"non-auth\" |\n+|\t\t\t, item.to_string().c_str()); |\n+|\t\treturn msg; |\n+|#endif |\n+|\t} |\n+| |\n+|\tdht_put_alert::dht_put_alert(aux::stack_allocator&, sha1_hash const& t, int n) |\n+|\t\t: target(t) |\n+|\t\t, public_key() |\n+|\t\t, signature() |\n+|_\b\t_\b\t_\b,_\b _\bs_\ba_\bl_\bt_\b(_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a02|_\b._\b._\b/_\bs_\br_\bc_\b/ |support authentication here. tracker_req().auth |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bu_\bd_\bp_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b._\bc_\bp_\bp_\b:_\b8_\b1_\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* s\bsu\bup\bpp\bpo\bor\brt\bt a\bau\but\bth\bhe\ben\bnt\bti\bic\bca\bat\bti\bio\bon\bn h\bhe\ber\bre\be.\b. t\btr\bra\bac\bck\bke\ber\br_\b_r\bre\beq\bq(\b()\b).\b.a\bau\but\bth\bh *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/u\bud\bdp\bp_\b_t\btr\bra\bac\bck\bke\ber\br_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn.\b.c\bcp\bpp\bp:\b:8\b81\b1 *\b**\b**\b* |\n+|udp_tracker_connection::m_connection_cache; |\n+| |\n+|\tstd::mutex udp_tracker_connection::m_cache_mutex; |\n+| |\n+|\tudp_tracker_connection::udp_tracker_connection( |\n+|\t\tio_context& ios |\n+|\t\t, tracker_manager& man |\n+|\t\t, tracker_request const& req |\n+|\t\t, std::weak_ptr c) |\n+|\t\t: tracker_connection(man, req, ios, std::move(c)) |\n+|\t\t, m_transaction_id(0) |\n+|\t\t, m_attempts(0) |\n+|\t\t, m_state(action_t::error) |\n+|\t\t, m_abort(false) |\n+|\t{ |\n+|\t\tupdate_transaction_id(); |\n+|\t} |\n+| |\n+|\tvoid udp_tracker_connection::start() |\n+|\t{ |\n+|std::string hostname; |\n+|std::string protocol; |\n+|\t\tint port; |\n+|\t\terror_code ec; |\n+| |\n+|\t\tstd::tie(protocol, std::ignore, hostname, port, std::ignore) |\n+|\t\t\t= parse_url_components(tracker_req().url, ec); |\n+|\t\tif (port == -1) port = protocol == \"http\" ? 80 : 443; |\n+| |\n+|\t\tif (ec) |\n+|\t\t{ |\n+|\t\t\ttracker_connection::fail(ec, operation_t::parse_address); |\n+|\t\t\treturn; |\n+|\t\t} |\n+| |\n+|\t\taux::session_settings const& settings = m_man.settings(); |\n+| |\n+|\t\tint const proxy_type = settings.get_int(settings_pack::proxy_type); |\n+| |\n+|\t\tif (settings.get_bool(settings_pack::proxy_hostnames) |\n+|\t\t\t&& (proxy_type == settings_pack::socks5 |\n+|\t\t\t\t|| proxy_type == settings_pack::socks5_pw)) |\n+|\t\t{ |\n+|\t\t\tm_hostname = hostname; |\n+|\t\t\tm_target.port(std::uint16_t(port)); |\n+|\t\t\tstart_announce(); |\n+|\t\t} |\n+|\t\telse |\n+|\t\t{ |\n+|\t\t\tusing namespace std::placeholders; |\n+|_\b\t_\b\t_\b\t_\bA_\bD_\bD_\b__\bO_\bU_\bT_\bS_\bT_\bA_\bN_\bD_\bI_\bN_\bG_\b__\bA_\bS_\bY_\bN_\bC_\b(_\b\"_\bu_\bd_\bp_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b:_\b:_\bn_\ba_\bm_\be_\b__\bl_\bo_\bo_\bk_\bu_\bp_\b\"_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a02|_\b._\b._\b/_\bs_\br_\bc_\b/_\bp_\be_\be_\br_\b__\bl_\bi_\bs_\bt_\b._\bc_\bp_\bp_\b:_\b5_\b3_\b9 |it would be nice if there was a way to iterate over these torrent_peer objects in the order they are allocated in the pool instead. |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bI_\bt_\b _\bw_\bo_\bu_\bl_\bd_\b _\bp_\br_\bo_\bb_\ba_\bb_\bl_\by_\b _\bb_\be_\b _\bm_\bo_\br_\be_\b _\be_\bf_\bf_\bi_\bc_\bi_\be_\bn_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* i\bit\bt w\bwo\bou\bul\bld\bd b\bbe\be n\bni\bic\bce\be i\bif\bf t\bth\bhe\ber\bre\be w\bwa\bas\bs a\ba w\bwa\bay\by t\bto\bo i\bit\bte\ber\bra\bat\bte\be o\bov\bve\ber\br t\bth\bhe\bes\bse\be t\bto\bor\brr\bre\ben\bnt\bt_\b_p\bpe\bee\ber\br o\bob\bbj\bje\bec\bct\bts\bs i\bin\bn t\bth\bhe\be o\bor\brd\bde\ber\br t\bth\bhe\bey\by a\bar\bre\be a\bal\bll\blo\boc\bca\bat\bte\bed\bd i\bin\bn t\bth\bhe\be p\bpo\boo\bol\bl i\bin\bns\bst\bte\bea\bad\bd.\b. I\bIt\bt w\bwo\bou\bul\bld\bd p\bpr\bro\bob\bba\bab\bbl\bly\by b\bbe\be m\bmo\bor\bre\be e\bef\bff\bfi\bic\bci\bie\ben\bnt\bt |\n+|*\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/p\bpe\bee\ber\br_\b_l\bli\bis\bst\bt.\b.c\bcp\bpp\bp:\b:5\b53\b39\b9 *\b**\b**\b* |\n+|, int session_time, torrent_state* state) |\n+|\t{ |\n+|\t\tTORRENT_ASSERT(is_single_thread()); |\n+|\t\tINVARIANT_CHECK; |\n+| |\n+|\t\tconst int candidate_count = 10; |\n+|\t\tpeers.reserve(candidate_count); |\n+| |\n+|\t\tint erase_candidate = -1; |\n+| |\n+|\t\tif (bool(m_finished) != state->is_finished) |\n+|\t\t\trecalculate_connect_candidates(state); |\n+| |\n+|\t\texternal_ip const& external = state->ip; |\n+|\t\tint external_port = state->port; |\n+| |\n+|\t\tif (m_round_robin >= int(m_peers.size())) m_round_robin = 0; |\n+| |\n+|\t\tint max_peerlist_size = state->max_peerlist_size; |\n+| |\n+|for (int iterations = std::min(int(m_peers.size()), 300); |\n+|iterations > 0; --iterations) |\n+|\t\t{ |\n+|\t\t\t++state->loop_counter; |\n+| |\n+|\t\t\tif (m_round_robin >= int(m_peers.size())) m_round_robin = 0; |\n+| |\n+|\t\t\ttorrent_peer& pe = *m_peers[m_round_robin]; |\n+|\t\t\tTORRENT_ASSERT(pe.in_use); |\n+|\t\t\tint current = m_round_robin; |\n+| |\n+|\t\t\t// if the number of peers is growing large |\n+|\t\t\t// we need to start weeding. |\n+| |\n+|\t\t\tif (int(m_peers.size()) >= max_peerlist_size * 0.95 |\n+|\t\t\t\t&& max_peerlist_size > 0) |\n+|\t\t\t{ |\n+|\t\t\t\tif (is_erase_candidate(pe) |\n+|\t\t\t\t\t&& (erase_candidate == -1 |\n+|\t\t\t\t\t\t|| !compare_peer_erase(*m_peers[erase_candidate], pe))) |\n+|\t\t\t\t{ |\n+|\t\t\t\t\tif (should_erase_immediately(pe)) |\n+|\t\t\t\t\t{ |\n+|\t\t\t\t\t\tif (erase_candidate > current) --erase_candidate; |\n+|\t\t\t\t\t\terase_peer(m_peers.begin() + current, state); |\n+|\t\t\t\t\t\tcontinue; |\n+|\t\t\t\t\t} |\n+|\t\t\t\t\telse |\n+|\t\t\t\t\t{ |\n+|\t\t\t\t\t\terase_candidate = current; |\n+|_\b\t_\b\t_\b\t_\b\t_\b\t_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a02|_\b._\b._\b/_\bs_\br_\bc_\b/_\bk_\ba_\bd_\be_\bm_\bl_\bi_\ba_\b/ |make this configurable in dht_settings |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bd_\bh_\bt_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b._\bc_\bp_\bp_\b:_\b8_\b7_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* m\bma\bak\bke\be t\bth\bhi\bis\bs c\bco\bon\bnf\bfi\big\bgu\bur\bra\bab\bbl\ble\be i\bin\bn d\bdh\bht\bt_\b_s\bse\bet\btt\bti\bin\bng\bgs\bs *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/k\bka\bad\bde\bem\bml\bli\bia\ba/\b/d\bdh\bht\bt_\b_s\bst\bto\bor\bra\bag\bge\be.\b.c\bcp\bpp\bp:\b:8\b87\b7 *\b**\b**\b* |\n+|tcp::endpoint addr; |\n+|\t\tbool seed = 0; |\n+|\t}; |\n+| |\n+|\t// internal |\n+|\tbool operator<(peer_entry const& lhs, peer_entry const& rhs) |\n+|\t{ |\n+|\t\treturn lhs.addr.address() == rhs.addr.address() |\n+|\t\t\t? lhs.addr.port() < rhs.addr.port() |\n+|\t\t\t: lhs.addr.address() < rhs.addr.address(); |\n+|\t} |\n+| |\n+|\t// this is a group. It contains a set of group members |\n+|\tstruct torrent_entry |\n+|\t{ |\n+|\t\tstd::string name; |\n+|\t\tstd::vector peers4; |\n+|\t\tstd::vector peers6; |\n+|\t}; |\n+| |\n+|constexpr time_duration announce_interval = minutes(30); |\n+| |\n+|\tstruct dht_immutable_item |\n+|\t{ |\n+|\t\t// the actual value |\n+|\t\tstd::unique_ptr value; |\n+|\t\t// this counts the number of IPs we have seen |\n+|\t\t// announcing this item, this is used to determine |\n+|\t\t// popularity if we reach the limit of items to store |\n+|\t\tbloom_filter<128> ips; |\n+|\t\t// the last time we heard about this item |\n+|\t\t// the correct interpretation of this field |\n+|\t\t// requires a time reference |\n+|\t\ttime_point last_seen; |\n+|\t\t// number of IPs in the bloom filter |\n+|\t\tint num_announcers = 0; |\n+|\t\t// size of malloced space pointed to by value |\n+|\t\tint size = 0; |\n+|\t}; |\n+| |\n+|\tstruct dht_mutable_item : dht_immutable_item |\n+|\t{ |\n+|\t\tsignature sig{}; |\n+|\t\tsequence_number seq{}; |\n+|\t\tpublic_key key{}; |\n+|\t\tstd::string salt; |\n+|\t}; |\n+| |\n+|\tvoid set_value(dht_immutable_item& item, span buf) |\n+|\t{ |\n+|_\b\t_\b\t_\bi_\bn_\bt_\b _\bc_\bo_\bn_\bs_\bt_\b _\bs_\bi_\bz_\be_\b _\b=_\b _\bi_\bn_\bt_\b(_\bb_\bu_\bf_\b._\bs_\bi_\bz_\be_\b(_\b)_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b2_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bk_\ba_\bd_\be_\bm_\bl_\bi_\ba_\b/_\bn_\bo_\bd_\be_\b._\bc_\bp_\bp_\b:_\b6_\b8_\b4_\b _\b _\b|_\bi_\bt_\b _\bw_\bo_\bu_\bl_\bd_\b _\bb_\be_\b _\bn_\bi_\bc_\be_\b _\bt_\bo_\b _\bh_\ba_\bv_\be_\b _\ba_\b _\bb_\bi_\ba_\bs_\b _\bt_\bo_\bw_\ba_\br_\bd_\bs_\b _\bn_\bo_\bd_\be_\b-_\bi_\bd_\b _\bp_\br_\be_\bf_\bi_\bx_\be_\bs_\b _\bt_\bh_\ba_\bt_\b _\ba_\br_\be_\b _\bm_\bi_\bs_\bs_\bi_\bn_\bg_\b _\bi_\bn_\b _\bt_\bh_\be_\b _\bb_\bu_\bc_\bk_\be_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |*\b**\b**\b**\b**\b* i\bit\bt w\bwo\bou\bul\bld\bd b\bbe\be n\bni\bic\bce\be t\bto\bo h\bha\bav\bve\be a\ba b\bbi\bia\bas\bs t\bto\bow\bwa\bar\brd\bds\bs n\bno\bod\bde\be-\b-i\bid\bd p\bpr\bre\bef\bfi\bix\bxe\bes\bs t\bth\bha\bat\bt a\bar\bre\be m\bmi\bis\bss\bsi\bin\bng\bg i\bin\bn t\bth\bhe\be b\bbu\buc\bck\bke\bet\bt *\b**\b**\b**\b**\b* |\n |*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/k\bka\bad\bde\bem\bml\bli\bia\ba/\b/n\bno\bod\bde\be.\b.c\bcp\bpp\bp:\b:6\b68\b84\b4 *\b**\b**\b* |\n |node_entry const* ne = m_table.next_refresh(); |\n |\tif (ne == nullptr) return; |\n | |\n |\t// this shouldn't happen |\n@@ -4171,124 +4226,14 @@\n |\t\t{ |\n |\t\t\t// this entry belongs in the new bucket |\n |\t\t\tif (j->pinged() && int(new_bucket.size()) < new_bucket_size) |\n |\t\t\t\tnew_bucket.push_back(*j); |\n |\t\t\telse |\n |\t\t\t\tnew_replacement_bucket.push_back(*j); |\n |_\b\t_\b\t_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a02|_\b._\b._\b/_\bs_\br_\bc_\b/_\bk_\ba_\bd_\be_\bm_\bl_\bi_\ba_\b/ |make this configurable in dht_settings |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bd_\bh_\bt_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b._\bc_\bp_\bp_\b:_\b8_\b7_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* m\bma\bak\bke\be t\bth\bhi\bis\bs c\bco\bon\bnf\bfi\big\bgu\bur\bra\bab\bbl\ble\be i\bin\bn d\bdh\bht\bt_\b_s\bse\bet\btt\bti\bin\bng\bgs\bs *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/k\bka\bad\bde\bem\bml\bli\bia\ba/\b/d\bdh\bht\bt_\b_s\bst\bto\bor\bra\bag\bge\be.\b.c\bcp\bpp\bp:\b:8\b87\b7 *\b**\b**\b* |\n-|tcp::endpoint addr; |\n-|\t\tbool seed = 0; |\n-|\t}; |\n-| |\n-|\t// internal |\n-|\tbool operator<(peer_entry const& lhs, peer_entry const& rhs) |\n-|\t{ |\n-|\t\treturn lhs.addr.address() == rhs.addr.address() |\n-|\t\t\t? lhs.addr.port() < rhs.addr.port() |\n-|\t\t\t: lhs.addr.address() < rhs.addr.address(); |\n-|\t} |\n-| |\n-|\t// this is a group. It contains a set of group members |\n-|\tstruct torrent_entry |\n-|\t{ |\n-|\t\tstd::string name; |\n-|\t\tstd::vector peers4; |\n-|\t\tstd::vector peers6; |\n-|\t}; |\n-| |\n-|constexpr time_duration announce_interval = minutes(30); |\n-| |\n-|\tstruct dht_immutable_item |\n-|\t{ |\n-|\t\t// the actual value |\n-|\t\tstd::unique_ptr value; |\n-|\t\t// this counts the number of IPs we have seen |\n-|\t\t// announcing this item, this is used to determine |\n-|\t\t// popularity if we reach the limit of items to store |\n-|\t\tbloom_filter<128> ips; |\n-|\t\t// the last time we heard about this item |\n-|\t\t// the correct interpretation of this field |\n-|\t\t// requires a time reference |\n-|\t\ttime_point last_seen; |\n-|\t\t// number of IPs in the bloom filter |\n-|\t\tint num_announcers = 0; |\n-|\t\t// size of malloced space pointed to by value |\n-|\t\tint size = 0; |\n-|\t}; |\n-| |\n-|\tstruct dht_mutable_item : dht_immutable_item |\n-|\t{ |\n-|\t\tsignature sig{}; |\n-|\t\tsequence_number seq{}; |\n-|\t\tpublic_key key{}; |\n-|\t\tstd::string salt; |\n-|\t}; |\n-| |\n-|\tvoid set_value(dht_immutable_item& item, span buf) |\n-|\t{ |\n-|_\b\t_\b\t_\bi_\bn_\bt_\b _\bc_\bo_\bn_\bs_\bt_\b _\bs_\bi_\bz_\be_\b _\b=_\b _\bi_\bn_\bt_\b(_\bb_\bu_\bf_\b._\bs_\bi_\bz_\be_\b(_\b)_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a02|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |this could be done more efficiently by just looking up the interface with the given name, maybe even with if_nametoindex() |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\be_\bn_\bu_\bm_\b__\bn_\be_\bt_\b._\bh_\bp_\bp_\b:_\b1_\b9_\b6_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs c\bco\bou\bul\bld\bd b\bbe\be d\bdo\bon\bne\be m\bmo\bor\bre\be e\bef\bff\bfi\bic\bci\bie\ben\bnt\btl\bly\by b\bby\by j\bju\bus\bst\bt l\blo\boo\bok\bki\bin\bng\bg u\bup\bp t\bth\bhe\be i\bin\bnt\bte\ber\brf\bfa\bac\bce\be w\bwi\bit\bth\bh t\bth\bhe\be g\bgi\biv\bve\ben\bn n\bna\bam\bme\be,\b, m\bma\bay\byb\bbe\be e\bev\bve\ben\bn w\bwi\bit\bth\bh i\bif\bf_\b_n\bna\bam\bme\bet\bto\boi\bin\bnd\bde\bex\bx(\b()\b) *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/e\ben\bnu\bum\bm_\b_n\bne\bet\bt.\b.h\bhp\bpp\bp:\b:1\b19\b96\b6 *\b**\b**\b* |\n-|// IPv6 address. If we're asking to be bound to an IPv6 address and |\n-|\t\t\t// providing 0.0.0.0 as the device, turn it into \"::\" |\n-|\t\t\tif (ip == address_v4::any() && protocol == boost::asio::ip::tcp::v6()) |\n-|\t\t\t\tip = address_v6::any(); |\n-|\t\t\tbind_ep.address(ip); |\n-|\t\t\t// it appears to be an IP. Just bind to that address |\n-|\t\t\tsock.bind(bind_ep, ec); |\n-|\t\t\treturn bind_ep.address(); |\n-|\t\t} |\n-| |\n-|\t\tec.clear(); |\n-| |\n-|#if TORRENT_HAS_BINDTODEVICE |\n-|\t\t// try to use SO_BINDTODEVICE here, if that exists. If it fails, |\n-|\t\t// fall back to the mechanism we have below |\n-|\t\taux::bind_device(sock, device_name, ec); |\n-|\t\tif (ec) |\n-|#endif |\n-|\t\t{ |\n-|\t\t\tec.clear(); |\n-|std::vector ifs = enum_net_interfaces(ios, ec); |\n-|if (ec) return bind_ep.address(); |\n-| |\n-|\t\t\tbool found = false; |\n-| |\n-|\t\t\tfor (auto const& iface : ifs) |\n-|\t\t\t{ |\n-|\t\t\t\t// we're looking for a specific interface, and its address |\n-|\t\t\t\t// (which must be of the same family as the address we're |\n-|\t\t\t\t// connecting to) |\n-|\t\t\t\tif (std::strcmp(iface.name, device_name) != 0) continue; |\n-|\t\t\t\tif (iface.interface_address.is_v4() != (protocol == boost::asio::ip::tcp::v4())) |\n-|\t\t\t\t\tcontinue; |\n-| |\n-|\t\t\t\tbind_ep.address(iface.interface_address); |\n-|\t\t\t\tfound = true; |\n-|\t\t\t\tbreak; |\n-|\t\t\t} |\n-| |\n-|\t\t\tif (!found) |\n-|\t\t\t{ |\n-|\t\t\t\tec = error_code(boost::system::errc::no_such_device, generic_category()); |\n-|\t\t\t\treturn bind_ep.address(); |\n-|\t\t\t} |\n-|\t\t} |\n-|\t\tsock.bind(bind_ep, ec); |\n-|\t\treturn bind_ep.address(); |\n-|\t} |\n-| |\n-|\t// returns the device name whose local address is ``addr``. If |\n-|_\b\t_\b/_\b/_\b _\bn_\bo_\b _\bs_\bu_\bc_\bh_\b _\bd_\be_\bv_\bi_\bc_\be_\b _\bi_\bs_\b _\bf_\bo_\bu_\bn_\bd_\b,_\b _\ba_\bn_\b _\be_\bm_\bp_\bt_\by_\b _\bs_\bt_\br_\bi_\bn_\bg_\b _\bi_\bs_\b _\br_\be_\bt_\bu_\br_\bn_\be_\bd_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |relevance\u00a02|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |use the resolver interface that has a built-in cache |\n |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bp_\br_\bo_\bx_\by_\b__\bb_\ba_\bs_\be_\b._\bh_\bp_\bp_\b:_\b3_\b2_\b7_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |*\b**\b**\b**\b**\b* u\bus\bse\be t\bth\bhe\be r\bre\bes\bso\bol\blv\bve\ber\br i\bin\bnt\bte\ber\brf\bfa\bac\bce\be t\bth\bha\bat\bt h\bha\bas\bs a\ba b\bbu\bui\bil\blt\bt-\b-i\bin\bn c\bca\bac\bch\bhe\be *\b**\b**\b**\b**\b* |\n |*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/p\bpr\bro\box\bxy\by_\b_b\bba\bas\bse\be.\b.h\bhp\bpp\bp:\b:3\b32\b27\b7 *\b**\b**\b* |\n |\t// The handler must be taken as lvalue reference here since we may not call |\n |\t// it. But if we do, we want the call operator to own the function object. |\n |\ttemplate |\n@@ -4335,14 +4280,124 @@\n |\tusing allocator_type = typename boost::asio::associated_allocator::type; |\n |\tusing executor_type = typename boost::asio::associated_executor::type; |\n | |\n |\tallocator_type get_allocator() const noexcept |\n |\t{ return boost::asio::get_associated_allocator(m_underlying_handler); } |\n | |\n |_\b\t_\be_\bx_\be_\bc_\bu_\bt_\bo_\br_\b__\bt_\by_\bp_\be_\b _\bg_\be_\bt_\b__\be_\bx_\be_\bc_\bu_\bt_\bo_\br_\b(_\b)_\b _\bc_\bo_\bn_\bs_\bt_\b _\bn_\bo_\be_\bx_\bc_\be_\bp_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a02|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |having 8 priority levels is probably excessive. It should probably be changed to 3 levels + dont-download |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bp_\bi_\be_\bc_\be_\b__\bp_\bi_\bc_\bk_\be_\br_\b._\bh_\bp_\bp_\b:_\b6_\b6_\b8_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* h\bha\bav\bvi\bin\bng\bg 8\b8 p\bpr\bri\bio\bor\bri\bit\bty\by l\ble\bev\bve\bel\bls\bs i\bis\bs p\bpr\bro\bob\bba\bab\bbl\bly\by e\bex\bxc\bce\bes\bss\bsi\biv\bve\be.\b. I\bIt\bt s\bsh\bho\bou\bul\bld\bd p\bpr\bro\bob\bba\bab\bbl\bly\by b\bbe\be c\bch\bha\ban\bng\bge\bed\bd t\bto\bo 3\b3 l\ble\bev\bve\bel\bls\bs +\b+ d\bdo\bon\bnt\bt-\b-d\bdo\bow\bwn\bnl\blo\boa\bad\bd *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/p\bpi\bie\bec\bce\be_\b_p\bpi\bic\bck\bke\ber\br.\b.h\bhp\bpp\bp:\b:6\b66\b68\b8 *\b**\b**\b* |\n+|else if (state() == piece_full) |\n+|\t\t\t\t\t\tstate(piece_full_reverse); |\n+|\t\t\t} |\n+| |\n+|\t\t\t// the number of peers that has this piece |\n+|\t\t\t// (availability) |\n+|\t\t\tstd::uint32_t peer_count : 26; |\n+| |\n+|\t\t\t// one of the download_queue_t values. This indicates whether this piece |\n+|\t\t\t// is currently being downloaded or not, and what state it's in if |\n+|\t\t\t// it is. Specifically, as an optimization, pieces that have all blocks |\n+|\t\t\t// requested from them are separated out into separate lists to make |\n+|\t\t\t// lookups quicker. The main oddity is that whether a downloading piece |\n+|\t\t\t// has only been requested from peers that are reverse, that's |\n+|\t\t\t// recorded as piece_downloading_reverse, which really means the same |\n+|\t\t\t// as piece_downloading, it just saves space to also indicate that it |\n+|\t\t\t// has a bit lower priority. The reverse bit is only relevant if the |\n+|\t\t\t// state is piece_downloading. |\n+|\t\t\tstd::uint32_t download_state : 3; |\n+| |\n+| |\n+|// is 0 if the piece is filtered (not to be downloaded) |\n+|\t\t\t// 1 is low priority |\n+|\t\t\t// 2 is low priority |\n+|\t\t\t// 3 is mid priority |\n+|\t\t\t// 4 is default priority |\n+|\t\t\t// 5 is mid priority |\n+|\t\t\t// 6 is high priority |\n+|\t\t\t// 7 is high priority |\n+|\t\t\tstd::uint32_t piece_priority : 3; |\n+| |\n+|\t\t\t// index in to the piece_info vector |\n+|\t\t\tprio_index_t index; |\n+| |\n+|#ifdef TORRENT_DEBUG_REFCOUNTS |\n+|\t\t\t// all the peers that have this piece |\n+|\t\t\tstd::set have_peers; |\n+|#endif |\n+| |\n+|\t\t\t// index is set to this to indicate that we have the |\n+|\t\t\t// piece. There is no entry for the piece in the |\n+|\t\t\t// buckets if this is the case. |\n+|\t\t\tstatic constexpr prio_index_t we_have_index{-1}; |\n+| |\n+|\t\t\t// the priority value that means the piece is filtered |\n+|\t\t\tstatic constexpr std::uint32_t filter_priority = 0; |\n+| |\n+|\t\t\t// the max number the peer count can hold |\n+|\t\t\tstatic constexpr std::uint32_t max_peer_count = 0xffff; |\n+| |\n+|_\b\t_\b\t_\b\t_\bb_\bo_\bo_\bl_\b _\bh_\ba_\bv_\be_\b(_\b)_\b _\bc_\bo_\bn_\bs_\bt_\b _\b{_\b _\br_\be_\bt_\bu_\br_\bn_\b _\bi_\bn_\bd_\be_\bx_\b _\b=_\b=_\b _\bw_\be_\b__\bh_\ba_\bv_\be_\b__\bi_\bn_\bd_\be_\bx_\b;_\b _\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a02|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |add async_connect() that takes a hostname and port as well |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bs_\bo_\bc_\bk_\bs_\b5_\b__\bs_\bt_\br_\be_\ba_\bm_\b._\bh_\bp_\bp_\b:_\b1_\b5_\b3_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* a\bad\bdd\bd a\bas\bsy\byn\bnc\bc_\b_c\bco\bon\bnn\bne\bec\bct\bt(\b()\b) t\bth\bha\bat\bt t\bta\bak\bke\bes\bs a\ba h\bho\bos\bst\btn\bna\bam\bme\be a\ban\bnd\bd p\bpo\bor\brt\bt a\bas\bs w\bwe\bel\bll\bl *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/s\bso\boc\bck\bks\bs5\b5_\b_s\bst\btr\bre\bea\bam\bm.\b.h\bhp\bpp\bp:\b:1\b15\b53\b3 *\b**\b**\b* |\n+|TORRENT_ASSERT(!aux::is_ip_address(host)); |\n+|\t\tm_dst_name = host; |\n+|\t\tif (m_dst_name.size() > 255) |\n+|\t\t\tm_dst_name.resize(255); |\n+|\t} |\n+| |\n+|\tvoid close(error_code& ec) |\n+|\t{ |\n+|\t\tm_dst_name.clear(); |\n+|\t\tproxy_base::close(ec); |\n+|\t} |\n+| |\n+|#ifndef BOOST_NO_EXCEPTIONS |\n+|\tvoid close() |\n+|\t{ |\n+|\t\tm_dst_name.clear(); |\n+|\t\tproxy_base::close(); |\n+|\t} |\n+|#endif |\n+| |\n+|template |\n+|void async_connect(endpoint_type const& endpoint, Handler handler) |\n+|\t{ |\n+|\t\t// make sure we don't try to connect to INADDR_ANY. binding is fine, |\n+|\t\t// and using a hostname is fine on SOCKS version 5. |\n+|\t\tTORRENT_ASSERT(endpoint.address() != address() |\n+|\t\t\t|| (!m_dst_name.empty() && m_version == 5)); |\n+| |\n+|\t\tm_remote_endpoint = endpoint; |\n+| |\n+|\t\t// the connect is split up in the following steps: |\n+|\t\t// 1. resolve name of proxy server |\n+|\t\t// 2. connect to proxy server |\n+|\t\t// 3. if version == 5: |\n+|\t\t// 3.1 send SOCKS5 authentication method message |\n+|\t\t// 3.2 read SOCKS5 authentication response |\n+|\t\t// 3.3 send username+password |\n+|\t\t// 4. send SOCKS command message |\n+| |\n+|\t\tADD_OUTSTANDING_ASYNC(\"socks5_stream::name_lookup\"); |\n+|\t\tm_resolver.async_resolve(m_hostname, to_string(m_port).data(), wrap_allocator( |\n+|\t\t\t[this](error_code const& ec, tcp::resolver::results_type ips, Handler hn) { |\n+|\t\t\t\tname_lookup(ec, std::move(ips), std::move(hn)); |\n+|\t\t\t}, std::move(handler))); |\n+|\t} |\n+| |\n+|private: |\n+| |\n+|\ttemplate |\n+|\tvoid name_lookup(error_code const& e, tcp::resolver::results_type ips |\n+|_\b\t_\b\t_\b,_\b _\bH_\ba_\bn_\bd_\bl_\be_\br_\b _\bh_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |relevance\u00a02|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |this should really be a circular buffer |\n |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bp_\be_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b._\bh_\bp_\bp_\b:_\b9_\b9_\b6_\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs s\bsh\bho\bou\bul\bld\bd r\bre\bea\bal\bll\bly\by b\bbe\be a\ba c\bci\bir\brc\bcu\bul\bla\bar\br b\bbu\buf\bff\bfe\ber\br *\b**\b**\b**\b**\b* |\n |*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/p\bpe\bee\ber\br_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn.\b.h\bhp\bpp\bp:\b:9\b99\b96\b6 *\b**\b**\b* |\n |// it just serves as a queue to remember what we've sent, to avoid |\n |\t\t// re-sending suggests for the same piece |\n |\t\t// i.e. outgoing suggest pieces |\n@@ -4442,124 +4497,69 @@\n |\t\t// and false if we got an incoming connection |\n |\t\t// could be considered: true = local, false = remote |\n |\t\tbool m_outgoing:1; |\n | |\n |\t\t// is true if we learn the incoming connections listening |\n |\t\t// during the extended handshake |\n |_\b\t_\b\t_\bb_\bo_\bo_\bl_\b _\bm_\b__\br_\be_\bc_\be_\bi_\bv_\be_\bd_\b__\bl_\bi_\bs_\bt_\be_\bn_\b__\bp_\bo_\br_\bt_\b:_\b1_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a02|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |add async_connect() that takes a hostname and port as well |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bs_\bo_\bc_\bk_\bs_\b5_\b__\bs_\bt_\br_\be_\ba_\bm_\b._\bh_\bp_\bp_\b:_\b1_\b5_\b3_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* a\bad\bdd\bd a\bas\bsy\byn\bnc\bc_\b_c\bco\bon\bnn\bne\bec\bct\bt(\b()\b) t\bth\bha\bat\bt t\bta\bak\bke\bes\bs a\ba h\bho\bos\bst\btn\bna\bam\bme\be a\ban\bnd\bd p\bpo\bor\brt\bt a\bas\bs w\bwe\bel\bll\bl *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/s\bso\boc\bck\bks\bs5\b5_\b_s\bst\btr\bre\bea\bam\bm.\b.h\bhp\bpp\bp:\b:1\b15\b53\b3 *\b**\b**\b* |\n-|TORRENT_ASSERT(!aux::is_ip_address(host)); |\n-|\t\tm_dst_name = host; |\n-|\t\tif (m_dst_name.size() > 255) |\n-|\t\t\tm_dst_name.resize(255); |\n-|\t} |\n+|relevance\u00a02|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |this could be done more efficiently by just looking up the interface with the given name, maybe even with if_nametoindex() |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\be_\bn_\bu_\bm_\b__\bn_\be_\bt_\b._\bh_\bp_\bp_\b:_\b1_\b9_\b6_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs c\bco\bou\bul\bld\bd b\bbe\be d\bdo\bon\bne\be m\bmo\bor\bre\be e\bef\bff\bfi\bic\bci\bie\ben\bnt\btl\bly\by b\bby\by j\bju\bus\bst\bt l\blo\boo\bok\bki\bin\bng\bg u\bup\bp t\bth\bhe\be i\bin\bnt\bte\ber\brf\bfa\bac\bce\be w\bwi\bit\bth\bh t\bth\bhe\be g\bgi\biv\bve\ben\bn n\bna\bam\bme\be,\b, m\bma\bay\byb\bbe\be e\bev\bve\ben\bn w\bwi\bit\bth\bh i\bif\bf_\b_n\bna\bam\bme\bet\bto\boi\bin\bnd\bde\bex\bx(\b()\b) *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/e\ben\bnu\bum\bm_\b_n\bne\bet\bt.\b.h\bhp\bpp\bp:\b:1\b19\b96\b6 *\b**\b**\b* |\n+|// IPv6 address. If we're asking to be bound to an IPv6 address and |\n+|\t\t\t// providing 0.0.0.0 as the device, turn it into \"::\" |\n+|\t\t\tif (ip == address_v4::any() && protocol == boost::asio::ip::tcp::v6()) |\n+|\t\t\t\tip = address_v6::any(); |\n+|\t\t\tbind_ep.address(ip); |\n+|\t\t\t// it appears to be an IP. Just bind to that address |\n+|\t\t\tsock.bind(bind_ep, ec); |\n+|\t\t\treturn bind_ep.address(); |\n+|\t\t} |\n | |\n-|\tvoid close(error_code& ec) |\n-|\t{ |\n-|\t\tm_dst_name.clear(); |\n-|\t\tproxy_base::close(ec); |\n-|\t} |\n+|\t\tec.clear(); |\n | |\n-|#ifndef BOOST_NO_EXCEPTIONS |\n-|\tvoid close() |\n-|\t{ |\n-|\t\tm_dst_name.clear(); |\n-|\t\tproxy_base::close(); |\n-|\t} |\n+|#if TORRENT_HAS_BINDTODEVICE |\n+|\t\t// try to use SO_BINDTODEVICE here, if that exists. If it fails, |\n+|\t\t// fall back to the mechanism we have below |\n+|\t\taux::bind_device(sock, device_name, ec); |\n+|\t\tif (ec) |\n |#endif |\n+|\t\t{ |\n+|\t\t\tec.clear(); |\n+|std::vector ifs = enum_net_interfaces(ios, ec); |\n+|if (ec) return bind_ep.address(); |\n | |\n-|template |\n-|void async_connect(endpoint_type const& endpoint, Handler handler) |\n-|\t{ |\n-|\t\t// make sure we don't try to connect to INADDR_ANY. binding is fine, |\n-|\t\t// and using a hostname is fine on SOCKS version 5. |\n-|\t\tTORRENT_ASSERT(endpoint.address() != address() |\n-|\t\t\t|| (!m_dst_name.empty() && m_version == 5)); |\n-| |\n-|\t\tm_remote_endpoint = endpoint; |\n-| |\n-|\t\t// the connect is split up in the following steps: |\n-|\t\t// 1. resolve name of proxy server |\n-|\t\t// 2. connect to proxy server |\n-|\t\t// 3. if version == 5: |\n-|\t\t// 3.1 send SOCKS5 authentication method message |\n-|\t\t// 3.2 read SOCKS5 authentication response |\n-|\t\t// 3.3 send username+password |\n-|\t\t// 4. send SOCKS command message |\n-| |\n-|\t\tADD_OUTSTANDING_ASYNC(\"socks5_stream::name_lookup\"); |\n-|\t\tm_resolver.async_resolve(m_hostname, to_string(m_port).data(), wrap_allocator( |\n-|\t\t\t[this](error_code const& ec, tcp::resolver::results_type ips, Handler hn) { |\n-|\t\t\t\tname_lookup(ec, std::move(ips), std::move(hn)); |\n-|\t\t\t}, std::move(handler))); |\n-|\t} |\n+|\t\t\tbool found = false; |\n | |\n-|private: |\n+|\t\t\tfor (auto const& iface : ifs) |\n+|\t\t\t{ |\n+|\t\t\t\t// we're looking for a specific interface, and its address |\n+|\t\t\t\t// (which must be of the same family as the address we're |\n+|\t\t\t\t// connecting to) |\n+|\t\t\t\tif (std::strcmp(iface.name, device_name) != 0) continue; |\n+|\t\t\t\tif (iface.interface_address.is_v4() != (protocol == boost::asio::ip::tcp::v4())) |\n+|\t\t\t\t\tcontinue; |\n | |\n-|\ttemplate |\n-|\tvoid name_lookup(error_code const& e, tcp::resolver::results_type ips |\n-|_\b\t_\b\t_\b,_\b _\bH_\ba_\bn_\bd_\bl_\be_\br_\b _\bh_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a02|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |having 8 priority levels is probably excessive. It should probably be changed to 3 levels + dont-download |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bp_\bi_\be_\bc_\be_\b__\bp_\bi_\bc_\bk_\be_\br_\b._\bh_\bp_\bp_\b:_\b6_\b6_\b8_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* h\bha\bav\bvi\bin\bng\bg 8\b8 p\bpr\bri\bio\bor\bri\bit\bty\by l\ble\bev\bve\bel\bls\bs i\bis\bs p\bpr\bro\bob\bba\bab\bbl\bly\by e\bex\bxc\bce\bes\bss\bsi\biv\bve\be.\b. I\bIt\bt s\bsh\bho\bou\bul\bld\bd p\bpr\bro\bob\bba\bab\bbl\bly\by b\bbe\be c\bch\bha\ban\bng\bge\bed\bd t\bto\bo 3\b3 l\ble\bev\bve\bel\bls\bs +\b+ d\bdo\bon\bnt\bt-\b-d\bdo\bow\bwn\bnl\blo\boa\bad\bd *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/p\bpi\bie\bec\bce\be_\b_p\bpi\bic\bck\bke\ber\br.\b.h\bhp\bpp\bp:\b:6\b66\b68\b8 *\b**\b**\b* |\n-|else if (state() == piece_full) |\n-|\t\t\t\t\t\tstate(piece_full_reverse); |\n+|\t\t\t\tbind_ep.address(iface.interface_address); |\n+|\t\t\t\tfound = true; |\n+|\t\t\t\tbreak; |\n |\t\t\t} |\n | |\n-|\t\t\t// the number of peers that has this piece |\n-|\t\t\t// (availability) |\n-|\t\t\tstd::uint32_t peer_count : 26; |\n-| |\n-|\t\t\t// one of the download_queue_t values. This indicates whether this piece |\n-|\t\t\t// is currently being downloaded or not, and what state it's in if |\n-|\t\t\t// it is. Specifically, as an optimization, pieces that have all blocks |\n-|\t\t\t// requested from them are separated out into separate lists to make |\n-|\t\t\t// lookups quicker. The main oddity is that whether a downloading piece |\n-|\t\t\t// has only been requested from peers that are reverse, that's |\n-|\t\t\t// recorded as piece_downloading_reverse, which really means the same |\n-|\t\t\t// as piece_downloading, it just saves space to also indicate that it |\n-|\t\t\t// has a bit lower priority. The reverse bit is only relevant if the |\n-|\t\t\t// state is piece_downloading. |\n-|\t\t\tstd::uint32_t download_state : 3; |\n-| |\n-| |\n-|// is 0 if the piece is filtered (not to be downloaded) |\n-|\t\t\t// 1 is low priority |\n-|\t\t\t// 2 is low priority |\n-|\t\t\t// 3 is mid priority |\n-|\t\t\t// 4 is default priority |\n-|\t\t\t// 5 is mid priority |\n-|\t\t\t// 6 is high priority |\n-|\t\t\t// 7 is high priority |\n-|\t\t\tstd::uint32_t piece_priority : 3; |\n-| |\n-|\t\t\t// index in to the piece_info vector |\n-|\t\t\tprio_index_t index; |\n-| |\n-|#ifdef TORRENT_DEBUG_REFCOUNTS |\n-|\t\t\t// all the peers that have this piece |\n-|\t\t\tstd::set have_peers; |\n-|#endif |\n-| |\n-|\t\t\t// index is set to this to indicate that we have the |\n-|\t\t\t// piece. There is no entry for the piece in the |\n-|\t\t\t// buckets if this is the case. |\n-|\t\t\tstatic constexpr prio_index_t we_have_index{-1}; |\n-| |\n-|\t\t\t// the priority value that means the piece is filtered |\n-|\t\t\tstatic constexpr std::uint32_t filter_priority = 0; |\n-| |\n-|\t\t\t// the max number the peer count can hold |\n-|\t\t\tstatic constexpr std::uint32_t max_peer_count = 0xffff; |\n+|\t\t\tif (!found) |\n+|\t\t\t{ |\n+|\t\t\t\tec = error_code(boost::system::errc::no_such_device, generic_category()); |\n+|\t\t\t\treturn bind_ep.address(); |\n+|\t\t\t} |\n+|\t\t} |\n+|\t\tsock.bind(bind_ep, ec); |\n+|\t\treturn bind_ep.address(); |\n+|\t} |\n | |\n-|_\b\t_\b\t_\b\t_\bb_\bo_\bo_\bl_\b _\bh_\ba_\bv_\be_\b(_\b)_\b _\bc_\bo_\bn_\bs_\bt_\b _\b{_\b _\br_\be_\bt_\bu_\br_\bn_\b _\bi_\bn_\bd_\be_\bx_\b _\b=_\b=_\b _\bw_\be_\b__\bh_\ba_\bv_\be_\b__\bi_\bn_\bd_\be_\bx_\b;_\b _\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|\t// returns the device name whose local address is ``addr``. If |\n+|_\b\t_\b/_\b/_\b _\bn_\bo_\b _\bs_\bu_\bc_\bh_\b _\bd_\be_\bv_\bi_\bc_\be_\b _\bi_\bs_\b _\bf_\bo_\bu_\bn_\bd_\b,_\b _\ba_\bn_\b _\be_\bm_\bp_\bt_\by_\b _\bs_\bt_\br_\bi_\bn_\bg_\b _\bi_\bs_\b _\br_\be_\bt_\bu_\br_\bn_\be_\bd_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |relevance\u00a02|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bu_\bx_\b__\b/ |this type should probably be renamed to send_buffer |\n |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bc_\bh_\ba_\bi_\bn_\be_\bd_\b__\bb_\bu_\bf_\bf_\be_\br_\b._\bh_\bp_\bp_\b:_\b5_\b9_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs t\bty\byp\bpe\be s\bsh\bho\bou\bul\bld\bd p\bpr\bro\bob\bba\bab\bbl\bly\by b\bbe\be r\bre\ben\bna\bam\bme\bed\bd t\bto\bo s\bse\ben\bnd\bd_\b_b\bbu\buf\bff\bfe\ber\br *\b**\b**\b**\b**\b* |\n |*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/a\bau\bux\bx_\b_/\b/c\bch\bha\bai\bin\bne\bed\bd_\b_b\bbu\buf\bff\bfe\ber\br.\b.h\bhp\bpp\bp:\b:5\b59\b9 *\b**\b**\b* |\n |#include \"libtorrent/aux_/buffer.hpp\" |\n | |\n |#include |\n@@ -4690,68 +4690,14 @@\n | |\n |\t\tvirtual void remove_torrent(torrent_handle const& h, remove_flags_t options = {}) = 0; |\n |\t\tvirtual void remove_torrent_impl(std::shared_ptr tptr, remove_flags_t options) = 0; |\n | |\n |\t\t// port filter |\n |\t\tvirtual port_filter const& get_port_filter() const = 0; |\n |_\b\t_\b\t_\bv_\bi_\br_\bt_\bu_\ba_\bl_\b _\bv_\bo_\bi_\bd_\b _\bb_\ba_\bn_\b__\bi_\bp_\b(_\ba_\bd_\bd_\br_\be_\bs_\bs_\b _\ba_\bd_\bd_\br_\b)_\b _\b=_\b _\b0_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b1_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bi_\bm_\bp_\bl_\b._\bc_\bp_\bp_\b:_\b5_\b7_\b0_\b7_\b _\b _\b|_\br_\be_\bp_\bo_\br_\bt_\b _\bt_\bh_\be_\b _\bp_\br_\bo_\bp_\be_\br_\b _\ba_\bd_\bd_\br_\be_\bs_\bs_\b _\bo_\bf_\b _\bt_\bh_\be_\b _\br_\bo_\bu_\bt_\be_\br_\b _\ba_\bs_\b _\bt_\bh_\be_\b _\bs_\bo_\bu_\br_\bc_\be_\b _\bI_\bP_\b _\bo_\bf_\b _\bt_\bh_\bi_\bs_\b _\bv_\bo_\bt_\be_\b _\bo_\bf_\b _\bo_\bu_\br_\b _\be_\bx_\bt_\be_\br_\bn_\ba_\bl_\b _\ba_\bd_\bd_\br_\be_\bs_\bs_\b,_\b _\bi_\bn_\bs_\bt_\be_\ba_\bd_\b _\bo_\bf_\b _\bt_\bh_\be_\b _\be_\bm_\bp_\bt_\by_\b _\ba_\bd_\bd_\br_\be_\bs_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* r\bre\bep\bpo\bor\brt\bt t\bth\bhe\be p\bpr\bro\bop\bpe\ber\br a\bad\bdd\bdr\bre\bes\bss\bs o\bof\bf t\bth\bhe\be r\bro\bou\but\bte\ber\br a\bas\bs t\bth\bhe\be s\bso\bou\bur\brc\bce\be I\bIP\bP o\bof\bf t\bth\bhi\bis\bs v\bvo\bot\bte\be o\bof\bf o\bou\bur\br e\bex\bxt\bte\ber\brn\bna\bal\bl a\bad\bdd\bdr\bre\bes\bss\bs,\b, i\bin\bns\bst\bte\bea\bad\bd o\bof\bf t\bth\bhe\be e\bem\bmp\bpt\bty\by a\bad\bdd\bdr\bre\bes\bss\bs *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/s\bse\bes\bss\bsi\bio\bon\bn_\b_i\bim\bmp\bpl\bl.\b.c\bcp\bpp\bp:\b:5\b57\b70\b07\b7 *\b**\b**\b* |\n-|, listen_socket_handle const& ls) |\n-|\t{ |\n-|\t\tTORRENT_ASSERT(is_single_thread()); |\n-| |\n-|\t\tlisten_socket_t* listen_socket = ls.get(); |\n-| |\n-|\t\t// NOTE: don't assume that if ec != 0, the rest of the logic |\n-|\t\t// is not necessary, the ports still need to be set, in other |\n-|\t\t// words, don't early return without careful review of the |\n-|\t\t// remaining logic |\n-|\t\tif (ec && m_alerts.should_post()) |\n-|\t\t{ |\n-|\t\t\tm_alerts.emplace_alert(mapping |\n-|\t\t\t\t, transport, ec, listen_socket ? listen_socket->local_endpoint.address() : address()); |\n-|\t\t} |\n-| |\n-|\t\tif (!listen_socket) return; |\n-| |\n-|\t\tif (!ec && !external_ip.is_unspecified()) |\n-|\t\t{ |\n-|listen_socket->external_address.cast_vote(external_ip, source_router, address()); |\n-|} |\n-| |\n-|\t\t// need to check whether this mapping is for one of session ports (it could also be a user mapping) |\n-|\t\tif ((proto == portmap_protocol::tcp) && (listen_socket->tcp_port_mapping[transport].mapping == mapping)) |\n-|\t\t\tlisten_socket->tcp_port_mapping[transport].port = port; |\n-|\t\telse if ((proto == portmap_protocol::udp) && (listen_socket->udp_port_mapping[transport].mapping == mapping)) |\n-|\t\t\tlisten_socket->udp_port_mapping[transport].port = port; |\n-| |\n-|\t\tif (!ec && m_alerts.should_post()) |\n-|\t\t{ |\n-|\t\t\tm_alerts.emplace_alert(mapping, port |\n-|\t\t\t\t, transport, proto, listen_socket->local_endpoint.address()); |\n-|\t\t} |\n-|\t} |\n-| |\n-|#if TORRENT_ABI_VERSION == 1 |\n-|\tsession_status session_impl::status() const |\n-|\t{ |\n-|//\t\tINVARIANT_CHECK; |\n-|\t\tTORRENT_ASSERT(is_single_thread()); |\n-| |\n-|\t\tsession_status s; |\n-| |\n-|\t\ts.optimistic_unchoke_counter = m_optimistic_unchoke_time_scaler; |\n-|\t\ts.unchoke_counter = m_unchoke_time_scaler; |\n-|\t\ts.num_dead_peers = int(m_undead_peers.size()); |\n-| |\n-|\t\ts.num_peers = int(m_stats_counters[counters::num_peers_connected]); |\n-|\t\ts.num_unchoked = int(m_stats_counters[counters::num_peers_up_unchoked_all]); |\n-|_\b\t_\b\t_\bs_\b._\ba_\bl_\bl_\bo_\bw_\be_\bd_\b__\bu_\bp_\bl_\bo_\ba_\bd_\b__\bs_\bl_\bo_\bt_\bs_\b _\b=_\b _\bi_\bn_\bt_\b(_\bm_\b__\bs_\bt_\ba_\bt_\bs_\b__\bc_\bo_\bu_\bn_\bt_\be_\br_\bs_\b[_\bc_\bo_\bu_\bn_\bt_\be_\br_\bs_\b:_\b:_\bn_\bu_\bm_\b__\bu_\bn_\bc_\bh_\bo_\bk_\be_\b__\bs_\bl_\bo_\bt_\bs_\b]_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n | | |make this depend on the error and on the filesystem the files are being downloaded to. If the error is no_space_left_on_device and |\n |relevance\u00a01|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b1_\b1_\b2_\b6 |the filesystem doesn't support sparse files, only zero the priorities of the pieces that are at the tails of all files, leaving |\n |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\be_\bv_\be_\br_\by_\bt_\bh_\bi_\bn_\bg_\b _\bu_\bp_\b _\bt_\bo_\b _\bt_\bh_\be_\b _\bh_\bi_\bg_\bh_\be_\bs_\bt_\b _\bw_\br_\bi_\bt_\bt_\be_\bn_\b _\bp_\bi_\be_\bc_\be_\b _\bi_\bn_\b _\be_\ba_\bc_\bh_\b _\bf_\bi_\bl_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |*\b**\b**\b**\b**\b* m\bma\bak\bke\be t\bth\bhi\bis\bs d\bde\bep\bpe\ben\bnd\bd o\bon\bn t\bth\bhe\be e\ber\brr\bro\bor\br a\ban\bnd\bd o\bon\bn t\bth\bhe\be f\bfi\bil\ble\bes\bsy\bys\bst\bte\bem\bm t\bth\bhe\be f\bfi\bil\ble\bes\bs a\bar\bre\be b\bbe\bei\bin\bng\bg d\bdo\bow\bwn\bnl\blo\boa\bad\bde\bed\bd t\bto\bo.\b. I\bIf\bf t\bth\bhe\be e\ber\brr\bro\bor\br i\bis\bs n\bno\bo_\b_s\bsp\bpa\bac\bce\be_\b_l\ble\bef\bft\bt_\b_o\bon\bn_\b_d\bde\bev\bvi\bic\bce\be a\ban\bnd\bd t\bth\bhe\be f\bfi\bil\ble\bes\bsy\bys\bst\bte\bem\bm d\bdo\boe\bes\bsn\bn'\b't\bt s\bsu\bup\bpp\bpo\bor\brt\bt s\bsp\bpa\bar\brs\bse\be |\n |f\bfi\bil\ble\bes\bs,\b, o\bon\bnl\bly\by z\bze\ber\bro\bo t\bth\bhe\be p\bpr\bri\bio\bor\bri\bit\bti\bie\bes\bs o\bof\bf t\bth\bhe\be p\bpi\bie\bec\bce\bes\bs t\bth\bha\bat\bt a\bar\bre\be a\bat\bt t\bth\bhe\be t\bta\bai\bil\bls\bs o\bof\bf a\bal\bll\bl f\bfi\bil\ble\bes\bs,\b, l\ble\bea\bav\bvi\bin\bng\bg e\bev\bve\ber\bry\byt\bth\bhi\bin\bng\bg u\bup\bp t\bto\bo t\bth\bhe\be h\bhi\big\bgh\bhe\bes\bst\bt w\bwr\bri\bit\btt\bte\ben\bn p\bpi\bie\bec\bce\be i\bin\bn e\bea\bac\bch\bh f\bfi\bil\ble\be *\b**\b**\b**\b**\b* |\n |*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:1\b11\b12\b26\b6 *\b**\b**\b* |\n |\t\t// notify the user of the error |\n@@ -4853,14 +4799,68 @@\n |\t\t\t// we need to keep the object alive during this operation |\n |\t\t\tm_ses.disk_thread().async_release_files(m_storage |\n |\t\t\t\t, std::bind(&torrent::on_cache_flushed, shared_from_this(), false)); |\n |\t\t\tm_ses.deferred_submit_jobs(); |\n |\t\t} |\n | |\n |_\b\t_\b\t_\b/_\b/_\b _\bt_\bh_\bi_\bs_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\b _\bj_\bu_\bs_\bt_\b _\bc_\bo_\bm_\bp_\bl_\be_\bt_\be_\bd_\b _\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\bs_\b,_\b _\bw_\bh_\bi_\bc_\bh_\b _\bm_\be_\ba_\bn_\bs_\b _\bi_\bt_\b _\bw_\bi_\bl_\bl_\b _\bf_\ba_\bl_\bl_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b1_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bi_\bm_\bp_\bl_\b._\bc_\bp_\bp_\b:_\b5_\b7_\b0_\b7_\b _\b _\b|_\br_\be_\bp_\bo_\br_\bt_\b _\bt_\bh_\be_\b _\bp_\br_\bo_\bp_\be_\br_\b _\ba_\bd_\bd_\br_\be_\bs_\bs_\b _\bo_\bf_\b _\bt_\bh_\be_\b _\br_\bo_\bu_\bt_\be_\br_\b _\ba_\bs_\b _\bt_\bh_\be_\b _\bs_\bo_\bu_\br_\bc_\be_\b _\bI_\bP_\b _\bo_\bf_\b _\bt_\bh_\bi_\bs_\b _\bv_\bo_\bt_\be_\b _\bo_\bf_\b _\bo_\bu_\br_\b _\be_\bx_\bt_\be_\br_\bn_\ba_\bl_\b _\ba_\bd_\bd_\br_\be_\bs_\bs_\b,_\b _\bi_\bn_\bs_\bt_\be_\ba_\bd_\b _\bo_\bf_\b _\bt_\bh_\be_\b _\be_\bm_\bp_\bt_\by_\b _\ba_\bd_\bd_\br_\be_\bs_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* r\bre\bep\bpo\bor\brt\bt t\bth\bhe\be p\bpr\bro\bop\bpe\ber\br a\bad\bdd\bdr\bre\bes\bss\bs o\bof\bf t\bth\bhe\be r\bro\bou\but\bte\ber\br a\bas\bs t\bth\bhe\be s\bso\bou\bur\brc\bce\be I\bIP\bP o\bof\bf t\bth\bhi\bis\bs v\bvo\bot\bte\be o\bof\bf o\bou\bur\br e\bex\bxt\bte\ber\brn\bna\bal\bl a\bad\bdd\bdr\bre\bes\bss\bs,\b, i\bin\bns\bst\bte\bea\bad\bd o\bof\bf t\bth\bhe\be e\bem\bmp\bpt\bty\by a\bad\bdd\bdr\bre\bes\bss\bs *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/s\bse\bes\bss\bsi\bio\bon\bn_\b_i\bim\bmp\bpl\bl.\b.c\bcp\bpp\bp:\b:5\b57\b70\b07\b7 *\b**\b**\b* |\n+|, listen_socket_handle const& ls) |\n+|\t{ |\n+|\t\tTORRENT_ASSERT(is_single_thread()); |\n+| |\n+|\t\tlisten_socket_t* listen_socket = ls.get(); |\n+| |\n+|\t\t// NOTE: don't assume that if ec != 0, the rest of the logic |\n+|\t\t// is not necessary, the ports still need to be set, in other |\n+|\t\t// words, don't early return without careful review of the |\n+|\t\t// remaining logic |\n+|\t\tif (ec && m_alerts.should_post()) |\n+|\t\t{ |\n+|\t\t\tm_alerts.emplace_alert(mapping |\n+|\t\t\t\t, transport, ec, listen_socket ? listen_socket->local_endpoint.address() : address()); |\n+|\t\t} |\n+| |\n+|\t\tif (!listen_socket) return; |\n+| |\n+|\t\tif (!ec && !external_ip.is_unspecified()) |\n+|\t\t{ |\n+|listen_socket->external_address.cast_vote(external_ip, source_router, address()); |\n+|} |\n+| |\n+|\t\t// need to check whether this mapping is for one of session ports (it could also be a user mapping) |\n+|\t\tif ((proto == portmap_protocol::tcp) && (listen_socket->tcp_port_mapping[transport].mapping == mapping)) |\n+|\t\t\tlisten_socket->tcp_port_mapping[transport].port = port; |\n+|\t\telse if ((proto == portmap_protocol::udp) && (listen_socket->udp_port_mapping[transport].mapping == mapping)) |\n+|\t\t\tlisten_socket->udp_port_mapping[transport].port = port; |\n+| |\n+|\t\tif (!ec && m_alerts.should_post()) |\n+|\t\t{ |\n+|\t\t\tm_alerts.emplace_alert(mapping, port |\n+|\t\t\t\t, transport, proto, listen_socket->local_endpoint.address()); |\n+|\t\t} |\n+|\t} |\n+| |\n+|#if TORRENT_ABI_VERSION == 1 |\n+|\tsession_status session_impl::status() const |\n+|\t{ |\n+|//\t\tINVARIANT_CHECK; |\n+|\t\tTORRENT_ASSERT(is_single_thread()); |\n+| |\n+|\t\tsession_status s; |\n+| |\n+|\t\ts.optimistic_unchoke_counter = m_optimistic_unchoke_time_scaler; |\n+|\t\ts.unchoke_counter = m_unchoke_time_scaler; |\n+|\t\ts.num_dead_peers = int(m_undead_peers.size()); |\n+| |\n+|\t\ts.num_peers = int(m_stats_counters[counters::num_peers_connected]); |\n+|\t\ts.num_unchoked = int(m_stats_counters[counters::num_peers_up_unchoked_all]); |\n+|_\b\t_\b\t_\bs_\b._\ba_\bl_\bl_\bo_\bw_\be_\bd_\b__\bu_\bp_\bl_\bo_\ba_\bd_\b__\bs_\bl_\bo_\bt_\bs_\b _\b=_\b _\bi_\bn_\bt_\b(_\bm_\b__\bs_\bt_\ba_\bt_\bs_\b__\bc_\bo_\bu_\bn_\bt_\be_\br_\bs_\b[_\bc_\bo_\bu_\bn_\bt_\be_\br_\bs_\b:_\b:_\bn_\bu_\bm_\b__\bu_\bn_\bc_\bh_\bo_\bk_\be_\b__\bs_\bl_\bo_\bt_\bs_\b]_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |relevance\u00a01|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |have one instance per possible subnet, 192.168.x.x, 10.x.x.x, etc. |\n |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bi_\bp_\b__\bv_\bo_\bt_\be_\br_\b._\bh_\bp_\bp_\b:_\b1_\b3_\b0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |*\b**\b**\b**\b**\b* h\bha\bav\bve\be o\bon\bne\be i\bin\bns\bst\bta\ban\bnc\bce\be p\bpe\ber\br p\bpo\bos\bss\bsi\bib\bbl\ble\be s\bsu\bub\bbn\bne\bet\bt,\b, 1\b19\b92\b2.\b.1\b16\b68\b8.\b.x\bx.\b.x\bx,\b, 1\b10\b0.\b.x\bx.\b.x\bx.\b.x\bx,\b, e\bet\btc\bc.\b. *\b**\b**\b**\b**\b* |\n |*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/i\bip\bp_\b_v\bvo\bot\bte\ber\br.\b.h\bhp\bpp\bp:\b:1\b13\b30\b0 *\b**\b**\b* |\n |// stores one address for each combination of local/global and ipv4/ipv6 |\n |\t// use of this class should be avoided, get the IP from the appropriate |\n |\t// listen interface wherever possible |\n@@ -4883,159 +4883,80 @@\n |\t\t// [n][0] = IPv4 [n][1] = IPv6 |\n |address m_addresses[2][2]; |\n |}; |\n | |\n |} |\n | |\n |_\b#_\be_\bn_\bd_\bi_\bf_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bb_\bl_\bo_\bo_\bm_\b__\bf_\bi_\bl_\bt_\be_\br_\b._\bc_\bp_\bp_\b:|test size() |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b3_\b5_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bte\bes\bst\bt s\bsi\biz\bze\be(\b()\b) *\b**\b**\b**\b**\b* |\n-|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bb\bb_\bl\bl_\bo\bo_\bo\bo_\bm\bm_\b_\b__\bf\bf_\bi\bi_\bl\bl_\bt\bt_\be\be_\br\br_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b1\b1_\b3\b3_\b5\b5_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bb_\bl_\bo_\bo_\bm_\b__\bf_\bi_\bl_\bt_\be_\br_\b._\bc_\bp_\bp_\b:|test clear() |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b3_\b6_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bte\bes\bst\bt c\bcl\ble\bea\bar\br(\b()\b) *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/t\bte\bes\bst\bt/\b/t\bte\bes\bst\bt_\b_b\bbl\blo\boo\bom\bm_\b_f\bfi\bil\blt\bte\ber\br.\b.c\bcp\bpp\bp:\b:1\b13\b36\b6 *\b**\b**\b* |\n-|sha1_hash k(\"\\x01\\x00\\x02\\x00 \"); |\n-|\tTEST_CHECK(!filter.find(k)); |\n-|\tfilter.set(k); |\n-|\tTEST_CHECK(filter.find(k)); |\n-| |\n-|\tstd::uint8_t compare[4] = { 0x16, 0xff, 0x55, 0xaa}; |\n-| |\n-|\tbits_out = filter.to_string(); |\n-|\tTEST_EQUAL(memcmp(compare, bits_out.c_str(), 4), 0); |\n-|} |\n-| |\n-|} // anonymous namespace |\n-| |\n-|TORRENT_TEST(bloom_filter) |\n-|{ |\n-|\ttest_set_and_get(); |\n-|\ttest_set_bits(); |\n-|\ttest_count_zeroes(); |\n-|\ttest_to_from_string(); |\n-| |\n-|_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b._\bc_\bp_\bp_\b:|test file attributes |\n |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b2_\b0_\b8_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |*\b**\b**\b**\b**\b* t\bte\bes\bst\bt f\bfi\bil\ble\be a\bat\btt\btr\bri\bib\bbu\but\bte\bes\bs *\b**\b**\b**\b**\b* |\n |_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bf\bf_\bi\bi_\bl\bl_\be\be_\b_\b__\bs\bs_\bt\bt_\bo\bo_\br\br_\ba\ba_\bg\bg_\be\be_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b1\b1_\b2\b2_\b0\b0_\b8\b8_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b._\bc_\bp_\bp_\b:|test symlinks |\n |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b2_\b0_\b9_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |*\b**\b**\b**\b**\b* t\bte\bes\bst\bt s\bsy\bym\bml\bli\bin\bnk\bks\bs *\b**\b**\b**\b**\b* |\n |_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bf\bf_\bi\bi_\bl\bl_\be\be_\b_\b__\bs\bs_\bt\bt_\bo\bo_\br\br_\ba\ba_\bg\bg_\be\be_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b1\b1_\b2\b2_\b0\b0_\b9\b9_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bf_\bl_\ba_\bg_\bs_\b._\bc_\bp_\bp_\b:_\b1_\b6_\b3 |change to a different test setup. currently always paused. test_set_after_add(torrent_flags::paused); test_unset_after_add |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b(_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bl_\ba_\bg_\bs_\b:_\b:_\bp_\ba_\bu_\bs_\be_\bd_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* c\bch\bha\ban\bng\bge\be t\bto\bo a\ba d\bdi\bif\bff\bfe\ber\bre\ben\bnt\bt t\bte\bes\bst\bt s\bse\bet\btu\bup\bp.\b. c\bcu\bur\brr\bre\ben\bnt\btl\bly\by a\bal\blw\bwa\bay\bys\bs p\bpa\bau\bus\bse\bed\bd.\b. t\bte\bes\bst\bt_\b_s\bse\bet\bt_\b_a\baf\bft\bte\ber\br_\b_a\bad\bdd\bd(\b(t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfl\bla\bag\bgs\bs:\b::\b:p\bpa\bau\bus\bse\bed\bd)\b);\b; t\bte\bes\bst\bt_\b_u\bun\bns\bse\bet\bt_\b_a\baf\bft\bte\ber\br_\b_a\bad\bdd\bd(\b(t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfl\bla\bag\bgs\bs:\b::\b:p\bpa\bau\bus\bse\bed\bd)\b);\b; *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/t\bte\bes\bst\bt/\b/t\bte\bes\bst\bt_\b_f\bfl\bla\bag\bgs\bs.\b.c\bcp\bpp\bp:\b:1\b16\b63\b3 *\b**\b**\b* |\n-|{ |\n-|\t// share-mode |\n-|\ttest_add_and_get_flags(torrent_flags::share_mode); |\n-|\ttest_set_after_add(torrent_flags::share_mode); |\n-|\ttest_unset_after_add(torrent_flags::share_mode); |\n-|} |\n-|#endif |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bt_\br_\ba_\bn_\bs_\bf_\be_\br_\b._\bc_\bp_\bp_\b:_\b1_\b7_\b3_\b _\b|_\bt_\bh_\be_\bs_\be_\b _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk_\b _\bt_\be_\bs_\bt_\bs_\b _\bb_\be_\bl_\bo_\bn_\bg_\b _\bi_\bn_\b _\bt_\bh_\be_\bi_\br_\b _\bo_\bw_\bn_\b _\bt_\be_\bs_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bth\bhe\bes\bse\be s\bse\bet\btt\bti\bin\bng\bgs\bs_\b_p\bpa\bac\bck\bk t\bte\bes\bst\bts\bs b\bbe\bel\blo\bon\bng\bg i\bin\bn t\bth\bhe\bei\bir\br o\bow\bwn\bn t\bte\bes\bst\bt *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/t\bte\bes\bst\bt/\b/t\bte\bes\bst\bt_\b_t\btr\bra\ban\bns\bsf\bfe\ber\br.\b.c\bcp\bpp\bp:\b:1\b17\b73\b3 *\b**\b**\b* |\n+|// to the time it will take to complete the test |\n+|\tpack.set_int(settings_pack::min_reconnect_time, 0); |\n+|\tpack.set_int(settings_pack::stop_tracker_timeout, 1); |\n+|\tpack.set_bool(settings_pack::announce_to_all_trackers, true); |\n+|\tpack.set_bool(settings_pack::announce_to_all_tiers, true); |\n | |\n-|TORRENT_TEST(flag_apply_ip_filter) |\n-|{ |\n-|\t// apply-ip-filter |\n-|\ttest_add_and_get_flags(torrent_flags::apply_ip_filter); |\n-|\ttest_set_after_add(torrent_flags::apply_ip_filter); |\n-|\ttest_unset_after_add(torrent_flags::apply_ip_filter); |\n-|} |\n+|\t// make sure we announce to both http and udp trackers |\n+|\tpack.set_bool(settings_pack::prefer_udp_trackers, false); |\n+|\tpack.set_bool(settings_pack::enable_outgoing_utp, false); |\n+|\tpack.set_bool(settings_pack::enable_incoming_utp, false); |\n+|\tpack.set_bool(settings_pack::enable_lsd, false); |\n+|\tpack.set_bool(settings_pack::enable_natpmp, false); |\n+|\tpack.set_bool(settings_pack::enable_upnp, false); |\n+|\tpack.set_bool(settings_pack::enable_dht, false); |\n | |\n-|TORRENT_TEST(flag_paused) |\n-|{ |\n-|\t// paused |\n-|\ttest_add_and_get_flags(torrent_flags::paused); |\n-|} |\n+|\tpack.set_int(settings_pack::out_enc_policy, settings_pack::pe_disabled); |\n+|\tpack.set_int(settings_pack::in_enc_policy, settings_pack::pe_disabled); |\n | |\n-|TORRENT_TEST(flag_auto_managed) |\n-|{ |\n-|\t// auto-managed |\n-|\ttest_add_and_get_flags(torrent_flags::auto_managed); |\n-|\ttest_set_after_add(torrent_flags::auto_managed); |\n-|\ttest_unset_after_add(torrent_flags::auto_managed); |\n-|} |\n+|\tpack.set_bool(settings_pack::allow_multiple_connections_per_ip, false); |\n | |\n-|// super seeding mode is automatically turned off if we're not a seed |\n-|// since the posix_disk_io is not threaded, this will happen immediately |\n-|#if TORRENT_HAVE_MMAP |\n-|#ifndef TORRENT_DISABLE_SUPERSEEDING |\n-|TORRENT_TEST(flag_super_seeding) |\n-|{ |\n-|\t// super-seeding |\n-|\ttest_add_and_get_flags(torrent_flags::super_seeding); |\n-|\ttest_unset_after_add(torrent_flags::super_seeding); |\n-|\ttest_set_after_add(torrent_flags::super_seeding); |\n-|} |\n-|#endif |\n-|#endif |\n+|pack.set_int(settings_pack::unchoke_slots_limit, 0); |\n+|ses1.apply_settings(pack); |\n+|\tTEST_CHECK(ses1.get_settings().get_int(settings_pack::unchoke_slots_limit) == 0); |\n | |\n-|TORRENT_TEST(flag_sequential_download) |\n-|{ |\n-|\t// sequential-download |\n-|\ttest_add_and_get_flags(torrent_flags::sequential_download); |\n-|\ttest_set_after_add(torrent_flags::sequential_download); |\n-|\ttest_unset_after_add(torrent_flags::sequential_download); |\n-|_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bf_\bl_\ba_\bg_\bs_\b._\bc_\bp_\bp_\b:_\b2_\b0_\b5 |this test is flaky, since the torrent will become ready before asking for the flags, and by then stop_when_ready will have been |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bc_\bl_\be_\ba_\br_\be_\bd_\b _\bt_\be_\bs_\bt_\b__\ba_\bd_\bd_\b__\ba_\bn_\bd_\b__\bg_\be_\bt_\b__\bf_\bl_\ba_\bg_\bs_\b(_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bl_\ba_\bg_\bs_\b:_\b:_\bs_\bt_\bo_\bp_\b__\bw_\bh_\be_\bn_\b__\br_\be_\ba_\bd_\by_\b)_\b;_\b _\bs_\be_\bt_\bt_\bi_\bn_\bg_\b _\bs_\bt_\bo_\bp_\b-_\bw_\bh_\be_\bn_\b-_\br_\be_\ba_\bd_\by_\b _\bw_\bh_\be_\bn_\b _\ba_\bl_\br_\be_\ba_\bd_\by_\b _\bs_\bt_\bo_\bp_\bp_\be_\bd_\b _\bh_\ba_\bs_\b _\bn_\bo_\b _\be_\bf_\bf_\be_\bc_\bt_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs t\bte\bes\bst\bt i\bis\bs f\bfl\bla\bak\bky\by,\b, s\bsi\bin\bnc\bce\be t\bth\bhe\be t\bto\bor\brr\bre\ben\bnt\bt w\bwi\bil\bll\bl b\bbe\bec\bco\bom\bme\be r\bre\bea\bad\bdy\by b\bbe\bef\bfo\bor\bre\be a\bas\bsk\bki\bin\bng\bg f\bfo\bor\br t\bth\bhe\be f\bfl\bla\bag\bgs\bs,\b, a\ban\bnd\bd b\bby\by t\bth\bhe\ben\bn s\bst\bto\bop\bp_\b_w\bwh\bhe\ben\bn_\b_r\bre\bea\bad\bdy\by w\bwi\bil\bll\bl h\bha\bav\bve\be b\bbe\bee\ben\bn c\bcl\ble\bea\bar\bre\bed\bd t\bte\bes\bst\bt_\b_a\bad\bdd\bd_\b_a\ban\bnd\bd_\b_g\bge\bet\bt_\b_f\bfl\bla\bag\bgs\bs |\n-|(\b(t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfl\bla\bag\bgs\bs:\b::\b:s\bst\bto\bop\bp_\b_w\bwh\bhe\ben\bn_\b_r\bre\bea\bad\bdy\by)\b);\b; s\bse\bet\btt\bti\bin\bng\bg s\bst\bto\bop\bp-\b-w\bwh\bhe\ben\bn-\b-r\bre\bea\bad\bdy\by w\bwh\bhe\ben\bn a\bal\blr\bre\bea\bad\bdy\by s\bst\bto\bop\bpp\bpe\bed\bd h\bha\bas\bs n\bno\bo e\bef\bff\bfe\bec\bct\bt.\b. *\b**\b**\b**\b**\b* |\n-|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bf\bf_\bl\bl_\ba\ba_\bg\bg_\bs\bs_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b2\b2_\b0\b0_\b5\b5_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bf_\bl_\ba_\bg_\bs_\b._\bc_\bp_\bp_\b:_\b2_\b0_\b9_\b _\b _\b _\b _\b|_\bc_\bh_\ba_\bn_\bg_\be_\b _\bt_\bo_\b _\ba_\b _\bd_\bi_\bf_\bf_\be_\br_\be_\bn_\bt_\b _\bt_\be_\bs_\bt_\b _\bs_\be_\bt_\bu_\bp_\b._\b _\bc_\bu_\br_\br_\be_\bn_\bt_\bl_\by_\b _\ba_\bl_\bw_\ba_\by_\bs_\b _\bp_\ba_\bu_\bs_\be_\bd_\b._\b _\bt_\be_\bs_\bt_\b__\bs_\be_\bt_\b__\ba_\bf_\bt_\be_\br_\b__\ba_\bd_\bd_\b(_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bl_\ba_\bg_\bs_\b:_\b:_\bs_\bt_\bo_\bp_\b__\bw_\bh_\be_\bn_\b__\br_\be_\ba_\bd_\by_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* c\bch\bha\ban\bng\bge\be t\bto\bo a\ba d\bdi\bif\bff\bfe\ber\bre\ben\bnt\bt t\bte\bes\bst\bt s\bse\bet\btu\bup\bp.\b. c\bcu\bur\brr\bre\ben\bnt\btl\bly\by a\bal\blw\bwa\bay\bys\bs p\bpa\bau\bus\bse\bed\bd.\b. t\bte\bes\bst\bt_\b_s\bse\bet\bt_\b_a\baf\bft\bte\ber\br_\b_a\bad\bdd\bd(\b(t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfl\bla\bag\bgs\bs:\b::\b:s\bst\bto\bop\bp_\b_w\bwh\bhe\ben\bn_\b_r\bre\bea\bad\bdy\by)\b);\b; *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/t\bte\bes\bst\bt/\b/t\bte\bes\bst\bt_\b_f\bfl\bla\bag\bgs\bs.\b.c\bcp\bpp\bp:\b:2\b20\b09\b9 *\b**\b**\b* |\n-|test_set_after_add(torrent_flags::super_seeding); |\n-|} |\n-|#endif |\n-|#endif |\n+|\tpack.set_int(settings_pack::unchoke_slots_limit, -1); |\n+|\tses1.apply_settings(pack); |\n+|\tTEST_CHECK(ses1.get_settings().get_int(settings_pack::unchoke_slots_limit) == -1); |\n | |\n-|TORRENT_TEST(flag_sequential_download) |\n-|{ |\n-|\t// sequential-download |\n-|\ttest_add_and_get_flags(torrent_flags::sequential_download); |\n-|\ttest_set_after_add(torrent_flags::sequential_download); |\n-|\ttest_unset_after_add(torrent_flags::sequential_download); |\n-|} |\n+|\tpack.set_int(settings_pack::unchoke_slots_limit, 8); |\n+|\tses1.apply_settings(pack); |\n+|\tTEST_CHECK(ses1.get_settings().get_int(settings_pack::unchoke_slots_limit) == 8); |\n | |\n-|// the stop when ready flag will be cleared when the torrent is ready to start |\n-|// downloading. |\n-|// since the posix_disk_io is not threaded, this will happen immediately |\n-|#if TORRENT_HAVE_MMAP |\n-|TORRENT_TEST(flag_stop_when_ready) |\n-|{ |\n-|\t// stop-when-ready |\n-|test_unset_after_add(torrent_flags::stop_when_ready); |\n-|} |\n-|#endif |\n+|\tses2.apply_settings(pack); |\n | |\n-|TORRENT_TEST(flag_disable_dht) |\n-|{ |\n-|\ttest_add_and_get_flags(torrent_flags::disable_dht); |\n-|\ttest_set_after_add(torrent_flags::disable_dht); |\n-|\ttest_unset_after_add(torrent_flags::disable_dht); |\n-|} |\n+|\ttorrent_handle tor1; |\n+|\ttorrent_handle tor2; |\n | |\n+|\tcreate_directory(\"tmp1_transfer\", ec); |\n+|\tstd::ofstream file(\"tmp1_transfer/temporary\"); |\n+|\tstd::shared_ptr t = ::create_torrent(&file, \"temporary\", 32 * 1024, 13, false); |\n+|\tfile.close(); |\n | |\n-|TORRENT_TEST(flag_disable_lsd) |\n-|{ |\n-|\ttest_add_and_get_flags(torrent_flags::disable_lsd); |\n-|\ttest_set_after_add(torrent_flags::disable_lsd); |\n-|\ttest_unset_after_add(torrent_flags::disable_lsd); |\n-|} |\n+|\tTEST_CHECK(exists(combine_path(\"tmp1_transfer\", \"temporary\"))); |\n | |\n-|TORRENT_TEST(flag_disable_pex) |\n-|{ |\n-|\ttest_add_and_get_flags(torrent_flags::disable_pex); |\n-|\ttest_set_after_add(torrent_flags::disable_pex); |\n-|\ttest_unset_after_add(torrent_flags::disable_pex); |\n-|_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|\tadd_torrent_params params; |\n+|\tparams.storage_mode = storage_mode; |\n+|\tparams.flags &= ~torrent_flags::paused; |\n+|\tparams.flags &= ~torrent_flags::auto_managed; |\n+| |\n+|\twait_for_listen(ses1, \"ses1\"); |\n+|_\b\t_\bw_\ba_\bi_\bt_\b__\bf_\bo_\br_\b__\bl_\bi_\bs_\bt_\be_\bn_\b(_\bs_\be_\bs_\b2_\b,_\b _\b\"_\bs_\be_\bs_\b2_\b\"_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/ |test sending invalid requests (out of bound piece index, offsets and sizes) |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bt_\be_\bs_\bt_\b__\bf_\ba_\bs_\bt_\b__\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\b._\bc_\bp_\bp_\b:_\b1_\b1_\b3_\b5_\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bte\bes\bst\bt s\bse\ben\bnd\bdi\bin\bng\bg i\bin\bnv\bva\bal\bli\bid\bd r\bre\beq\bqu\bue\bes\bst\bts\bs (\b(o\bou\but\bt o\bof\bf b\bbo\bou\bun\bnd\bd p\bpi\bie\bec\bce\be i\bin\bnd\bde\bex\bx,\b, o\bof\bff\bfs\bse\bet\bts\bs a\ban\bnd\bd s\bsi\biz\bze\bes\bs)\b) *\b**\b**\b**\b**\b* |\n+|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bf\bf_\ba\ba_\bs\bs_\bt\bt_\b_\b__\be\be_\bx\bx_\bt\bt_\be\be_\bn\bn_\bs\bs_\bi\bi_\bo\bo_\bn\bn_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b1\b1_\b1\b1_\b3\b3_\b5\b5_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bd_\bh_\bt_\b._\bc_\bp_\bp_\b:_\b4_\b7_\b2_\b _\b _\b _\b _\b _\b _\b|_\bc_\bh_\be_\bc_\bk_\b _\bt_\bo_\b _\bm_\ba_\bk_\be_\b _\bs_\bu_\br_\be_\b _\bt_\bh_\be_\b _\b\"_\bb_\be_\bs_\bt_\b\"_\b _\bi_\bt_\be_\bm_\bs_\b _\ba_\br_\be_\b _\bs_\bt_\bo_\br_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |*\b**\b**\b**\b**\b* c\bch\bhe\bec\bck\bk t\bto\bo m\bma\bak\bke\be s\bsu\bur\bre\be t\bth\bhe\be \"\b\"b\bbe\bes\bst\bt\"\b\" i\bit\bte\bem\bms\bs a\bar\bre\be s\bst\bto\bor\bre\bed\bd *\b**\b**\b**\b**\b* |\n |*\b**\b**\b* .\b..\b./\b/t\bte\bes\bst\bt/\b/t\bte\bes\bst\bt_\b_d\bdh\bht\bt.\b.c\bcp\bpp\bp:\b:4\b47\b72\b2 *\b**\b**\b* |\n |, msg_args().target(items[j].target)); |\n | |\n |\t\tkey_desc_t const desc[] = |\n |\t\t{ |\n@@ -5162,50 +5083,14 @@\n |TORRENT_TEST(dht) |\n |{ |\n |\t// dummy dht test |\n |\tTEST_CHECK(true); |\n |} |\n | |\n |_\b#_\be_\bn_\bd_\bi_\bf_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bp_\be_\be_\br_\b__\bl_\bi_\bs_\bt_\b._\bc_\bp_\bp_\b: |test erasing peers |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b2_\b4_\b1_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bte\bes\bst\bt e\ber\bra\bas\bsi\bin\bng\bg p\bpe\bee\ber\brs\bs *\b**\b**\b**\b**\b* |\n-|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bp\bp_\be\be_\be\be_\br\br_\b_\b__\bl\bl_\bi\bi_\bs\bs_\bt\bt_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b1\b1_\b2\b2_\b4\b4_\b1\b1_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bp_\be_\be_\br_\b__\bl_\bi_\bs_\bt_\b._\bc_\bp_\bp_\b: |test update_peer_port with allow_multiple_connections_per_ip and without |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b2_\b4_\b2_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bte\bes\bst\bt u\bup\bpd\bda\bat\bte\be_\b_p\bpe\bee\ber\br_\b_p\bpo\bor\brt\bt w\bwi\bit\bth\bh a\bal\bll\blo\bow\bw_\b_m\bmu\bul\blt\bti\bip\bpl\ble\be_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bns\bs_\b_p\bpe\ber\br_\b_i\bip\bp a\ban\bnd\bd w\bwi\bit\bth\bho\bou\but\bt *\b**\b**\b**\b**\b* |\n-|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bp\bp_\be\be_\be\be_\br\br_\b_\b__\bl\bl_\bi\bi_\bs\bs_\bt\bt_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b1\b1_\b2\b2_\b4\b4_\b2\b2_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bp_\be_\be_\br_\b__\bl_\bi_\bs_\bt_\b._\bc_\bp_\bp_\b: |test add i2p peers |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b2_\b4_\b3_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bte\bes\bst\bt a\bad\bdd\bd i\bi2\b2p\bp p\bpe\bee\ber\brs\bs *\b**\b**\b**\b**\b* |\n-|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bp\bp_\be\be_\be\be_\br\br_\b_\b__\bl\bl_\bi\bi_\bs\bs_\bt\bt_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b1\b1_\b2\b2_\b4\b4_\b3\b3_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bp_\be_\be_\br_\b__\bl_\bi_\bs_\bt_\b._\bc_\bp_\bp_\b: |test allow_i2p_mixed |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b2_\b4_\b4_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bte\bes\bst\bt a\bal\bll\blo\bow\bw_\b_i\bi2\b2p\bp_\b_m\bmi\bix\bxe\bed\bd *\b**\b**\b**\b**\b* |\n-|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bp\bp_\be\be_\be\be_\br\br_\b_\b__\bl\bl_\bi\bi_\bs\bs_\bt\bt_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b1\b1_\b2\b2_\b4\b4_\b4\b4_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bp_\be_\be_\br_\b__\bl_\bi_\bs_\bt_\b._\bc_\bp_\bp_\b: |test insert_peer failing with all error conditions |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b2_\b4_\b5_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bte\bes\bst\bt i\bin\bns\bse\ber\brt\bt_\b_p\bpe\bee\ber\br f\bfa\bai\bil\bli\bin\bng\bg w\bwi\bit\bth\bh a\bal\bll\bl e\ber\brr\bro\bor\br c\bco\bon\bnd\bdi\bit\bti\bio\bon\bns\bs *\b**\b**\b**\b**\b* |\n-|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bp\bp_\be\be_\be\be_\br\br_\b_\b__\bl\bl_\bi\bi_\bs\bs_\bt\bt_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b1\b1_\b2\b2_\b4\b4_\b5\b5_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bp_\be_\be_\br_\b__\bl_\bi_\bs_\bt_\b._\bc_\bp_\bp_\b: |test IPv6 |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b2_\b4_\b6_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bte\bes\bst\bt I\bIP\bPv\bv6\b6 *\b**\b**\b**\b**\b* |\n-|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bp\bp_\be\be_\be\be_\br\br_\b_\b__\bl\bl_\bi\bi_\bs\bs_\bt\bt_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b1\b1_\b2\b2_\b4\b4_\b6\b6_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bp_\be_\be_\br_\b__\bl_\bi_\bs_\bt_\b._\bc_\bp_\bp_\b: |test connect_to_peer() failing |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b2_\b4_\b7_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bte\bes\bst\bt c\bco\bon\bnn\bne\bec\bct\bt_\b_t\bto\bo_\b_p\bpe\bee\ber\br(\b()\b) f\bfa\bai\bil\bli\bin\bng\bg *\b**\b**\b**\b**\b* |\n-|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bp\bp_\be\be_\be\be_\br\br_\b_\b__\bl\bl_\bi\bi_\bs\bs_\bt\bt_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b1\b1_\b2\b2_\b4\b4_\b7\b7_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bp_\be_\be_\br_\b__\bl_\bi_\bs_\bt_\b._\bc_\bp_\bp_\b: |test connection_closed |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b2_\b4_\b8_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bte\bes\bst\bt c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn_\b_c\bcl\blo\bos\bse\bed\bd *\b**\b**\b**\b**\b* |\n-|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bp\bp_\be\be_\be\be_\br\br_\b_\b__\bl\bl_\bi\bi_\bs\bs_\bt\bt_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b1\b1_\b2\b2_\b4\b4_\b8\b8_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bp_\be_\be_\br_\b__\bl_\bi_\bs_\bt_\b._\bc_\bp_\bp_\b: |connect candidates recalculation when incrementing failcount |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b2_\b4_\b9_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* c\bco\bon\bnn\bne\bec\bct\bt c\bca\ban\bnd\bdi\bid\bda\bat\bte\bes\bs r\bre\bec\bca\bal\blc\bcu\bul\bla\bat\bti\bio\bon\bn w\bwh\bhe\ben\bn i\bin\bnc\bcr\bre\bem\bme\ben\bnt\bti\bin\bng\bg f\bfa\bai\bil\blc\bco\bou\bun\bnt\bt *\b**\b**\b**\b**\b* |\n-|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bp\bp_\be\be_\be\be_\br\br_\b_\b__\bl\bl_\bi\bi_\bs\bs_\bt\bt_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b1\b1_\b2\b2_\b4\b4_\b9\b9_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bs_\bs_\bl_\b._\bc_\bp_\bp_\b:_\b4_\b0_\b7_\b _\b _\b _\b _\b _\b _\b|_\bt_\be_\bs_\bt_\b _\bu_\bs_\bi_\bn_\bg_\b _\ba_\b _\bs_\bi_\bg_\bn_\be_\bd_\b _\bc_\be_\br_\bt_\bi_\bf_\bi_\bc_\ba_\bt_\be_\b _\bw_\bi_\bt_\bh_\b _\bt_\bh_\be_\b _\bw_\br_\bo_\bn_\bg_\b _\bi_\bn_\bf_\bo_\b-_\bh_\ba_\bs_\bh_\b _\bi_\bn_\b _\bD_\bN_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |*\b**\b**\b**\b**\b* t\bte\bes\bst\bt u\bus\bsi\bin\bng\bg a\ba s\bsi\big\bgn\bne\bed\bd c\bce\ber\brt\bti\bif\bfi\bic\bca\bat\bte\be w\bwi\bit\bth\bh t\bth\bhe\be w\bwr\bro\bon\bng\bg i\bin\bnf\bfo\bo-\b-h\bha\bas\bsh\bh i\bin\bn D\bDN\bN *\b**\b**\b**\b**\b* |\n |*\b**\b**\b* .\b..\b./\b/t\bte\bes\bst\bt/\b/t\bte\bes\bst\bt_\b_s\bss\bsl\bl.\b.c\bcp\bpp\bp:\b:4\b40\b07\b7 *\b**\b**\b* |\n |// in verifying peers |\n |\tctx.set_verify_mode(context::verify_none, ec); |\n |\tif (ec) |\n |\t{ |\n@@ -5306,281 +5191,151 @@\n |\t\treturn false; |\n |\t} |\n | |\n |\tif (memcmp(buf, \"\\x13\" \"BitTorrent protocol\", 20) != 0) |\n |\t{ |\n |\t\tstd::printf(\"invalid bittorrent handshake\\n\"); |\n |_\b\t_\b\t_\br_\be_\bt_\bu_\br_\bn_\b _\bf_\ba_\bl_\bs_\be_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bt_\br_\ba_\bn_\bs_\bf_\be_\br_\b._\bc_\bp_\bp_\b:_\b1_\b7_\b3_\b _\b|_\bt_\bh_\be_\bs_\be_\b _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk_\b _\bt_\be_\bs_\bt_\bs_\b _\bb_\be_\bl_\bo_\bn_\bg_\b _\bi_\bn_\b _\bt_\bh_\be_\bi_\br_\b _\bo_\bw_\bn_\b _\bt_\be_\bs_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bth\bhe\bes\bse\be s\bse\bet\btt\bti\bin\bng\bgs\bs_\b_p\bpa\bac\bck\bk t\bte\bes\bst\bts\bs b\bbe\bel\blo\bon\bng\bg i\bin\bn t\bth\bhe\bei\bir\br o\bow\bwn\bn t\bte\bes\bst\bt *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/t\bte\bes\bst\bt/\b/t\bte\bes\bst\bt_\b_t\btr\bra\ban\bns\bsf\bfe\ber\br.\b.c\bcp\bpp\bp:\b:1\b17\b73\b3 *\b**\b**\b* |\n-|// to the time it will take to complete the test |\n-|\tpack.set_int(settings_pack::min_reconnect_time, 0); |\n-|\tpack.set_int(settings_pack::stop_tracker_timeout, 1); |\n-|\tpack.set_bool(settings_pack::announce_to_all_trackers, true); |\n-|\tpack.set_bool(settings_pack::announce_to_all_tiers, true); |\n-| |\n-|\t// make sure we announce to both http and udp trackers |\n-|\tpack.set_bool(settings_pack::prefer_udp_trackers, false); |\n-|\tpack.set_bool(settings_pack::enable_outgoing_utp, false); |\n-|\tpack.set_bool(settings_pack::enable_incoming_utp, false); |\n-|\tpack.set_bool(settings_pack::enable_lsd, false); |\n-|\tpack.set_bool(settings_pack::enable_natpmp, false); |\n-|\tpack.set_bool(settings_pack::enable_upnp, false); |\n-|\tpack.set_bool(settings_pack::enable_dht, false); |\n-| |\n-|\tpack.set_int(settings_pack::out_enc_policy, settings_pack::pe_disabled); |\n-|\tpack.set_int(settings_pack::in_enc_policy, settings_pack::pe_disabled); |\n-| |\n-|\tpack.set_bool(settings_pack::allow_multiple_connections_per_ip, false); |\n-| |\n-|pack.set_int(settings_pack::unchoke_slots_limit, 0); |\n-|ses1.apply_settings(pack); |\n-|\tTEST_CHECK(ses1.get_settings().get_int(settings_pack::unchoke_slots_limit) == 0); |\n-| |\n-|\tpack.set_int(settings_pack::unchoke_slots_limit, -1); |\n-|\tses1.apply_settings(pack); |\n-|\tTEST_CHECK(ses1.get_settings().get_int(settings_pack::unchoke_slots_limit) == -1); |\n-| |\n-|\tpack.set_int(settings_pack::unchoke_slots_limit, 8); |\n-|\tses1.apply_settings(pack); |\n-|\tTEST_CHECK(ses1.get_settings().get_int(settings_pack::unchoke_slots_limit) == 8); |\n-| |\n-|\tses2.apply_settings(pack); |\n-| |\n-|\ttorrent_handle tor1; |\n-|\ttorrent_handle tor2; |\n-| |\n-|\tcreate_directory(\"tmp1_transfer\", ec); |\n-|\tstd::ofstream file(\"tmp1_transfer/temporary\"); |\n-|\tstd::shared_ptr t = ::create_torrent(&file, \"temporary\", 32 * 1024, 13, false); |\n-|\tfile.close(); |\n-| |\n-|\tTEST_CHECK(exists(combine_path(\"tmp1_transfer\", \"temporary\"))); |\n-| |\n-|\tadd_torrent_params params; |\n-|\tparams.storage_mode = storage_mode; |\n-|\tparams.flags &= ~torrent_flags::paused; |\n-|\tparams.flags &= ~torrent_flags::auto_managed; |\n+|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bf_\bl_\ba_\bg_\bs_\b._\bc_\bp_\bp_\b:_\b1_\b6_\b3 |change to a different test setup. currently always paused. test_set_after_add(torrent_flags::paused); test_unset_after_add |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b(_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bl_\ba_\bg_\bs_\b:_\b:_\bp_\ba_\bu_\bs_\be_\bd_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* c\bch\bha\ban\bng\bge\be t\bto\bo a\ba d\bdi\bif\bff\bfe\ber\bre\ben\bnt\bt t\bte\bes\bst\bt s\bse\bet\btu\bup\bp.\b. c\bcu\bur\brr\bre\ben\bnt\btl\bly\by a\bal\blw\bwa\bay\bys\bs p\bpa\bau\bus\bse\bed\bd.\b. t\bte\bes\bst\bt_\b_s\bse\bet\bt_\b_a\baf\bft\bte\ber\br_\b_a\bad\bdd\bd(\b(t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfl\bla\bag\bgs\bs:\b::\b:p\bpa\bau\bus\bse\bed\bd)\b);\b; t\bte\bes\bst\bt_\b_u\bun\bns\bse\bet\bt_\b_a\baf\bft\bte\ber\br_\b_a\bad\bdd\bd(\b(t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfl\bla\bag\bgs\bs:\b::\b:p\bpa\bau\bus\bse\bed\bd)\b);\b; *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/t\bte\bes\bst\bt/\b/t\bte\bes\bst\bt_\b_f\bfl\bla\bag\bgs\bs.\b.c\bcp\bpp\bp:\b:1\b16\b63\b3 *\b**\b**\b* |\n+|{ |\n+|\t// share-mode |\n+|\ttest_add_and_get_flags(torrent_flags::share_mode); |\n+|\ttest_set_after_add(torrent_flags::share_mode); |\n+|\ttest_unset_after_add(torrent_flags::share_mode); |\n+|} |\n+|#endif |\n | |\n-|\twait_for_listen(ses1, \"ses1\"); |\n-|_\b\t_\bw_\ba_\bi_\bt_\b__\bf_\bo_\br_\b__\bl_\bi_\bs_\bt_\be_\bn_\b(_\bs_\be_\bs_\b2_\b,_\b _\b\"_\bs_\be_\bs_\b2_\b\"_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/ |test the case where we have > 120 samples (and have the base delay actually be updated) |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bt_\be_\bs_\bt_\b__\bt_\bi_\bm_\be_\bs_\bt_\ba_\bm_\bp_\b__\bh_\bi_\bs_\bt_\bo_\br_\by_\b._\bc_\bp_\bp_\b:_\b5_\b4_\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bte\bes\bst\bt t\bth\bhe\be c\bca\bas\bse\be w\bwh\bhe\ber\bre\be w\bwe\be h\bha\bav\bve\be >\b> 1\b12\b20\b0 s\bsa\bam\bmp\bpl\ble\bes\bs (\b(a\ban\bnd\bd h\bha\bav\bve\be t\bth\bhe\be b\bba\bas\bse\be d\bde\bel\bla\bay\by a\bac\bct\btu\bua\bal\bll\bly\by b\bbe\be u\bup\bpd\bda\bat\bte\bed\bd)\b) *\b**\b**\b**\b**\b* |\n-|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bt\bt_\bi\bi_\bm\bm_\be\be_\bs\bs_\bt\bt_\ba\ba_\bm\bm_\bp\bp_\b_\b__\bh\bh_\bi\bi_\bs\bs_\bt\bt_\bo\bo_\br\br_\by\by_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b5\b5_\b4\b4_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/ |test the case where a sample is lower than the history entry but not lower than the base |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bt_\be_\bs_\bt_\b__\bt_\bi_\bm_\be_\bs_\bt_\ba_\bm_\bp_\b__\bh_\bi_\bs_\bt_\bo_\br_\by_\b._\bc_\bp_\bp_\b:_\b5_\b5_\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bte\bes\bst\bt t\bth\bhe\be c\bca\bas\bse\be w\bwh\bhe\ber\bre\be a\ba s\bsa\bam\bmp\bpl\ble\be i\bis\bs l\blo\bow\bwe\ber\br t\bth\bha\ban\bn t\bth\bhe\be h\bhi\bis\bst\bto\bor\bry\by e\ben\bnt\btr\bry\by b\bbu\but\bt n\bno\bot\bt l\blo\bow\bwe\ber\br t\bth\bha\ban\bn t\bth\bhe\be b\bba\bas\bse\be *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/t\bte\bes\bst\bt/\b/t\bte\bes\bst\bt_\b_t\bti\bim\bme\bes\bst\bta\bam\bmp\bp_\b_h\bhi\bis\bst\bto\bor\bry\by.\b.c\bcp\bpp\bp:\b:5\b55\b5 *\b**\b**\b* |\n-|#include \"libtorrent/aux_/timestamp_history.hpp\" |\n+|TORRENT_TEST(flag_apply_ip_filter) |\n+|{ |\n+|\t// apply-ip-filter |\n+|\ttest_add_and_get_flags(torrent_flags::apply_ip_filter); |\n+|\ttest_set_after_add(torrent_flags::apply_ip_filter); |\n+|\ttest_unset_after_add(torrent_flags::apply_ip_filter); |\n+|} |\n | |\n-|TORRENT_TEST(timestamp_history) |\n+|TORRENT_TEST(flag_paused) |\n |{ |\n-|\tusing namespace lt; |\n+|\t// paused |\n+|\ttest_add_and_get_flags(torrent_flags::paused); |\n+|} |\n | |\n-|\taux::timestamp_history h; |\n-|\tTEST_EQUAL(h.add_sample(0x32, false), 0); |\n-|\tTEST_EQUAL(h.base(), 0x32); |\n-|\tTEST_EQUAL(h.add_sample(0x33, false), 0x1); |\n-|\tTEST_EQUAL(h.base(), 0x32); |\n-|\tTEST_EQUAL(h.add_sample(0x3433, false), 0x3401); |\n-|\tTEST_EQUAL(h.base(), 0x32); |\n-|\tTEST_EQUAL(h.add_sample(0x30, false), 0); |\n-|\tTEST_EQUAL(h.base(), 0x30); |\n+|TORRENT_TEST(flag_auto_managed) |\n+|{ |\n+|\t// auto-managed |\n+|\ttest_add_and_get_flags(torrent_flags::auto_managed); |\n+|\ttest_set_after_add(torrent_flags::auto_managed); |\n+|\ttest_unset_after_add(torrent_flags::auto_managed); |\n+|} |\n | |\n-|\t// test that wrapping of the timestamp is properly handled |\n-|\th.add_sample(0xfffffff3, false); |\n-|\tTEST_EQUAL(h.base(), 0xfffffff3); |\n+|// super seeding mode is automatically turned off if we're not a seed |\n+|// since the posix_disk_io is not threaded, this will happen immediately |\n+|#if TORRENT_HAVE_MMAP |\n+|#ifndef TORRENT_DISABLE_SUPERSEEDING |\n+|TORRENT_TEST(flag_super_seeding) |\n+|{ |\n+|\t// super-seeding |\n+|\ttest_add_and_get_flags(torrent_flags::super_seeding); |\n+|\ttest_unset_after_add(torrent_flags::super_seeding); |\n+|\ttest_set_after_add(torrent_flags::super_seeding); |\n+|} |\n+|#endif |\n+|#endif |\n | |\n+|TORRENT_TEST(flag_sequential_download) |\n+|{ |\n+|\t// sequential-download |\n+|\ttest_add_and_get_flags(torrent_flags::sequential_download); |\n+|\ttest_set_after_add(torrent_flags::sequential_download); |\n+|\ttest_unset_after_add(torrent_flags::sequential_download); |\n |_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b._\bc_\bp_\bp_\b:|test remap_files |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b4_\b5_\b9_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bte\bes\bst\bt r\bre\bem\bma\bap\bp_\b_f\bfi\bil\ble\bes\bs *\b**\b**\b**\b**\b* |\n-|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bt\bt_\bo\bo_\br\br_\br\br_\be\be_\bn\bn_\bt\bt_\b_\b__\bi\bi_\bn\bn_\bf\bf_\bo\bo_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b4\b4_\b5\b5_\b9\b9_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b._\bc_\bp_\bp_\b:|torrent with 'p' (padfile) attribute |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b4_\b6_\b0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bto\bor\brr\bre\ben\bnt\bt w\bwi\bit\bth\bh '\b'p\bp'\b' (\b(p\bpa\bad\bdf\bfi\bil\ble\be)\b) a\bat\btt\btr\bri\bib\bbu\but\bte\be *\b**\b**\b**\b**\b* |\n-|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bt\bt_\bo\bo_\br\br_\br\br_\be\be_\bn\bn_\bt\bt_\b_\b__\bi\bi_\bn\bn_\bf\bf_\bo\bo_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b4\b4_\b6\b6_\b0\b0_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b._\bc_\bp_\bp_\b:|torrent with 'h' (hidden) attribute |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b4_\b6_\b1_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bto\bor\brr\bre\ben\bnt\bt w\bwi\bit\bth\bh '\b'h\bh'\b' (\b(h\bhi\bid\bdd\bde\ben\bn)\b) a\bat\btt\btr\bri\bib\bbu\but\bte\be *\b**\b**\b**\b**\b* |\n-|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bt\bt_\bo\bo_\br\br_\br\br_\be\be_\bn\bn_\bt\bt_\b_\b__\bi\bi_\bn\bn_\bf\bf_\bo\bo_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b4\b4_\b6\b6_\b1\b1_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b._\bc_\bp_\bp_\b:|torrent with 'x' (executable) attribute |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b4_\b6_\b2_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bto\bor\brr\bre\ben\bnt\bt w\bwi\bit\bth\bh '\b'x\bx'\b' (\b(e\bex\bxe\bec\bcu\but\bta\bab\bbl\ble\be)\b) a\bat\btt\btr\bri\bib\bbu\but\bte\be *\b**\b**\b**\b**\b* |\n-|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bt\bt_\bo\bo_\br\br_\br\br_\be\be_\bn\bn_\bt\bt_\b_\b__\bi\bi_\bn\bn_\bf\bf_\bo\bo_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b4\b4_\b6\b6_\b2\b2_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b._\bc_\bp_\bp_\b:|torrent with 'l' (symlink) attribute |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b4_\b6_\b3_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bto\bor\brr\bre\ben\bnt\bt w\bwi\bit\bth\bh '\b'l\bl'\b' (\b(s\bsy\bym\bml\bli\bin\bnk\bk)\b) a\bat\btt\btr\bri\bib\bbu\but\bte\be *\b**\b**\b**\b**\b* |\n-|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bt\bt_\bo\bo_\br\br_\br\br_\be\be_\bn\bn_\bt\bt_\b_\b__\bi\bi_\bn\bn_\bf\bf_\bo\bo_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b4\b4_\b6\b6_\b3\b3_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b._\bc_\bp_\bp_\b:|torrent with multiple trackers in multiple tiers, making sure we shuffle them (how do you test shuffling?, load it multiple times |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b4_\b6_\b4_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\ba_\bn_\bd_\b _\bm_\ba_\bk_\be_\b _\bs_\bu_\br_\be_\b _\bi_\bt_\b'_\bs_\b _\bi_\bn_\b _\bd_\bi_\bf_\bf_\be_\br_\be_\bn_\bt_\b _\bo_\br_\bd_\be_\br_\b _\ba_\bt_\b _\bl_\be_\ba_\bs_\bt_\b _\bo_\bn_\bc_\be_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bto\bor\brr\bre\ben\bnt\bt w\bwi\bit\bth\bh m\bmu\bul\blt\bti\bip\bpl\ble\be t\btr\bra\bac\bck\bke\ber\brs\bs i\bin\bn m\bmu\bul\blt\bti\bip\bpl\ble\be t\bti\bie\ber\brs\bs,\b, m\bma\bak\bki\bin\bng\bg s\bsu\bur\bre\be w\bwe\be s\bsh\bhu\buf\bff\bfl\ble\be t\bth\bhe\bem\bm (\b(h\bho\bow\bw d\bdo\bo y\byo\bou\bu t\bte\bes\bst\bt s\bsh\bhu\buf\bff\bfl\bli\bin\bng\bg?\b?,\b, l\blo\boa\bad\bd i\bit\bt m\bmu\bul\blt\bti\bip\bpl\ble\be t\bti\bim\bme\bes\bs a\ban\bnd\bd m\bma\bak\bke\be s\bsu\bur\bre\be i\bit\bt'\b's\bs i\bin\bn d\bdi\bif\bff\bfe\ber\bre\ben\bnt\bt o\bor\brd\bde\ber\br |\n-|a\bat\bt l\ble\bea\bas\bst\bt o\bon\bnc\bce\be)\b) *\b**\b**\b**\b**\b* |\n-|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bt\bt_\bo\bo_\br\br_\br\br_\be\be_\bn\bn_\bt\bt_\b_\b__\bi\bi_\bn\bn_\bf\bf_\bo\bo_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b4\b4_\b6\b6_\b4\b4_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b._\bc_\bp_\bp_\b:|torrents with a zero-length name |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b4_\b6_\b7_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bto\bor\brr\bre\ben\bnt\bts\bs w\bwi\bit\bth\bh a\ba z\bze\ber\bro\bo-\b-l\ble\ben\bng\bgt\bth\bh n\bna\bam\bme\be *\b**\b**\b**\b**\b* |\n-|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bt\bt_\bo\bo_\br\br_\br\br_\be\be_\bn\bn_\bt\bt_\b_\b__\bi\bi_\bn\bn_\bf\bf_\bo\bo_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b4\b4_\b6\b6_\b7\b7_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b._\bc_\bp_\bp_\b:|torrent with a non-dictionary info-section |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b4_\b6_\b8_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bto\bor\brr\bre\ben\bnt\bt w\bwi\bit\bth\bh a\ba n\bno\bon\bn-\b-d\bdi\bic\bct\bti\bio\bon\bna\bar\bry\by i\bin\bnf\bfo\bo-\b-s\bse\bec\bct\bti\bio\bon\bn *\b**\b**\b**\b**\b* |\n-|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bt\bt_\bo\bo_\br\br_\br\br_\be\be_\bn\bn_\bt\bt_\b_\b__\bi\bi_\bn\bn_\bf\bf_\bo\bo_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b4\b4_\b6\b6_\b8\b8_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b._\bc_\bp_\bp_\b:|torrents with DHT nodes |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b4_\b6_\b9_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bto\bor\brr\bre\ben\bnt\bts\bs w\bwi\bit\bth\bh D\bDH\bHT\bT n\bno\bod\bde\bes\bs *\b**\b**\b**\b**\b* |\n-|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bt\bt_\bo\bo_\br\br_\br\br_\be\be_\bn\bn_\bt\bt_\b_\b__\bi\bi_\bn\bn_\bf\bf_\bo\bo_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b4\b4_\b6\b6_\b9\b9_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b._\bc_\bp_\bp_\b:|torrent with url-list as a single string |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b4_\b7_\b0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bto\bor\brr\bre\ben\bnt\bt w\bwi\bit\bth\bh u\bur\brl\bl-\b-l\bli\bis\bst\bt a\bas\bs a\ba s\bsi\bin\bng\bgl\ble\be s\bst\btr\bri\bin\bng\bg *\b**\b**\b**\b**\b* |\n-|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bt\bt_\bo\bo_\br\br_\br\br_\be\be_\bn\bn_\bt\bt_\b_\b__\bi\bi_\bn\bn_\bf\bf_\bo\bo_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b4\b4_\b7\b7_\b0\b0_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b._\bc_\bp_\bp_\b:|torrent with http seed as a single string |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b4_\b7_\b1_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bto\bor\brr\bre\ben\bnt\bt w\bwi\bit\bth\bh h\bht\btt\btp\bp s\bse\bee\bed\bd a\bas\bs a\ba s\bsi\bin\bng\bgl\ble\be s\bst\btr\bri\bin\bng\bg *\b**\b**\b**\b**\b* |\n-|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bt\bt_\bo\bo_\br\br_\br\br_\be\be_\bn\bn_\bt\bt_\b_\b__\bi\bi_\bn\bn_\bf\bf_\bo\bo_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b4\b4_\b7\b7_\b1\b1_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b._\bc_\bp_\bp_\b:|torrent with a comment |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b4_\b7_\b2_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bto\bor\brr\bre\ben\bnt\bt w\bwi\bit\bth\bh a\ba c\bco\bom\bmm\bme\ben\bnt\bt *\b**\b**\b**\b**\b* |\n-|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bt\bt_\bo\bo_\br\br_\br\br_\be\be_\bn\bn_\bt\bt_\b_\b__\bi\bi_\bn\bn_\bf\bf_\bo\bo_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b4\b4_\b7\b7_\b2\b2_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b._\bc_\bp_\bp_\b:|torrent with an SSL cert |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b4_\b7_\b3_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bto\bor\brr\bre\ben\bnt\bt w\bwi\bit\bth\bh a\ban\bn S\bSS\bSL\bL c\bce\ber\brt\bt *\b**\b**\b**\b**\b* |\n-|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bt\bt_\bo\bo_\br\br_\br\br_\be\be_\bn\bn_\bt\bt_\b_\b__\bi\bi_\bn\bn_\bf\bf_\bo\bo_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b4\b4_\b7\b7_\b3\b3_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b._\bc_\bp_\bp_\b:|torrent with attributes (executable and hidden) |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b4_\b7_\b4_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bto\bor\brr\bre\ben\bnt\bt w\bwi\bit\bth\bh a\bat\btt\btr\bri\bib\bbu\but\bte\bes\bs (\b(e\bex\bxe\bec\bcu\but\bta\bab\bbl\ble\be a\ban\bnd\bd h\bhi\bid\bdd\bde\ben\bn)\b) *\b**\b**\b**\b**\b* |\n-|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bt\bt_\bo\bo_\br\br_\br\br_\be\be_\bn\bn_\bt\bt_\b_\b__\bi\bi_\bn\bn_\bf\bf_\bo\bo_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b4\b4_\b7\b7_\b4\b4_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b._\bc_\bp_\bp_\b:|torrent_info constructor that takes an invalid bencoded buffer |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b4_\b7_\b5_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br t\bth\bha\bat\bt t\bta\bak\bke\bes\bs a\ban\bn i\bin\bnv\bva\bal\bli\bid\bd b\bbe\ben\bnc\bco\bod\bde\bed\bd b\bbu\buf\bff\bfe\ber\br *\b**\b**\b**\b**\b* |\n-|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bt\bt_\bo\bo_\br\br_\br\br_\be\be_\bn\bn_\bt\bt_\b_\b__\bi\bi_\bn\bn_\bf\bf_\bo\bo_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b4\b4_\b7\b7_\b5\b5_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b._\bc_\bp_\bp_\b:|verify_encoding with a string that triggers character replacement |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b4_\b7_\b6_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* v\bve\ber\bri\bif\bfy\by_\b_e\ben\bnc\bco\bod\bdi\bin\bng\bg w\bwi\bit\bth\bh a\ba s\bst\btr\bri\bin\bng\bg t\bth\bha\bat\bt t\btr\bri\big\bgg\bge\ber\brs\bs c\bch\bha\bar\bra\bac\bct\bte\ber\br r\bre\bep\bpl\bla\bac\bce\bem\bme\ben\bnt\bt *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/t\bte\bes\bst\bt/\b/t\bte\bes\bst\bt_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo.\b.c\bcp\bpp\bp:\b:4\b47\b76\b6 *\b**\b**\b* |\n-|{ \"v2_non_multiple_piece_layer.torrent\", errors::torrent_invalid_piece_layer}, |\n-|\t{ \"v2_piece_layer_invalid_file_hash.torrent\", errors::torrent_invalid_piece_layer}, |\n-|\t{ \"v2_invalid_piece_layer.torrent\", errors::torrent_invalid_piece_layer}, |\n-|\t{ \"v2_invalid_piece_layer_root.torrent\", errors::torrent_invalid_piece_layer}, |\n-|\t{ \"v2_unknown_piece_layer_entry.torrent\", errors::torrent_invalid_piece_layer}, |\n-|\t{ \"v2_invalid_piece_layer_size.torrent\", errors::torrent_invalid_piece_layer}, |\n-|\t{ \"v2_bad_file_alignment.torrent\", errors::torrent_inconsistent_files}, |\n-|\t{ \"v2_unordered_files.torrent\", errors::invalid_bencoding}, |\n-|\t{ \"v2_overlong_integer.torrent\", errors::invalid_bencoding}, |\n-|\t{ \"v2_missing_file_root_invalid_symlink.torrent\", errors::torrent_missing_pieces_root}, |\n-|\t{ \"v2_large_file.torrent\", errors::torrent_invalid_length}, |\n-|\t{ \"v2_large_offset.torrent\", errors::too_many_pieces_in_torrent}, |\n-|\t{ \"v2_piece_size.torrent\", errors::torrent_missing_piece_length}, |\n-|\t{ \"v2_invalid_pad_file.torrent\", errors::torrent_invalid_pad_file}, |\n-|\t{ \"v2_zero_root.torrent\", errors::torrent_missing_pieces_root}, |\n-|\t{ \"v2_zero_root_small.torrent\", errors::torrent_missing_pieces_root}, |\n-|}; |\n-| |\n-|} // anonymous namespace |\n-| |\n+|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bf_\bl_\ba_\bg_\bs_\b._\bc_\bp_\bp_\b:_\b2_\b0_\b5 |this test is flaky, since the torrent will become ready before asking for the flags, and by then stop_when_ready will have been |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bc_\bl_\be_\ba_\br_\be_\bd_\b _\bt_\be_\bs_\bt_\b__\ba_\bd_\bd_\b__\ba_\bn_\bd_\b__\bg_\be_\bt_\b__\bf_\bl_\ba_\bg_\bs_\b(_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bl_\ba_\bg_\bs_\b:_\b:_\bs_\bt_\bo_\bp_\b__\bw_\bh_\be_\bn_\b__\br_\be_\ba_\bd_\by_\b)_\b;_\b _\bs_\be_\bt_\bt_\bi_\bn_\bg_\b _\bs_\bt_\bo_\bp_\b-_\bw_\bh_\be_\bn_\b-_\br_\be_\ba_\bd_\by_\b _\bw_\bh_\be_\bn_\b _\ba_\bl_\br_\be_\ba_\bd_\by_\b _\bs_\bt_\bo_\bp_\bp_\be_\bd_\b _\bh_\ba_\bs_\b _\bn_\bo_\b _\be_\bf_\bf_\be_\bc_\bt_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs t\bte\bes\bst\bt i\bis\bs f\bfl\bla\bak\bky\by,\b, s\bsi\bin\bnc\bce\be t\bth\bhe\be t\bto\bor\brr\bre\ben\bnt\bt w\bwi\bil\bll\bl b\bbe\bec\bco\bom\bme\be r\bre\bea\bad\bdy\by b\bbe\bef\bfo\bor\bre\be a\bas\bsk\bki\bin\bng\bg f\bfo\bor\br t\bth\bhe\be f\bfl\bla\bag\bgs\bs,\b, a\ban\bnd\bd b\bby\by t\bth\bhe\ben\bn s\bst\bto\bop\bp_\b_w\bwh\bhe\ben\bn_\b_r\bre\bea\bad\bdy\by w\bwi\bil\bll\bl h\bha\bav\bve\be b\bbe\bee\ben\bn c\bcl\ble\bea\bar\bre\bed\bd t\bte\bes\bst\bt_\b_a\bad\bdd\bd_\b_a\ban\bnd\bd_\b_g\bge\bet\bt_\b_f\bfl\bla\bag\bgs\bs |\n+|(\b(t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfl\bla\bag\bgs\bs:\b::\b:s\bst\bto\bop\bp_\b_w\bwh\bhe\ben\bn_\b_r\bre\bea\bad\bdy\by)\b);\b; s\bse\bet\btt\bti\bin\bng\bg s\bst\bto\bop\bp-\b-w\bwh\bhe\ben\bn-\b-r\bre\bea\bad\bdy\by w\bwh\bhe\ben\bn a\bal\blr\bre\bea\bad\bdy\by s\bst\bto\bop\bpp\bpe\bed\bd h\bha\bas\bs n\bno\bo e\bef\bff\bfe\bec\bct\bt.\b. *\b**\b**\b**\b**\b* |\n+|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bf\bf_\bl\bl_\ba\ba_\bg\bg_\bs\bs_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b2\b2_\b0\b0_\b5\b5_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bf_\bl_\ba_\bg_\bs_\b._\bc_\bp_\bp_\b:_\b2_\b0_\b9_\b _\b _\b _\b _\b|_\bc_\bh_\ba_\bn_\bg_\be_\b _\bt_\bo_\b _\ba_\b _\bd_\bi_\bf_\bf_\be_\br_\be_\bn_\bt_\b _\bt_\be_\bs_\bt_\b _\bs_\be_\bt_\bu_\bp_\b._\b _\bc_\bu_\br_\br_\be_\bn_\bt_\bl_\by_\b _\ba_\bl_\bw_\ba_\by_\bs_\b _\bp_\ba_\bu_\bs_\be_\bd_\b._\b _\bt_\be_\bs_\bt_\b__\bs_\be_\bt_\b__\ba_\bf_\bt_\be_\br_\b__\ba_\bd_\bd_\b(_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bl_\ba_\bg_\bs_\b:_\b:_\bs_\bt_\bo_\bp_\b__\bw_\bh_\be_\bn_\b__\br_\be_\ba_\bd_\by_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* c\bch\bha\ban\bng\bge\be t\bto\bo a\ba d\bdi\bif\bff\bfe\ber\bre\ben\bnt\bt t\bte\bes\bst\bt s\bse\bet\btu\bup\bp.\b. c\bcu\bur\brr\bre\ben\bnt\btl\bly\by a\bal\blw\bwa\bay\bys\bs p\bpa\bau\bus\bse\bed\bd.\b. t\bte\bes\bst\bt_\b_s\bse\bet\bt_\b_a\baf\bft\bte\ber\br_\b_a\bad\bdd\bd(\b(t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfl\bla\bag\bgs\bs:\b::\b:s\bst\bto\bop\bp_\b_w\bwh\bhe\ben\bn_\b_r\bre\bea\bad\bdy\by)\b);\b; *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/t\bte\bes\bst\bt/\b/t\bte\bes\bst\bt_\b_f\bfl\bla\bag\bgs\bs.\b.c\bcp\bpp\bp:\b:2\b20\b09\b9 *\b**\b**\b* |\n+|test_set_after_add(torrent_flags::super_seeding); |\n+|} |\n+|#endif |\n+|#endif |\n | |\n-|TORRENT_TEST(add_tracker) |\n+|TORRENT_TEST(flag_sequential_download) |\n |{ |\n-|\ttorrent_info ti(info_hash_t(sha1_hash(\" \"))); |\n-|\tTEST_EQUAL(ti.trackers().size(), 0); |\n-| |\n-|\tti.add_tracker(\"http://test.com/announce\"); |\n-|\tTEST_EQUAL(ti.trackers().size(), 1); |\n-| |\n-|\tannounce_entry ae = ti.trackers()[0]; |\n-|\tTEST_EQUAL(ae.url, \"http://test.com/announce\"); |\n+|\t// sequential-download |\n+|\ttest_add_and_get_flags(torrent_flags::sequential_download); |\n+|\ttest_set_after_add(torrent_flags::sequential_download); |\n+|\ttest_unset_after_add(torrent_flags::sequential_download); |\n+|} |\n | |\n-|\tti.clear_trackers(); |\n-|\tTEST_EQUAL(ti.trackers().size(), 0); |\n+|// the stop when ready flag will be cleared when the torrent is ready to start |\n+|// downloading. |\n+|// since the posix_disk_io is not threaded, this will happen immediately |\n+|#if TORRENT_HAVE_MMAP |\n+|TORRENT_TEST(flag_stop_when_ready) |\n+|{ |\n+|\t// stop-when-ready |\n+|test_unset_after_add(torrent_flags::stop_when_ready); |\n |} |\n+|#endif |\n | |\n-|TORRENT_TEST(url_list_and_httpseeds) |\n+|TORRENT_TEST(flag_disable_dht) |\n |{ |\n-|\tentry info; |\n-|\tinfo[\"pieces\"] = \"aaaaaaaaaaaaaaaaaaaa\"; |\n-|\tinfo[\"name.utf-8\"] = \"test1\"; |\n-|\tinfo[\"name\"] = \"test__\"; |\n-|\tinfo[\"piece length\"] = 16 * 1024; |\n-|\tinfo[\"length\"] = 3245; |\n-|\tentry::list_type l; |\n-|\tl.push_back(entry(\"http://foo.com/bar1\")); |\n-|\tl.push_back(entry(\"http://foo.com/bar1\")); |\n-|\tl.push_back(entry(\"http://foo.com/bar2\")); |\n-|\tentry const e(l); |\n-|\tentry torrent; |\n-|_\b\t_\bt_\bo_\br_\br_\be_\bn_\bt_\b[_\b\"_\bu_\br_\bl_\b-_\bl_\bi_\bs_\bt_\b\"_\b]_\b _\b=_\b _\be_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\b._\bc_\bp_\bp_\b:_\b6_\b0_\b _\b _\b _\b|_\bt_\be_\bs_\bt_\b _\bs_\bc_\br_\ba_\bp_\be_\b _\br_\be_\bq_\bu_\be_\bs_\bt_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bte\bes\bst\bt s\bsc\bcr\bra\bap\bpe\be r\bre\beq\bqu\bue\bes\bst\bts\bs *\b**\b**\b**\b**\b* |\n-|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bt\bt_\br\br_\ba\ba_\bc\bc_\bk\bk_\be\be_\br\br_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b6\b6_\b0\b0_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\b._\bc_\bp_\bp_\b:_\b6_\b1_\b _\b _\b _\b|_\bt_\be_\bs_\bt_\b _\bp_\ba_\br_\bs_\be_\b _\bp_\be_\be_\br_\bs_\b6_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bte\bes\bst\bt p\bpa\bar\brs\bse\be p\bpe\bee\ber\brs\bs6\b6 *\b**\b**\b**\b**\b* |\n-|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bt\bt_\br\br_\ba\ba_\bc\bc_\bk\bk_\be\be_\br\br_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b6\b6_\b1\b1_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\b._\bc_\bp_\bp_\b:_\b6_\b2_\b _\b _\b _\b|_\bt_\be_\bs_\bt_\b _\bp_\ba_\br_\bs_\be_\b _\bt_\br_\ba_\bc_\bk_\be_\br_\b-_\bi_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bte\bes\bst\bt p\bpa\bar\brs\bse\be t\btr\bra\bac\bck\bke\ber\br-\b-i\bid\bd *\b**\b**\b**\b**\b* |\n-|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bt\bt_\br\br_\ba\ba_\bc\bc_\bk\bk_\be\be_\br\br_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b6\b6_\b2\b2_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\b._\bc_\bp_\bp_\b:_\b6_\b3_\b _\b _\b _\b|_\bt_\be_\bs_\bt_\b _\bp_\ba_\br_\bs_\be_\b _\bf_\ba_\bi_\bl_\bu_\br_\be_\b-_\br_\be_\ba_\bs_\bo_\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bte\bes\bst\bt p\bpa\bar\brs\bse\be f\bfa\bai\bil\blu\bur\bre\be-\b-r\bre\bea\bas\bso\bon\bn *\b**\b**\b**\b**\b* |\n-|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bt\bt_\br\br_\ba\ba_\bc\bc_\bk\bk_\be\be_\br\br_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b6\b6_\b3\b3_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\b._\bc_\bp_\bp_\b:_\b6_\b4 |test all failure paths, including invalid bencoding not a dictionary no files entry in scrape response no info-hash entry in scrape |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\br_\be_\bs_\bp_\bo_\bn_\bs_\be_\b _\bm_\ba_\bl_\bf_\bo_\br_\bm_\be_\bd_\b _\bp_\be_\be_\br_\bs_\b _\bi_\bn_\b _\bp_\be_\be_\br_\b _\bl_\bi_\bs_\bt_\b _\bo_\bf_\b _\bd_\bi_\bc_\bt_\bi_\bo_\bn_\ba_\br_\bi_\be_\bs_\b _\bu_\bn_\be_\bv_\be_\bn_\b _\bn_\bu_\bm_\bb_\be_\br_\b _\bo_\bf_\b _\bb_\by_\bt_\be_\bs_\b _\bi_\bn_\b _\bp_\be_\be_\br_\bs_\b _\ba_\bn_\bd_\b _\bp_\be_\be_\br_\bs_\b6_\b _\bs_\bt_\br_\bi_\bn_\bg_\b _\br_\be_\bs_\bp_\bo_\bn_\bs_\be_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bte\bes\bst\bt a\bal\bll\bl f\bfa\bai\bil\blu\bur\bre\be p\bpa\bat\bth\bhs\bs,\b, i\bin\bnc\bcl\blu\bud\bdi\bin\bng\bg i\bin\bnv\bva\bal\bli\bid\bd b\bbe\ben\bnc\bco\bod\bdi\bin\bng\bg n\bno\bot\bt a\ba d\bdi\bic\bct\bti\bio\bon\bna\bar\bry\by n\bno\bo f\bfi\bil\ble\bes\bs e\ben\bnt\btr\bry\by i\bin\bn s\bsc\bcr\bra\bap\bpe\be r\bre\bes\bsp\bpo\bon\bns\bse\be n\bno\bo i\bin\bnf\bfo\bo-\b-h\bha\bas\bsh\bh e\ben\bnt\btr\bry\by i\bin\bn s\bsc\bcr\bra\bap\bpe\be r\bre\bes\bsp\bpo\bon\bns\bse\be m\bma\bal\blf\bfo\bor\brm\bme\bed\bd p\bpe\bee\ber\brs\bs i\bin\bn p\bpe\bee\ber\br l\bli\bis\bst\bt|\n-|o\bof\bf d\bdi\bic\bct\bti\bio\bon\bna\bar\bri\bie\bes\bs u\bun\bne\bev\bve\ben\bn n\bnu\bum\bmb\bbe\ber\br o\bof\bf b\bby\byt\bte\bes\bs i\bin\bn p\bpe\bee\ber\brs\bs a\ban\bnd\bd p\bpe\bee\ber\brs\bs6\b6 s\bst\btr\bri\bin\bng\bg r\bre\bes\bsp\bpo\bon\bns\bse\bes\bs *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/t\bte\bes\bst\bt/\b/t\bte\bes\bst\bt_\b_t\btr\bra\bac\bck\bke\ber\br.\b.c\bcp\bpp\bp:\b:6\b64\b4 *\b**\b**\b* |\n-|#include \"test_utils.hpp\" |\n-|#include \"udp_tracker.hpp\" |\n-|#include \"settings.hpp\" |\n-|#include \"test_utils.hpp\" |\n-|#include \"libtorrent/alert.hpp\" |\n-|#include \"libtorrent/peer_info.hpp\" // for peer_list_entry |\n-|#include \"libtorrent/alert_types.hpp\" |\n-|#include \"libtorrent/session.hpp\" |\n-|#include \"libtorrent/session_params.hpp\" |\n-|#include \"libtorrent/error_code.hpp\" |\n-|#include \"libtorrent/tracker_manager.hpp\" |\n-|#include \"libtorrent/http_tracker_connection.hpp\" // for parse_tracker_response |\n-|#include \"libtorrent/torrent_info.hpp\" |\n-|#include \"libtorrent/announce_entry.hpp\" |\n-|#include \"libtorrent/torrent.hpp\" |\n-|#include \"libtorrent/aux_/path.hpp\" |\n-|#include \"libtorrent/socket_io.hpp\" |\n+|\ttest_add_and_get_flags(torrent_flags::disable_dht); |\n+|\ttest_set_after_add(torrent_flags::disable_dht); |\n+|\ttest_unset_after_add(torrent_flags::disable_dht); |\n+|} |\n | |\n-|using namespace lt; |\n | |\n+|TORRENT_TEST(flag_disable_lsd) |\n+|{ |\n+|\ttest_add_and_get_flags(torrent_flags::disable_lsd); |\n+|\ttest_set_after_add(torrent_flags::disable_lsd); |\n+|\ttest_unset_after_add(torrent_flags::disable_lsd); |\n+|} |\n | |\n-|TORRENT_TEST(parse_hostname_peers) |\n+|TORRENT_TEST(flag_disable_pex) |\n |{ |\n-|\tchar const response[] = \"d5:peersld7:peer id20:aaaaaaaaaaaaaaaaaaaa\" |\n-|\t\t\"2:ip13:test_hostname4:porti1000eed\" |\n-|\t\t\"7:peer id20:bbbbabaababababababa2:ip12:another_host4:porti1001eeee\"; |\n-|\terror_code ec; |\n-|\ttracker_response resp = parse_tracker_response(response |\n-|\t\t, ec, {}, sha1_hash()); |\n+|\ttest_add_and_get_flags(torrent_flags::disable_pex); |\n+|\ttest_set_after_add(torrent_flags::disable_pex); |\n+|\ttest_unset_after_add(torrent_flags::disable_pex); |\n+|_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bb_\bl_\bo_\bo_\bm_\b__\bf_\bi_\bl_\bt_\be_\br_\b._\bc_\bp_\bp_\b:|test size() |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b3_\b5_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bte\bes\bst\bt s\bsi\biz\bze\be(\b()\b) *\b**\b**\b**\b**\b* |\n+|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bb\bb_\bl\bl_\bo\bo_\bo\bo_\bm\bm_\b_\b__\bf\bf_\bi\bi_\bl\bl_\bt\bt_\be\be_\br\br_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b1\b1_\b3\b3_\b5\b5_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bb_\bl_\bo_\bo_\bm_\b__\bf_\bi_\bl_\bt_\be_\br_\b._\bc_\bp_\bp_\b:|test clear() |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b3_\b6_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bte\bes\bst\bt c\bcl\ble\bea\bar\br(\b()\b) *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/t\bte\bes\bst\bt/\b/t\bte\bes\bst\bt_\b_b\bbl\blo\boo\bom\bm_\b_f\bfi\bil\blt\bte\ber\br.\b.c\bcp\bpp\bp:\b:1\b13\b36\b6 *\b**\b**\b* |\n+|sha1_hash k(\"\\x01\\x00\\x02\\x00 \"); |\n+|\tTEST_CHECK(!filter.find(k)); |\n+|\tfilter.set(k); |\n+|\tTEST_CHECK(filter.find(k)); |\n | |\n-|\tTEST_EQUAL(ec, error_code()); |\n-|\tTEST_EQUAL(resp.peers.size(), 2); |\n-|\tif (resp.peers.size() == 2) |\n-|\t{ |\n-|\t\tpeer_entry const& e0 = resp.peers[0]; |\n-|\t\tpeer_entry const& e1 = resp.peers[1]; |\n-|\t\tTEST_EQUAL(e0.hostname, \"test_hostname\"); |\n-|\t\tTEST_EQUAL(e0.port, 1000); |\n-|\t\tTEST_EQUAL(e0.pid, peer_id(\"aaaaaaaaaaaaaaaaaaaa\")); |\n+|\tstd::uint8_t compare[4] = { 0x16, 0xff, 0x55, 0xaa}; |\n | |\n-|\t\tTEST_EQUAL(e1.hostname, \"another_host\"); |\n-|\t\tTEST_EQUAL(e1.port, 1001); |\n-|\t\tTEST_EQUAL(e1.pid, peer_id(\"bbbbabaababababababa\")); |\n-|\t} |\n+|\tbits_out = filter.to_string(); |\n+|\tTEST_EQUAL(memcmp(compare, bits_out.c_str(), 4), 0); |\n |} |\n | |\n-|TORRENT_TEST(parse_peers4) |\n+|} // anonymous namespace |\n+| |\n+|TORRENT_TEST(bloom_filter) |\n |{ |\n-|\tchar const response[] = \"d5:peers12:\\x01\\x02\\x03\\x04\\x30\\x10\" |\n-|\t\t\"\\x09\\x08\\x07\\x06\\x20\\x10\" \"e\"; |\n-|_\b\t_\be_\br_\br_\bo_\br_\b__\bc_\bo_\bd_\be_\b _\be_\bc_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|\ttest_set_and_get(); |\n+|\ttest_set_bits(); |\n+|\ttest_count_zeroes(); |\n+|\ttest_to_from_string(); |\n+| |\n+|_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\br_\be_\bs_\bu_\bm_\be_\b._\bc_\bp_\bp_\b:_\b5_\b8_\b2_\b _\b _\b _\b|_\bt_\be_\bs_\bt_\b _\bw_\bh_\ba_\bt_\b _\bh_\ba_\bp_\bp_\be_\bn_\bs_\b _\bw_\bh_\be_\bn_\b _\bl_\bo_\ba_\bd_\bi_\bn_\bg_\b _\ba_\b _\br_\be_\bs_\bu_\bm_\be_\b _\bf_\bi_\bl_\be_\b _\bw_\bi_\bt_\bh_\b _\bb_\bo_\bt_\bh_\b _\bp_\bi_\be_\bc_\be_\b _\bp_\br_\bi_\bo_\br_\bi_\bt_\bi_\be_\bs_\b _\ba_\bn_\bd_\b _\bf_\bi_\bl_\be_\b _\bp_\br_\bi_\bo_\br_\bi_\bt_\bi_\be_\bs_\b _\b(_\bf_\bi_\bl_\be_\b _\bp_\br_\bi_\bo_\b _\bs_\bh_\bo_\bu_\bl_\bd_\b _\bt_\ba_\bk_\be_\b _\bp_\br_\be_\bc_\be_\bd_\be_\bn_\bc_\be_\b)_\b _\b _\b _\b _\b _\b |\n |*\b**\b**\b**\b**\b* t\bte\bes\bst\bt w\bwh\bha\bat\bt h\bha\bap\bpp\bpe\ben\bns\bs w\bwh\bhe\ben\bn l\blo\boa\bad\bdi\bin\bng\bg a\ba r\bre\bes\bsu\bum\bme\be f\bfi\bil\ble\be w\bwi\bit\bth\bh b\bbo\bot\bth\bh p\bpi\bie\bec\bce\be p\bpr\bri\bio\bor\bri\bit\bti\bie\bes\bs a\ban\bnd\bd f\bfi\bil\ble\be p\bpr\bri\bio\bor\bri\bit\bti\bie\bes\bs (\b(f\bfi\bil\ble\be p\bpr\bri\bio\bo s\bsh\bho\bou\bul\bld\bd t\bta\bak\bke\be p\bpr\bre\bec\bce\bed\bde\ben\bnc\bce\be)\b) *\b**\b**\b**\b**\b* |\n |*\b**\b**\b* .\b..\b./\b/t\bte\bes\bst\bt/\b/t\bte\bes\bst\bt_\b_r\bre\bes\bsu\bum\bme\be.\b.c\bcp\bpp\bp:\b:5\b58\b82\b2 *\b**\b**\b* |\n |{ |\n |\t\t\tTEST_EQUAL(pieces[i], true); |\n |\t\t} |\n |\t} |\n@@ -5787,18 +5542,14 @@\n |template |\n |void test_unfinished_pieces(Fun f) |\n |{ |\n |\t// create a torrent and complete files |\n |\tstd::shared_ptr ti = generate_torrent(true, true); |\n | |\n |_\b\t_\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs_\b _\bp_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/ |test sending invalid requests (out of bound piece index, offsets and sizes) |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bt_\be_\bs_\bt_\b__\bf_\ba_\bs_\bt_\b__\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\b._\bc_\bp_\bp_\b:_\b1_\b1_\b3_\b5_\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bte\bes\bst\bt s\bse\ben\bnd\bdi\bin\bng\bg i\bin\bnv\bva\bal\bli\bid\bd r\bre\beq\bqu\bue\bes\bst\bts\bs (\b(o\bou\but\bt o\bof\bf b\bbo\bou\bun\bnd\bd p\bpi\bie\bec\bce\be i\bin\bnd\bde\bex\bx,\b, o\bof\bff\bfs\bse\bet\bts\bs a\ban\bnd\bd s\bsi\biz\bze\bes\bs)\b) *\b**\b**\b**\b**\b* |\n-|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bf\bf_\ba\ba_\bs\bs_\bt\bt_\b_\b__\be\be_\bx\bx_\bt\bt_\be\be_\bn\bn_\bs\bs_\bi\bi_\bo\bo_\bn\bn_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b1\b1_\b1\b1_\b3\b3_\b5\b5_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/ |test files with different piece size (negative test) |\n |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bt_\be_\bs_\bt_\b__\br_\be_\bs_\bo_\bl_\bv_\be_\b__\bl_\bi_\bn_\bk_\bs_\b._\bc_\bp_\bp_\b:_\b9_\b5_\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |*\b**\b**\b**\b**\b* t\bte\bes\bst\bt f\bfi\bil\ble\bes\bs w\bwi\bit\bth\bh d\bdi\bif\bff\bfe\ber\bre\ben\bnt\bt p\bpi\bie\bec\bce\be s\bsi\biz\bze\be (\b(n\bne\beg\bga\bat\bti\biv\bve\be t\bte\bes\bst\bt)\b) *\b**\b**\b**\b**\b* |\n |*\b**\b**\b* .\b..\b./\b/t\bte\bes\bst\bt/\b/t\bte\bes\bst\bt_\b_r\bre\bes\bso\bol\blv\bve\be_\b_l\bli\bin\bnk\bks\bs.\b.c\bcp\bpp\bp:\b:9\b95\b5 *\b**\b**\b* |\n |{ \"test2\", \"test1_pad_files\", 0}, |\n |\t{ \"test3\", \"test1_pad_files\", 0}, |\n |\t{ \"test2\", \"test1_single\", 0}, |\n@@ -5871,23 +5622,272 @@\n |\t\tauto const num_matches = std::size_t(std::count_if(links.begin(), links.end() |\n |\t\t\t, std::bind(&resolve_links::link_t::ti, _1))); |\n | |\n |\t\t// some debug output in case the test fails |\n |\t\tif (num_matches > e.expected_matches) |\n |\t\t{ |\n |_\b\t_\b\t_\b\t_\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b _\bc_\bo_\bn_\bs_\bt_\b&_\b _\bf_\bs_\b _\b=_\b _\bt_\bi_\b1_\b-_\b>_\bf_\bi_\bl_\be_\bs_\b(_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bu_\bp_\bn_\bp_\b._\bc_\bp_\bp_\b:_\b1_\b5_\b6_\b _\b _\b _\b _\b _\b|_\bs_\bt_\bo_\br_\be_\b _\bt_\bh_\be_\b _\bl_\bo_\bg_\b _\ba_\bn_\bd_\b _\bv_\be_\br_\bi_\bf_\by_\b _\bt_\bh_\ba_\bt_\b _\bs_\bo_\bm_\be_\b _\bk_\be_\by_\b _\bm_\be_\bs_\bs_\ba_\bg_\be_\bs_\b _\ba_\br_\be_\b _\bt_\bh_\be_\br_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* s\bst\bto\bor\bre\be t\bth\bhe\be l\blo\bog\bg a\ban\bnd\bd v\bve\ber\bri\bif\bfy\by t\bth\bha\bat\bt s\bso\bom\bme\be k\bke\bey\by m\bme\bes\bss\bsa\bag\bge\bes\bs a\bar\bre\be t\bth\bhe\ber\bre\be *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/t\bte\bes\bst\bt/\b/t\bte\bes\bst\bt_\b_u\bup\bpn\bnp\bp.\b.c\bcp\bpp\bp:\b:1\b15\b56\b6 *\b**\b**\b* |\n-|, portmap_protocol const protocol, error_code const& err |\n-|\t\t\t, portmap_transport, aux::listen_socket_handle const&) override |\n-|\t\t{ |\n-|\t\t\tcallback_info info = {mapping, port, err}; |\n-|\t\t\tcallbacks.push_back(info); |\n-|\t\t\tstd::cout << \"mapping: \" << static_cast(mapping) |\n+|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bp_\be_\be_\br_\b__\bl_\bi_\bs_\bt_\b._\bc_\bp_\bp_\b: |test erasing peers |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b2_\b4_\b1_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bte\bes\bst\bt e\ber\bra\bas\bsi\bin\bng\bg p\bpe\bee\ber\brs\bs *\b**\b**\b**\b**\b* |\n+|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bp\bp_\be\be_\be\be_\br\br_\b_\b__\bl\bl_\bi\bi_\bs\bs_\bt\bt_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b1\b1_\b2\b2_\b4\b4_\b1\b1_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bp_\be_\be_\br_\b__\bl_\bi_\bs_\bt_\b._\bc_\bp_\bp_\b: |test update_peer_port with allow_multiple_connections_per_ip and without |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b2_\b4_\b2_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bte\bes\bst\bt u\bup\bpd\bda\bat\bte\be_\b_p\bpe\bee\ber\br_\b_p\bpo\bor\brt\bt w\bwi\bit\bth\bh a\bal\bll\blo\bow\bw_\b_m\bmu\bul\blt\bti\bip\bpl\ble\be_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bns\bs_\b_p\bpe\ber\br_\b_i\bip\bp a\ban\bnd\bd w\bwi\bit\bth\bho\bou\but\bt *\b**\b**\b**\b**\b* |\n+|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bp\bp_\be\be_\be\be_\br\br_\b_\b__\bl\bl_\bi\bi_\bs\bs_\bt\bt_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b1\b1_\b2\b2_\b4\b4_\b2\b2_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bp_\be_\be_\br_\b__\bl_\bi_\bs_\bt_\b._\bc_\bp_\bp_\b: |test add i2p peers |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b2_\b4_\b3_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bte\bes\bst\bt a\bad\bdd\bd i\bi2\b2p\bp p\bpe\bee\ber\brs\bs *\b**\b**\b**\b**\b* |\n+|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bp\bp_\be\be_\be\be_\br\br_\b_\b__\bl\bl_\bi\bi_\bs\bs_\bt\bt_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b1\b1_\b2\b2_\b4\b4_\b3\b3_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bp_\be_\be_\br_\b__\bl_\bi_\bs_\bt_\b._\bc_\bp_\bp_\b: |test allow_i2p_mixed |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b2_\b4_\b4_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bte\bes\bst\bt a\bal\bll\blo\bow\bw_\b_i\bi2\b2p\bp_\b_m\bmi\bix\bxe\bed\bd *\b**\b**\b**\b**\b* |\n+|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bp\bp_\be\be_\be\be_\br\br_\b_\b__\bl\bl_\bi\bi_\bs\bs_\bt\bt_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b1\b1_\b2\b2_\b4\b4_\b4\b4_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bp_\be_\be_\br_\b__\bl_\bi_\bs_\bt_\b._\bc_\bp_\bp_\b: |test insert_peer failing with all error conditions |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b2_\b4_\b5_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bte\bes\bst\bt i\bin\bns\bse\ber\brt\bt_\b_p\bpe\bee\ber\br f\bfa\bai\bil\bli\bin\bng\bg w\bwi\bit\bth\bh a\bal\bll\bl e\ber\brr\bro\bor\br c\bco\bon\bnd\bdi\bit\bti\bio\bon\bns\bs *\b**\b**\b**\b**\b* |\n+|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bp\bp_\be\be_\be\be_\br\br_\b_\b__\bl\bl_\bi\bi_\bs\bs_\bt\bt_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b1\b1_\b2\b2_\b4\b4_\b5\b5_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bp_\be_\be_\br_\b__\bl_\bi_\bs_\bt_\b._\bc_\bp_\bp_\b: |test IPv6 |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b2_\b4_\b6_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bte\bes\bst\bt I\bIP\bPv\bv6\b6 *\b**\b**\b**\b**\b* |\n+|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bp\bp_\be\be_\be\be_\br\br_\b_\b__\bl\bl_\bi\bi_\bs\bs_\bt\bt_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b1\b1_\b2\b2_\b4\b4_\b6\b6_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bp_\be_\be_\br_\b__\bl_\bi_\bs_\bt_\b._\bc_\bp_\bp_\b: |test connect_to_peer() failing |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b2_\b4_\b7_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bte\bes\bst\bt c\bco\bon\bnn\bne\bec\bct\bt_\b_t\bto\bo_\b_p\bpe\bee\ber\br(\b()\b) f\bfa\bai\bil\bli\bin\bng\bg *\b**\b**\b**\b**\b* |\n+|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bp\bp_\be\be_\be\be_\br\br_\b_\b__\bl\bl_\bi\bi_\bs\bs_\bt\bt_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b1\b1_\b2\b2_\b4\b4_\b7\b7_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bp_\be_\be_\br_\b__\bl_\bi_\bs_\bt_\b._\bc_\bp_\bp_\b: |test connection_closed |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b2_\b4_\b8_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bte\bes\bst\bt c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn_\b_c\bcl\blo\bos\bse\bed\bd *\b**\b**\b**\b**\b* |\n+|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bp\bp_\be\be_\be\be_\br\br_\b_\b__\bl\bl_\bi\bi_\bs\bs_\bt\bt_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b1\b1_\b2\b2_\b4\b4_\b8\b8_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bp_\be_\be_\br_\b__\bl_\bi_\bs_\bt_\b._\bc_\bp_\bp_\b: |connect candidates recalculation when incrementing failcount |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b2_\b4_\b9_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* c\bco\bon\bnn\bne\bec\bct\bt c\bca\ban\bnd\bdi\bid\bda\bat\bte\bes\bs r\bre\bec\bca\bal\blc\bcu\bul\bla\bat\bti\bio\bon\bn w\bwh\bhe\ben\bn i\bin\bnc\bcr\bre\bem\bme\ben\bnt\bti\bin\bng\bg f\bfa\bai\bil\blc\bco\bou\bun\bnt\bt *\b**\b**\b**\b**\b* |\n+|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bp\bp_\be\be_\be\be_\br\br_\b_\b__\bl\bl_\bi\bi_\bs\bs_\bt\bt_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b1\b1_\b2\b2_\b4\b4_\b9\b9_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b._\bc_\bp_\bp_\b:|test remap_files |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b4_\b5_\b9_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bte\bes\bst\bt r\bre\bem\bma\bap\bp_\b_f\bfi\bil\ble\bes\bs *\b**\b**\b**\b**\b* |\n+|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bt\bt_\bo\bo_\br\br_\br\br_\be\be_\bn\bn_\bt\bt_\b_\b__\bi\bi_\bn\bn_\bf\bf_\bo\bo_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b4\b4_\b5\b5_\b9\b9_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b._\bc_\bp_\bp_\b:|torrent with 'p' (padfile) attribute |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b4_\b6_\b0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bto\bor\brr\bre\ben\bnt\bt w\bwi\bit\bth\bh '\b'p\bp'\b' (\b(p\bpa\bad\bdf\bfi\bil\ble\be)\b) a\bat\btt\btr\bri\bib\bbu\but\bte\be *\b**\b**\b**\b**\b* |\n+|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bt\bt_\bo\bo_\br\br_\br\br_\be\be_\bn\bn_\bt\bt_\b_\b__\bi\bi_\bn\bn_\bf\bf_\bo\bo_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b4\b4_\b6\b6_\b0\b0_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b._\bc_\bp_\bp_\b:|torrent with 'h' (hidden) attribute |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b4_\b6_\b1_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bto\bor\brr\bre\ben\bnt\bt w\bwi\bit\bth\bh '\b'h\bh'\b' (\b(h\bhi\bid\bdd\bde\ben\bn)\b) a\bat\btt\btr\bri\bib\bbu\but\bte\be *\b**\b**\b**\b**\b* |\n+|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bt\bt_\bo\bo_\br\br_\br\br_\be\be_\bn\bn_\bt\bt_\b_\b__\bi\bi_\bn\bn_\bf\bf_\bo\bo_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b4\b4_\b6\b6_\b1\b1_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b._\bc_\bp_\bp_\b:|torrent with 'x' (executable) attribute |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b4_\b6_\b2_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bto\bor\brr\bre\ben\bnt\bt w\bwi\bit\bth\bh '\b'x\bx'\b' (\b(e\bex\bxe\bec\bcu\but\bta\bab\bbl\ble\be)\b) a\bat\btt\btr\bri\bib\bbu\but\bte\be *\b**\b**\b**\b**\b* |\n+|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bt\bt_\bo\bo_\br\br_\br\br_\be\be_\bn\bn_\bt\bt_\b_\b__\bi\bi_\bn\bn_\bf\bf_\bo\bo_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b4\b4_\b6\b6_\b2\b2_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b._\bc_\bp_\bp_\b:|torrent with 'l' (symlink) attribute |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b4_\b6_\b3_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bto\bor\brr\bre\ben\bnt\bt w\bwi\bit\bth\bh '\b'l\bl'\b' (\b(s\bsy\bym\bml\bli\bin\bnk\bk)\b) a\bat\btt\btr\bri\bib\bbu\but\bte\be *\b**\b**\b**\b**\b* |\n+|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bt\bt_\bo\bo_\br\br_\br\br_\be\be_\bn\bn_\bt\bt_\b_\b__\bi\bi_\bn\bn_\bf\bf_\bo\bo_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b4\b4_\b6\b6_\b3\b3_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b._\bc_\bp_\bp_\b:|torrent with multiple trackers in multiple tiers, making sure we shuffle them (how do you test shuffling?, load it multiple times |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b4_\b6_\b4_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\ba_\bn_\bd_\b _\bm_\ba_\bk_\be_\b _\bs_\bu_\br_\be_\b _\bi_\bt_\b'_\bs_\b _\bi_\bn_\b _\bd_\bi_\bf_\bf_\be_\br_\be_\bn_\bt_\b _\bo_\br_\bd_\be_\br_\b _\ba_\bt_\b _\bl_\be_\ba_\bs_\bt_\b _\bo_\bn_\bc_\be_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bto\bor\brr\bre\ben\bnt\bt w\bwi\bit\bth\bh m\bmu\bul\blt\bti\bip\bpl\ble\be t\btr\bra\bac\bck\bke\ber\brs\bs i\bin\bn m\bmu\bul\blt\bti\bip\bpl\ble\be t\bti\bie\ber\brs\bs,\b, m\bma\bak\bki\bin\bng\bg s\bsu\bur\bre\be w\bwe\be s\bsh\bhu\buf\bff\bfl\ble\be t\bth\bhe\bem\bm (\b(h\bho\bow\bw d\bdo\bo y\byo\bou\bu t\bte\bes\bst\bt s\bsh\bhu\buf\bff\bfl\bli\bin\bng\bg?\b?,\b, l\blo\boa\bad\bd i\bit\bt m\bmu\bul\blt\bti\bip\bpl\ble\be t\bti\bim\bme\bes\bs a\ban\bnd\bd m\bma\bak\bke\be s\bsu\bur\bre\be i\bit\bt'\b's\bs i\bin\bn d\bdi\bif\bff\bfe\ber\bre\ben\bnt\bt o\bor\brd\bde\ber\br |\n+|a\bat\bt l\ble\bea\bas\bst\bt o\bon\bnc\bce\be)\b) *\b**\b**\b**\b**\b* |\n+|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bt\bt_\bo\bo_\br\br_\br\br_\be\be_\bn\bn_\bt\bt_\b_\b__\bi\bi_\bn\bn_\bf\bf_\bo\bo_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b4\b4_\b6\b6_\b4\b4_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b._\bc_\bp_\bp_\b:|torrents with a zero-length name |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b4_\b6_\b7_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bto\bor\brr\bre\ben\bnt\bts\bs w\bwi\bit\bth\bh a\ba z\bze\ber\bro\bo-\b-l\ble\ben\bng\bgt\bth\bh n\bna\bam\bme\be *\b**\b**\b**\b**\b* |\n+|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bt\bt_\bo\bo_\br\br_\br\br_\be\be_\bn\bn_\bt\bt_\b_\b__\bi\bi_\bn\bn_\bf\bf_\bo\bo_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b4\b4_\b6\b6_\b7\b7_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b._\bc_\bp_\bp_\b:|torrent with a non-dictionary info-section |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b4_\b6_\b8_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bto\bor\brr\bre\ben\bnt\bt w\bwi\bit\bth\bh a\ba n\bno\bon\bn-\b-d\bdi\bic\bct\bti\bio\bon\bna\bar\bry\by i\bin\bnf\bfo\bo-\b-s\bse\bec\bct\bti\bio\bon\bn *\b**\b**\b**\b**\b* |\n+|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bt\bt_\bo\bo_\br\br_\br\br_\be\be_\bn\bn_\bt\bt_\b_\b__\bi\bi_\bn\bn_\bf\bf_\bo\bo_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b4\b4_\b6\b6_\b8\b8_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b._\bc_\bp_\bp_\b:|torrents with DHT nodes |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b4_\b6_\b9_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bto\bor\brr\bre\ben\bnt\bts\bs w\bwi\bit\bth\bh D\bDH\bHT\bT n\bno\bod\bde\bes\bs *\b**\b**\b**\b**\b* |\n+|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bt\bt_\bo\bo_\br\br_\br\br_\be\be_\bn\bn_\bt\bt_\b_\b__\bi\bi_\bn\bn_\bf\bf_\bo\bo_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b4\b4_\b6\b6_\b9\b9_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b._\bc_\bp_\bp_\b:|torrent with url-list as a single string |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b4_\b7_\b0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bto\bor\brr\bre\ben\bnt\bt w\bwi\bit\bth\bh u\bur\brl\bl-\b-l\bli\bis\bst\bt a\bas\bs a\ba s\bsi\bin\bng\bgl\ble\be s\bst\btr\bri\bin\bng\bg *\b**\b**\b**\b**\b* |\n+|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bt\bt_\bo\bo_\br\br_\br\br_\be\be_\bn\bn_\bt\bt_\b_\b__\bi\bi_\bn\bn_\bf\bf_\bo\bo_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b4\b4_\b7\b7_\b0\b0_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b._\bc_\bp_\bp_\b:|torrent with http seed as a single string |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b4_\b7_\b1_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bto\bor\brr\bre\ben\bnt\bt w\bwi\bit\bth\bh h\bht\btt\btp\bp s\bse\bee\bed\bd a\bas\bs a\ba s\bsi\bin\bng\bgl\ble\be s\bst\btr\bri\bin\bng\bg *\b**\b**\b**\b**\b* |\n+|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bt\bt_\bo\bo_\br\br_\br\br_\be\be_\bn\bn_\bt\bt_\b_\b__\bi\bi_\bn\bn_\bf\bf_\bo\bo_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b4\b4_\b7\b7_\b1\b1_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b._\bc_\bp_\bp_\b:|torrent with a comment |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b4_\b7_\b2_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bto\bor\brr\bre\ben\bnt\bt w\bwi\bit\bth\bh a\ba c\bco\bom\bmm\bme\ben\bnt\bt *\b**\b**\b**\b**\b* |\n+|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bt\bt_\bo\bo_\br\br_\br\br_\be\be_\bn\bn_\bt\bt_\b_\b__\bi\bi_\bn\bn_\bf\bf_\bo\bo_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b4\b4_\b7\b7_\b2\b2_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b._\bc_\bp_\bp_\b:|torrent with an SSL cert |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b4_\b7_\b3_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bto\bor\brr\bre\ben\bnt\bt w\bwi\bit\bth\bh a\ban\bn S\bSS\bSL\bL c\bce\ber\brt\bt *\b**\b**\b**\b**\b* |\n+|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bt\bt_\bo\bo_\br\br_\br\br_\be\be_\bn\bn_\bt\bt_\b_\b__\bi\bi_\bn\bn_\bf\bf_\bo\bo_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b4\b4_\b7\b7_\b3\b3_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b._\bc_\bp_\bp_\b:|torrent with attributes (executable and hidden) |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b4_\b7_\b4_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bto\bor\brr\bre\ben\bnt\bt w\bwi\bit\bth\bh a\bat\btt\btr\bri\bib\bbu\but\bte\bes\bs (\b(e\bex\bxe\bec\bcu\but\bta\bab\bbl\ble\be a\ban\bnd\bd h\bhi\bid\bdd\bde\ben\bn)\b) *\b**\b**\b**\b**\b* |\n+|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bt\bt_\bo\bo_\br\br_\br\br_\be\be_\bn\bn_\bt\bt_\b_\b__\bi\bi_\bn\bn_\bf\bf_\bo\bo_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b4\b4_\b7\b7_\b4\b4_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b._\bc_\bp_\bp_\b:|torrent_info constructor that takes an invalid bencoded buffer |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b4_\b7_\b5_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br t\bth\bha\bat\bt t\bta\bak\bke\bes\bs a\ban\bn i\bin\bnv\bva\bal\bli\bid\bd b\bbe\ben\bnc\bco\bod\bde\bed\bd b\bbu\buf\bff\bfe\ber\br *\b**\b**\b**\b**\b* |\n+|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bt\bt_\bo\bo_\br\br_\br\br_\be\be_\bn\bn_\bt\bt_\b_\b__\bi\bi_\bn\bn_\bf\bf_\bo\bo_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b4\b4_\b7\b7_\b5\b5_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b._\bc_\bp_\bp_\b:|verify_encoding with a string that triggers character replacement |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b4_\b7_\b6_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* v\bve\ber\bri\bif\bfy\by_\b_e\ben\bnc\bco\bod\bdi\bin\bng\bg w\bwi\bit\bth\bh a\ba s\bst\btr\bri\bin\bng\bg t\bth\bha\bat\bt t\btr\bri\big\bgg\bge\ber\brs\bs c\bch\bha\bar\bra\bac\bct\bte\ber\br r\bre\bep\bpl\bla\bac\bce\bem\bme\ben\bnt\bt *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/t\bte\bes\bst\bt/\b/t\bte\bes\bst\bt_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo.\b.c\bcp\bpp\bp:\b:4\b47\b76\b6 *\b**\b**\b* |\n+|{ \"v2_non_multiple_piece_layer.torrent\", errors::torrent_invalid_piece_layer}, |\n+|\t{ \"v2_piece_layer_invalid_file_hash.torrent\", errors::torrent_invalid_piece_layer}, |\n+|\t{ \"v2_invalid_piece_layer.torrent\", errors::torrent_invalid_piece_layer}, |\n+|\t{ \"v2_invalid_piece_layer_root.torrent\", errors::torrent_invalid_piece_layer}, |\n+|\t{ \"v2_unknown_piece_layer_entry.torrent\", errors::torrent_invalid_piece_layer}, |\n+|\t{ \"v2_invalid_piece_layer_size.torrent\", errors::torrent_invalid_piece_layer}, |\n+|\t{ \"v2_bad_file_alignment.torrent\", errors::torrent_inconsistent_files}, |\n+|\t{ \"v2_unordered_files.torrent\", errors::invalid_bencoding}, |\n+|\t{ \"v2_overlong_integer.torrent\", errors::invalid_bencoding}, |\n+|\t{ \"v2_missing_file_root_invalid_symlink.torrent\", errors::torrent_missing_pieces_root}, |\n+|\t{ \"v2_large_file.torrent\", errors::torrent_invalid_length}, |\n+|\t{ \"v2_large_offset.torrent\", errors::too_many_pieces_in_torrent}, |\n+|\t{ \"v2_piece_size.torrent\", errors::torrent_missing_piece_length}, |\n+|\t{ \"v2_invalid_pad_file.torrent\", errors::torrent_invalid_pad_file}, |\n+|\t{ \"v2_zero_root.torrent\", errors::torrent_missing_pieces_root}, |\n+|\t{ \"v2_zero_root_small.torrent\", errors::torrent_missing_pieces_root}, |\n+|}; |\n+| |\n+|} // anonymous namespace |\n+| |\n+| |\n+|TORRENT_TEST(add_tracker) |\n+|{ |\n+|\ttorrent_info ti(info_hash_t(sha1_hash(\" \"))); |\n+|\tTEST_EQUAL(ti.trackers().size(), 0); |\n+| |\n+|\tti.add_tracker(\"http://test.com/announce\"); |\n+|\tTEST_EQUAL(ti.trackers().size(), 1); |\n+| |\n+|\tannounce_entry ae = ti.trackers()[0]; |\n+|\tTEST_EQUAL(ae.url, \"http://test.com/announce\"); |\n+| |\n+|\tti.clear_trackers(); |\n+|\tTEST_EQUAL(ti.trackers().size(), 0); |\n+|} |\n+| |\n+|TORRENT_TEST(url_list_and_httpseeds) |\n+|{ |\n+|\tentry info; |\n+|\tinfo[\"pieces\"] = \"aaaaaaaaaaaaaaaaaaaa\"; |\n+|\tinfo[\"name.utf-8\"] = \"test1\"; |\n+|\tinfo[\"name\"] = \"test__\"; |\n+|\tinfo[\"piece length\"] = 16 * 1024; |\n+|\tinfo[\"length\"] = 3245; |\n+|\tentry::list_type l; |\n+|\tl.push_back(entry(\"http://foo.com/bar1\")); |\n+|\tl.push_back(entry(\"http://foo.com/bar1\")); |\n+|\tl.push_back(entry(\"http://foo.com/bar2\")); |\n+|\tentry const e(l); |\n+|\tentry torrent; |\n+|_\b\t_\bt_\bo_\br_\br_\be_\bn_\bt_\b[_\b\"_\bu_\br_\bl_\b-_\bl_\bi_\bs_\bt_\b\"_\b]_\b _\b=_\b _\be_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\b._\bc_\bp_\bp_\b:_\b6_\b0_\b _\b _\b _\b|_\bt_\be_\bs_\bt_\b _\bs_\bc_\br_\ba_\bp_\be_\b _\br_\be_\bq_\bu_\be_\bs_\bt_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bte\bes\bst\bt s\bsc\bcr\bra\bap\bpe\be r\bre\beq\bqu\bue\bes\bst\bts\bs *\b**\b**\b**\b**\b* |\n+|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bt\bt_\br\br_\ba\ba_\bc\bc_\bk\bk_\be\be_\br\br_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b6\b6_\b0\b0_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\b._\bc_\bp_\bp_\b:_\b6_\b1_\b _\b _\b _\b|_\bt_\be_\bs_\bt_\b _\bp_\ba_\br_\bs_\be_\b _\bp_\be_\be_\br_\bs_\b6_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bte\bes\bst\bt p\bpa\bar\brs\bse\be p\bpe\bee\ber\brs\bs6\b6 *\b**\b**\b**\b**\b* |\n+|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bt\bt_\br\br_\ba\ba_\bc\bc_\bk\bk_\be\be_\br\br_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b6\b6_\b1\b1_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\b._\bc_\bp_\bp_\b:_\b6_\b2_\b _\b _\b _\b|_\bt_\be_\bs_\bt_\b _\bp_\ba_\br_\bs_\be_\b _\bt_\br_\ba_\bc_\bk_\be_\br_\b-_\bi_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bte\bes\bst\bt p\bpa\bar\brs\bse\be t\btr\bra\bac\bck\bke\ber\br-\b-i\bid\bd *\b**\b**\b**\b**\b* |\n+|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bt\bt_\br\br_\ba\ba_\bc\bc_\bk\bk_\be\be_\br\br_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b6\b6_\b2\b2_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\b._\bc_\bp_\bp_\b:_\b6_\b3_\b _\b _\b _\b|_\bt_\be_\bs_\bt_\b _\bp_\ba_\br_\bs_\be_\b _\bf_\ba_\bi_\bl_\bu_\br_\be_\b-_\br_\be_\ba_\bs_\bo_\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bte\bes\bst\bt p\bpa\bar\brs\bse\be f\bfa\bai\bil\blu\bur\bre\be-\b-r\bre\bea\bas\bso\bon\bn *\b**\b**\b**\b**\b* |\n+|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bt\bt_\br\br_\ba\ba_\bc\bc_\bk\bk_\be\be_\br\br_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b6\b6_\b3\b3_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\b._\bc_\bp_\bp_\b:_\b6_\b4 |test all failure paths, including invalid bencoding not a dictionary no files entry in scrape response no info-hash entry in scrape |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\br_\be_\bs_\bp_\bo_\bn_\bs_\be_\b _\bm_\ba_\bl_\bf_\bo_\br_\bm_\be_\bd_\b _\bp_\be_\be_\br_\bs_\b _\bi_\bn_\b _\bp_\be_\be_\br_\b _\bl_\bi_\bs_\bt_\b _\bo_\bf_\b _\bd_\bi_\bc_\bt_\bi_\bo_\bn_\ba_\br_\bi_\be_\bs_\b _\bu_\bn_\be_\bv_\be_\bn_\b _\bn_\bu_\bm_\bb_\be_\br_\b _\bo_\bf_\b _\bb_\by_\bt_\be_\bs_\b _\bi_\bn_\b _\bp_\be_\be_\br_\bs_\b _\ba_\bn_\bd_\b _\bp_\be_\be_\br_\bs_\b6_\b _\bs_\bt_\br_\bi_\bn_\bg_\b _\br_\be_\bs_\bp_\bo_\bn_\bs_\be_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bte\bes\bst\bt a\bal\bll\bl f\bfa\bai\bil\blu\bur\bre\be p\bpa\bat\bth\bhs\bs,\b, i\bin\bnc\bcl\blu\bud\bdi\bin\bng\bg i\bin\bnv\bva\bal\bli\bid\bd b\bbe\ben\bnc\bco\bod\bdi\bin\bng\bg n\bno\bot\bt a\ba d\bdi\bic\bct\bti\bio\bon\bna\bar\bry\by n\bno\bo f\bfi\bil\ble\bes\bs e\ben\bnt\btr\bry\by i\bin\bn s\bsc\bcr\bra\bap\bpe\be r\bre\bes\bsp\bpo\bon\bns\bse\be n\bno\bo i\bin\bnf\bfo\bo-\b-h\bha\bas\bsh\bh e\ben\bnt\btr\bry\by i\bin\bn s\bsc\bcr\bra\bap\bpe\be r\bre\bes\bsp\bpo\bon\bns\bse\be m\bma\bal\blf\bfo\bor\brm\bme\bed\bd p\bpe\bee\ber\brs\bs i\bin\bn p\bpe\bee\ber\br l\bli\bis\bst\bt|\n+|o\bof\bf d\bdi\bic\bct\bti\bio\bon\bna\bar\bri\bie\bes\bs u\bun\bne\bev\bve\ben\bn n\bnu\bum\bmb\bbe\ber\br o\bof\bf b\bby\byt\bte\bes\bs i\bin\bn p\bpe\bee\ber\brs\bs a\ban\bnd\bd p\bpe\bee\ber\brs\bs6\b6 s\bst\btr\bri\bin\bng\bg r\bre\bes\bsp\bpo\bon\bns\bse\bes\bs *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/t\bte\bes\bst\bt/\b/t\bte\bes\bst\bt_\b_t\btr\bra\bac\bck\bke\ber\br.\b.c\bcp\bpp\bp:\b:6\b64\b4 *\b**\b**\b* |\n+|#include \"test_utils.hpp\" |\n+|#include \"udp_tracker.hpp\" |\n+|#include \"settings.hpp\" |\n+|#include \"test_utils.hpp\" |\n+|#include \"libtorrent/alert.hpp\" |\n+|#include \"libtorrent/peer_info.hpp\" // for peer_list_entry |\n+|#include \"libtorrent/alert_types.hpp\" |\n+|#include \"libtorrent/session.hpp\" |\n+|#include \"libtorrent/session_params.hpp\" |\n+|#include \"libtorrent/error_code.hpp\" |\n+|#include \"libtorrent/tracker_manager.hpp\" |\n+|#include \"libtorrent/http_tracker_connection.hpp\" // for parse_tracker_response |\n+|#include \"libtorrent/torrent_info.hpp\" |\n+|#include \"libtorrent/announce_entry.hpp\" |\n+|#include \"libtorrent/torrent.hpp\" |\n+|#include \"libtorrent/aux_/path.hpp\" |\n+|#include \"libtorrent/socket_io.hpp\" |\n+| |\n+|using namespace lt; |\n+| |\n+| |\n+|TORRENT_TEST(parse_hostname_peers) |\n+|{ |\n+|\tchar const response[] = \"d5:peersld7:peer id20:aaaaaaaaaaaaaaaaaaaa\" |\n+|\t\t\"2:ip13:test_hostname4:porti1000eed\" |\n+|\t\t\"7:peer id20:bbbbabaababababababa2:ip12:another_host4:porti1001eeee\"; |\n+|\terror_code ec; |\n+|\ttracker_response resp = parse_tracker_response(response |\n+|\t\t, ec, {}, sha1_hash()); |\n+| |\n+|\tTEST_EQUAL(ec, error_code()); |\n+|\tTEST_EQUAL(resp.peers.size(), 2); |\n+|\tif (resp.peers.size() == 2) |\n+|\t{ |\n+|\t\tpeer_entry const& e0 = resp.peers[0]; |\n+|\t\tpeer_entry const& e1 = resp.peers[1]; |\n+|\t\tTEST_EQUAL(e0.hostname, \"test_hostname\"); |\n+|\t\tTEST_EQUAL(e0.port, 1000); |\n+|\t\tTEST_EQUAL(e0.pid, peer_id(\"aaaaaaaaaaaaaaaaaaaa\")); |\n+| |\n+|\t\tTEST_EQUAL(e1.hostname, \"another_host\"); |\n+|\t\tTEST_EQUAL(e1.port, 1001); |\n+|\t\tTEST_EQUAL(e1.pid, peer_id(\"bbbbabaababababababa\")); |\n+|\t} |\n+|} |\n+| |\n+|TORRENT_TEST(parse_peers4) |\n+|{ |\n+|\tchar const response[] = \"d5:peers12:\\x01\\x02\\x03\\x04\\x30\\x10\" |\n+|\t\t\"\\x09\\x08\\x07\\x06\\x20\\x10\" \"e\"; |\n+|_\b\t_\be_\br_\br_\bo_\br_\b__\bc_\bo_\bd_\be_\b _\be_\bc_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/ |test the case where we have > 120 samples (and have the base delay actually be updated) |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bt_\be_\bs_\bt_\b__\bt_\bi_\bm_\be_\bs_\bt_\ba_\bm_\bp_\b__\bh_\bi_\bs_\bt_\bo_\br_\by_\b._\bc_\bp_\bp_\b:_\b5_\b4_\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bte\bes\bst\bt t\bth\bhe\be c\bca\bas\bse\be w\bwh\bhe\ber\bre\be w\bwe\be h\bha\bav\bve\be >\b> 1\b12\b20\b0 s\bsa\bam\bmp\bpl\ble\bes\bs (\b(a\ban\bnd\bd h\bha\bav\bve\be t\bth\bhe\be b\bba\bas\bse\be d\bde\bel\bla\bay\by a\bac\bct\btu\bua\bal\bll\bly\by b\bbe\be u\bup\bpd\bda\bat\bte\bed\bd)\b) *\b**\b**\b**\b**\b* |\n+|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b/\b/_\bt\bt_\be\be_\bs\bs_\bt\bt_\b_\b__\bt\bt_\bi\bi_\bm\bm_\be\be_\bs\bs_\bt\bt_\ba\ba_\bm\bm_\bp\bp_\b_\b__\bh\bh_\bi\bi_\bs\bs_\bt\bt_\bo\bo_\br\br_\by\by_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b5\b5_\b4\b4_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/ |test the case where a sample is lower than the history entry but not lower than the base |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bt_\be_\bs_\bt_\b__\bt_\bi_\bm_\be_\bs_\bt_\ba_\bm_\bp_\b__\bh_\bi_\bs_\bt_\bo_\br_\by_\b._\bc_\bp_\bp_\b:_\b5_\b5_\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bte\bes\bst\bt t\bth\bhe\be c\bca\bas\bse\be w\bwh\bhe\ber\bre\be a\ba s\bsa\bam\bmp\bpl\ble\be i\bis\bs l\blo\bow\bwe\ber\br t\bth\bha\ban\bn t\bth\bhe\be h\bhi\bis\bst\bto\bor\bry\by e\ben\bnt\btr\bry\by b\bbu\but\bt n\bno\bot\bt l\blo\bow\bwe\ber\br t\bth\bha\ban\bn t\bth\bhe\be b\bba\bas\bse\be *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/t\bte\bes\bst\bt/\b/t\bte\bes\bst\bt_\b_t\bti\bim\bme\bes\bst\bta\bam\bmp\bp_\b_h\bhi\bis\bst\bto\bor\bry\by.\b.c\bcp\bpp\bp:\b:5\b55\b5 *\b**\b**\b* |\n+|#include \"libtorrent/aux_/timestamp_history.hpp\" |\n+| |\n+|TORRENT_TEST(timestamp_history) |\n+|{ |\n+|\tusing namespace lt; |\n+| |\n+|\taux::timestamp_history h; |\n+|\tTEST_EQUAL(h.add_sample(0x32, false), 0); |\n+|\tTEST_EQUAL(h.base(), 0x32); |\n+|\tTEST_EQUAL(h.add_sample(0x33, false), 0x1); |\n+|\tTEST_EQUAL(h.base(), 0x32); |\n+|\tTEST_EQUAL(h.add_sample(0x3433, false), 0x3401); |\n+|\tTEST_EQUAL(h.base(), 0x32); |\n+|\tTEST_EQUAL(h.add_sample(0x30, false), 0); |\n+|\tTEST_EQUAL(h.base(), 0x30); |\n+| |\n+|\t// test that wrapping of the timestamp is properly handled |\n+|\th.add_sample(0xfffffff3, false); |\n+|\tTEST_EQUAL(h.base(), 0xfffffff3); |\n+| |\n+|_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bu_\bp_\bn_\bp_\b._\bc_\bp_\bp_\b:_\b1_\b5_\b6_\b _\b _\b _\b _\b _\b|_\bs_\bt_\bo_\br_\be_\b _\bt_\bh_\be_\b _\bl_\bo_\bg_\b _\ba_\bn_\bd_\b _\bv_\be_\br_\bi_\bf_\by_\b _\bt_\bh_\ba_\bt_\b _\bs_\bo_\bm_\be_\b _\bk_\be_\by_\b _\bm_\be_\bs_\bs_\ba_\bg_\be_\bs_\b _\ba_\br_\be_\b _\bt_\bh_\be_\br_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* s\bst\bto\bor\bre\be t\bth\bhe\be l\blo\bog\bg a\ban\bnd\bd v\bve\ber\bri\bif\bfy\by t\bth\bha\bat\bt s\bso\bom\bme\be k\bke\bey\by m\bme\bes\bss\bsa\bag\bge\bes\bs a\bar\bre\be t\bth\bhe\ber\bre\be *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/t\bte\bes\bst\bt/\b/t\bte\bes\bst\bt_\b_u\bup\bpn\bnp\bp.\b.c\bcp\bpp\bp:\b:1\b15\b56\b6 *\b**\b**\b* |\n+|, portmap_protocol const protocol, error_code const& err |\n+|\t\t\t, portmap_transport, aux::listen_socket_handle const&) override |\n+|\t\t{ |\n+|\t\t\tcallback_info info = {mapping, port, err}; |\n+|\t\t\tcallbacks.push_back(info); |\n+|\t\t\tstd::cout << \"mapping: \" << static_cast(mapping) |\n |\t\t\t\t<< \", port: \" << port << \", IP: \" << ip |\n |\t\t\t\t<< \", proto: \" << static_cast(protocol) |\n |\t\t\t\t<< \", error: \\\"\" << err.message() << \"\\\"\\n\"; |\n |\t\t} |\n |\t#ifndef TORRENT_DISABLE_LOGGING |\n |\t\tbool should_log_portmap(portmap_transport) const override |\n |\t\t{ |\n@@ -6012,69 +6012,1227 @@\n |\tfor (int i = 127; i < 127 + 4; ++i) |\n |\t\tTEST_CHECK(t[i] == f[i]); |\n | |\n |\tTEST_CHECK(t.verified_leafs() == none_set(num_blocks)); |\n |} |\n | |\n |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/ |why is this a linked list? |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bu_\bd_\bp_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b._\bc_\bp_\bp_\b:_\b6_\b3_\b3_\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* w\bwh\bhy\by i\bis\bs t\bth\bhi\bis\bs a\ba l\bli\bin\bnk\bke\bed\bd l\bli\bis\bst\bt?\b? *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/u\bud\bdp\bp_\b_t\btr\bra\bac\bck\bke\ber\br_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn.\b.c\bcp\bpp\bp:\b:6\b63\b33\b3 *\b**\b**\b* |\n-|ipv6_peer_entry e{}; |\n-|\t\t\t\tstd::memcpy(e.ip.data(), buf.data(), 16); |\n-|\t\t\t\tbuf = buf.subspan(16); |\n-|\t\t\t\te.port = aux::read_uint16(buf); |\n-|\t\t\t\tresp.peers6.push_back(e); |\n-|\t\t\t} |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\be_\be_\br_\b._\bc_\bp_\bp_\b:_\b1_\b9_\b2_\b _\b _\b _\b|_\bh_\bo_\bw_\b _\bd_\bo_\b _\bw_\be_\b _\bd_\be_\ba_\bl_\b _\bw_\bi_\bt_\bh_\b _\bo_\bu_\br_\b _\be_\bx_\bt_\be_\br_\bn_\ba_\bl_\b _\ba_\bd_\bd_\br_\be_\bs_\bs_\b _\bc_\bh_\ba_\bn_\bg_\bi_\bn_\bg_\b?_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* h\bho\bow\bw d\bdo\bo w\bwe\be d\bde\bea\bal\bl w\bwi\bit\bth\bh o\bou\bur\br e\bex\bxt\bte\ber\brn\bna\bal\bl a\bad\bdd\bdr\bre\bes\bss\bs c\bch\bha\ban\bng\bgi\bin\bng\bg?\b? *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt_\b_p\bpe\bee\ber\br.\b.c\bcp\bpp\bp:\b:1\b19\b92\b2 *\b**\b**\b* |\n+|// connections. If it fails, we'll |\n+|\t\t// retry with encryption |\n+|\t\t, pe_support(false) |\n+|#endif |\n+|\t\t, is_v6_addr(false) |\n+|#if TORRENT_USE_I2P |\n+|\t\t, is_i2p_addr(false) |\n+|#endif |\n+|\t\t, on_parole(false) |\n+|\t\t, banned(false) |\n+|\t\t, supports_utp(true) // assume peers support utp |\n+|\t\t, confirmed_supports_utp(false) |\n+|\t\t, supports_holepunch(false) |\n+|\t\t, web_seed(false) |\n+|\t\t, protocol_v2(false) |\n+|\t{} |\n+| |\n+|\tstd::uint32_t torrent_peer::rank(external_ip const& external, int external_port) const |\n+|\t{ |\n+|\t\tTORRENT_ASSERT(in_use); |\n+|if (peer_rank == 0) |\n+|peer_rank = peer_priority( |\n+|\t\t\t\ttcp::endpoint(external.external_address(this->address()), std::uint16_t(external_port)) |\n+|\t\t\t\t, tcp::endpoint(this->address(), this->port)); |\n+|\t\treturn peer_rank; |\n+|\t} |\n+| |\n+|#ifndef TORRENT_DISABLE_LOGGING |\n+|\tstd::string torrent_peer::to_string() const |\n+|\t{ |\n+|\t\tTORRENT_ASSERT(in_use); |\n+|#if TORRENT_USE_I2P |\n+|\t\tif (is_i2p_addr) return dest().to_string(); |\n+|#endif // TORRENT_USE_I2P |\n+|\t\treturn address().to_string(); |\n+|\t} |\n+|#endif |\n+| |\n+|\tstd::int64_t torrent_peer::total_download() const |\n+|\t{ |\n+|\t\tTORRENT_ASSERT(in_use); |\n+|\t\tif (connection != nullptr) |\n+|\t\t{ |\n+|\t\t\tTORRENT_ASSERT(prev_amount_download == 0); |\n+|\t\t\treturn connection->statistics().total_payload_download(); |\n |\t\t} |\n |\t\telse |\n |\t\t{ |\n-|\t\t\tresp.peers4.reserve(static_cast(num_peers)); |\n-|\t\t\tfor (int i = 0; i < num_peers; ++i) |\n+|\t\t\treturn std::int64_t(prev_amount_download) << 10; |\n+|\t\t} |\n+|_\b\t_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bm_\ba_\bg_\bn_\be_\bt_\b__\bu_\br_\bi_\b._\bc_\bp_\bp_\b:_\b4_\b3_\b9_\b _\b _\b _\b _\b _\b|_\bw_\bh_\ba_\bt_\b'_\bs_\b _\bt_\bh_\be_\b _\br_\bi_\bg_\bh_\bt_\b _\bn_\bu_\bm_\bb_\be_\br_\b _\bh_\be_\br_\be_\b?_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* w\bwh\bha\bat\bt'\b's\bs t\bth\bhe\be r\bri\big\bgh\bht\bt n\bnu\bum\bmb\bbe\ber\br h\bhe\ber\bre\be?\b? *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/m\bma\bag\bgn\bne\bet\bt_\b_u\bur\bri\bi.\b.c\bcp\bpp\bp:\b:4\b43\b39\b9 *\b**\b**\b* |\n+|} |\n+|\t\t\telse if (string_equal_no_case(name, \"so\"_sv)) // select-only (files) |\n |\t\t\t{ |\n-|\t\t\t\tipv4_peer_entry e{}; |\n-|\t\t\t\tstd::memcpy(e.ip.data(), buf.data(), 4); |\n-|\t\t\t\tbuf = buf.subspan(4); |\n-|\t\t\t\te.port = aux::read_uint16(buf); |\n-|\t\t\t\tresp.peers4.push_back(e); |\n+|\t\t\t\t// accept only digits, '-' and ',' |\n+|\t\t\t\tif (std::any_of(value.begin(), value.end(), [](char c) |\n+|\t\t\t\t\t{ return !is_digit(c) && c != '-' && c != ','; })) |\n+|\t\t\t\t\tcontinue; |\n+| |\n+|\t\t\t\t// make sure all file priorities are set to 0, except the ones |\n+|\t\t\t\t// we specify in the file_priorities |\n+|\t\t\t\tp.flags |= torrent_flags::default_dont_download; |\n+| |\n+|\t\t\t\tdo |\n+|\t\t\t\t{ |\n+|\t\t\t\t\tstring_view token; |\n+|\t\t\t\t\tstd::tie(token, value) = split_string(value, ','); |\n+| |\n+|\t\t\t\t\tif (token.empty()) continue; |\n+| |\n+|\t\t\t\t\tint idx1, idx2; |\n+|constexpr int max_index = 10000; // can't risk out of memory |\n+| |\n+|\t\t\t\t\tauto const divider = token.find_first_of('-'); |\n+|\t\t\t\t\tif (divider != std::string::npos) // it's a range |\n+|\t\t\t\t\t{ |\n+|\t\t\t\t\t\tif (divider == 0) // no start index |\n+|\t\t\t\t\t\t\tcontinue; |\n+|\t\t\t\t\t\tif (divider == token.size() - 1) // no end index |\n+|\t\t\t\t\t\t\tcontinue; |\n+| |\n+|\t\t\t\t\t\tidx1 = std::atoi(token.substr(0, divider).to_string().c_str()); |\n+|\t\t\t\t\t\tif (idx1 < 0 || idx1 > max_index) // invalid index |\n+|\t\t\t\t\t\t\tcontinue; |\n+|\t\t\t\t\t\tidx2 = std::atoi(token.substr(divider + 1).to_string().c_str()); |\n+|\t\t\t\t\t\tif (idx2 < 0 || idx2 > max_index) // invalid index |\n+|\t\t\t\t\t\t\tcontinue; |\n+| |\n+|\t\t\t\t\t\tif (idx1 > idx2) // wrong range limits |\n+|\t\t\t\t\t\t\tcontinue; |\n+|\t\t\t\t\t} |\n+|\t\t\t\t\telse // it's an index |\n+|\t\t\t\t\t{ |\n+|\t\t\t\t\t\tidx1 = std::atoi(token.to_string().c_str()); |\n+|\t\t\t\t\t\tif (idx1 < 0 || idx1 > max_index) // invalid index |\n+|\t\t\t\t\t\t\tcontinue; |\n+|\t\t\t\t\t\tidx2 = idx1; |\n+|\t\t\t\t\t} |\n+| |\n+|\t\t\t\t\tif (int(p.file_priorities.size()) <= idx2) |\n+|_\b\t_\b\t_\b\t_\b\t_\b\t_\b\t_\bp_\b._\bf_\bi_\bl_\be_\b__\bp_\br_\bi_\bo_\br_\bi_\bt_\bi_\be_\bs_\b._\br_\be_\bs_\bi_\bz_\be_\b(_\bs_\bt_\ba_\bt_\bi_\bc_\b__\bc_\ba_\bs_\bt_\b<_\bs_\bt_\bd_\b:_\b:_\bs_\bi_\bz_\be_\b__\bt_\b>_\b(_\bi_\bd_\bx_\b2_\b)_\b _\b+_\b _\b1_\b,_\b _\bd_\bo_\bn_\bt_\b__\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\br_\ba_\bn_\bd_\bo_\bm_\b._\bc_\bp_\bp_\b:_\b1_\b4_\b1_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bi_\bm_\bp_\br_\bo_\bv_\be_\b _\bc_\ba_\bl_\bl_\bi_\bn_\bg_\b _\bR_\bA_\bN_\bD_\b__\bb_\by_\bt_\be_\bs_\b _\bm_\bu_\bl_\bt_\bi_\bp_\bl_\be_\b _\bt_\bi_\bm_\be_\bs_\b,_\b _\bu_\bs_\bi_\bn_\bg_\b _\bf_\ba_\bl_\bl_\bb_\ba_\bc_\bk_\b _\bf_\bo_\br_\b _\bn_\bo_\bw_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* i\bim\bmp\bpr\bro\bov\bve\be c\bca\bal\bll\bli\bin\bng\bg R\bRA\bAN\bND\bD_\b_b\bby\byt\bte\bes\bs m\bmu\bul\blt\bti\bip\bpl\ble\be t\bti\bim\bme\bes\bs,\b, u\bus\bsi\bin\bng\bg f\bfa\bal\bll\blb\bba\bac\bck\bk f\bfo\bor\br n\bno\bow\bw *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/r\bra\ban\bnd\bdo\bom\bm.\b.c\bcp\bpp\bp:\b:1\b14\b41\b1 *\b**\b**\b* |\n+|#else |\n+|\t\t\tstd::generate(buffer.begin(), buffer.end(), [] { return char(random(0xff)); }); |\n+|#endif |\n+|\t\t} |\n+| |\n+|\t\tvoid crypto_random_bytes(span buffer) |\n+|\t\t{ |\n+|#ifdef TORRENT_BUILD_SIMULATOR |\n+|\t\t\t// In the simulator we want deterministic random numbers |\n+|\t\t\tstd::generate(buffer.begin(), buffer.end(), [] { return char(random(0xff)); }); |\n+|#elif TORRENT_USE_CNG |\n+|\t\t\taux::cng_gen_random(buffer); |\n+|#elif TORRENT_USE_CRYPTOAPI |\n+|\t\t\t// windows |\n+|\t\t\taux::crypt_gen_random(buffer); |\n+|#elif defined TORRENT_USE_LIBCRYPTO && !defined TORRENT_USE_WOLFSSL |\n+|// wolfSSL uses wc_RNG_GenerateBlock as the internal function for the |\n+|// openssl compatibility layer. This function API does not support |\n+|// an arbitrary buffer size (openssl does), it is limited by the |\n+|// constant RNG_MAX_BLOCK_LEN. |\n+| |\n+|// openssl |\n+|\t\t\tint r = RAND_bytes(reinterpret_cast(buffer.data()) |\n+|\t\t\t\t, int(buffer.size())); |\n+|\t\t\tif (r != 1) aux::throw_ex(errors::no_entropy); |\n+|#elif TORRENT_USE_GETRANDOM |\n+|\t\t\tssize_t const r = ::getrandom(buffer.data(), static_cast(buffer.size()), 0); |\n+|\t\t\tif (r == ssize_t(buffer.size())) return; |\n+|\t\t\tif (r == -1 && errno != ENOSYS) aux::throw_ex(error_code(errno, generic_category())); |\n+|\t\t\tstatic dev_random dev; |\n+|\t\t\tdev.read(buffer); |\n+|#elif TORRENT_USE_DEV_RANDOM |\n+|\t\t\tstatic dev_random dev; |\n+|\t\t\tdev.read(buffer); |\n+|#else |\n+| |\n+|#if TORRENT_BROKEN_RANDOM_DEVICE |\n+|\t\t\t// even pseudo random numbers rely on being able to seed the random |\n+|\t\t\t// generator |\n+|#error \"no entropy source available\" |\n+|#else |\n+|#ifdef TORRENT_I_WANT_INSECURE_RANDOM_NUMBERS |\n+|\t\t\tstd::generate(buffer.begin(), buffer.end(), [] { return char(random(0xff)); }); |\n+|#else |\n+|#error \"no secure entropy source available. If you really want insecure random numbers, define TORRENT_I_WANT_INSECURE_RANDOM_NUMBERS\" |\n+|#endif |\n+|#endif |\n+| |\n+|#endif |\n+|\t\t} |\n+|_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bh_\ba_\bs_\bh_\b__\bp_\bi_\bc_\bk_\be_\br_\b._\bc_\bp_\bp_\b:_\b3_\b0_\b9_\b _\b _\b _\b _\b|_\bu_\bs_\be_\b _\bs_\bt_\br_\bu_\bc_\bt_\bu_\br_\be_\bd_\b _\bb_\bi_\bn_\bd_\bi_\bn_\bg_\bs_\b _\bi_\bn_\b _\bC_\b+_\b+_\b1_\b7_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* u\bus\bse\be s\bst\btr\bru\buc\bct\btu\bur\bre\bed\bd b\bbi\bin\bnd\bdi\bin\bng\bgs\bs i\bin\bn C\bC+\b++\b+1\b17\b7 *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/h\bha\bas\bsh\bh_\b_p\bpi\bic\bck\bke\ber\br.\b.c\bcp\bpp\bp:\b:3\b30\b09\b9 *\b**\b**\b* |\n+|, int const offset, sha256_hash const& h) |\n+|\t{ |\n+|\t\tTORRENT_ASSERT(offset >= 0); |\n+|\t\tauto const f = m_files.file_index_at_piece(piece); |\n+| |\n+|\t\tif (m_files.pad_file_at(f)) |\n+|\t\t\treturn { set_block_hash_result::result::success, 0, 0 }; |\n+| |\n+|\t\tauto& merkle_tree = m_merkle_trees[f]; |\n+|\t\tpiece_index_t const file_first_piece = m_files.piece_index_at_file(f); |\n+|\t\tstd::int64_t const block_offset = static_cast(piece) * std::int64_t(m_files.piece_length()) |\n+|\t\t\t+ offset - m_files.file_offset(f); |\n+|\t\tint const block_index = aux::numeric_cast(block_offset / default_block_size); |\n+| |\n+|\t\tif (h.is_all_zeros()) |\n+|\t\t{ |\n+|\t\t\tTORRENT_ASSERT_FAIL(); |\n+|\t\t\treturn set_block_hash_result::block_hash_failed(); |\n+|\t\t} |\n+| |\n+|aux::merkle_tree::set_block_result result; |\n+|int leafs_index; |\n+|\t\tint leafs_size; |\n+|\t\tstd::tie(result, leafs_index, leafs_size) = merkle_tree.set_block(block_index, h); |\n+| |\n+|\t\tif (result == aux::merkle_tree::set_block_result::unknown) |\n+|\t\t\treturn set_block_hash_result::unknown(); |\n+|\t\tif (result == aux::merkle_tree::set_block_result::block_hash_failed) |\n+|\t\t\treturn set_block_hash_result::block_hash_failed(); |\n+| |\n+|\t\tauto const status = (result == aux::merkle_tree::set_block_result::hash_failed) |\n+|\t\t\t? set_block_hash_result::result::piece_hash_failed |\n+|\t\t\t: set_block_hash_result::result::success; |\n+| |\n+|\t\tint const blocks_per_piece = m_files.piece_length() / default_block_size; |\n+| |\n+|\t\treturn { status |\n+|\t\t\t, int(leafs_index - static_cast(piece - file_first_piece) * blocks_per_piece) |\n+|\t\t\t, std::min(leafs_size, m_files.file_num_pieces(f) * blocks_per_piece - leafs_index) }; |\n+|\t} |\n+| |\n+|\tvoid hash_picker::hashes_rejected(hash_request const& req) |\n+|\t{ |\n+|\t\tTORRENT_ASSERT(req.base == m_piece_layer && req.index % 512 == 0); |\n+| |\n+|\t\tfor (int i = req.index; i < req.index + req.count; i += 512) |\n+|\t\t{ |\n+|\t\t\tm_piece_hash_requested[req.file][i / 512].last_request = min_time(); |\n+|\t\t\t--m_piece_hash_requested[req.file][i / 512].num_requests; |\n+|_\b\t_\b\t_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\bp_\ba_\br_\bt_\b__\bf_\bi_\bl_\be_\b._\bc_\bp_\bp_\b:_\b3_\b0_\b0 |what do we do if someone is currently reading from the disk from this piece? does it matter? Since we won't actively erase the data |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bf_\br_\bo_\bm_\b _\bd_\bi_\bs_\bk_\b,_\b _\bb_\bu_\bt_\b _\bi_\bt_\b _\bm_\ba_\by_\b _\bb_\be_\b _\bo_\bv_\be_\br_\bw_\br_\bi_\bt_\bt_\be_\bn_\b _\bs_\bo_\bo_\bn_\b,_\b _\bi_\bt_\b'_\bs_\b _\bp_\br_\bo_\bb_\ba_\bb_\bl_\by_\b _\bn_\bo_\bt_\b _\bt_\bh_\ba_\bt_\b _\bb_\bi_\bg_\b _\bo_\bf_\b _\ba_\b _\bd_\be_\ba_\bl_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* w\bwh\bha\bat\bt d\bdo\bo w\bwe\be d\bdo\bo i\bif\bf s\bso\bom\bme\beo\bon\bne\be i\bis\bs c\bcu\bur\brr\bre\ben\bnt\btl\bly\by r\bre\bea\bad\bdi\bin\bng\bg f\bfr\bro\bom\bm t\bth\bhe\be d\bdi\bis\bsk\bk f\bfr\bro\bom\bm t\bth\bhi\bis\bs p\bpi\bie\bec\bce\be?\b? d\bdo\boe\bes\bs i\bit\bt m\bma\bat\btt\bte\ber\br?\b? S\bSi\bin\bnc\bce\be w\bwe\be w\bwo\bon\bn'\b't\bt a\bac\bct\bti\biv\bve\bel\bly\by e\ber\bra\bas\bse\be t\bth\bhe\be d\bda\bat\bta\ba f\bfr\bro\bom\bm d\bdi\bis\bsk\bk,\b, b\bbu\but\bt i\bit\bt m\bma\bay\by b\bbe\be o\bov\bve\ber\brw\bwr\bri\bit\btt\bte\ben\bn |\n+|s\bso\boo\bon\bn,\b, i\bit\bt'\b's\bs p\bpr\bro\bob\bba\bab\bbl\bly\by n\bno\bot\bt t\bth\bha\bat\bt b\bbi\big\bg o\bof\bf a\ba d\bde\bea\bal\bl *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/p\bpa\bar\brt\bt_\b_f\bfi\bil\ble\be.\b.c\bcp\bpp\bp:\b:3\b30\b00\b0 *\b**\b**\b* |\n+|create_directories(m_path, ec); |\n+|\t\t\t\tif (ec) return {}; |\n+|\t\t\t\treturn aux::file_handle(fn, 0, mode); |\n |\t\t\t} |\n+|\t\t\treturn {}; |\n |\t\t} |\n+|\t} |\n+|\tcatch (storage_error const& e) |\n+|\t{ |\n+|\t\tec = e.ec; |\n+|\t\treturn {}; |\n+|\t} |\n | |\n-|std::list
    ip_list; |\n-|std::transform(m_endpoints.begin(), m_endpoints.end(), std::back_inserter(ip_list) |\n-|\t\t\t, [](tcp::endpoint const& ep) { return ep.address(); } ); |\n+|\tvoid part_file::free_piece(piece_index_t const piece) |\n+|\t{ |\n+|\t\tstd::lock_guard l(m_mutex); |\n | |\n-|\t\tcb->tracker_response(tracker_req(), m_target.address(), ip_list, resp); |\n+|\t\tauto const i = m_piece_map.find(piece); |\n+|\t\tif (i == m_piece_map.end()) return; |\n | |\n-|\t\tclose(); |\n-|\t\treturn true; |\n+| |\n+|m_free_slots.push_back(i->second); |\n+|\t\tm_piece_map.erase(i); |\n+|\t\tm_dirty_metadata = true; |\n |\t} |\n | |\n-|\tbool udp_tracker_connection::on_scrape_response(span buf) |\n+|\tvoid part_file::move_partfile(std::string const& path, error_code& ec) |\n |\t{ |\n-|\t\trestart_read_timeout(); |\n-|\t\tauto const action = static_cast(aux::read_int32(buf)); |\n-|\t\tstd::uint32_t const transaction = aux::read_uint32(buf); |\n+|\t\tstd::lock_guard l(m_mutex); |\n | |\n-|\t\tif (transaction != m_transaction_id) |\n+|\t\tflush_metadata_impl(ec); |\n+|\t\tif (ec) return; |\n+| |\n+|\t\tif (!m_piece_map.empty()) |\n |\t\t{ |\n-|\t\t\tfail(error_code(errors::invalid_tracker_transaction_id), operation_t::bittorrent); |\n-|\t\t\treturn false; |\n+|\t\t\tstd::string old_path = combine_path(m_path, m_name); |\n+|\t\t\tstd::string new_path = combine_path(path, m_name); |\n+| |\n+|\t\t\trename(old_path, new_path, ec); |\n+|\t\t\tif (ec == boost::system::errc::no_such_file_or_directory) |\n+|\t\t\t\tec.clear(); |\n+| |\n+|\t\t\tif (ec) |\n+|\t\t\t{ |\n+|\t\t\t\tstorage_error se; |\n+|\t\t\t\taux::copy_file(old_path, new_path, se); |\n+|\t\t\t\tec = se.ec; |\n+|\t\t\t\tif (ec) return; |\n+|\t\t\t\tremove(old_path, ec); |\n+|\t\t\t} |\n+|_\b\t_\b\t_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bp_\ba_\br_\bt_\b__\bf_\bi_\bl_\be_\b._\bc_\bp_\bp_\b:_\b4_\b1_\b1_\b _\b _\b _\b _\b _\b _\b|_\bi_\bn_\bs_\bt_\be_\ba_\bd_\b _\bo_\bf_\b _\br_\be_\bb_\bu_\bi_\bl_\bd_\bi_\bn_\bg_\b _\bt_\bh_\be_\b _\bw_\bh_\bo_\bl_\be_\b _\bf_\bi_\bl_\be_\b _\bh_\be_\ba_\bd_\be_\br_\b _\ba_\bn_\bd_\b _\bf_\bl_\bu_\bs_\bh_\bi_\bn_\bg_\b _\bi_\bt_\b,_\b _\bu_\bp_\bd_\ba_\bt_\be_\b _\bt_\bh_\be_\b _\bs_\bl_\bo_\bt_\b _\be_\bn_\bt_\br_\bi_\be_\bs_\b _\ba_\bs_\b _\bw_\be_\b _\bg_\bo_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* i\bin\bns\bst\bte\bea\bad\bd o\bof\bf r\bre\beb\bbu\bui\bil\bld\bdi\bin\bng\bg t\bth\bhe\be w\bwh\bho\bol\ble\be f\bfi\bil\ble\be h\bhe\bea\bad\bde\ber\br a\ban\bnd\bd f\bfl\blu\bus\bsh\bhi\bin\bng\bg i\bit\bt,\b, u\bup\bpd\bda\bat\bte\be t\bth\bhe\be s\bsl\blo\bot\bt e\ben\bnt\btr\bri\bie\bes\bs a\bas\bs w\bwe\be g\bgo\bo *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/p\bpa\bar\brt\bt_\b_f\bfi\bil\ble\be.\b.c\bcp\bpp\bp:\b:4\b41\b11\b1 *\b**\b**\b* |\n+|TORRENT_ASSERT(j->second == slot); |\n+|\t\t\t\t\t\tm_free_slots.push_back(j->second); |\n+|\t\t\t\t\t\tm_piece_map.erase(j); |\n+|\t\t\t\t\t\tm_dirty_metadata = true; |\n+|\t\t\t\t\t} |\n+|\t\t\t\t} |\n+|\t\t\t} |\n+|\t\t\tfile_offset += block_to_copy; |\n+|\t\t\tpiece_offset = 0; |\n+|\t\t\tsize -= block_to_copy; |\n |\t\t} |\n+|\t} |\n | |\n-|\t\tif (action == action_t::error) |\n+|\tvoid part_file::flush_metadata(error_code& ec) |\n+|\t{ |\n+|\t\tstd::lock_guard l(m_mutex); |\n+| |\n+|\t\tflush_metadata_impl(ec); |\n+|\t} |\n+| |\n+|void part_file::flush_metadata_impl(error_code& ec) |\n+|{ |\n+|\t\t// do we need to flush the metadata? |\n+|\t\tif (m_dirty_metadata == false) return; |\n+| |\n+|\t\tif (m_piece_map.empty()) |\n |\t\t{ |\n-|\t\t\tfail(error_code(errors::tracker_failure), operation_t::bittorrent |\n-|\t\t\t\t, std::string(buf.data(), static_cast(buf.size())).c_str()); |\n+|\t\t\t// if we don't have any pieces left in the |\n+|\t\t\t// part file, remove it |\n+|\t\t\tstd::string const p = combine_path(m_path, m_name); |\n+|\t\t\tremove(p, ec); |\n+| |\n+|\t\t\tif (ec == boost::system::errc::no_such_file_or_directory) |\n+|\t\t\t\tec.clear(); |\n+|\t\t\treturn; |\n+|\t\t} |\n+| |\n+|\t\tauto f = open_file(aux::open_mode::write | aux::open_mode::hidden, ec); |\n+|\t\tif (ec) return; |\n+| |\n+|\t\tstd::vector header(static_cast(m_header_size)); |\n+| |\n+|\t\tusing namespace libtorrent::aux; |\n+| |\n+|\t\tchar* ptr = header.data(); |\n+|\t\twrite_uint32(m_max_pieces, ptr); |\n+|\t\twrite_uint32(m_piece_size, ptr); |\n+| |\n+|\t\tfor (piece_index_t piece(0); piece < piece_index_t(m_max_pieces); ++piece) |\n+|\t\t{ |\n+|_\b\t_\b\t_\b\t_\ba_\bu_\bt_\bo_\b _\bc_\bo_\bn_\bs_\bt_\b _\bi_\b _\b=_\b _\bm_\b__\bp_\bi_\be_\bc_\be_\b__\bm_\ba_\bp_\b._\bf_\bi_\bn_\bd_\b(_\bp_\bi_\be_\bc_\be_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b._\bc_\bp_\bp_\b:_\b4_\b5_\b7_\b _\b _\b _\b|_\bm_\ba_\by_\bb_\be_\b _\bi_\bt_\b _\bw_\bo_\bu_\bl_\bd_\b _\bb_\be_\b _\bn_\bi_\bc_\be_\b _\bt_\bo_\b _\bh_\ba_\bv_\be_\b _\ba_\b _\bb_\be_\bt_\bt_\be_\br_\b _\bi_\bn_\bd_\be_\bx_\b _\bh_\be_\br_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* m\bma\bay\byb\bbe\be i\bit\bt w\bwo\bou\bul\bld\bd b\bbe\be n\bni\bic\bce\be t\bto\bo h\bha\bav\bve\be a\ba b\bbe\bet\btt\bte\ber\br i\bin\bnd\bde\bex\bx h\bhe\ber\bre\be *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/f\bfi\bil\ble\be_\b_s\bst\bto\bor\bra\bag\bge\be.\b.c\bcp\bpp\bp:\b:4\b45\b57\b7 *\b**\b**\b* |\n+|// find the file iterator and file offset |\n+|\t\taux::file_entry target; |\n+|\t\ttarget.offset = aux::numeric_cast(offset); |\n+|\t\tTORRENT_ASSERT(!compare_file_offset(target, m_files.front())); |\n+| |\n+|\t\tauto file_iter = std::upper_bound( |\n+|\t\t\tm_files.begin(), m_files.end(), target, compare_file_offset); |\n+| |\n+|\t\tTORRENT_ASSERT(file_iter != m_files.begin()); |\n+|\t\t--file_iter; |\n+|\t\treturn file_index_t{int(file_iter - m_files.begin())}; |\n+|\t} |\n+| |\n+|\tfile_index_t file_storage::file_index_at_piece(piece_index_t const piece) const |\n+|\t{ |\n+|\t\treturn file_index_at_offset(static_cast(piece) * std::int64_t(piece_length())); |\n+|\t} |\n+| |\n+|\tfile_index_t file_storage::file_index_for_root(sha256_hash const& root_hash) const |\n+|\t{ |\n+|for (file_index_t const i : file_range()) |\n+|{ |\n+|\t\t\tif (root(i) == root_hash) return i; |\n+|\t\t} |\n+|\t\treturn file_index_t{-1}; |\n+|\t} |\n+| |\n+|\tpiece_index_t file_storage::piece_index_at_file(file_index_t f) const |\n+|\t{ |\n+|\t\treturn piece_index_t{aux::numeric_cast(file_offset(f) / piece_length())}; |\n+|\t} |\n+| |\n+|#if TORRENT_ABI_VERSION <= 2 |\n+|\tchar const* file_storage::file_name_ptr(file_index_t const index) const |\n+|\t{ |\n+|\t\treturn m_files[index].name; |\n+|\t} |\n+| |\n+|\tint file_storage::file_name_len(file_index_t const index) const |\n+|\t{ |\n+|\t\tif (m_files[index].name_len == aux::file_entry::name_is_owned) |\n+|\t\t\treturn -1; |\n+|\t\treturn m_files[index].name_len; |\n+|\t} |\n+|#endif |\n+| |\n+|\tstd::vector file_storage::map_block(piece_index_t const piece |\n+|\t\t, std::int64_t const offset, std::int64_t size) const |\n+|\t{ |\n+|\t\tTORRENT_ASSERT_PRECOND(piece >= piece_index_t{0}); |\n+|_\b\t_\b\t_\bT_\bO_\bR_\bR_\bE_\bN_\bT_\b__\bA_\bS_\bS_\bE_\bR_\bT_\b__\bP_\bR_\bE_\bC_\bO_\bN_\bD_\b(_\bp_\bi_\be_\bc_\be_\b _\b<_\b _\be_\bn_\bd_\b__\bp_\bi_\be_\bc_\be_\b(_\b)_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b._\bc_\bp_\bp_\b:_\b1_\b2_\b4_\b2_\b _\b _\b|_\bt_\bh_\bi_\bs_\b _\bw_\bo_\bu_\bl_\bd_\b _\bb_\be_\b _\bm_\bo_\br_\be_\b _\be_\bf_\bf_\bi_\bc_\bi_\be_\bn_\bt_\b _\bi_\bf_\b _\bm_\b__\bp_\ba_\bt_\bh_\bs_\b _\bw_\ba_\bs_\b _\bs_\bo_\br_\bt_\be_\bd_\b _\bf_\bi_\br_\bs_\bt_\b,_\b _\bs_\bu_\bc_\bh_\b _\bt_\bh_\ba_\bt_\b _\ba_\b _\bl_\bo_\bw_\be_\br_\b _\bp_\ba_\bt_\bh_\b _\bi_\bn_\bd_\be_\bx_\b _\ba_\bl_\bw_\ba_\by_\bs_\b _\bm_\be_\ba_\bn_\bt_\b _\bs_\bo_\br_\bt_\be_\bd_\b-_\bb_\be_\bf_\bo_\br_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs w\bwo\bou\bul\bld\bd b\bbe\be m\bmo\bor\bre\be e\bef\bff\bfi\bic\bci\bie\ben\bnt\bt i\bif\bf m\bm_\b_p\bpa\bat\bth\bhs\bs w\bwa\bas\bs s\bso\bor\brt\bte\bed\bd f\bfi\bir\brs\bst\bt,\b, s\bsu\buc\bch\bh t\bth\bha\bat\bt a\ba l\blo\bow\bwe\ber\br p\bpa\bat\bth\bh i\bin\bnd\bde\bex\bx a\bal\blw\bwa\bay\bys\bs m\bme\bea\ban\bnt\bt s\bso\bor\brt\bte\bed\bd-\b-b\bbe\bef\bfo\bor\bre\be *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/f\bfi\bil\ble\be_\b_s\bst\bto\bor\bra\bag\bge\be.\b.c\bcp\bpp\bp:\b:1\b12\b24\b42\b2 *\b**\b**\b* |\n+|} |\n+| |\n+|\tvoid file_storage::canonicalize_impl(bool const backwards_compatible) |\n+|\t{ |\n+|\t\tTORRENT_ASSERT(piece_length() >= 16 * 1024); |\n+| |\n+|\t\t// use this vector to track the new ordering of files |\n+|\t\t// this allows the use of STL algorithms despite them |\n+|\t\t// not supporting a custom swap functor |\n+|\t\taux::vector new_order(end_file()); |\n+|\t\tfor (auto i : file_range()) |\n+|\t\t\tnew_order[i] = i; |\n+| |\n+|\t\t// remove any existing pad files |\n+|\t\t{ |\n+|\t\t\tauto pad_begin = std::partition(new_order.begin(), new_order.end() |\n+|\t\t\t\t, [this](file_index_t i) { return !m_files[i].pad_file; }); |\n+|\t\t\tnew_order.erase(pad_begin, new_order.end()); |\n+|\t\t} |\n+| |\n+| |\n+|// sort files by path/name |\n+|\t\tstd::sort(new_order.begin(), new_order.end() |\n+|\t\t\t, [this](file_index_t l, file_index_t r) |\n+|\t\t{ |\n+|\t\t\t// assuming m_paths are unique! |\n+|\t\t\tauto const& lf = m_files[l]; |\n+|\t\t\tauto const& rf = m_files[r]; |\n+|\t\t\tif (lf.path_index != rf.path_index) |\n+|\t\t\t{ |\n+|\t\t\t\tint const ret = path_compare(m_paths[lf.path_index], lf.filename() |\n+|\t\t\t\t\t, m_paths[rf.path_index], rf.filename()); |\n+|\t\t\t\tif (ret != 0) return ret < 0; |\n+|\t\t\t} |\n+|\t\t\treturn lf.filename() < rf.filename(); |\n+|\t\t}); |\n+| |\n+|\t\taux::vector new_files; |\n+|\t\taux::vector new_file_hashes; |\n+|\t\taux::vector new_mtime; |\n+| |\n+|\t\t// reserve enough space for the worst case after padding |\n+|\t\tnew_files.reserve(new_order.size() * 2 - 1); |\n+|\t\tif (!m_file_hashes.empty()) |\n+|\t\t\tnew_file_hashes.reserve(new_order.size() * 2 - 1); |\n+|\t\tif (!m_mtime.empty()) |\n+|\t\t\tnew_mtime.reserve(new_order.size() * 2 - 1); |\n+| |\n+|\t\t// re-compute offsets and insert pad files as necessary |\n+|_\b\t_\b\t_\bs_\bt_\bd_\b:_\b:_\bi_\bn_\bt_\b6_\b4_\b__\bt_\b _\bo_\bf_\bf_\b _\b=_\b _\b0_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b._\bc_\bp_\bp_\b:_\b1_\b3_\b4_\b5_\b _\b _\b|_\bi_\bn_\b _\bC_\b+_\b+_\b1_\b7_\b _\bt_\bh_\bi_\bs_\b _\bc_\bo_\bu_\bl_\bd_\b _\bb_\be_\b _\bs_\bt_\br_\bi_\bn_\bg_\b__\bv_\bi_\be_\bw_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* i\bin\bn C\bC+\b++\b+1\b17\b7 t\bth\bhi\bis\bs c\bco\bou\bul\bld\bd b\bbe\be s\bst\btr\bri\bin\bng\bg_\b_v\bvi\bie\bew\bw *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/f\bfi\bil\ble\be_\b_s\bst\bto\bor\bra\bag\bge\be.\b.c\bcp\bpp\bp:\b:1\b13\b34\b45\b5 *\b**\b**\b* |\n+|add_pad_file(i); |\n+|\t\t} |\n+| |\n+|\t\tm_files = std::move(new_files); |\n+|\t\tm_file_hashes = std::move(new_file_hashes); |\n+|\t\tm_mtime = std::move(new_mtime); |\n+| |\n+|\t\tm_total_size = off; |\n+|\t} |\n+| |\n+|\tvoid file_storage::sanitize_symlinks() |\n+|\t{ |\n+|\t\t// symlinks are unusual, this function is optimized assuming there are no |\n+|\t\t// symbolic links in the torrent. If we find one symbolic link, we'll |\n+|\t\t// build the hash table of files it's allowed to refer to, but don't pay |\n+|\t\t// that price up-front. |\n+|\t\tstd::unordered_map file_map; |\n+|\t\tbool file_map_initialized = false; |\n+| |\n+|\t\t// lazily instantiated set of all valid directories a symlink may point to |\n+|std::unordered_set dir_map; |\n+|bool dir_map_initialized = false; |\n+| |\n+|\t\t// symbolic links that points to directories |\n+|\t\tstd::unordered_map dir_links; |\n+| |\n+|\t\t// we validate symlinks in (potentially) 2 passes over the files. |\n+|\t\t// remaining symlinks to validate after the first pass |\n+|\t\tstd::vector symlinks_to_validate; |\n+| |\n+|\t\tfor (auto const i : file_range()) |\n+|\t\t{ |\n+|\t\t\tif (!(file_flags(i) & file_storage::flag_symlink)) continue; |\n+| |\n+|\t\t\tif (!file_map_initialized) |\n+|\t\t\t{ |\n+|\t\t\t\tfor (auto const j : file_range()) |\n+|\t\t\t\t\tfile_map.insert({internal_file_path(j), j}); |\n+|\t\t\t\tfile_map_initialized = true; |\n+|\t\t\t} |\n+| |\n+|\t\t\taux::file_entry const& fe = m_files[i]; |\n+|\t\t\tTORRENT_ASSERT(fe.symlink_index < int(m_symlinks.size())); |\n+| |\n+|\t\t\t// symlink targets are only allowed to point to files or directories in |\n+|\t\t\t// this torrent. |\n+|\t\t\t{ |\n+|\t\t\t\tstd::string target = m_symlinks[fe.symlink_index]; |\n+| |\n+|\t\t\t\tif (is_complete(target)) |\n+|_\b\t_\b\t_\b\t_\b\t_\b{_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b1_\b9_\b5_\b1_\b _\b _\b _\b _\b _\b _\b _\b|_\bt_\bh_\bi_\bs_\b _\bc_\bo_\bu_\bl_\bd_\b _\bb_\be_\b _\bo_\bp_\bt_\bi_\bm_\bi_\bz_\be_\bd_\b _\bb_\by_\b _\bl_\bo_\bo_\bk_\bi_\bn_\bg_\b _\bu_\bp_\b _\bw_\bh_\bi_\bc_\bh_\b _\bf_\bi_\bl_\be_\bs_\b _\ba_\br_\be_\b _\bc_\bo_\bm_\bp_\bl_\be_\bt_\be_\b _\ba_\bn_\bd_\b _\bj_\bu_\bs_\bt_\b _\bl_\bo_\bo_\bk_\b _\ba_\bt_\b _\bt_\bh_\bo_\bs_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs c\bco\bou\bul\bld\bd b\bbe\be o\bop\bpt\bti\bim\bmi\biz\bze\bed\bd b\bby\by l\blo\boo\bok\bki\bin\bng\bg u\bup\bp w\bwh\bhi\bic\bch\bh f\bfi\bil\ble\bes\bs a\bar\bre\be c\bco\bom\bmp\bpl\ble\bet\bte\be a\ban\bnd\bd j\bju\bus\bst\bt l\blo\boo\bok\bk a\bat\bt t\bth\bho\bos\bse\be *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:1\b19\b95\b51\b1 *\b**\b**\b* |\n+|//\t\t\t\tTORRENT_ASSERT(picker().have_piece(i)); |\n+|\t\t\t\twe_have(i); |\n+|\t\t\t} |\n+|\t\t} |\n+| |\n+|\t\tset_state(torrent_status::checking_resume_data); |\n+| |\n+|\t\taux::vector links; |\n+|#ifndef TORRENT_DISABLE_MUTABLE_TORRENTS |\n+|\t\tif (!m_torrent_file->similar_torrents().empty() |\n+|\t\t\t|| !m_torrent_file->collections().empty()) |\n+|\t\t{ |\n+|\t\t\tresolve_links res(m_torrent_file); |\n+| |\n+|\t\t\tfor (auto const& ih : m_torrent_file->similar_torrents()) |\n+|\t\t\t{ |\n+|\t\t\t\tstd::shared_ptr t = m_ses.find_torrent(info_hash_t(ih)).lock(); |\n+|\t\t\t\tif (!t) continue; |\n+| |\n+|\t\t\t\t// Only attempt to reuse files from torrents that are seeding. |\n+|if (!t->is_seed()) continue; |\n+| |\n+|\t\t\t\tres.match(t->get_torrent_file(), t->save_path()); |\n+|\t\t\t} |\n+|\t\t\tfor (auto const& c : m_torrent_file->collections()) |\n+|\t\t\t{ |\n+|\t\t\t\tstd::vector> ts = m_ses.find_collection(c); |\n+| |\n+|\t\t\t\tfor (auto const& t : ts) |\n+|\t\t\t\t{ |\n+|_\b\t_\b\t_\b\t_\b\t_\b\t_\b/_\b/_\b _\bO_\bn_\bl_\by_\b _\ba_\bt_\bt_\be_\bm_\bp_\bt_\b _\bt_\bo_\b _\br_\be_\bu_\bs_\be_\b _\bf_\bi_\bl_\be_\bs_\b _\bf_\br_\bo_\bm_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\bs_\b _\bt_\bh_\ba_\bt_\b _\ba_\br_\be_\b _\bs_\be_\be_\bd_\bi_\bn_\bg_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b1_\b9_\b6_\b4_\b _\b _\b _\b _\b _\b _\b _\b|_\bt_\bh_\bi_\bs_\b _\bc_\bo_\bu_\bl_\bd_\b _\bb_\be_\b _\bo_\bp_\bt_\bi_\bm_\bi_\bz_\be_\bd_\b _\bb_\by_\b _\bl_\bo_\bo_\bk_\bi_\bn_\bg_\b _\bu_\bp_\b _\bw_\bh_\bi_\bc_\bh_\b _\bf_\bi_\bl_\be_\bs_\b _\ba_\br_\be_\b _\bc_\bo_\bm_\bp_\bl_\be_\bt_\be_\b _\ba_\bn_\bd_\b _\bj_\bu_\bs_\bt_\b _\bl_\bo_\bo_\bk_\b _\ba_\bt_\b _\bt_\bh_\bo_\bs_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs c\bco\bou\bul\bld\bd b\bbe\be o\bop\bpt\bti\bim\bmi\biz\bze\bed\bd b\bby\by l\blo\boo\bok\bki\bin\bng\bg u\bup\bp w\bwh\bhi\bic\bch\bh f\bfi\bil\ble\bes\bs a\bar\bre\be c\bco\bom\bmp\bpl\ble\bet\bte\be a\ban\bnd\bd j\bju\bus\bst\bt l\blo\boo\bok\bk a\bat\bt t\bth\bho\bos\bse\be *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:1\b19\b96\b64\b4 *\b**\b**\b* |\n+|{ |\n+|\t\t\tresolve_links res(m_torrent_file); |\n+| |\n+|\t\t\tfor (auto const& ih : m_torrent_file->similar_torrents()) |\n+|\t\t\t{ |\n+|\t\t\t\tstd::shared_ptr t = m_ses.find_torrent(info_hash_t(ih)).lock(); |\n+|\t\t\t\tif (!t) continue; |\n+| |\n+|\t\t\t\t// Only attempt to reuse files from torrents that are seeding. |\n+|\t\t\t\tif (!t->is_seed()) continue; |\n+| |\n+|\t\t\t\tres.match(t->get_torrent_file(), t->save_path()); |\n+|\t\t\t} |\n+|\t\t\tfor (auto const& c : m_torrent_file->collections()) |\n+|\t\t\t{ |\n+|\t\t\t\tstd::vector> ts = m_ses.find_collection(c); |\n+| |\n+|\t\t\t\tfor (auto const& t : ts) |\n+|\t\t\t\t{ |\n+|\t\t\t\t\t// Only attempt to reuse files from torrents that are seeding. |\n+|if (!t->is_seed()) continue; |\n+| |\n+|\t\t\t\t\tres.match(t->get_torrent_file(), t->save_path()); |\n+|\t\t\t\t} |\n+|\t\t\t} |\n+| |\n+|\t\t\tstd::vector const& l = res.get_links(); |\n+|\t\t\tif (!l.empty()) |\n+|\t\t\t{ |\n+|\t\t\t\tlinks.resize(m_torrent_file->files().num_files()); |\n+|\t\t\t\tfor (auto const& i : l) |\n+|\t\t\t\t{ |\n+|\t\t\t\t\tif (!i.ti) continue; |\n+|\t\t\t\t\tlinks[i.file_idx] = combine_path(i.save_path |\n+|\t\t\t\t\t\t, i.ti->files().file_path(i.file_idx)); |\n+|\t\t\t\t} |\n+|\t\t\t} |\n+|\t\t} |\n+|#endif // TORRENT_DISABLE_MUTABLE_TORRENTS |\n+| |\n+|#if TORRENT_USE_ASSERTS |\n+|\t\tTORRENT_ASSERT(m_outstanding_check_files == false); |\n+|\t\tm_outstanding_check_files = true; |\n+|#endif |\n+| |\n+|\t\tif (!m_add_torrent_params || !(m_add_torrent_params->flags & torrent_flags::no_verify_files)) |\n+|\t\t{ |\n+|\t\t\tm_ses.disk_thread().async_check_files( |\n+|\t\t\t\tm_storage, m_add_torrent_params ? m_add_torrent_params.get() : nullptr |\n+|\t\t\t\t, std::move(links), [self = shared_from_this()](status_t st, storage_error const& error) |\n+|_\b\t_\b\t_\b\t_\b\t_\b{_\b _\bs_\be_\bl_\bf_\b-_\b>_\bo_\bn_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b__\bc_\bh_\be_\bc_\bk_\be_\bd_\b(_\bs_\bt_\b,_\b _\be_\br_\br_\bo_\br_\b)_\b;_\b _\b}_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b2_\b7_\b2_\b8 |this pattern is repeated in a few places. Factor this into a function and generalize the concept of a torrent having a dedicated |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bl_\bi_\bs_\bt_\be_\bn_\b _\bp_\bo_\br_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs p\bpa\bat\btt\bte\ber\brn\bn i\bis\bs r\bre\bep\bpe\bea\bat\bte\bed\bd i\bin\bn a\ba f\bfe\bew\bw p\bpl\bla\bac\bce\bes\bs.\b. F\bFa\bac\bct\bto\bor\br t\bth\bhi\bis\bs i\bin\bnt\bto\bo a\ba f\bfu\bun\bnc\bct\bti\bio\bon\bn a\ban\bnd\bd g\bge\ben\bne\ber\bra\bal\bli\biz\bze\be t\bth\bhe\be c\bco\bon\bnc\bce\bep\bpt\bt o\bof\bf a\ba t\bto\bor\brr\bre\ben\bnt\bt h\bha\bav\bvi\bin\bng\bg a\ba d\bde\bed\bdi\bic\bca\bat\bte\bed\bd l\bli\bis\bst\bte\ben\bn p\bpo\bor\brt\bt *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:2\b27\b72\b28\b8 *\b**\b**\b* |\n+|// not ready for peers. Except, if we don't have metadata, |\n+|\t\t// we need peers to download from |\n+|\t\tif (!m_files_checked && valid_metadata()) return; |\n+| |\n+|\t\tif (!m_announce_to_lsd) return; |\n+| |\n+|\t\t// private torrents are never announced on LSD |\n+|\t\tif (m_torrent_file->is_valid() && m_torrent_file->priv()) return; |\n+| |\n+|#if TORRENT_USE_I2P |\n+|\t\t// i2p torrents are also never announced on LSD |\n+|\t\t// unless we allow mixed swarms |\n+|\t\tif (is_i2p() && !settings().get_bool(settings_pack::allow_i2p_mixed)) |\n+|\t\t\treturn; |\n+|#endif |\n+| |\n+|\t\tif (is_paused()) return; |\n+| |\n+|\t\tif (!m_ses.has_lsd()) return; |\n+| |\n+|#ifdef TORRENT_SSL_PEERS |\n+|int port = is_ssl_torrent() ? m_ses.ssl_listen_port() : m_ses.listen_port(); |\n+|#else |\n+|\t\tint port = m_ses.listen_port(); |\n+|#endif |\n+| |\n+|\t\t// announce with the local discovery service |\n+|\t\tm_torrent_file->info_hashes().for_each([&](sha1_hash const& ih, protocol_version) |\n+|\t\t{ |\n+|\t\t\tm_ses.announce_lsd(ih, port); |\n+|\t\t}); |\n+|\t} |\n+| |\n+|#ifndef TORRENT_DISABLE_DHT |\n+| |\n+|\tvoid torrent::dht_announce() |\n+|\t{ |\n+|\t\tTORRENT_ASSERT(is_single_thread()); |\n+|\t\tif (!m_ses.dht()) |\n+|\t\t{ |\n+|#ifndef TORRENT_DISABLE_LOGGING |\n+|\t\t\tdebug_log(\"DHT: no dht initialized\"); |\n+|#endif |\n+|\t\t\treturn; |\n+|\t\t} |\n+|\t\tif (!should_announce_dht()) |\n+|\t\t{ |\n+|#ifndef TORRENT_DISABLE_LOGGING |\n+|\t\t\tif (should_log()) |\n+|\t\t\t{ |\n+|_\b#_\bi_\bf_\b _\bT_\bO_\bR_\bR_\bE_\bN_\bT_\b__\bU_\bS_\bE_\b__\bI_\b2_\bP_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b3_\b8_\b8_\b5_\b _\b _\b _\b _\b _\b _\b _\b|_\ba_\bd_\bd_\b _\bo_\bn_\be_\b _\bp_\be_\be_\br_\b _\bp_\be_\br_\b _\bI_\bP_\b _\bt_\bh_\be_\b _\bh_\bo_\bs_\bt_\bn_\ba_\bm_\be_\b _\br_\be_\bs_\bo_\bl_\bv_\be_\bs_\b _\bt_\bo_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* a\bad\bdd\bd o\bon\bne\be p\bpe\bee\ber\br p\bpe\ber\br I\bIP\bP t\bth\bhe\be h\bho\bos\bst\btn\bna\bam\bme\be r\bre\bes\bso\bol\blv\bve\bes\bs t\bto\bo *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:3\b38\b88\b85\b5 *\b**\b**\b* |\n+|catch (...) { handle_exception(); } |\n+|#endif |\n+| |\n+|\tvoid torrent::on_peer_name_lookup(error_code const& e |\n+|\t\t, std::vector
    const& host_list, int const port |\n+|\t\t, protocol_version const v) try |\n+|\t{ |\n+|\t\tTORRENT_ASSERT(is_single_thread()); |\n+| |\n+|\t\tINVARIANT_CHECK; |\n+| |\n+|\t\tCOMPLETE_ASYNC(\"torrent::on_peer_name_lookup\"); |\n+| |\n+|#ifndef TORRENT_DISABLE_LOGGING |\n+|\t\tif (e && should_log()) |\n+|\t\t\tdebug_log(\"peer name lookup error: %s\", e.message().c_str()); |\n+|#endif |\n+| |\n+|\t\tif (e || m_abort || host_list.empty() || m_ses.is_aborted()) return; |\n+| |\n+|tcp::endpoint host(host_list.front(), std::uint16_t(port)); |\n+| |\n+|\t\tif (m_ip_filter && m_ip_filter->access(host.address()) & ip_filter::blocked) |\n+|\t\t{ |\n+|#ifndef TORRENT_DISABLE_LOGGING |\n+|\t\t\tif (should_log()) |\n+|\t\t\t{ |\n+|\t\t\t\tdebug_log(\"blocked ip from tracker: %s\", host.address().to_string().c_str()); |\n+|\t\t\t} |\n+|#endif |\n+|\t\t\tif (m_ses.alerts().should_post()) |\n+|\t\t\t\tm_ses.alerts().emplace_alert(get_handle() |\n+|\t\t\t\t\t, host, peer_blocked_alert::ip_filter); |\n+|\t\t\treturn; |\n+|\t\t} |\n+| |\n+|\t\tif (add_peer(host, peer_info::tracker, v == protocol_version::V2 ? pex_lt_v2 : pex_flags_t(0))) |\n+|\t\t{ |\n+|\t\t\tstate_updated(); |\n+| |\n+|#ifndef TORRENT_DISABLE_LOGGING |\n+|\t\t\tif (should_log()) |\n+|\t\t\t{ |\n+|\t\t\t\tdebug_log(\"name-lookup add_peer() [ %s ] connect-candidates: %d\" |\n+|\t\t\t\t\t, host.address().to_string().c_str() |\n+|\t\t\t\t\t, m_peer_list ? m_peer_list->num_connect_candidates() : -1); |\n+|\t\t\t} |\n+|#endif |\n+|\t\t} |\n+|\t\tupdate_want_peers(); |\n+|_\b\t_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b4_\b5_\b8_\b1_\b _\b _\b _\b _\b _\b _\b _\b|_\bo_\bn_\bl_\by_\b _\bd_\bo_\b _\bt_\bh_\bi_\bs_\b _\bi_\bf_\b _\bt_\bh_\be_\b _\bp_\bi_\be_\bc_\be_\b _\bs_\bi_\bz_\be_\b _\b>_\b _\b1_\b _\bb_\bl_\bo_\bc_\bk_\bs_\b _\bT_\bh_\bi_\bs_\b _\bi_\bs_\b _\ba_\b _\bv_\b2_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\b _\bs_\bo_\b _\bw_\be_\b _\bc_\ba_\bn_\b _\br_\be_\bq_\bu_\be_\bs_\bt_\b _\bg_\be_\bt_\b _\bb_\bl_\bo_\bc_\bk_\b _\bl_\be_\bv_\be_\bl_\b _\bh_\ba_\bs_\bh_\be_\bs_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* o\bon\bnl\bly\by d\bdo\bo t\bth\bhi\bis\bs i\bif\bf t\bth\bhe\be p\bpi\bie\bec\bce\be s\bsi\biz\bze\be >\b> 1\b1 b\bbl\blo\boc\bck\bks\bs T\bTh\bhi\bis\bs i\bis\bs a\ba v\bv2\b2 t\bto\bor\brr\bre\ben\bnt\bt s\bso\bo w\bwe\be c\bca\ban\bn r\bre\beq\bqu\bue\bes\bst\bt g\bge\bet\bt b\bbl\blo\boc\bck\bk l\ble\bev\bve\bel\bl h\bha\bas\bsh\bhe\bes\bs.\b. *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:4\b45\b58\b81\b1 *\b**\b**\b* |\n+|{ |\n+|\t\t\tstd::set ret; |\n+|\t\t\tif (!blocks.empty() && !downloaders.empty()) |\n+|\t\t\t{ |\n+|\t\t\t\tfor (auto const b : blocks) ret.insert(downloaders[std::size_t(b)]); |\n+|\t\t\t} |\n+|\t\t\telse |\n+|\t\t\t{ |\n+|\t\t\t\tstd::copy(downloaders.begin(), downloaders.end(), std::inserter(ret, ret.begin())); |\n+|\t\t\t} |\n+|\t\t\treturn ret; |\n+|\t\t}(); |\n+| |\n+|\t\t// if this piece wasn't downloaded from peers, we just found it on disk. |\n+|\t\t// In that case, we should just consider it as \"not-have\" and there's no |\n+|\t\t// need to try to get higher fidelity hashes (yet) |\n+|\t\tbool const found_on_disk = peers.size() == 1 && peers.count(nullptr); |\n+| |\n+|\t\tif (!torrent_file().info_hashes().has_v1() && blocks.empty() && !found_on_disk) |\n+|\t\t{ |\n+|verify_block_hashes(index); |\n+|} |\n+| |\n+|\t\t// the below code is penalizing peers that sent use bad data. |\n+|\t\t// increase the total amount of failed bytes |\n+|\t\tif (!found_on_disk) |\n+|\t\t{ |\n+|\t\t\tif (blocks.empty()) |\n+|\t\t\t\tadd_failed_bytes(m_torrent_file->piece_size(index)); |\n+|\t\t\telse |\n+|\t\t\t\tadd_failed_bytes(static_cast(blocks.size()) * default_block_size); |\n+| |\n+|#ifndef TORRENT_DISABLE_EXTENSIONS |\n+|\t\t\tfor (auto& ext : m_extensions) |\n+|\t\t\t{ |\n+|\t\t\t\text->on_piece_failed(index); |\n+|\t\t\t} |\n+|#endif |\n+| |\n+|\t\t\t// did we receive this piece from a single peer? |\n+|\t\t\t// if we know exactly which blocks failed the hash, we can also be certain |\n+|\t\t\t// that all peers in the list sent us bad data |\n+|\t\t\tbool const known_bad_peer = (!found_on_disk && peers.size() == 1) || !blocks.empty(); |\n+| |\n+|\t\t\tpenalize_peers(peers, index, known_bad_peer); |\n+|\t\t} |\n+| |\n+|\t\t// If m_storage isn't set here, it means we're shutting down |\n+|\t\tif (m_storage) |\n+|\t\t{ |\n+|_\b\t_\b\t_\b\t_\b/_\b/_\b _\bi_\bt_\b _\bd_\bo_\be_\bs_\bn_\b'_\bt_\b _\bm_\ba_\bk_\be_\b _\bm_\bu_\bc_\bh_\b _\bs_\be_\bn_\bs_\be_\b _\bt_\bo_\b _\bf_\ba_\bi_\bl_\b _\bt_\bo_\b _\bh_\ba_\bs_\bh_\b _\ba_\b _\bp_\bi_\be_\bc_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b7_\b5_\b2_\b5_\b _\b _\b _\b _\b _\b _\b _\b|_\bc_\bo_\bm_\be_\b _\bu_\bp_\b _\bw_\bi_\bt_\bh_\b _\ba_\b _\bb_\be_\bt_\bt_\be_\br_\b _\bw_\ba_\by_\b _\bo_\bf_\b _\bd_\bo_\bi_\bn_\bg_\b _\bt_\bh_\bi_\bs_\b,_\b _\bi_\bn_\bs_\bt_\be_\ba_\bd_\b _\bo_\bf_\b _\ba_\bn_\b _\bi_\bm_\bm_\be_\bd_\bi_\ba_\bt_\be_\bl_\by_\b _\bi_\bn_\bv_\bo_\bk_\be_\bd_\b _\bl_\ba_\bm_\bb_\bd_\ba_\b _\be_\bx_\bp_\br_\be_\bs_\bs_\bi_\bo_\bn_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* c\bco\bom\bme\be u\bup\bp w\bwi\bit\bth\bh a\ba b\bbe\bet\btt\bte\ber\br w\bwa\bay\by o\bof\bf d\bdo\boi\bin\bng\bg t\bth\bhi\bis\bs,\b, i\bin\bns\bst\bte\bea\bad\bd o\bof\bf a\ban\bn i\bim\bmm\bme\bed\bdi\bia\bat\bte\bel\bly\by i\bin\bnv\bvo\bok\bke\bed\bd l\bla\bam\bmb\bbd\bda\ba e\bex\bxp\bpr\bre\bes\bss\bsi\bio\bon\bn.\b. *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:7\b75\b52\b25\b5 *\b**\b**\b* |\n+||| peerinfo->confirmed_supports_utp)) |\n+|\t\t\t{ |\n+|\t\t\t\tsm = m_ses.utp_socket_manager(); |\n+|\t\t\t} |\n+| |\n+|\t\t\t// don't make a TCP connection if it's disabled |\n+|\t\t\tif (sm == nullptr && !settings().get_bool(settings_pack::enable_outgoing_tcp)) |\n+|\t\t\t{ |\n+|#ifndef TORRENT_DISABLE_LOGGING |\n+|\t\t\t\tif (should_log()) |\n+|\t\t\t\t{ |\n+|\t\t\t\t\tdebug_log(\"discarding peer \\\"%s\\\": TCP connections disabled \" |\n+|\t\t\t\t\t\t\"[ supports-utp: %d ]\", peerinfo->to_string().c_str() |\n+|\t\t\t\t\t\t, peerinfo->supports_utp); |\n+|\t\t\t\t} |\n+|#endif |\n+|\t\t\t\treturn false; |\n+|\t\t\t} |\n+|\t\t} |\n+| |\n+|aux::socket_type s = [&] { |\n+| |\n+|#if TORRENT_USE_I2P |\n+|\t\tif (peerinfo->is_i2p_addr) |\n+|\t\t{ |\n+|\t\t\t// It's not entirely obvious why this peer connection is not marked as |\n+|\t\t\t// one. The main feature of a peer connection is that whether or not we |\n+|\t\t\t// proxy it is configurable. When we use i2p, we want to always prox |\n+|\t\t\t// everything via i2p. |\n+| |\n+|\t\t\taux::proxy_settings proxy; |\n+|\t\t\tproxy.hostname = settings().get_str(settings_pack::i2p_hostname); |\n+|\t\t\tproxy.port = std::uint16_t(settings().get_int(settings_pack::i2p_port)); |\n+|\t\t\tproxy.type = settings_pack::i2p_proxy; |\n+| |\n+|\t\t\taux::socket_type ret = instantiate_connection(m_ses.get_context() |\n+|\t\t\t\t, proxy, nullptr, nullptr, false, false); |\n+|\t\t\ti2p_stream& str = boost::get(ret); |\n+|\t\t\tstr.set_local_i2p_endpoint(m_ses.local_i2p_endpoint()); |\n+|\t\t\tstr.set_destination(static_cast(peerinfo)->dest()); |\n+|\t\t\tstr.set_command(i2p_stream::cmd_connect); |\n+|\t\t\tstr.set_session_id(m_ses.i2p_session()); |\n+|\t\t\treturn ret; |\n+|\t\t} |\n+|\t\telse |\n+|#endif |\n+|\t\t{ |\n+|\t\t\tvoid* userdata = nullptr; |\n+|#ifdef TORRENT_SSL_PEERS |\n+|\t\t\tif (is_ssl_torrent()) |\n+|_\b\t_\b\t_\b\t_\b{_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b9_\b1_\b1_\b8_\b _\b _\b _\b _\b _\b _\b _\b|_\bp_\be_\br_\bh_\ba_\bp_\bs_\b _\b0_\b _\bs_\bh_\bo_\bu_\bl_\bd_\b _\ba_\bc_\bt_\bu_\ba_\bl_\bl_\by_\b _\bm_\be_\ba_\bn_\b _\b0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* p\bpe\ber\brh\bha\bap\bps\bs 0\b0 s\bsh\bho\bou\bul\bld\bd a\bac\bct\btu\bua\bal\bll\bly\by m\bme\bea\ban\bn 0\b0 *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:9\b91\b11\b18\b8 *\b**\b**\b* |\n+|// finished torrents may not change their queue positions, as it's set to |\n+|\t\t// -1 |\n+|\t\tif ((m_abort || is_finished()) && p != no_pos) return; |\n+| |\n+|\t\tTORRENT_ASSERT((p == no_pos) == is_finished() |\n+|\t\t\t|| (!m_auto_managed && p == no_pos) |\n+|\t\t\t|| (m_abort && p == no_pos) |\n+|\t\t\t|| (!m_added && p == no_pos)); |\n+|\t\tif (p == m_sequence_number) return; |\n+| |\n+|\t\tTORRENT_ASSERT(p >= no_pos); |\n+| |\n+|\t\tstate_updated(); |\n+| |\n+|\t\tm_ses.set_queue_position(this, p); |\n+|\t} |\n+| |\n+|\tvoid torrent::set_max_uploads(int limit, bool const state_update) |\n+|\t{ |\n+|\t\tTORRENT_ASSERT(is_single_thread()); |\n+|if (limit <= 0) limit = (1 << 24) - 1; |\n+|if (int(m_max_uploads) == limit) return; |\n+|\t\tif (state_update) state_updated(); |\n+|\t\tm_max_uploads = aux::numeric_cast(limit); |\n+|#ifndef TORRENT_DISABLE_LOGGING |\n+|\t\tif (should_log() && state_update) |\n+|\t\t\tdebug_log(\"*** set-max-uploads: %d\", m_max_uploads); |\n+|#endif |\n+| |\n+|\t\tif (state_update) |\n+|\t\t\tset_need_save_resume(torrent_handle::if_config_changed); |\n+|\t} |\n+| |\n+|\tvoid torrent::set_max_connections(int limit, bool const state_update) |\n+|\t{ |\n+|_\b\t_\b\t_\bT_\bO_\bR_\bR_\bE_\bN_\bT_\b__\bA_\bS_\bS_\bE_\bR_\bT_\b(_\bi_\bs_\b__\bs_\bi_\bn_\bg_\bl_\be_\b__\bt_\bh_\br_\be_\ba_\bd_\b(_\b)_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b9_\b1_\b3_\b5_\b _\b _\b _\b _\b _\b _\b _\b|_\bp_\be_\br_\bh_\ba_\bp_\bs_\b _\b0_\b _\bs_\bh_\bo_\bu_\bl_\bd_\b _\ba_\bc_\bt_\bu_\ba_\bl_\bl_\by_\b _\bm_\be_\ba_\bn_\b _\b0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* p\bpe\ber\brh\bha\bap\bps\bs 0\b0 s\bsh\bho\bou\bul\bld\bd a\bac\bct\btu\bua\bal\bll\bly\by m\bme\bea\ban\bn 0\b0 *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:9\b91\b13\b35\b5 *\b**\b**\b* |\n+|\tvoid torrent::set_max_uploads(int limit, bool const state_update) |\n+|\t{ |\n+|\t\tTORRENT_ASSERT(is_single_thread()); |\n+|\t\tif (limit <= 0) limit = (1 << 24) - 1; |\n+|\t\tif (int(m_max_uploads) == limit) return; |\n+|\t\tif (state_update) state_updated(); |\n+|\t\tm_max_uploads = aux::numeric_cast(limit); |\n+|#ifndef TORRENT_DISABLE_LOGGING |\n+|\t\tif (should_log() && state_update) |\n+|\t\t\tdebug_log(\"*** set-max-uploads: %d\", m_max_uploads); |\n+|#endif |\n+| |\n+|\t\tif (state_update) |\n+|\t\t\tset_need_save_resume(torrent_handle::if_config_changed); |\n+|\t} |\n+| |\n+|\tvoid torrent::set_max_connections(int limit, bool const state_update) |\n+|\t{ |\n+|\t\tTORRENT_ASSERT(is_single_thread()); |\n+|if (limit <= 0) limit = (1 << 24) - 1; |\n+|if (int(m_max_connections) == limit) return; |\n+|\t\tif (state_update) state_updated(); |\n+|\t\tm_max_connections = aux::numeric_cast(limit); |\n+|\t\tupdate_want_peers(); |\n+| |\n+|#ifndef TORRENT_DISABLE_LOGGING |\n+|\t\tif (should_log() && state_update) |\n+|\t\t\tdebug_log(\"*** set-max-connections: %d\", m_max_connections); |\n+|#endif |\n+| |\n+|\t\tif (num_peers() > int(m_max_connections)) |\n+|\t\t{ |\n+|\t\t\tdisconnect_peers(num_peers() - m_max_connections |\n+|\t\t\t\t, errors::too_many_connections); |\n+|\t\t} |\n+| |\n+|\t\tif (state_update) |\n+|\t\t\tset_need_save_resume(torrent_handle::if_config_changed); |\n+|\t} |\n+| |\n+|\tvoid torrent::set_upload_limit(int const limit) |\n+|\t{ |\n+|\t\tset_limit_impl(limit, peer_connection::upload_channel); |\n+|#ifndef TORRENT_DISABLE_LOGGING |\n+|\t\tdebug_log(\"*** set-upload-limit: %d\", limit); |\n+|#endif |\n+|\t} |\n+| |\n+|\tvoid torrent::set_download_limit(int const limit) |\n+|_\b\t_\b{_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b1_\b1_\b0_\b6_\b1_\b _\b _\b _\b _\b _\b _\b|_\bi_\bn_\bs_\bt_\be_\ba_\bd_\b _\bo_\bf_\b _\br_\be_\bs_\bo_\br_\bt_\bi_\bn_\bg_\b _\bt_\bh_\be_\b _\bw_\bh_\bo_\bl_\be_\b _\bl_\bi_\bs_\bt_\b,_\b _\bi_\bn_\bs_\be_\br_\bt_\b _\bt_\bh_\be_\b _\bp_\be_\be_\br_\bs_\b _\bd_\bi_\br_\be_\bc_\bt_\bl_\by_\b _\bi_\bn_\bt_\bo_\b _\bt_\bh_\be_\b _\br_\bi_\bg_\bh_\bt_\b _\bp_\bl_\ba_\bc_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* i\bin\bns\bst\bte\bea\bad\bd o\bof\bf r\bre\bes\bso\bor\brt\bti\bin\bng\bg t\bth\bhe\be w\bwh\bho\bol\ble\be l\bli\bis\bst\bt,\b, i\bin\bns\bse\ber\brt\bt t\bth\bhe\be p\bpe\bee\ber\brs\bs d\bdi\bir\bre\bec\bct\btl\bly\by i\bin\bnt\bto\bo t\bth\bhe\be r\bri\big\bgh\bht\bt p\bpl\bla\bac\bce\be *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:1\b11\b10\b06\b61\b1 *\b**\b**\b* |\n+|std::printf(\"timed out [average-piece-time: %d ms ]\\n\" |\n+|\t\t\t\t\t, m_average_piece_time); |\n+|#endif |\n+|\t\t\t} |\n+| |\n+|\t\t\t// pick all blocks for this piece. the peers list is kept up to date |\n+|\t\t\t// and sorted. when we issue a request to a peer, its download queue |\n+|\t\t\t// time will increase and it may need to be bumped in the peers list, |\n+|\t\t\t// since it's ordered by download queue time |\n+|\t\t\tpick_time_critical_block(peers, ignore_peers |\n+|\t\t\t\t, peers_with_requests |\n+|\t\t\t\t, pi, &i, m_picker.get() |\n+|\t\t\t\t, blocks_in_piece, timed_out); |\n+| |\n+|\t\t\t// put back the peers we ignored into the peer list for the next piece |\n+|\t\t\tif (!ignore_peers.empty()) |\n+|\t\t\t{ |\n+|\t\t\t\tpeers.insert(peers.begin(), ignore_peers.begin(), ignore_peers.end()); |\n+|\t\t\t\tignore_peers.clear(); |\n+| |\n+|std::sort(peers.begin(), peers.end() |\n+|, [] (peer_connection const* lhs, peer_connection const* rhs) |\n+|\t\t\t\t\t{ return lhs->download_queue_time(16*1024) < rhs->download_queue_time(16*1024); }); |\n+|\t\t\t} |\n+| |\n+|\t\t\t// if this peer's download time exceeds 2 seconds, we're done. |\n+|\t\t\t// We don't want to build unreasonably long request queues |\n+|\t\t\tif (!peers.empty() && peers[0]->download_queue_time() > milliseconds(2000)) |\n+|\t\t\t\tbreak; |\n+|\t\t} |\n+| |\n+|\t\t// commit all the time critical requests |\n+|\t\tfor (auto p : peers_with_requests) |\n+|\t\t{ |\n+|\t\t\tp->send_block_requests(); |\n+|\t\t} |\n+|\t} |\n+|#endif // TORRENT_DISABLE_STREAMING |\n+| |\n+|\tstd::set torrent::web_seeds(web_seed_entry::type_t const type) const |\n+|\t{ |\n+|\t\tTORRENT_ASSERT(is_single_thread()); |\n+|\t\tstd::set ret; |\n+|\t\tfor (auto const& s : m_web_seeds) |\n+|\t\t{ |\n+|\t\t\tif (s.peer_info.banned) continue; |\n+|\t\t\tif (s.removed) continue; |\n+|\t\t\tif (s.type != type) continue; |\n+|\t\t\tret.insert(s.url); |\n+|\t\t} |\n+|_\b\t_\b\t_\br_\be_\bt_\bu_\br_\bn_\b _\br_\be_\bt_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs_\b._\bc_\bp_\bp_\b:|pre C++17, GCC and msvc does not make std::string nothrow move assignable, which means no type containing a string will be nothrow |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b7_\b8_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bm_\bo_\bv_\be_\b _\ba_\bs_\bs_\bi_\bg_\bn_\ba_\bb_\bl_\be_\b _\bb_\by_\b _\bd_\be_\bf_\ba_\bu_\bl_\bt_\b _\be_\bi_\bt_\bh_\be_\br_\b _\bs_\bt_\ba_\bt_\bi_\bc_\b__\ba_\bs_\bs_\be_\br_\bt_\b(_\bs_\bt_\bd_\b:_\b:_\bi_\bs_\b__\bn_\bo_\bt_\bh_\br_\bo_\bw_\b__\bm_\bo_\bv_\be_\b__\ba_\bs_\bs_\bi_\bg_\bn_\ba_\bb_\bl_\be_\b:_\b:_\bv_\ba_\bl_\bu_\be_\b _\b,_\b _\b\"_\bs_\bh_\bo_\bu_\bl_\bd_\b _\bb_\be_\b _\bn_\bo_\bt_\bh_\br_\bo_\bw_\b _\bm_\bo_\bv_\be_\b _\ba_\bs_\bs_\bi_\bg_\bn_\ba_\bb_\bl_\be_\b\"_\b)_\b;_\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* p\bpr\bre\be C\bC+\b++\b+1\b17\b7,\b, G\bGC\bCC\bC a\ban\bnd\bd m\bms\bsv\bvc\bc d\bdo\boe\bes\bs n\bno\bot\bt m\bma\bak\bke\be s\bst\btd\bd:\b::\b:s\bst\btr\bri\bin\bng\bg n\bno\bot\bth\bhr\bro\bow\bw m\bmo\bov\bve\be a\bas\bss\bsi\big\bgn\bna\bab\bbl\ble\be,\b, w\bwh\bhi\bic\bch\bh m\bme\bea\ban\bns\bs n\bno\bo t\bty\byp\bpe\be c\bco\bon\bnt\bta\bai\bin\bni\bin\bng\bg a\ba s\bst\btr\bri\bin\bng\bg w\bwi\bil\bll\bl b\bbe\be n\bno\bot\bth\bhr\bro\bow\bw m\bmo\bov\bve\be a\bas\bss\bsi\big\bgn\bna\bab\bbl\ble\be b\bby\by d\bde\bef\bfa\bau\bul\blt\bt e\bei\bit\bth\bhe\ber\br |\n+|s\bst\bta\bat\bti\bic\bc_\b_a\bas\bss\bse\ber\brt\bt(\b(s\bst\btd\bd:\b::\b:i\bis\bs_\b_n\bno\bot\bth\bhr\bro\bow\bw_\b_m\bmo\bov\bve\be_\b_a\bas\bss\bsi\big\bgn\bna\bab\bbl\ble\be:\b::\b:v\bva\bal\blu\bue\be ,\b, \"\b\"s\bsh\bho\bou\bul\bld\bd b\bbe\be n\bno\bot\bth\bhr\bro\bow\bw m\bmo\bov\bve\be a\bas\bss\bsi\big\bgn\bna\bab\bbl\ble\be\"\b\")\b);\b; *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_p\bpa\bar\bra\bam\bms\bs.\b.c\bcp\bpp\bp:\b:7\b78\b8 *\b**\b**\b* |\n+|DECL_FLAG(sequential_download); |\n+|\t\t\tDECL_FLAG(pinned); |\n+|\t\t\tDECL_FLAG(stop_when_ready); |\n+|\t\t\tDECL_FLAG(override_trackers); |\n+|\t\t\tDECL_FLAG(override_web_seeds); |\n+|\t\t\tDECL_FLAG(need_save_resume); |\n+|\t\t\tDECL_FLAG(override_resume_data); |\n+|\t\t\tDECL_FLAG(merge_resume_trackers); |\n+|\t\t\tDECL_FLAG(use_resume_save_path); |\n+|\t\t\tDECL_FLAG(merge_resume_http_seeds); |\n+|\t\t\tDECL_FLAG(default_flags); |\n+|#undef DECL_FLAG |\n+|#endif // TORRENT_ABI_VERSION |\n+| |\n+|\tstatic_assert(std::is_nothrow_move_constructible::value |\n+|\t\t, \"should be nothrow move constructible\"); |\n+| |\n+|\tstatic_assert(std::is_nothrow_move_constructible::value |\n+|\t\t, \"should be nothrow move constructible\"); |\n+| |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs_\b._\bc_\bp_\bp_\b:|it would be nice if this was nothrow default constructible static_assert(std::is_nothrow_default_constructible::value , \"should be |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b8_\b4_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bn_\bo_\bt_\bh_\br_\bo_\bw_\b _\bd_\be_\bf_\ba_\bu_\bl_\bt_\b _\bc_\bo_\bn_\bs_\bt_\br_\bu_\bc_\bt_\bi_\bb_\bl_\be_\b\"_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* i\bit\bt w\bwo\bou\bul\bld\bd b\bbe\be n\bni\bic\bce\be i\bif\bf t\bth\bhi\bis\bs w\bwa\bas\bs n\bno\bot\bth\bhr\bro\bow\bw d\bde\bef\bfa\bau\bul\blt\bt c\bco\bon\bns\bst\btr\bru\buc\bct\bti\bib\bbl\ble\be s\bst\bta\bat\bti\bic\bc_\b_a\bas\bss\bse\ber\brt\bt(\b(s\bst\btd\bd:\b::\b:i\bis\bs_\b_n\bno\bot\bth\bhr\bro\bow\bw_\b_d\bde\bef\bfa\bau\bul\blt\bt_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bti\bib\bbl\ble\be:\b::\b:v\bva\bal\blu\bue\be ,\b, \"\b\"s\bsh\bho\bou\bul\bld\bd b\bbe\be n\bno\bot\bth\bhr\bro\bow\bw d\bde\bef\bfa\bau\bul\blt\bt c\bco\bon\bns\bst\btr\bru\buc\bct\bti\bib\bbl\ble\be\"\b\")\b);\b; *\b**\b**\b**\b**\b*|\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_p\bpa\bar\bra\bam\bms\bs.\b.c\bcp\bpp\bp:\b:8\b84\b4 *\b**\b**\b* |\n+|DECL_FLAG(pinned); |\n+|\t\t\tDECL_FLAG(stop_when_ready); |\n+|\t\t\tDECL_FLAG(override_trackers); |\n+|\t\t\tDECL_FLAG(override_web_seeds); |\n+|\t\t\tDECL_FLAG(need_save_resume); |\n+|\t\t\tDECL_FLAG(override_resume_data); |\n+|\t\t\tDECL_FLAG(merge_resume_trackers); |\n+|\t\t\tDECL_FLAG(use_resume_save_path); |\n+|\t\t\tDECL_FLAG(merge_resume_http_seeds); |\n+|\t\t\tDECL_FLAG(default_flags); |\n+|#undef DECL_FLAG |\n+|#endif // TORRENT_ABI_VERSION |\n+| |\n+|\tstatic_assert(std::is_nothrow_move_constructible::value |\n+|\t\t, \"should be nothrow move constructible\"); |\n+| |\n+|\tstatic_assert(std::is_nothrow_move_constructible::value |\n+|\t\t, \"should be nothrow move constructible\"); |\n+| |\n+| |\n+| |\n+|namespace aux { |\n+| |\n+|\t// returns whether this add_torrent_params object has \"resume-data\", i.e. |\n+|\t// information about which pieces we have. |\n+|\tbool contains_resume_data(add_torrent_params const& atp) |\n+|\t{ |\n+|\t\treturn !atp.have_pieces.empty() |\n+|\t\t\t|| (atp.flags & torrent_flags::seed_mode); |\n+|\t} |\n+|} |\n+| |\n+|_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bu_\bt_\bi_\bl_\bs_\b._\bc_\bp_\bp_\b:_\b2_\b3_\b0 |ideally, if we end up copying files because of a move across volumes, the source should not be deleted until they've all been |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bc_\bo_\bp_\bi_\be_\bd_\b._\b _\bT_\bh_\ba_\bt_\b _\bw_\bo_\bu_\bl_\bd_\b _\bl_\be_\bt_\b _\bu_\bs_\b _\br_\bo_\bl_\bl_\bb_\ba_\bc_\bk_\b _\bw_\bi_\bt_\bh_\b _\bh_\bi_\bg_\bh_\be_\br_\b _\bc_\bo_\bn_\bf_\bi_\bd_\be_\bn_\bc_\be_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* i\bid\bde\bea\bal\bll\bly\by,\b, i\bif\bf w\bwe\be e\ben\bnd\bd u\bup\bp c\bco\bop\bpy\byi\bin\bng\bg f\bfi\bil\ble\bes\bs b\bbe\bec\bca\bau\bus\bse\be o\bof\bf a\ba m\bmo\bov\bve\be a\bac\bcr\bro\bos\bss\bs v\bvo\bol\blu\bum\bme\bes\bs,\b, t\bth\bhe\be s\bso\bou\bur\brc\bce\be s\bsh\bho\bou\bul\bld\bd n\bno\bot\bt b\bbe\be d\bde\bel\ble\bet\bte\bed\bd u\bun\bnt\bti\bil\bl t\bth\bhe\bey\by'\b'v\bve\be a\bal\bll\bl b\bbe\bee\ben\bn c\bco\bop\bpi\bie\bed\bd.\b. T\bTh\bha\bat\bt w\bwo\bou\bul\bld\bd l\ble\bet\bt u\bus\bs r\bro\bol\bll\blb\bba\bac\bck\bk w\bwi\bit\bth\bh |\n+|h\bhi\big\bgh\bhe\ber\br c\bco\bon\bnf\bfi\bid\bde\ben\bnc\bce\be.\b. *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/s\bst\bto\bor\bra\bag\bge\be_\b_u\but\bti\bil\bls\bs.\b.c\bcp\bpp\bp:\b:2\b23\b30\b0 *\b**\b**\b* |\n+|// later |\n+|\t\taux::vector copied_files(std::size_t(f.num_files()), false); |\n+| |\n+|\t\t// track how far we got in case of an error |\n+|\t\tfile_index_t file_index{}; |\n+|\t\tfor (auto const i : f.file_range()) |\n+|\t\t{ |\n+|\t\t\t// files moved out to absolute paths are not moved |\n+|\t\t\tif (f.file_absolute_path(i)) continue; |\n+| |\n+|\t\t\tstd::string const old_path = combine_path(save_path, f.file_path(i)); |\n+|\t\t\tstd::string const new_path = combine_path(new_save_path, f.file_path(i)); |\n+| |\n+|\t\t\terror_code ignore; |\n+|\t\t\tif (flags == move_flags_t::dont_replace && exists(new_path, ignore)) |\n+|\t\t\t{ |\n+|\t\t\t\tif (ret == status_t::no_error) ret = status_t::need_full_check; |\n+|\t\t\t\tcontinue; |\n+|\t\t\t} |\n+| |\n+|move_file(old_path, new_path, ec); |\n+| |\n+|\t\t\t// if the source file doesn't exist. That's not a problem |\n+|\t\t\t// we just ignore that file |\n+|\t\t\tif (ec.ec == boost::system::errc::no_such_file_or_directory) |\n+|\t\t\t\tec.ec.clear(); |\n+|\t\t\telse if (ec |\n+|\t\t\t\t&& ec.ec != boost::system::errc::invalid_argument |\n+|\t\t\t\t&& ec.ec != boost::system::errc::permission_denied) |\n+|\t\t\t{ |\n+|\t\t\t\t// moving the file failed |\n+|\t\t\t\t// on OSX, the error when trying to rename a file across different |\n+|\t\t\t\t// volumes is EXDEV, which will make it fall back to copying. |\n+|\t\t\t\tec.ec.clear(); |\n+|\t\t\t\tcopy_file(old_path, new_path, ec); |\n+|\t\t\t\tif (!ec) copied_files[i] = true; |\n+|\t\t\t} |\n+| |\n+|\t\t\tif (ec) |\n+|\t\t\t{ |\n+|\t\t\t\tec.file(i); |\n+|\t\t\t\tfile_index = i; |\n+|\t\t\t\tbreak; |\n+|\t\t\t} |\n+|\t\t} |\n+| |\n+|\t\tif (!ec && move_partfile) |\n+|\t\t{ |\n+|\t\t\terror_code e; |\n+|\t\t\tmove_partfile(new_save_path, e); |\n+|_\b\t_\b\t_\b\t_\bi_\bf_\b _\b(_\be_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bu_\bt_\bi_\bl_\bs_\b._\bc_\bp_\bp_\b:_\b5_\b3_\b8 |it would seem reasonable to, instead, set the have_pieces bits for the pieces representing these files, and resume with the normal |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bl_\bo_\bg_\bi_\bc_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* i\bit\bt w\bwo\bou\bul\bld\bd s\bse\bee\bem\bm r\bre\bea\bas\bso\bon\bna\bab\bbl\ble\be t\bto\bo,\b, i\bin\bns\bst\bte\bea\bad\bd,\b, s\bse\bet\bt t\bth\bhe\be h\bha\bav\bve\be_\b_p\bpi\bie\bec\bce\bes\bs b\bbi\bit\bts\bs f\bfo\bor\br t\bth\bhe\be p\bpi\bie\bec\bce\bes\bs r\bre\bep\bpr\bre\bes\bse\ben\bnt\bti\bin\bng\bg t\bth\bhe\bes\bse\be f\bfi\bil\ble\bes\bs,\b, a\ban\bnd\bd r\bre\bes\bsu\bum\bme\be w\bwi\bit\bth\bh t\bth\bhe\be n\bno\bor\brm\bma\bal\bl l\blo\bog\bgi\bic\bc *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/s\bst\bto\bor\bra\bag\bge\be_\b_u\but\bti\bil\bls\bs.\b.c\bcp\bpp\bp:\b:5\b53\b38\b8 *\b**\b**\b* |\n+|continue; |\n+| |\n+|\t\t\t\tstd::int64_t const size = get_filesize(stat, file_index, fs |\n+|\t\t\t\t\t, save_path, ec); |\n+|\t\t\t\tif (size < 0) return false; |\n+| |\n+|\t\t\t\tif (size < fs.file_size(file_index)) |\n+|\t\t\t\t{ |\n+|\t\t\t\t\tec.ec = errors::mismatching_file_size; |\n+|\t\t\t\t\tec.file(file_index); |\n+|\t\t\t\t\tec.operation = operation_t::check_resume; |\n+|\t\t\t\t\treturn false; |\n+|\t\t\t\t} |\n+|\t\t\t} |\n |\t\t\treturn true; |\n |\t\t} |\n | |\n-|\t\tif (action != action_t::scrape) |\n-|_\b\t_\b\t_\b{_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|#ifndef TORRENT_DISABLE_MUTABLE_TORRENTS |\n+|\t\t// always trigger a full recheck when we pull in files from other |\n+|\t\t// torrents, via hard links |\n+|if (added_files) return false; |\n+|#endif |\n+| |\n+|\t\t// parse have bitmask. Verify that the files we expect to have |\n+|\t\t// actually do exist |\n+|\t\tpiece_index_t const end_piece = std::min(rd.have_pieces.end_index(), fs.end_piece()); |\n+|\t\tfor (piece_index_t i(0); i < end_piece; ++i) |\n+|\t\t{ |\n+|\t\t\tif (rd.have_pieces.get_bit(i) == false) continue; |\n+| |\n+|\t\t\tstd::vector f = fs.map_block(i, 0, 1); |\n+|\t\t\tTORRENT_ASSERT(!f.empty()); |\n+| |\n+|\t\t\tfile_index_t const file_index = f[0].file_index; |\n+| |\n+|\t\t\t// files with priority zero may not have been saved to disk at their |\n+|\t\t\t// expected location, but is likely to be in a partfile. Just exempt it |\n+|\t\t\t// from checking |\n+|\t\t\tif (file_index < file_priority.end_index() |\n+|\t\t\t\t&& file_priority[file_index] == dont_download) |\n+|\t\t\t\tcontinue; |\n+| |\n+|\t\t\tif (fs.pad_file_at(file_index)) continue; |\n+| |\n+|\t\t\tif (get_filesize(stat, file_index, fs, save_path, ec) < 0) |\n+|\t\t\t\treturn false; |\n+| |\n+|\t\t\t// OK, this file existed, good. Now, skip all remaining pieces in |\n+|\t\t\t// this file. We're just sanity-checking whether the files exist |\n+|\t\t\t// or not. |\n+|_\b\t_\b\t_\b\t_\bp_\be_\be_\br_\b__\br_\be_\bq_\bu_\be_\bs_\bt_\b _\bc_\bo_\bn_\bs_\bt_\b _\bp_\br_\b _\b=_\b _\bf_\bs_\b._\bm_\ba_\bp_\b__\bf_\bi_\bl_\be_\b(_\bf_\bi_\bl_\be_\b__\bi_\bn_\bd_\be_\bx_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/ |technically, this isn't supposed to happen, but it seems to sometimes. Some of the accounting is probably wrong in certain cases |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bh_\bt_\bt_\bp_\b__\bs_\be_\be_\bd_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b._\bc_\bp_\bp_\b:_\b4_\b4_\b1_\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bte\bec\bch\bhn\bni\bic\bca\bal\bll\bly\by,\b, t\bth\bhi\bis\bs i\bis\bsn\bn'\b't\bt s\bsu\bup\bpp\bpo\bos\bse\bed\bd t\bto\bo h\bha\bap\bpp\bpe\ben\bn,\b, b\bbu\but\bt i\bit\bt s\bse\bee\bem\bms\bs t\bto\bo s\bso\bom\bme\bet\bti\bim\bme\bes\bs.\b. S\bSo\bom\bme\be o\bof\bf t\bth\bhe\be a\bac\bcc\bco\bou\bun\bnt\bti\bin\bng\bg i\bis\bs p\bpr\bro\bob\bba\bab\bbl\bly\by w\bwr\bro\bon\bng\bg i\bin\bn c\bce\ber\brt\bta\bai\bin\bn c\bca\bas\bse\bes\bs *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/h\bht\btt\btp\bp_\b_s\bse\bee\bed\bd_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn.\b.c\bcp\bpp\bp:\b:4\b44\b41\b1 *\b**\b**\b* |\n+|// cut out the chunk header from the receive buffer |\n+|\t\t\t\t\tTORRENT_ASSERT(m_chunk_pos + m_body_start < INT_MAX); |\n+|\t\t\t\t\tm_recv_buffer.cut(header_size, t->block_size() + 1024, aux::numeric_cast(m_chunk_pos + m_body_start)); |\n+|\t\t\t\t\trecv_buffer = m_recv_buffer.get(); |\n+|\t\t\t\t\trecv_buffer = recv_buffer.subspan(m_body_start); |\n+|\t\t\t\t\tm_chunk_pos += chunk_size; |\n+|\t\t\t\t\tif (chunk_size == 0) |\n+|\t\t\t\t\t{ |\n+|\t\t\t\t\t\tTORRENT_ASSERT(m_recv_buffer.get().size() < m_chunk_pos + m_body_start + 1 |\n+|\t\t\t\t\t\t\t|| m_recv_buffer.get()[static_cast(m_chunk_pos + m_body_start)] == 'H' |\n+|\t\t\t\t\t\t\t|| (m_parser.chunked_encoding() |\n+|\t\t\t\t\t\t\t\t&& m_recv_buffer.get()[static_cast(m_chunk_pos + m_body_start)] == '\\r')); |\n+|\t\t\t\t\t\tm_chunk_pos = -1; |\n+|\t\t\t\t\t} |\n+|\t\t\t\t} |\n+|\t\t\t} |\n+| |\n+|\t\t\tint payload = int(bytes_transferred); |\n+|\t\t\tif (payload > m_response_left) payload = int(m_response_left); |\n+|\t\t\tif (payload > front_request.length) payload = front_request.length; |\n+|if (payload > outstanding_bytes()) payload = outstanding_bytes(); |\n+|received_bytes(payload, 0); |\n+|\t\t\tincoming_piece_fragment(payload); |\n+|\t\t\tm_response_left -= payload; |\n+| |\n+|\t\t\tif (m_parser.status_code() == 503) |\n+|\t\t\t{ |\n+|\t\t\t\tif (!m_parser.finished()) return; |\n+| |\n+|\t\t\t\tint retry_time = std::atoi(std::string(recv_buffer.begin(), recv_buffer.end()).c_str()); |\n+|\t\t\t\tif (retry_time <= 0) retry_time = 60; |\n+|#ifndef TORRENT_DISABLE_LOGGING |\n+|\t\t\t\tpeer_log(peer_log_alert::info, \"CONNECT\", \"retrying in %d seconds\", retry_time); |\n+|#endif |\n+| |\n+|\t\t\t\treceived_bytes(0, int(bytes_transferred)); |\n+|\t\t\t\t// temporarily unavailable, retry later |\n+|\t\t\t\tt->retry_web_seed(this, seconds32(retry_time)); |\n+|\t\t\t\tdisconnect(error_code(m_parser.status_code(), http_category()), operation_t::bittorrent, failure); |\n+|\t\t\t\treturn; |\n+|\t\t\t} |\n+| |\n+| |\n+|\t\t\t// we only received the header, no data |\n+|\t\t\tif (recv_buffer.empty()) break; |\n+| |\n+|\t\t\tif (recv_buffer.size() < front_request.length) break; |\n+| |\n+|\t\t\t// if the response is chunked, we need to receive the last |\n+|\t\t\t// terminating chunk and the tail headers before we can proceed |\n+|_\b\t_\b\t_\b\t_\bi_\bf_\b _\b(_\bm_\b__\bp_\ba_\br_\bs_\be_\br_\b._\bc_\bh_\bu_\bn_\bk_\be_\bd_\b__\be_\bn_\bc_\bo_\bd_\bi_\bn_\bg_\b(_\b)_\b _\b&_\b&_\b _\bm_\b__\bc_\bh_\bu_\bn_\bk_\b__\bp_\bo_\bs_\b _\b>_\b=_\b _\b0_\b)_\b _\bb_\br_\be_\ba_\bk_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bl_\bo_\ba_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b1_\b2_\b1_\b _\b _\b _\b|_\bm_\bo_\bv_\be_\b _\bt_\bh_\be_\b _\bl_\bo_\ba_\bd_\bi_\bn_\bg_\b _\bl_\bo_\bg_\bi_\bc_\b _\bf_\br_\bo_\bm_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b _\bc_\bo_\bn_\bs_\bt_\br_\bu_\bc_\bt_\bo_\br_\b _\bi_\bn_\bt_\bo_\b _\bh_\be_\br_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* m\bmo\bov\bve\be t\bth\bhe\be l\blo\boa\bad\bdi\bin\bng\bg l\blo\bog\bgi\bic\bc f\bfr\bro\bom\bm t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br i\bin\bnt\bto\bo h\bhe\ber\bre\be *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/l\blo\boa\bad\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:1\b12\b21\b1 *\b**\b**\b* |\n+|mask.resize(std::size_t(full_size), false); |\n+|\t\t\t\tfor (int i = merkle_first_leaf(piece_layer_size) |\n+|\t\t\t\t\t, end = i + num_pieces; i < end; ++i) |\n+|\t\t\t\t{ |\n+|\t\t\t\t\tmask[std::size_t(i)] = true; |\n+|\t\t\t\t} |\n+|\t\t\t} |\n+|\t\t\tti->free_piece_layers(); |\n+|\t\t} |\n+|\t\tatp.info_hashes = atp.ti->info_hashes(); |\n+|\t} |\n+|} |\n+| |\n+|\tadd_torrent_params load_torrent_file(std::string const& filename) |\n+|\t{ return load_torrent_file(filename, load_torrent_limits{}); } |\n+|\tadd_torrent_params load_torrent_buffer(span buffer) |\n+|\t{ return load_torrent_buffer(buffer, load_torrent_limits{}); } |\n+|\tadd_torrent_params load_torrent_parsed(bdecode_node const& torrent_file) |\n+|\t{ return load_torrent_parsed(torrent_file, load_torrent_limits{}); } |\n+| |\n+|add_torrent_params load_torrent_file(std::string const& filename, load_torrent_limits const& cfg) |\n+|{ |\n+|\t\tadd_torrent_params ret; |\n+|\t\tret.ti = std::make_shared(filename, cfg); |\n+|\t\tupdate_atp(ret); |\n+|\t\treturn ret; |\n+|\t} |\n+| |\n+|\tadd_torrent_params load_torrent_buffer(span buffer, load_torrent_limits const& cfg) |\n+|\t{ |\n+|\t\tadd_torrent_params ret; |\n+|\t\tret.ti = std::make_shared(buffer, cfg, from_span); |\n+|\t\tupdate_atp(ret); |\n+|\t\treturn ret; |\n+|\t} |\n+| |\n+|\tadd_torrent_params load_torrent_parsed(bdecode_node const& torrent_file, load_torrent_limits const& cfg) |\n+|\t{ |\n+|\t\tadd_torrent_params ret; |\n+|\t\tret.ti = std::make_shared(torrent_file, cfg); |\n+|\t\tupdate_atp(ret); |\n+|\t\treturn ret; |\n+|\t} |\n+| |\n+|_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bm_\be_\br_\bk_\bl_\be_\b__\bt_\br_\be_\be_\b._\bc_\bp_\bp_\b:_\b1_\b1_\b0_\b _\b _\b _\b _\b|_\bi_\bn_\b _\bC_\b+_\b+_\b2_\b0_\b,_\b _\bu_\bs_\be_\b _\bs_\bt_\bd_\b:_\b:_\bi_\bd_\be_\bn_\bt_\bi_\bt_\by_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |*\b**\b**\b**\b**\b* i\bin\bn C\bC+\b++\b+2\b20\b0,\b, u\bus\bse\be s\bst\btd\bd:\b::\b:i\bid\bde\ben\bnt\bti\bit\bty\by *\b**\b**\b**\b**\b* |\n |*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/m\bme\ber\brk\bkl\ble\be_\b_t\btr\bre\bee\be.\b.c\bcp\bpp\bp:\b:1\b11\b10\b0 *\b**\b**\b* |\n |allocate_full(); |\n | |\n |\t\tmerkle_validate_copy(t, m_tree, root(), m_block_verified); |\n | |\n@@ -6426,235 +7584,614 @@\n | |\n |\tint merkle_tree::block_layer_start() const |\n |\t{ |\n |\t\tint const num_leafs = merkle_num_leafs(m_num_blocks); |\n |\t\tTORRENT_ASSERT(num_leafs > 0); |\n |\t\treturn merkle_first_leaf(num_leafs); |\n |_\b\t_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bu_\bt_\bi_\bl_\bs_\b._\bc_\bp_\bp_\b:_\b2_\b3_\b0 |ideally, if we end up copying files because of a move across volumes, the source should not be deleted until they've all been |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bc_\bo_\bp_\bi_\be_\bd_\b._\b _\bT_\bh_\ba_\bt_\b _\bw_\bo_\bu_\bl_\bd_\b _\bl_\be_\bt_\b _\bu_\bs_\b _\br_\bo_\bl_\bl_\bb_\ba_\bc_\bk_\b _\bw_\bi_\bt_\bh_\b _\bh_\bi_\bg_\bh_\be_\br_\b _\bc_\bo_\bn_\bf_\bi_\bd_\be_\bn_\bc_\be_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* i\bid\bde\bea\bal\bll\bly\by,\b, i\bif\bf w\bwe\be e\ben\bnd\bd u\bup\bp c\bco\bop\bpy\byi\bin\bng\bg f\bfi\bil\ble\bes\bs b\bbe\bec\bca\bau\bus\bse\be o\bof\bf a\ba m\bmo\bov\bve\be a\bac\bcr\bro\bos\bss\bs v\bvo\bol\blu\bum\bme\bes\bs,\b, t\bth\bhe\be s\bso\bou\bur\brc\bce\be s\bsh\bho\bou\bul\bld\bd n\bno\bot\bt b\bbe\be d\bde\bel\ble\bet\bte\bed\bd u\bun\bnt\bti\bil\bl t\bth\bhe\bey\by'\b'v\bve\be a\bal\bll\bl b\bbe\bee\ben\bn c\bco\bop\bpi\bie\bed\bd.\b. T\bTh\bha\bat\bt w\bwo\bou\bul\bld\bd l\ble\bet\bt u\bus\bs r\bro\bol\bll\blb\bba\bac\bck\bk w\bwi\bit\bth\bh |\n-|h\bhi\big\bgh\bhe\ber\br c\bco\bon\bnf\bfi\bid\bde\ben\bnc\bce\be.\b. *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/s\bst\bto\bor\bra\bag\bge\be_\b_u\but\bti\bil\bls\bs.\b.c\bcp\bpp\bp:\b:2\b23\b30\b0 *\b**\b**\b* |\n-|// later |\n-|\t\taux::vector copied_files(std::size_t(f.num_files()), false); |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bc_\bh_\bo_\bk_\be_\br_\b._\bc_\bp_\bp_\b:_\b2_\b5_\b8_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bm_\ba_\bk_\be_\b _\bc_\bo_\bn_\bf_\bi_\bg_\bu_\br_\ba_\bb_\bl_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* m\bma\bak\bke\be c\bco\bon\bnf\bfi\big\bgu\bur\bra\bab\bbl\ble\be *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/c\bch\bho\bok\bke\ber\br.\b.c\bcp\bpp\bp:\b:2\b25\b58\b8 *\b**\b**\b* |\n+|// first reset the number of unchoke slots, because we'll calculate |\n+|\t\t\t// it purely based on the current state of our peers. |\n+|\t\t\tupload_slots = 0; |\n | |\n-|\t\t// track how far we got in case of an error |\n-|\t\tfile_index_t file_index{}; |\n-|\t\tfor (auto const i : f.file_range()) |\n-|\t\t{ |\n-|\t\t\t// files moved out to absolute paths are not moved |\n-|\t\t\tif (f.file_absolute_path(i)) continue; |\n+|\t\t\tint rate_threshold = sett.get_int(settings_pack::rate_choker_initial_threshold); |\n | |\n-|\t\t\tstd::string const old_path = combine_path(save_path, f.file_path(i)); |\n-|\t\t\tstd::string const new_path = combine_path(new_save_path, f.file_path(i)); |\n+|\t\t\tstd::sort(peers.begin(), peers.end() |\n+|\t\t\t\t, [](peer_connection const* lhs, peer_connection const* rhs) |\n+|\t\t\t\t{ return upload_rate_compare(lhs, rhs); }); |\n | |\n-|\t\t\terror_code ignore; |\n-|\t\t\tif (flags == move_flags_t::dont_replace && exists(new_path, ignore)) |\n+|\t\t\tfor (auto const* p : peers) |\n |\t\t\t{ |\n-|\t\t\t\tif (ret == status_t::no_error) ret = status_t::need_full_check; |\n-|\t\t\t\tcontinue; |\n+|\t\t\t\tint const rate = int(p->uploaded_in_last_round() |\n+|\t\t\t\t\t* 1000 / total_milliseconds(unchoke_interval)); |\n+| |\n+|\t\t\t\t// always have at least 1 unchoke slot |\n+|\t\t\t\tif (rate < rate_threshold) break; |\n+| |\n+|\t\t\t\t++upload_slots; |\n+| |\n+|rate_threshold += 2048; |\n+|} |\n+|\t\t\t++upload_slots; |\n+|\t\t} |\n+| |\n+|\t\t// sorts the peers that are eligible for unchoke by download rate and |\n+|\t\t// secondary by total upload. The reason for this is, if all torrents are |\n+|\t\t// being seeded, the download rate will be 0, and the peers we have sent |\n+|\t\t// the least to should be unchoked |\n+| |\n+|\t\t// we use partial sort here, because we only care about the top |\n+|\t\t// upload_slots peers. |\n+| |\n+|\t\tint const slots = std::min(upload_slots, int(peers.size())); |\n+| |\n+|\t\tif (sett.get_int(settings_pack::seed_choking_algorithm) |\n+|\t\t\t== settings_pack::round_robin) |\n+|\t\t{ |\n+|\t\t\tint const pieces = sett.get_int(settings_pack::seeding_piece_quota); |\n+| |\n+|\t\t\tstd::nth_element(peers.begin(), peers.begin() |\n+|\t\t\t\t+ slots, peers.end() |\n+|\t\t\t\t, [pieces](peer_connection const* lhs, peer_connection const* rhs) |\n+|\t\t\t\t{ return unchoke_compare_rr(lhs, rhs, pieces); }); |\n+|\t\t} |\n+|\t\telse if (sett.get_int(settings_pack::seed_choking_algorithm) |\n+|\t\t\t== settings_pack::fastest_upload) |\n+|\t\t{ |\n+|\t\t\tstd::nth_element(peers.begin(), peers.begin() |\n+|\t\t\t\t+ slots, peers.end() |\n+|_\b\t_\b\t_\b\t_\b\t_\b,_\b _\b[_\b]_\b(_\bp_\be_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b _\bc_\bo_\bn_\bs_\bt_\b*_\b _\bl_\bh_\bs_\b,_\b _\bp_\be_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b _\bc_\bo_\bn_\bs_\bt_\b*_\b _\br_\bh_\bs_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bp_\bi_\be_\bc_\be_\b__\bp_\bi_\bc_\bk_\be_\br_\b._\bc_\bp_\bp_\b:_\b1_\b2_\b1_\b _\b _\b _\b|_\bf_\bi_\bn_\bd_\b _\ba_\b _\bb_\be_\bt_\bt_\be_\br_\b _\bp_\bl_\ba_\bc_\be_\b _\bf_\bo_\br_\b _\bt_\bh_\bi_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* f\bfi\bin\bnd\bd a\ba b\bbe\bet\btt\bte\ber\br p\bpl\bla\bac\bce\be f\bfo\bor\br t\bth\bhi\bis\bs *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/p\bpi\bie\bec\bce\be_\b_p\bpi\bic\bck\bke\ber\br.\b.c\bcp\bpp\bp:\b:1\b12\b21\b1 *\b**\b**\b* |\n+|if (limit == 0) |\n+|\t\t\t{ |\n+|\t\t\t\tstd::cerr << \" ...\"; |\n+|\t\t\t\tbreak; |\n+|\t\t\t} |\n+|\t\t\tif (*i == -1) break; |\n+|\t\t\twhile (j != p.m_priority_boundaries.end() && *j <= index) |\n+|\t\t\t{ |\n+|\t\t\t\tstd::cerr << \"| \"; |\n+|\t\t\t\t++j; |\n |\t\t\t} |\n+|\t\t\tstd::cerr << *i << \"(\" << p.m_piece_map[*i].index << \") \"; |\n+|\t\t\t--limit; |\n+|\t\t} |\n+|\t\tstd::cerr << std::endl; |\n+|\t} |\n+|} |\n+|#endif // TORRENT_PICKER_LOG |\n+|namespace libtorrent { |\n | |\n-|move_file(old_path, new_path, ec); |\n+|const piece_block piece_block::invalid( |\n+|std::numeric_limits::max() |\n+|\t\t, std::numeric_limits::max()); |\n | |\n-|\t\t\t// if the source file doesn't exist. That's not a problem |\n-|\t\t\t// we just ignore that file |\n-|\t\t\tif (ec.ec == boost::system::errc::no_such_file_or_directory) |\n-|\t\t\t\tec.ec.clear(); |\n-|\t\t\telse if (ec |\n-|\t\t\t\t&& ec.ec != boost::system::errc::invalid_argument |\n-|\t\t\t\t&& ec.ec != boost::system::errc::permission_denied) |\n+|\tconstexpr prio_index_t piece_picker::piece_pos::we_have_index; |\n+| |\n+|\tconstexpr picker_options_t piece_picker::rarest_first; |\n+|\tconstexpr picker_options_t piece_picker::reverse; |\n+|\tconstexpr picker_options_t piece_picker::on_parole; |\n+|\tconstexpr picker_options_t piece_picker::prioritize_partials; |\n+|\tconstexpr picker_options_t piece_picker::sequential; |\n+|\tconstexpr picker_options_t piece_picker::align_expanded_pieces; |\n+|\tconstexpr picker_options_t piece_picker::piece_extent_affinity; |\n+| |\n+|\tconstexpr download_queue_t piece_picker::piece_pos::piece_downloading; |\n+|\tconstexpr download_queue_t piece_picker::piece_pos::piece_full; |\n+|\tconstexpr download_queue_t piece_picker::piece_pos::piece_finished; |\n+|\tconstexpr download_queue_t piece_picker::piece_pos::piece_zero_prio; |\n+|\tconstexpr download_queue_t piece_picker::piece_pos::num_download_categories; |\n+|\tconstexpr download_queue_t piece_picker::piece_pos::piece_open; |\n+|\tconstexpr download_queue_t piece_picker::piece_pos::piece_downloading_reverse; |\n+|\tconstexpr download_queue_t piece_picker::piece_pos::piece_full_reverse; |\n+| |\n+|\t// the max number of blocks to create an affinity for |\n+|\tconstexpr int max_piece_affinity_extent = 4 * 1024 * 1024 / default_block_size; |\n+| |\n+|\tpiece_picker::piece_picker(std::int64_t const total_size, int const piece_size) |\n+|\t\t: m_priority_boundaries(1, m_pieces.end_index()) |\n+|\t{ |\n+|\t\tTORRENT_ASSERT(total_size > 0); |\n+|_\b\t_\b\t_\bT_\bO_\bR_\bR_\bE_\bN_\bT_\b__\bA_\bS_\bS_\bE_\bR_\bT_\b(_\bp_\bi_\be_\bc_\be_\b__\bs_\bi_\bz_\be_\b _\b>_\b _\b0_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+| | |this could probably be optimized by incrementally calling partial_sort to sort one more element in the list. Because chances are |\n+|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\bp_\bi_\be_\bc_\be_\b__\bp_\bi_\bc_\bk_\be_\br_\b._\bc_\bp_\bp_\b:_\b2_\b0_\b6_\b7 |that we'll just need a single piece, and once we've picked from it we're done. Sorting the rest of the list in that case is a waste |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bo_\bf_\b _\bt_\bi_\bm_\be_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs c\bco\bou\bul\bld\bd p\bpr\bro\bob\bba\bab\bbl\bly\by b\bbe\be o\bop\bpt\bti\bim\bmi\biz\bze\bed\bd b\bby\by i\bin\bnc\bcr\bre\bem\bme\ben\bnt\bta\bal\bll\bly\by c\bca\bal\bll\bli\bin\bng\bg p\bpa\bar\brt\bti\bia\bal\bl_\b_s\bso\bor\brt\bt t\bto\bo s\bso\bor\brt\bt o\bon\bne\be m\bmo\bor\bre\be e\bel\ble\bem\bme\ben\bnt\bt i\bin\bn t\bth\bhe\be l\bli\bis\bst\bt.\b. B\bBe\bec\bca\bau\bus\bse\be c\bch\bha\ban\bnc\bce\bes\bs a\bar\bre\be t\bth\bha\bat\bt w\bwe\be'\b'l\bll\bl j\bju\bus\bst\bt n\bne\bee\bed\bd a\ba s\bsi\bin\bng\bgl\ble\be p\bpi\bie\bec\bce\be,\b, a\ban\bnd\bd|\n+|o\bon\bnc\bce\be w\bwe\be'\b'v\bve\be p\bpi\bic\bck\bke\bed\bd f\bfr\bro\bom\bm i\bit\bt w\bwe\be'\b'r\bre\be d\bdo\bon\bne\be.\b. S\bSo\bor\brt\bti\bin\bng\bg t\bth\bhe\be r\bre\bes\bst\bt o\bof\bf t\bth\bhe\be l\bli\bis\bst\bt i\bin\bn t\bth\bha\bat\bt c\bca\bas\bse\be i\bis\bs a\ba w\bwa\bas\bst\bte\be o\bof\bf t\bti\bim\bme\be.\b. *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/p\bpi\bie\bec\bce\be_\b_p\bpi\bic\bck\bke\ber\br.\b.c\bcp\bpp\bp:\b:2\b20\b06\b67\b7 *\b**\b**\b* |\n+|// now, copy over the pointers. We also apply a filter here to not |\n+|\t\t\t// include ineligible pieces in certain modes. For instance, a piece |\n+|\t\t\t// that the current peer doesn't have is not included. |\n+|\t\t\tfor (auto& dp : m_downloads[piece_pos::piece_downloading]) |\n |\t\t\t{ |\n-|\t\t\t\t// moving the file failed |\n-|\t\t\t\t// on OSX, the error when trying to rename a file across different |\n-|\t\t\t\t// volumes is EXDEV, which will make it fall back to copying. |\n-|\t\t\t\tec.ec.clear(); |\n-|\t\t\t\tcopy_file(old_path, new_path, ec); |\n-|\t\t\t\tif (!ec) copied_files[i] = true; |\n+|\t\t\t\tpc.inc_stats_counter(counters::piece_picker_partial_loops); |\n+| |\n+|\t\t\t\tif (!is_piece_free(dp.index, pieces)) continue; |\n+| |\n+|\t\t\t\tTORRENT_ASSERT(m_piece_map[dp.index].download_queue() |\n+|\t\t\t\t\t== piece_pos::piece_downloading); |\n+| |\n+|\t\t\t\tordered_partials[num_ordered_partials++] = &dp; |\n |\t\t\t} |\n | |\n-|\t\t\tif (ec) |\n+|\t\t\t// now, sort the list. |\n+|\t\t\tif (options & rarest_first) |\n |\t\t\t{ |\n-|\t\t\t\tec.file(i); |\n-|\t\t\t\tfile_index = i; |\n-|\t\t\t\tbreak; |\n+|\t\t\t\tret |= picker_log_alert::rarest_first_partials; |\n+| |\n+|std::sort(ordered_partials.begin(), ordered_partials.begin() + num_ordered_partials |\n+|, std::bind(&piece_picker::partial_compare_rarest_first, this |\n+|\t\t\t\t\t\t, _1, _2)); |\n+|\t\t\t} |\n+| |\n+|\t\t\tfor (int i = 0; i < num_ordered_partials; ++i) |\n+|\t\t\t{ |\n+|\t\t\t\tret |= picker_log_alert::prioritize_partials; |\n+| |\n+|\t\t\t\tnum_blocks = add_blocks_downloading(*ordered_partials[i], pieces |\n+|\t\t\t\t\t, interesting_blocks, backup_blocks, backup_blocks2 |\n+|\t\t\t\t\t, num_blocks, prefer_contiguous_blocks, peer, options); |\n+|\t\t\t\tif (num_blocks <= 0) return ret; |\n+|\t\t\t\tif (int(backup_blocks.size()) >= num_blocks |\n+|\t\t\t\t\t&& int(backup_blocks2.size()) >= num_blocks) |\n+|\t\t\t\t\tbreak; |\n |\t\t\t} |\n+| |\n+|\t\t\tnum_blocks = append_blocks(interesting_blocks, backup_blocks |\n+|\t\t\t\t, num_blocks); |\n+|\t\t\tif (num_blocks <= 0) return ret; |\n+| |\n+|\t\t\tnum_blocks = append_blocks(interesting_blocks, backup_blocks2 |\n+|\t\t\t\t, num_blocks); |\n+|\t\t\tif (num_blocks <= 0) return ret; |\n |\t\t} |\n | |\n-|\t\tif (!ec && move_partfile) |\n+|\t\tif (!suggested_pieces.empty()) |\n |\t\t{ |\n-|\t\t\terror_code e; |\n-|\t\t\tmove_partfile(new_save_path, e); |\n-|_\b\t_\b\t_\b\t_\bi_\bf_\b _\b(_\be_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bu_\bt_\bi_\bl_\bs_\b._\bc_\bp_\bp_\b:_\b5_\b3_\b8 |it would seem reasonable to, instead, set the have_pieces bits for the pieces representing these files, and resume with the normal |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bl_\bo_\bg_\bi_\bc_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* i\bit\bt w\bwo\bou\bul\bld\bd s\bse\bee\bem\bm r\bre\bea\bas\bso\bon\bna\bab\bbl\ble\be t\bto\bo,\b, i\bin\bns\bst\bte\bea\bad\bd,\b, s\bse\bet\bt t\bth\bhe\be h\bha\bav\bve\be_\b_p\bpi\bie\bec\bce\bes\bs b\bbi\bit\bts\bs f\bfo\bor\br t\bth\bhe\be p\bpi\bie\bec\bce\bes\bs r\bre\bep\bpr\bre\bes\bse\ben\bnt\bti\bin\bng\bg t\bth\bhe\bes\bse\be f\bfi\bil\ble\bes\bs,\b, a\ban\bnd\bd r\bre\bes\bsu\bum\bme\be w\bwi\bit\bth\bh t\bth\bhe\be n\bno\bor\brm\bma\bal\bl l\blo\bog\bgi\bic\bc *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/s\bst\bto\bor\bra\bag\bge\be_\b_u\but\bti\bil\bls\bs.\b.c\bcp\bpp\bp:\b:5\b53\b38\b8 *\b**\b**\b* |\n-|continue; |\n+|\t\t\tfor (piece_index_t i : suggested_pieces) |\n+|_\b\t_\b\t_\b\t_\b{_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bp_\bi_\be_\bc_\be_\b__\bp_\bi_\bc_\bk_\be_\br_\b._\bc_\bp_\bp_\b:_\b2_\b2_\b1_\b1_\b _\b _\b|_\bI_\bs_\b _\bi_\bt_\b _\ba_\b _\bg_\bo_\bo_\bd_\b _\bi_\bd_\be_\ba_\b _\bt_\bh_\ba_\bt_\b _\bt_\bh_\bi_\bs_\b _\ba_\bf_\bf_\bi_\bn_\bi_\bt_\by_\b _\bt_\ba_\bk_\be_\bs_\b _\bp_\br_\be_\bc_\be_\bd_\be_\bn_\bc_\be_\b _\bo_\bv_\be_\br_\b _\bp_\bi_\be_\bc_\be_\b _\bp_\br_\bi_\bo_\br_\bi_\bt_\by_\b?_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* I\bIs\bs i\bit\bt a\ba g\bgo\boo\bod\bd i\bid\bde\bea\ba t\bth\bha\bat\bt t\bth\bhi\bis\bs a\baf\bff\bfi\bin\bni\bit\bty\by t\bta\bak\bke\bes\bs p\bpr\bre\bec\bce\bed\bde\ben\bnc\bce\be o\bov\bve\ber\br p\bpi\bie\bec\bce\be p\bpr\bri\bio\bor\bri\bit\bty\by?\b? *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/p\bpi\bie\bec\bce\be_\b_p\bpi\bic\bck\bke\ber\br.\b.c\bcp\bpp\bp:\b:2\b22\b21\b11\b1 *\b**\b**\b* |\n+|prio_index_t const end = priority_end(i); |\n+|\t\t\t\t\tfor (prio_index_t p = prev(end); p >= start; --p) |\n+|\t\t\t\t\t{ |\n+|\t\t\t\t\t\tpc.inc_stats_counter(counters::piece_picker_reverse_rare_loops); |\n | |\n-|\t\t\t\tstd::int64_t const size = get_filesize(stat, file_index, fs |\n-|\t\t\t\t\t, save_path, ec); |\n-|\t\t\t\tif (size < 0) return false; |\n+|\t\t\t\t\t\tif (!is_piece_free(m_pieces[p], pieces)) continue; |\n | |\n-|\t\t\t\tif (size < fs.file_size(file_index)) |\n-|\t\t\t\t{ |\n-|\t\t\t\t\tec.ec = errors::mismatching_file_size; |\n-|\t\t\t\t\tec.file(file_index); |\n-|\t\t\t\t\tec.operation = operation_t::check_resume; |\n-|\t\t\t\t\treturn false; |\n+|\t\t\t\t\t\tret |= picker_log_alert::reverse_rarest_first; |\n+| |\n+|\t\t\t\t\t\tnum_blocks = add_blocks(m_pieces[p], pieces |\n+|\t\t\t\t\t\t\t, interesting_blocks, backup_blocks |\n+|\t\t\t\t\t\t\t, backup_blocks2, num_blocks |\n+|\t\t\t\t\t\t\t, prefer_contiguous_blocks, peer, ignored_pieces |\n+|\t\t\t\t\t\t\t, options); |\n+|\t\t\t\t\t\tif (num_blocks <= 0) return ret; |\n+|\t\t\t\t\t} |\n |\t\t\t\t} |\n |\t\t\t} |\n-|\t\t\treturn true; |\n-|\t\t} |\n+|\t\t\telse |\n+|\t\t\t{ |\n+|if (options & piece_extent_affinity) |\n+|{ |\n+|\t\t\t\t\tint to_erase = -1; |\n+|\t\t\t\t\tint idx = -1; |\n+|\t\t\t\t\tfor (piece_extent_t const e : m_recent_extents) |\n+|\t\t\t\t\t{ |\n+|\t\t\t\t\t\t++idx; |\n+|\t\t\t\t\t\tbool have_all = true; |\n+|\t\t\t\t\t\tfor (piece_index_t const p : extent_for(e)) |\n+|\t\t\t\t\t\t{ |\n+|\t\t\t\t\t\t\tif (!m_piece_map[p].have()) have_all = false; |\n+|\t\t\t\t\t\t\tif (!is_piece_free(p, pieces)) continue; |\n | |\n-|#ifndef TORRENT_DISABLE_MUTABLE_TORRENTS |\n-|\t\t// always trigger a full recheck when we pull in files from other |\n-|\t\t// torrents, via hard links |\n-|if (added_files) return false; |\n+|\t\t\t\t\t\t\tret |= picker_log_alert::extent_affinity; |\n+| |\n+|\t\t\t\t\t\t\tnum_blocks = add_blocks(p, pieces |\n+|\t\t\t\t\t\t\t\t, interesting_blocks, backup_blocks |\n+|\t\t\t\t\t\t\t\t, backup_blocks2, num_blocks |\n+|\t\t\t\t\t\t\t\t, prefer_contiguous_blocks, peer, ignored_pieces |\n+|\t\t\t\t\t\t\t\t, options); |\n+|\t\t\t\t\t\t\tif (num_blocks <= 0) |\n+|\t\t\t\t\t\t\t{ |\n+|\t\t\t\t\t\t\t\t// if we have all pieces belonging to this extent, remove it |\n+|\t\t\t\t\t\t\t\tif (to_erase != -1) m_recent_extents.erase(m_recent_extents.begin() + to_erase); |\n+|\t\t\t\t\t\t\t\treturn ret; |\n+|\t\t\t\t\t\t\t} |\n+|\t\t\t\t\t\t} |\n+|\t\t\t\t\t\t// if we have all pieces belonging to this extent, remove it |\n+|\t\t\t\t\t\tif (have_all) to_erase = idx; |\n+|\t\t\t\t\t} |\n+|_\b\t_\b\t_\b\t_\b\t_\b\t_\bi_\bf_\b _\b(_\bt_\bo_\b__\be_\br_\ba_\bs_\be_\b _\b!_\b=_\b _\b-_\b1_\b)_\b _\bm_\b__\br_\be_\bc_\be_\bn_\bt_\b__\be_\bx_\bt_\be_\bn_\bt_\bs_\b._\be_\br_\ba_\bs_\be_\b(_\bm_\b__\br_\be_\bc_\be_\bn_\bt_\b__\be_\bx_\bt_\be_\bn_\bt_\bs_\b._\bb_\be_\bg_\bi_\bn_\b(_\b)_\b _\b+_\b _\bt_\bo_\b__\be_\br_\ba_\bs_\be_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bp_\bi_\be_\bc_\be_\b__\bp_\bi_\bc_\bk_\be_\br_\b._\bc_\bp_\bp_\b:_\b2_\b5_\b6_\b6_\b _\b _\b|_\bw_\bh_\be_\bn_\b _\be_\bx_\bp_\ba_\bn_\bd_\bi_\bn_\bg_\b _\bp_\bi_\be_\bc_\be_\bs_\b _\bf_\bo_\br_\b _\bc_\ba_\bc_\bh_\be_\b _\bs_\bt_\br_\bi_\bp_\be_\b _\br_\be_\ba_\bs_\bo_\bn_\bs_\b,_\b _\bt_\bh_\be_\b _\b!_\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\bi_\bn_\bg_\b _\bc_\bo_\bn_\bd_\bi_\bt_\bi_\bo_\bn_\b _\bd_\bo_\be_\bs_\bn_\b'_\bt_\b _\bm_\ba_\bk_\be_\b _\bm_\bu_\bc_\bh_\b _\bs_\be_\bn_\bs_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* w\bwh\bhe\ben\bn e\bex\bxp\bpa\ban\bnd\bdi\bin\bng\bg p\bpi\bie\bec\bce\bes\bs f\bfo\bor\br c\bca\bac\bch\bhe\be s\bst\btr\bri\bip\bpe\be r\bre\bea\bas\bso\bon\bns\bs,\b, t\bth\bhe\be !\b!d\bdo\bow\bwn\bnl\blo\boa\bad\bdi\bin\bng\bg c\bco\bon\bnd\bdi\bit\bti\bio\bon\bn d\bdo\boe\bes\bsn\bn'\b't\bt m\bma\bak\bke\be m\bmu\buc\bch\bh s\bse\ben\bns\bse\be *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/p\bpi\bie\bec\bce\be_\b_p\bpi\bic\bck\bke\ber\br.\b.c\bcp\bpp\bp:\b:2\b25\b56\b66\b6 *\b**\b**\b* |\n+|TORRENT_ASSERT(index < m_piece_map.end_index()); |\n+|\t\tif (next(index) == m_piece_map.end_index()) |\n+|\t\t\treturn m_blocks_in_last_piece; |\n+|\t\telse |\n+|\t\t\treturn blocks_per_piece(); |\n+|\t} |\n+| |\n+|\tbool piece_picker::is_piece_free(piece_index_t const piece |\n+|\t\t, typed_bitfield const& bitmask) const |\n+|\t{ |\n+|\t\treturn bitmask[piece] |\n+|\t\t\t&& !m_piece_map[piece].have() |\n+|\t\t\t&& !m_piece_map[piece].filtered(); |\n+|\t} |\n+| |\n+|\tbool piece_picker::can_pick(piece_index_t const piece |\n+|\t\t, typed_bitfield const& bitmask) const |\n+|\t{ |\n+|\t\treturn bitmask[piece] |\n+|\t\t\t&& !m_piece_map[piece].have() |\n+|&& !m_piece_map[piece].downloading() |\n+|&& !m_piece_map[piece].filtered(); |\n+|\t} |\n+| |\n+|#if TORRENT_USE_INVARIANT_CHECKS |\n+|\tvoid piece_picker::check_peers() |\n+|\t{ |\n+|\t\tfor (auto const& b : m_block_info) |\n+|\t\t{ |\n+|\t\t\tTORRENT_ASSERT(b.peer == nullptr || static_cast(b.peer)->in_use); |\n+|\t\t} |\n+|\t} |\n |#endif |\n | |\n-|\t\t// parse have bitmask. Verify that the files we expect to have |\n-|\t\t// actually do exist |\n-|\t\tpiece_index_t const end_piece = std::min(rd.have_pieces.end_index(), fs.end_piece()); |\n-|\t\tfor (piece_index_t i(0); i < end_piece; ++i) |\n+|\tvoid piece_picker::clear_peer(torrent_peer* peer) |\n+|\t{ |\n+|\t\tfor (auto& b : m_block_info) |\n |\t\t{ |\n-|\t\t\tif (rd.have_pieces.get_bit(i) == false) continue; |\n+|\t\t\tif (b.peer == peer) b.peer = nullptr; |\n+|\t\t} |\n+|\t} |\n | |\n-|\t\t\tstd::vector f = fs.map_block(i, 0, 1); |\n-|\t\t\tTORRENT_ASSERT(!f.empty()); |\n+|\t// the first bool is true if this is the only peer that has requested and downloaded |\n+|\t// blocks from this piece. |\n+|\t// the second bool is true if this is the only active peer that is requesting |\n+|_\b\t_\b/_\b/_\b _\ba_\bn_\bd_\b _\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\bi_\bn_\bg_\b _\bb_\bl_\bo_\bc_\bk_\bs_\b _\bf_\br_\bo_\bm_\b _\bt_\bh_\bi_\bs_\b _\bp_\bi_\be_\bc_\be_\b._\b _\bA_\bc_\bt_\bi_\bv_\be_\b _\bm_\be_\ba_\bn_\bs_\b _\bh_\ba_\bv_\bi_\bn_\bg_\b _\ba_\b _\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bp_\bi_\be_\bc_\be_\b__\bp_\bi_\bc_\bk_\be_\br_\b._\bc_\bp_\bp_\b:_\b3_\b1_\b4_\b4_\b _\b _\b|_\bs_\bh_\bo_\bu_\bl_\bd_\b _\b5_\b _\bb_\be_\b _\bc_\bo_\bn_\bf_\bi_\bg_\bu_\br_\ba_\bb_\bl_\be_\b?_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* s\bsh\bho\bou\bul\bld\bd 5\b5 b\bbe\be c\bco\bon\bnf\bfi\big\bgu\bur\bra\bab\bbl\ble\be?\b? *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/p\bpi\bie\bec\bce\be_\b_p\bpi\bic\bck\bke\ber\br.\b.c\bcp\bpp\bp:\b:3\b31\b14\b44\b4 *\b**\b**\b* |\n+|bool have_all = true; |\n | |\n-|\t\t\tfile_index_t const file_index = f[0].file_index; |\n+|\t\tfor (auto const piece : extent_for(this_extent)) |\n+|\t\t{ |\n+|\t\t\tif (piece == p) continue; |\n | |\n-|\t\t\t// files with priority zero may not have been saved to disk at their |\n-|\t\t\t// expected location, but is likely to be in a partfile. Just exempt it |\n-|\t\t\t// from checking |\n-|\t\t\tif (file_index < file_priority.end_index() |\n-|\t\t\t\t&& file_priority[file_index] == dont_download) |\n-|\t\t\t\tcontinue; |\n+|\t\t\tif (!m_piece_map[piece].have()) have_all = false; |\n | |\n-|\t\t\tif (fs.pad_file_at(file_index)) continue; |\n+|\t\t\t// if at least one piece in this extent has a different priority than |\n+|\t\t\t// the one we just started downloading, don't create an affinity for |\n+|\t\t\t// adjacent pieces. This probably means the pieces belong to different |\n+|\t\t\t// files, or that some other mechanism determining the priority should |\n+|\t\t\t// take precedence. |\n+|\t\t\tif (piece_priority(piece) != this_prio) return; |\n+|\t\t} |\n | |\n-|\t\t\tif (get_filesize(stat, file_index, fs, save_path, ec) < 0) |\n-|\t\t\t\treturn false; |\n+|\t\t// if we already have all the *other* pieces in this extent, there's no |\n+|\t\t// need to inflate their priorities |\n+|\t\tif (have_all) return; |\n | |\n-|\t\t\t// OK, this file existed, good. Now, skip all remaining pieces in |\n-|\t\t\t// this file. We're just sanity-checking whether the files exist |\n-|\t\t\t// or not. |\n-|_\b\t_\b\t_\b\t_\bp_\be_\be_\br_\b__\br_\be_\bq_\bu_\be_\bs_\bt_\b _\bc_\bo_\bn_\bs_\bt_\b _\bp_\br_\b _\b=_\b _\bf_\bs_\b._\bm_\ba_\bp_\b__\bf_\bi_\bl_\be_\b(_\bf_\bi_\bl_\be_\b__\bi_\bn_\bd_\be_\bx_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\bp_\ba_\br_\bt_\b__\bf_\bi_\bl_\be_\b._\bc_\bp_\bp_\b:_\b3_\b0_\b0 |what do we do if someone is currently reading from the disk from this piece? does it matter? Since we won't actively erase the data |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bf_\br_\bo_\bm_\b _\bd_\bi_\bs_\bk_\b,_\b _\bb_\bu_\bt_\b _\bi_\bt_\b _\bm_\ba_\by_\b _\bb_\be_\b _\bo_\bv_\be_\br_\bw_\br_\bi_\bt_\bt_\be_\bn_\b _\bs_\bo_\bo_\bn_\b,_\b _\bi_\bt_\b'_\bs_\b _\bp_\br_\bo_\bb_\ba_\bb_\bl_\by_\b _\bn_\bo_\bt_\b _\bt_\bh_\ba_\bt_\b _\bb_\bi_\bg_\b _\bo_\bf_\b _\ba_\b _\bd_\be_\ba_\bl_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* w\bwh\bha\bat\bt d\bdo\bo w\bwe\be d\bdo\bo i\bif\bf s\bso\bom\bme\beo\bon\bne\be i\bis\bs c\bcu\bur\brr\bre\ben\bnt\btl\bly\by r\bre\bea\bad\bdi\bin\bng\bg f\bfr\bro\bom\bm t\bth\bhe\be d\bdi\bis\bsk\bk f\bfr\bro\bom\bm t\bth\bhi\bis\bs p\bpi\bie\bec\bce\be?\b? d\bdo\boe\bes\bs i\bit\bt m\bma\bat\btt\bte\ber\br?\b? S\bSi\bin\bnc\bce\be w\bwe\be w\bwo\bon\bn'\b't\bt a\bac\bct\bti\biv\bve\bel\bly\by e\ber\bra\bas\bse\be t\bth\bhe\be d\bda\bat\bta\ba f\bfr\bro\bom\bm d\bdi\bis\bsk\bk,\b, b\bbu\but\bt i\bit\bt m\bma\bay\by b\bbe\be o\bov\bve\ber\brw\bwr\bri\bit\btt\bte\ben\bn |\n-|s\bso\boo\bon\bn,\b, i\bit\bt'\b's\bs p\bpr\bro\bob\bba\bab\bbl\bly\by n\bno\bot\bt t\bth\bha\bat\bt b\bbi\big\bg o\bof\bf a\ba d\bde\bea\bal\bl *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/p\bpa\bar\brt\bt_\b_f\bfi\bil\ble\be.\b.c\bcp\bpp\bp:\b:3\b30\b00\b0 *\b**\b**\b* |\n-|create_directories(m_path, ec); |\n-|\t\t\t\tif (ec) return {}; |\n-|\t\t\t\treturn aux::file_handle(fn, 0, mode); |\n-|\t\t\t} |\n-|\t\t\treturn {}; |\n-|\t\t} |\n+|if (m_recent_extents.size() < 5) |\n+|m_recent_extents.push_back(this_extent); |\n+| |\n+|\t\t// limit the number of extent affinities active at any given time to limit |\n+|\t\t// the cost of checking them. Also, don't replace them, commit to |\n+|\t\t// finishing them before starting another extent. This is analogous to |\n+|\t\t// limiting the number of partial pieces. |\n |\t} |\n-|\tcatch (storage_error const& e) |\n+| |\n+|\t// options may be 0 or piece_picker::reverse |\n+|\t// returns false if the block could not be marked as downloading |\n+|\tbool piece_picker::mark_as_downloading(piece_block const block |\n+|\t\t, torrent_peer* peer, picker_options_t const options) |\n |\t{ |\n-|\t\tec = e.ec; |\n-|\t\treturn {}; |\n+|#ifdef TORRENT_PICKER_LOG |\n+|\t\tstd::cerr << \"[\" << this << \"] \" << \"mark_as_downloading( {\" |\n+|\t\t\t<< block.piece_index << \", \" << block.block_index << \"} )\" << std::endl; |\n+|#endif |\n+| |\n+|\t\tTORRENT_ASSERT(peer == nullptr || peer->in_use); |\n+|\t\tTORRENT_ASSERT(block.block_index != piece_block::invalid.block_index); |\n+|\t\tTORRENT_ASSERT(block.piece_index != piece_block::invalid.piece_index); |\n+|\t\tTORRENT_ASSERT(block.piece_index < m_piece_map.end_index()); |\n+|\t\tTORRENT_ASSERT(block.block_index < blocks_in_piece(block.piece_index)); |\n+|\t\tTORRENT_ASSERT(!m_piece_map[block.piece_index].have()); |\n+| |\n+|\t\tpiece_pos& p = m_piece_map[block.piece_index]; |\n+|\t\tif (p.download_queue() == piece_pos::piece_open) |\n+|\t\t{ |\n+|#ifdef TORRENT_EXPENSIVE_INVARIANT_CHECKS |\n+|_\b\t_\b\t_\b\t_\bI_\bN_\bV_\bA_\bR_\bI_\bA_\bN_\bT_\b__\bC_\bH_\bE_\bC_\bK_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b._\bc_\bp_\bp_\b:_\b5_\b4_\b0_\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bI_\bn_\b _\bC_\b+_\b+_\b1_\b7_\b._\b _\bu_\bs_\be_\b _\bi_\bf_\b _\bc_\bo_\bn_\bs_\bt_\be_\bx_\bp_\br_\b _\bi_\bn_\bs_\bt_\be_\ba_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* I\bIn\bn C\bC+\b++\b+1\b17\b7.\b. u\bus\bse\be i\bif\bf c\bco\bon\bns\bst\bte\bex\bxp\bpr\br i\bin\bns\bst\bte\bea\bad\bd *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/s\bse\bes\bss\bsi\bio\bon\bn.\b.c\bcp\bpp\bp:\b:5\b54\b40\b0 *\b**\b**\b* |\n+|{} |\n+|\tsession_proxy::session_proxy(session_proxy const&) = default; |\n+|\tsession_proxy& session_proxy::operator=(session_proxy const&) & = default; |\n+|\tsession_proxy::session_proxy(session_proxy&&) noexcept = default; |\n+|\tsession_proxy& session_proxy::operator=(session_proxy&&) & noexcept = default; |\n+|\tsession_proxy::~session_proxy() |\n+|\t{ |\n+|\t\tif (m_thread && m_thread.use_count() == 1) |\n+|\t\t{ |\n+|#if defined TORRENT_ASIO_DEBUGGING |\n+|\t\t\twait_for_asio_handlers(); |\n+|#endif |\n+|\t\t\tm_thread->join(); |\n+|\t\t} |\n |\t} |\n | |\n-|\tvoid part_file::free_piece(piece_index_t const piece) |\n+|\tTORRENT_EXPORT std::unique_ptr default_disk_io_constructor( |\n+|\t\tio_context& ios, settings_interface const& sett, counters& cnt) |\n |\t{ |\n-|\t\tstd::lock_guard l(m_mutex); |\n+|#if TORRENT_HAVE_MMAP || TORRENT_HAVE_MAP_VIEW_OF_FILE |\n+|#include \"libtorrent/aux_/disable_deprecation_warnings_push.hpp\" |\n+|if (sizeof(void*) == 8) |\n+|\t\t\treturn mmap_disk_io_constructor(ios, sett, cnt); |\n+|\t\telse |\n+|\t\t\treturn posix_disk_io_constructor(ios, sett, cnt); |\n+|#include \"libtorrent/aux_/disable_warnings_pop.hpp\" |\n+|#else |\n+|\t\treturn posix_disk_io_constructor(ios, sett, cnt); |\n+|#endif |\n+|\t} |\n | |\n-|\t\tauto const i = m_piece_map.find(piece); |\n-|\t\tif (i == m_piece_map.end()) return; |\n+|_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\be_\bn_\bu_\bm_\b__\bn_\be_\bt_\b._\bc_\bp_\bp_\b:_\b1_\b4_\b4_\b _\b _\b _\b _\b _\b _\b _\b|_\bi_\bn_\b _\bC_\b+_\b+_\b1_\b7_\b,_\b _\bu_\bs_\be_\b _\b__\b__\bh_\ba_\bs_\b__\bi_\bn_\bc_\bl_\bu_\bd_\be_\b _\bf_\bo_\br_\b _\bt_\bh_\bi_\bs_\b._\b _\bO_\bt_\bh_\be_\br_\b _\bo_\bp_\be_\br_\ba_\bt_\bi_\bn_\bg_\b _\bs_\by_\bs_\bt_\be_\bm_\bs_\b _\ba_\br_\be_\b _\bl_\bi_\bk_\be_\bl_\by_\b _\bt_\bo_\b _\br_\be_\bq_\bu_\bi_\br_\be_\b _\bt_\bh_\bi_\bs_\b _\ba_\bs_\b _\bw_\be_\bl_\bl_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* i\bin\bn C\bC+\b++\b+1\b17\b7,\b, u\bus\bse\be _\b__\b_h\bha\bas\bs_\b_i\bin\bnc\bcl\blu\bud\bde\be f\bfo\bor\br t\bth\bhi\bis\bs.\b. O\bOt\bth\bhe\ber\br o\bop\bpe\ber\bra\bat\bti\bin\bng\bg s\bsy\bys\bst\bte\bem\bms\bs a\bar\bre\be l\bli\bik\bke\bel\bly\by t\bto\bo r\bre\beq\bqu\bui\bir\bre\be t\bth\bhi\bis\bs a\bas\bs w\bwe\bel\bll\bl *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/e\ben\bnu\bum\bm_\b_n\bne\bet\bt.\b.c\bcp\bpp\bp:\b:1\b14\b44\b4 *\b**\b**\b* |\n+|#include |\n+|#include |\n+|#include |\n+|#include |\n+|#include |\n+| |\n+|#if defined TORRENT_ANDROID && !defined IFA_F_DADFAILED |\n+|#define IFA_F_DADFAILED 8 |\n+|#endif |\n | |\n+|#endif |\n | |\n-|m_free_slots.push_back(i->second); |\n-|\t\tm_piece_map.erase(i); |\n-|\t\tm_dirty_metadata = true; |\n+|#if TORRENT_USE_IFADDRS |\n+|#include |\n+|#include |\n+|#include |\n+|#endif |\n+| |\n+|#if TORRENT_USE_IFADDRS || TORRENT_USE_IFCONF || TORRENT_USE_NETLINK || TORRENT_USE_SYSCTL |\n+|#ifdef TORRENT_BEOS |\n+|#include |\n+|#endif |\n+|// capture this here where warnings are disabled (the macro generates warnings) |\n+|const unsigned long siocgifmtu = SIOCGIFMTU; |\n+|#endif |\n+| |\n+|#include \"libtorrent/aux_/disable_warnings_pop.hpp\" |\n+| |\n+|#if defined(TORRENT_OS2) && !defined(IF_NAMESIZE) |\n+|#define IF_NAMESIZE IFNAMSIZ |\n+|#endif |\n+| |\n+|namespace libtorrent { |\n+| |\n+|namespace { |\n+| |\n+|#if !defined TORRENT_WINDOWS && !defined TORRENT_BUILD_SIMULATOR |\n+|\tstruct socket_closer |\n+|\t{ |\n+|\t\tsocket_closer(int s) : m_socket(s) {} |\n+|\t\tsocket_closer(socket_closer const&) = delete; |\n+|\t\tsocket_closer(socket_closer &&) = delete; |\n+|\t\tsocket_closer& operator=(socket_closer const&) = delete; |\n+|\t\tsocket_closer& operator=(socket_closer &&) = delete; |\n+|\t\t~socket_closer() { ::close(m_socket); } |\n+|\tprivate: |\n+|\t\tint m_socket; |\n+|\t}; |\n+|#endif |\n+| |\n+|_\b#_\bi_\bf_\b _\b!_\bd_\be_\bf_\bi_\bn_\be_\bd_\b _\bT_\bO_\bR_\bR_\bE_\bN_\bT_\b__\bB_\bU_\bI_\bL_\bD_\b__\bS_\bI_\bM_\bU_\bL_\bA_\bT_\bO_\bR_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\be_\bn_\bu_\bm_\b__\bn_\be_\bt_\b._\bc_\bp_\bp_\b:_\b2_\b6_\b8_\b _\b _\b _\b _\b _\b _\b _\b|_\bi_\bf_\b _\bw_\be_\b _\bg_\be_\bt_\b _\bh_\be_\br_\be_\b,_\b _\bt_\bh_\be_\b _\bc_\ba_\bl_\bl_\be_\br_\b _\bs_\bt_\bi_\bl_\bl_\b _\ba_\bs_\bs_\bu_\bm_\be_\bs_\b _\bt_\bh_\be_\b _\be_\br_\br_\bo_\br_\b _\bc_\bo_\bd_\be_\b _\bi_\bs_\b _\br_\be_\bp_\bo_\br_\bt_\be_\bd_\b _\bv_\bi_\ba_\b _\be_\br_\br_\bn_\bo_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* i\bif\bf w\bwe\be g\bge\bet\bt h\bhe\ber\bre\be,\b, t\bth\bhe\be c\bca\bal\bll\ble\ber\br s\bst\bti\bil\bll\bl a\bas\bss\bsu\bum\bme\bes\bs t\bth\bhe\be e\ber\brr\bro\bor\br c\bco\bod\bde\be i\bis\bs r\bre\bep\bpo\bor\brt\bte\bed\bd v\bvi\bia\ba e\ber\brr\brn\bno\bo *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/e\ben\bnu\bum\bm_\b_n\bne\bet\bt.\b.c\bcp\bpp\bp:\b:2\b26\b68\b8 *\b**\b**\b* |\n+|; |\n |\t} |\n+|#endif |\n | |\n-|\tvoid part_file::move_partfile(std::string const& path, error_code& ec) |\n+|#if TORRENT_USE_NETLINK |\n+| |\n+|\tint read_nl_sock(int sock, std::uint32_t const seq, std::uint32_t const pid |\n+|\t\t, std::function on_msg) |\n |\t{ |\n-|\t\tstd::lock_guard l(m_mutex); |\n+|\t\tstd::array buf; |\n+|\t\tfor (;;) |\n+|\t\t{ |\n+|\t\t\tint const read_len = int(recv(sock, buf.data(), buf.size(), 0)); |\n+|\t\t\tif (read_len < 0) return -1; |\n | |\n-|\t\tflush_metadata_impl(ec); |\n-|\t\tif (ec) return; |\n+|\t\t\tauto const* nl_hdr = reinterpret_cast(buf.data()); |\n+|\t\t\tint len = read_len; |\n | |\n-|\t\tif (!m_piece_map.empty()) |\n+|\t\t\tfor (; len > 0 && aux::nlmsg_ok(nl_hdr, len); nl_hdr = aux::nlmsg_next(nl_hdr, len)) |\n+|\t\t\t{ |\n+|if ((aux::nlmsg_ok(nl_hdr, read_len) == 0) || (nl_hdr->nlmsg_type == NLMSG_ERROR)) |\n+|return -1; |\n+|\t\t\t\t// this function doesn't handle multiple requests at the same time |\n+|_\b\t_\b\t_\b\t_\b\t_\b/_\b/_\b _\bs_\bo_\b _\br_\be_\bp_\bo_\br_\bt_\b _\ba_\bn_\b _\be_\br_\br_\bo_\br_\b _\bi_\bf_\b _\bt_\bh_\be_\b _\bm_\be_\bs_\bs_\ba_\bg_\be_\b _\bd_\bo_\be_\bs_\b _\bn_\bo_\bt_\b _\bh_\ba_\bv_\be_\b _\bt_\bh_\be_\b _\be_\bx_\bp_\be_\bc_\bt_\be_\bd_\b _\bs_\be_\bq_\b _\ba_\bn_\bd_\b _\bp_\bi_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\be_\bn_\bu_\bm_\b__\bn_\be_\bt_\b._\bc_\bp_\bp_\b:_\b2_\b7_\b4_\b _\b _\b _\b _\b _\b _\b _\b|_\bi_\bf_\b _\bw_\be_\b _\bg_\be_\bt_\b _\bh_\be_\br_\be_\b,_\b _\bt_\bh_\be_\b _\bc_\ba_\bl_\bl_\be_\br_\b _\bs_\bt_\bi_\bl_\bl_\b _\ba_\bs_\bs_\bu_\bm_\be_\bs_\b _\bt_\bh_\be_\b _\be_\br_\br_\bo_\br_\b _\bc_\bo_\bd_\be_\b _\bi_\bs_\b _\br_\be_\bp_\bo_\br_\bt_\be_\bd_\b _\bv_\bi_\ba_\b _\be_\br_\br_\bn_\bo_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* i\bif\bf w\bwe\be g\bge\bet\bt h\bhe\ber\bre\be,\b, t\bth\bhe\be c\bca\bal\bll\ble\ber\br s\bst\bti\bil\bll\bl a\bas\bss\bsu\bum\bme\bes\bs t\bth\bhe\be e\ber\brr\bro\bor\br c\bco\bod\bde\be i\bis\bs r\bre\bep\bpo\bor\brt\bte\bed\bd v\bvi\bia\ba e\ber\brr\brn\bno\bo *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/e\ben\bnu\bum\bm_\b_n\bne\bet\bt.\b.c\bcp\bpp\bp:\b:2\b27\b74\b4 *\b**\b**\b* |\n+|#if TORRENT_USE_NETLINK |\n+| |\n+|\tint read_nl_sock(int sock, std::uint32_t const seq, std::uint32_t const pid |\n+|\t\t, std::function on_msg) |\n+|\t{ |\n+|\t\tstd::array buf; |\n+|\t\tfor (;;) |\n |\t\t{ |\n-|\t\t\tstd::string old_path = combine_path(m_path, m_name); |\n-|\t\t\tstd::string new_path = combine_path(path, m_name); |\n+|\t\t\tint const read_len = int(recv(sock, buf.data(), buf.size(), 0)); |\n+|\t\t\tif (read_len < 0) return -1; |\n | |\n-|\t\t\trename(old_path, new_path, ec); |\n-|\t\t\tif (ec == boost::system::errc::no_such_file_or_directory) |\n-|\t\t\t\tec.clear(); |\n+|\t\t\tauto const* nl_hdr = reinterpret_cast(buf.data()); |\n+|\t\t\tint len = read_len; |\n | |\n-|\t\t\tif (ec) |\n+|\t\t\tfor (; len > 0 && aux::nlmsg_ok(nl_hdr, len); nl_hdr = aux::nlmsg_next(nl_hdr, len)) |\n |\t\t\t{ |\n-|\t\t\t\tstorage_error se; |\n-|\t\t\t\taux::copy_file(old_path, new_path, se); |\n-|\t\t\t\tec = se.ec; |\n-|\t\t\t\tif (ec) return; |\n-|\t\t\t\tremove(old_path, ec); |\n-|\t\t\t} |\n-|_\b\t_\b\t_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bp_\ba_\br_\bt_\b__\bf_\bi_\bl_\be_\b._\bc_\bp_\bp_\b:_\b4_\b1_\b1_\b _\b _\b _\b _\b _\b _\b|_\bi_\bn_\bs_\bt_\be_\ba_\bd_\b _\bo_\bf_\b _\br_\be_\bb_\bu_\bi_\bl_\bd_\bi_\bn_\bg_\b _\bt_\bh_\be_\b _\bw_\bh_\bo_\bl_\be_\b _\bf_\bi_\bl_\be_\b _\bh_\be_\ba_\bd_\be_\br_\b _\ba_\bn_\bd_\b _\bf_\bl_\bu_\bs_\bh_\bi_\bn_\bg_\b _\bi_\bt_\b,_\b _\bu_\bp_\bd_\ba_\bt_\be_\b _\bt_\bh_\be_\b _\bs_\bl_\bo_\bt_\b _\be_\bn_\bt_\br_\bi_\be_\bs_\b _\ba_\bs_\b _\bw_\be_\b _\bg_\bo_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* i\bin\bns\bst\bte\bea\bad\bd o\bof\bf r\bre\beb\bbu\bui\bil\bld\bdi\bin\bng\bg t\bth\bhe\be w\bwh\bho\bol\ble\be f\bfi\bil\ble\be h\bhe\bea\bad\bde\ber\br a\ban\bnd\bd f\bfl\blu\bus\bsh\bhi\bin\bng\bg i\bit\bt,\b, u\bup\bpd\bda\bat\bte\be t\bth\bhe\be s\bsl\blo\bot\bt e\ben\bnt\btr\bri\bie\bes\bs a\bas\bs w\bwe\be g\bgo\bo *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/p\bpa\bar\brt\bt_\b_f\bfi\bil\ble\be.\b.c\bcp\bpp\bp:\b:4\b41\b11\b1 *\b**\b**\b* |\n-|TORRENT_ASSERT(j->second == slot); |\n-|\t\t\t\t\t\tm_free_slots.push_back(j->second); |\n-|\t\t\t\t\t\tm_piece_map.erase(j); |\n-|\t\t\t\t\t\tm_dirty_metadata = true; |\n-|\t\t\t\t\t} |\n-|\t\t\t\t} |\n+|\t\t\t\tif ((aux::nlmsg_ok(nl_hdr, read_len) == 0) || (nl_hdr->nlmsg_type == NLMSG_ERROR)) |\n+|\t\t\t\t\treturn -1; |\n+|\t\t\t\t// this function doesn't handle multiple requests at the same time |\n+|\t\t\t\t// so report an error if the message does not have the expected seq and pid |\n+|if (nl_hdr->nlmsg_seq != seq || nl_hdr->nlmsg_pid != pid) |\n+|return -1; |\n+| |\n+|\t\t\t\tif (nl_hdr->nlmsg_type == NLMSG_DONE) return 0; |\n+| |\n+|\t\t\t\ton_msg(nl_hdr); |\n+| |\n+|\t\t\t\tif ((nl_hdr->nlmsg_flags & NLM_F_MULTI) == 0) return 0; |\n |\t\t\t} |\n-|\t\t\tfile_offset += block_to_copy; |\n-|\t\t\tpiece_offset = 0; |\n-|\t\t\tsize -= block_to_copy; |\n |\t\t} |\n+|//\t\treturn 0; |\n |\t} |\n | |\n-|\tvoid part_file::flush_metadata(error_code& ec) |\n+|\tint nl_dump_request(int const sock, std::uint32_t const seq |\n+|\t\t, nlmsghdr* const request_msg, std::function on_msg) |\n |\t{ |\n-|\t\tstd::lock_guard l(m_mutex); |\n+|\t\trequest_msg->nlmsg_flags = NLM_F_DUMP | NLM_F_REQUEST; |\n+|\t\trequest_msg->nlmsg_seq = seq; |\n+|\t\t// in theory nlmsg_pid should be set to the netlink port ID (NOT the process ID) |\n+|\t\t// of the sender, but the kernel ignores this field so it is typically set to |\n+|\t\t// zero |\n+|\t\trequest_msg->nlmsg_pid = 0; |\n | |\n-|\t\tflush_metadata_impl(ec); |\n-|\t} |\n+|\t\tif (::send(sock, request_msg, request_msg->nlmsg_len, 0) < 0) |\n+|\t\t\treturn -1; |\n | |\n-|void part_file::flush_metadata_impl(error_code& ec) |\n+|\t\t// get the socket's port ID so that we can verify it in the response |\n+|\t\tsockaddr_nl sock_addr; |\n+|\t\tsocklen_t sock_addr_len = sizeof(sock_addr); |\n+|\t\tif (::getsockname(sock, reinterpret_cast(&sock_addr), &sock_addr_len) < 0) |\n+|_\b\t_\b\t_\b\t_\br_\be_\bt_\bu_\br_\bn_\b _\b-_\b1_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bp_\ba_\bc_\bk_\be_\bt_\b__\bb_\bu_\bf_\bf_\be_\br_\b._\bc_\bp_\bp_\b:_\b1_\b5_\b7_\b _\b _\b|_\bu_\bs_\be_\b _\bc_\bo_\bm_\bp_\ba_\br_\be_\b__\bl_\be_\bs_\bs_\b__\bw_\br_\ba_\bp_\b _\bf_\bo_\br_\b _\bt_\bh_\bi_\bs_\b _\bc_\bo_\bm_\bp_\ba_\br_\bi_\bs_\bo_\bn_\b _\ba_\bs_\b _\bw_\be_\bl_\bl_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* u\bus\bse\be c\bco\bom\bmp\bpa\bar\bre\be_\b_l\ble\bes\bss\bs_\b_w\bwr\bra\bap\bp f\bfo\bor\br t\bth\bhi\bis\bs c\bco\bom\bmp\bpa\bar\bri\bis\bso\bon\bn a\bas\bs w\bwe\bel\bll\bl *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/p\bpa\bac\bck\bke\bet\bt_\b_b\bbu\buf\bff\bfe\ber\br.\b.c\bcp\bpp\bp:\b:1\b15\b57\b7 *\b**\b**\b* |\n |{ |\n-|\t\t// do we need to flush the metadata? |\n-|\t\tif (m_dirty_metadata == false) return; |\n+|\t\tINVARIANT_CHECK; |\n+|\t\tTORRENT_ASSERT_VAL(size <= 0xffff, size); |\n+|\t\tstd::uint32_t new_size = m_capacity == 0 ? 16 : m_capacity; |\n | |\n-|\t\tif (m_piece_map.empty()) |\n+|\t\twhile (new_size < size) |\n+|\t\t\tnew_size <<= 1; |\n+| |\n+|\t\taux::unique_ptr new_storage(new packet_ptr[new_size]); |\n+| |\n+|\t\tfor (index_type i = m_first; i < (m_first + m_capacity); ++i) |\n+|\t\t\tnew_storage[i & (new_size - 1)] = std::move(m_storage[i & (m_capacity - 1)]); |\n+| |\n+|\t\tm_storage = std::move(new_storage); |\n+|\t\tm_capacity = new_size; |\n+|\t} |\n+| |\n+|\tpacket_ptr packet_buffer::remove(index_type idx) |\n+|\t{ |\n+|\t\tINVARIANT_CHECK; |\n+|if (idx >= m_first + m_capacity) |\n+|return packet_ptr(); |\n+| |\n+|\t\tif (compare_less_wrap(idx, m_first, 0xffff)) |\n+|\t\t\treturn packet_ptr(); |\n+| |\n+|\t\tstd::size_t const mask = m_capacity - 1; |\n+|\t\tpacket_ptr old_value = std::move(m_storage[idx & mask]); |\n+|\t\tm_storage[idx & mask].reset(); |\n+| |\n+|\t\tif (old_value) |\n |\t\t{ |\n-|\t\t\t// if we don't have any pieces left in the |\n-|\t\t\t// part file, remove it |\n-|\t\t\tstd::string const p = combine_path(m_path, m_name); |\n-|\t\t\tremove(p, ec); |\n+|\t\t\t--m_size; |\n+|\t\t\tif (m_size == 0) m_last = m_first; |\n+|\t\t} |\n | |\n-|\t\t\tif (ec == boost::system::errc::no_such_file_or_directory) |\n-|\t\t\t\tec.clear(); |\n-|\t\t\treturn; |\n+|\t\tif (idx == m_first && m_size != 0) |\n+|\t\t{ |\n+|\t\t\t++m_first; |\n+|\t\t\tfor (index_type i = 0; i < m_capacity; ++i, ++m_first) |\n+|\t\t\t\tif (m_storage[m_first & mask]) break; |\n+|\t\t\tm_first &= 0xffff; |\n |\t\t} |\n | |\n-|\t\tauto f = open_file(aux::open_mode::write | aux::open_mode::hidden, ec); |\n-|\t\tif (ec) return; |\n+|\t\tif (((idx + 1) & 0xffff) == m_last && m_size != 0) |\n+|\t\t{ |\n+|\t\t\t--m_last; |\n+|\t\t\tfor (index_type i = 0; i < m_capacity; ++i, --m_last) |\n+|\t\t\t\tif (m_storage[m_last & mask]) break; |\n+|\t\t\t++m_last; |\n+|_\b\t_\b\t_\b\t_\bm_\b__\bl_\ba_\bs_\bt_\b _\b&_\b=_\b _\b0_\bx_\bf_\bf_\bf_\bf_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bu_\bd_\bp_\b__\bs_\bo_\bc_\bk_\be_\bt_\b._\bc_\bp_\bp_\b:_\b6_\b5_\b9_\b _\b _\b _\b _\b _\b|_\bp_\be_\br_\bh_\ba_\bp_\bs_\b _\ba_\bn_\b _\ba_\bt_\bt_\be_\bm_\bp_\bt_\b _\bs_\bh_\bo_\bu_\bl_\bd_\b _\bb_\be_\b _\bm_\ba_\bd_\be_\b _\bt_\bo_\b _\bb_\bi_\bn_\bd_\b _\bm_\b__\bs_\bo_\bc_\bk_\bs_\b5_\b__\bs_\bo_\bc_\bk_\b _\bt_\bo_\b _\bt_\bh_\be_\b _\bd_\be_\bv_\bi_\bc_\be_\b _\bo_\bf_\b _\bm_\b__\bl_\bi_\bs_\bt_\be_\bn_\b__\bs_\bo_\bc_\bk_\be_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* p\bpe\ber\brh\bha\bap\bps\bs a\ban\bn a\bat\btt\bte\bem\bmp\bpt\bt s\bsh\bho\bou\bul\bld\bd b\bbe\be m\bma\bad\bde\be t\bto\bo b\bbi\bin\bnd\bd m\bm_\b_s\bso\boc\bck\bks\bs5\b5_\b_s\bso\boc\bck\bk t\bto\bo t\bth\bhe\be d\bde\bev\bvi\bic\bce\be o\bof\bf m\bm_\b_l\bli\bis\bst\bte\ben\bn_\b_s\bso\boc\bck\bke\bet\bt *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/u\bud\bdp\bp_\b_s\bso\boc\bck\bke\bet\bt.\b.c\bcp\bpp\bp:\b:6\b65\b59\b9 *\b**\b**\b* |\n+|if (ec) |\n+|\t{ |\n+|\t\tif (m_alerts.should_post()) |\n+|\t\t\tm_alerts.emplace_alert(m_proxy_addr, operation_t::sock_option, ec); |\n+|\t\tec.clear(); |\n+|\t} |\n+|#endif |\n+|#endif |\n | |\n-|\t\tstd::vector header(static_cast(m_header_size)); |\n+|\ttcp::endpoint const bind_ep(m_listen_socket.get_local_endpoint().address(), 0); |\n+|\tm_socks5_sock.bind(bind_ep, ec); |\n+|\tif (ec) |\n+|\t{ |\n+|\t\tif (m_alerts.should_post()) |\n+|\t\t\tm_alerts.emplace_alert(m_proxy_addr, operation_t::sock_bind, ec); |\n+|\t\t++m_failures; |\n+|\t\tretry_connection(); |\n+|\t\treturn; |\n+|\t} |\n | |\n-|\t\tusing namespace libtorrent::aux; |\n | |\n-|\t\tchar* ptr = header.data(); |\n-|\t\twrite_uint32(m_max_pieces, ptr); |\n-|\t\twrite_uint32(m_piece_size, ptr); |\n+|ADD_OUTSTANDING_ASYNC(\"socks5::on_connected\"); |\n+|\tm_socks5_sock.async_connect(m_proxy_addr |\n+|\t\t, std::bind(&socks5::on_connected, self(), _1)); |\n | |\n-|\t\tfor (piece_index_t piece(0); piece < piece_index_t(m_max_pieces); ++piece) |\n-|\t\t{ |\n-|_\b\t_\b\t_\b\t_\ba_\bu_\bt_\bo_\b _\bc_\bo_\bn_\bs_\bt_\b _\bi_\b _\b=_\b _\bm_\b__\bp_\bi_\be_\bc_\be_\b__\bm_\ba_\bp_\b._\bf_\bi_\bn_\bd_\b(_\bp_\bi_\be_\bc_\be_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|\tADD_OUTSTANDING_ASYNC(\"socks5::on_connect_timeout\"); |\n+|\tm_timer.expires_after(seconds(10)); |\n+|\tm_timer.async_wait(std::bind(&socks5::on_connect_timeout |\n+|\t\t, self(), _1)); |\n+|} |\n+| |\n+|void socks5::on_connect_timeout(error_code const& e) |\n+|{ |\n+|\tCOMPLETE_ASYNC(\"socks5::on_connect_timeout\"); |\n+| |\n+|\tif (e == boost::asio::error::operation_aborted) return; |\n+| |\n+|\tif (m_abort) return; |\n+| |\n+|\tif (m_alerts.should_post()) |\n+|\t\tm_alerts.emplace_alert(m_proxy_addr, operation_t::connect, errors::timed_out); |\n+| |\n+|\terror_code ignore; |\n+|\tm_socks5_sock.close(ignore); |\n+| |\n+|\t++m_failures; |\n+|\tretry_connection(); |\n+|} |\n+| |\n+|void socks5::on_connected(error_code const& e) |\n+|_\b{_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bi_\bm_\bp_\bl_\b._\bc_\bp_\bp_\b:_\b6_\b1_\b5_\b _\b _\b _\b|_\bc_\bo_\bm_\be_\b _\bu_\bp_\b _\bw_\bi_\bt_\bh_\b _\bs_\bo_\bm_\be_\b _\ba_\bb_\bs_\bt_\br_\ba_\bc_\bt_\bi_\bo_\bn_\b _\bt_\bo_\b _\bd_\bo_\b _\bt_\bh_\bi_\bs_\b _\bf_\bo_\br_\b _\bg_\bn_\bu_\bt_\bl_\bs_\b _\ba_\bs_\b _\bw_\be_\bl_\bl_\b _\bl_\bo_\ba_\bd_\b _\bc_\be_\br_\bt_\bi_\bf_\bi_\bc_\ba_\bt_\be_\bs_\b _\bf_\br_\bo_\bm_\b _\bt_\bh_\be_\b _\bw_\bi_\bn_\bd_\bo_\bw_\bs_\b _\bs_\by_\bs_\bt_\be_\bm_\b _\bc_\be_\br_\bt_\bi_\bf_\bi_\bc_\ba_\bt_\be_\b _\bs_\bt_\bo_\br_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |*\b**\b**\b**\b**\b* c\bco\bom\bme\be u\bup\bp w\bwi\bit\bth\bh s\bso\bom\bme\be a\bab\bbs\bst\btr\bra\bac\bct\bti\bio\bon\bn t\bto\bo d\bdo\bo t\bth\bhi\bis\bs f\bfo\bor\br g\bgn\bnu\but\btl\bls\bs a\bas\bs w\bwe\bel\bll\bl l\blo\boa\bad\bd c\bce\ber\brt\bti\bif\bfi\bic\bca\bat\bte\bes\bs f\bfr\bro\bom\bm t\bth\bhe\be w\bwi\bin\bnd\bdo\bow\bws\bs s\bsy\bys\bst\bte\bem\bm c\bce\ber\brt\bti\bif\bfi\bic\bca\bat\bte\be s\bst\bto\bor\bre\be *\b**\b**\b**\b**\b* |\n |*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/s\bse\bes\bss\bsi\bio\bon\bn_\b_i\bim\bmp\bpl\bl.\b.c\bcp\bpp\bp:\b:6\b61\b15\b5 *\b**\b**\b* |\n |pause(); |\n |\t} |\n |#endif |\n | |\n@@ -7405,913 +8942,176 @@\n |\t\t\tfor (wakeup_t const& w : _wakeups) |\n |\t\t\t{ |\n |\t\t\t\tbool const idle_wakeup = w.context_switches > prev_csw; |\n |\t\t\t\tstd::fprintf(f, \"%\" PRId64 \"\\t%\" PRId64 \"\\t%\" PRId64 \"\\t%c\\t%s\\n\" |\n |\t\t\t\t\t, total_microseconds(w.timestamp - m) |\n |\t\t\t\t\t, total_microseconds(w.timestamp - prev) |\n |_\b\t_\b\t_\b\t_\b\t_\b\t_\b,_\b _\bw_\b._\bc_\bo_\bn_\bt_\be_\bx_\bt_\b__\bs_\bw_\bi_\bt_\bc_\bh_\be_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b._\bc_\bp_\bp_\b:_\b8_\b8_\b7_\b _\b _\b _\b|_\bt_\bh_\bi_\bs_\b _\bs_\bh_\bo_\bu_\bl_\bd_\b _\bb_\be_\b _\bc_\bo_\bn_\bs_\bi_\bd_\be_\br_\be_\bd_\b _\ba_\b _\bf_\ba_\bi_\bl_\bu_\br_\be_\b,_\b _\ba_\bn_\bd_\b _\bt_\bh_\be_\b _\b._\bt_\bo_\br_\br_\be_\bn_\bt_\b _\bf_\bi_\bl_\be_\b _\br_\be_\bj_\be_\bc_\bt_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs s\bsh\bho\bou\bul\bld\bd b\bbe\be c\bco\bon\bns\bsi\bid\bde\ber\bre\bed\bd a\ba f\bfa\bai\bil\blu\bur\bre\be,\b, a\ban\bnd\bd t\bth\bhe\be .\b.t\bto\bor\brr\bre\ben\bnt\bt f\bfi\bil\ble\be r\bre\bej\bje\bec\bct\bte\bed\bd *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo.\b.c\bcp\bpp\bp:\b:8\b88\b87\b7 *\b**\b**\b* |\n-|std::string ext = extension(filename); |\n-|\t\t\tint cnt = 0; |\n-|\t\t\tfor (;;) |\n-|\t\t\t{ |\n-|\t\t\t\t++cnt; |\n-|\t\t\t\tchar new_ext[50]; |\n-|\t\t\t\tstd::snprintf(new_ext, sizeof(new_ext), \".%d%s\", cnt, ext.c_str()); |\n-|\t\t\t\tfilename = base + new_ext; |\n-| |\n-|\t\t\t\tboost::crc_optimal<32, 0x1EDC6F41, 0xFFFFFFFF, 0xFFFFFFFF, true, true> crc; |\n-|\t\t\t\tprocess_string_lowercase(crc, filename); |\n-|\t\t\t\tstd::uint32_t const new_hash = crc.checksum(); |\n-|\t\t\t\tif (files.find(new_hash) == files.end()) |\n-|\t\t\t\t{ |\n-|\t\t\t\t\tfiles.insert({new_hash, {i, 0}}); |\n-|\t\t\t\t\tbreak; |\n-|\t\t\t\t} |\n-|\t\t\t\t++num_collisions; |\n-|\t\t\t\tif (num_collisions > 100) |\n-|\t\t\t\t{ |\n-|} |\n-|} |\n-| |\n-|\t\t\tcopy_on_write(); |\n-|\t\t\tm_files.rename_file(i, filename); |\n-|\t\t} |\n-|\t} |\n-| |\n-|\tvoid torrent_info::remap_files(file_storage const& f) |\n-|\t{ |\n-|\t\tINVARIANT_CHECK; |\n-| |\n-|\t\tTORRENT_ASSERT(is_loaded()); |\n-|\t\t// the new specified file storage must have the exact |\n-|\t\t// same size as the current file storage |\n-|\t\tTORRENT_ASSERT(m_files.total_size() == f.total_size()); |\n-| |\n-|\t\tif (m_files.total_size() != f.total_size()) return; |\n-|\t\tcopy_on_write(); |\n-|\t\tm_files = f; |\n-|\t\tm_files.set_num_pieces(m_orig_files->num_pieces()); |\n-|\t\tm_files.set_piece_length(m_orig_files->piece_length()); |\n-|\t} |\n-| |\n-|#if TORRENT_ABI_VERSION == 1 |\n-|\t// standard constructor that parses a torrent file |\n-|\ttorrent_info::torrent_info(entry const& torrent_file) |\n-|\t{ |\n-|\t\tstd::vector tmp; |\n-|\t\tstd::back_insert_iterator> out(tmp); |\n-|_\b\t_\b\t_\bb_\be_\bn_\bc_\bo_\bd_\be_\b(_\bo_\bu_\bt_\b,_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bi_\bl_\be_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs_\b._\bc_\bp_\bp_\b:|pre C++17, GCC and msvc does not make std::string nothrow move assignable, which means no type containing a string will be nothrow |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b7_\b8_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bm_\bo_\bv_\be_\b _\ba_\bs_\bs_\bi_\bg_\bn_\ba_\bb_\bl_\be_\b _\bb_\by_\b _\bd_\be_\bf_\ba_\bu_\bl_\bt_\b _\be_\bi_\bt_\bh_\be_\br_\b _\bs_\bt_\ba_\bt_\bi_\bc_\b__\ba_\bs_\bs_\be_\br_\bt_\b(_\bs_\bt_\bd_\b:_\b:_\bi_\bs_\b__\bn_\bo_\bt_\bh_\br_\bo_\bw_\b__\bm_\bo_\bv_\be_\b__\ba_\bs_\bs_\bi_\bg_\bn_\ba_\bb_\bl_\be_\b:_\b:_\bv_\ba_\bl_\bu_\be_\b _\b,_\b _\b\"_\bs_\bh_\bo_\bu_\bl_\bd_\b _\bb_\be_\b _\bn_\bo_\bt_\bh_\br_\bo_\bw_\b _\bm_\bo_\bv_\be_\b _\ba_\bs_\bs_\bi_\bg_\bn_\ba_\bb_\bl_\be_\b\"_\b)_\b;_\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* p\bpr\bre\be C\bC+\b++\b+1\b17\b7,\b, G\bGC\bCC\bC a\ban\bnd\bd m\bms\bsv\bvc\bc d\bdo\boe\bes\bs n\bno\bot\bt m\bma\bak\bke\be s\bst\btd\bd:\b::\b:s\bst\btr\bri\bin\bng\bg n\bno\bot\bth\bhr\bro\bow\bw m\bmo\bov\bve\be a\bas\bss\bsi\big\bgn\bna\bab\bbl\ble\be,\b, w\bwh\bhi\bic\bch\bh m\bme\bea\ban\bns\bs n\bno\bo t\bty\byp\bpe\be c\bco\bon\bnt\bta\bai\bin\bni\bin\bng\bg a\ba s\bst\btr\bri\bin\bng\bg w\bwi\bil\bll\bl b\bbe\be n\bno\bot\bth\bhr\bro\bow\bw m\bmo\bov\bve\be a\bas\bss\bsi\big\bgn\bna\bab\bbl\ble\be b\bby\by d\bde\bef\bfa\bau\bul\blt\bt e\bei\bit\bth\bhe\ber\br |\n-|s\bst\bta\bat\bti\bic\bc_\b_a\bas\bss\bse\ber\brt\bt(\b(s\bst\btd\bd:\b::\b:i\bis\bs_\b_n\bno\bot\bth\bhr\bro\bow\bw_\b_m\bmo\bov\bve\be_\b_a\bas\bss\bsi\big\bgn\bna\bab\bbl\ble\be:\b::\b:v\bva\bal\blu\bue\be ,\b, \"\b\"s\bsh\bho\bou\bul\bld\bd b\bbe\be n\bno\bot\bth\bhr\bro\bow\bw m\bmo\bov\bve\be a\bas\bss\bsi\big\bgn\bna\bab\bbl\ble\be\"\b\")\b);\b; *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_p\bpa\bar\bra\bam\bms\bs.\b.c\bcp\bpp\bp:\b:7\b78\b8 *\b**\b**\b* |\n-|DECL_FLAG(sequential_download); |\n-|\t\t\tDECL_FLAG(pinned); |\n-|\t\t\tDECL_FLAG(stop_when_ready); |\n-|\t\t\tDECL_FLAG(override_trackers); |\n-|\t\t\tDECL_FLAG(override_web_seeds); |\n-|\t\t\tDECL_FLAG(need_save_resume); |\n-|\t\t\tDECL_FLAG(override_resume_data); |\n-|\t\t\tDECL_FLAG(merge_resume_trackers); |\n-|\t\t\tDECL_FLAG(use_resume_save_path); |\n-|\t\t\tDECL_FLAG(merge_resume_http_seeds); |\n-|\t\t\tDECL_FLAG(default_flags); |\n-|#undef DECL_FLAG |\n-|#endif // TORRENT_ABI_VERSION |\n-| |\n-|\tstatic_assert(std::is_nothrow_move_constructible::value |\n-|\t\t, \"should be nothrow move constructible\"); |\n-| |\n-|\tstatic_assert(std::is_nothrow_move_constructible::value |\n-|\t\t, \"should be nothrow move constructible\"); |\n-| |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs_\b._\bc_\bp_\bp_\b:|it would be nice if this was nothrow default constructible static_assert(std::is_nothrow_default_constructible::value , \"should be |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b8_\b4_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bn_\bo_\bt_\bh_\br_\bo_\bw_\b _\bd_\be_\bf_\ba_\bu_\bl_\bt_\b _\bc_\bo_\bn_\bs_\bt_\br_\bu_\bc_\bt_\bi_\bb_\bl_\be_\b\"_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* i\bit\bt w\bwo\bou\bul\bld\bd b\bbe\be n\bni\bic\bce\be i\bif\bf t\bth\bhi\bis\bs w\bwa\bas\bs n\bno\bot\bth\bhr\bro\bow\bw d\bde\bef\bfa\bau\bul\blt\bt c\bco\bon\bns\bst\btr\bru\buc\bct\bti\bib\bbl\ble\be s\bst\bta\bat\bti\bic\bc_\b_a\bas\bss\bse\ber\brt\bt(\b(s\bst\btd\bd:\b::\b:i\bis\bs_\b_n\bno\bot\bth\bhr\bro\bow\bw_\b_d\bde\bef\bfa\bau\bul\blt\bt_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bti\bib\bbl\ble\be:\b::\b:v\bva\bal\blu\bue\be ,\b, \"\b\"s\bsh\bho\bou\bul\bld\bd b\bbe\be n\bno\bot\bth\bhr\bro\bow\bw d\bde\bef\bfa\bau\bul\blt\bt c\bco\bon\bns\bst\btr\bru\buc\bct\bti\bib\bbl\ble\be\"\b\")\b);\b; *\b**\b**\b**\b**\b*|\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_p\bpa\bar\bra\bam\bms\bs.\b.c\bcp\bpp\bp:\b:8\b84\b4 *\b**\b**\b* |\n-|DECL_FLAG(pinned); |\n-|\t\t\tDECL_FLAG(stop_when_ready); |\n-|\t\t\tDECL_FLAG(override_trackers); |\n-|\t\t\tDECL_FLAG(override_web_seeds); |\n-|\t\t\tDECL_FLAG(need_save_resume); |\n-|\t\t\tDECL_FLAG(override_resume_data); |\n-|\t\t\tDECL_FLAG(merge_resume_trackers); |\n-|\t\t\tDECL_FLAG(use_resume_save_path); |\n-|\t\t\tDECL_FLAG(merge_resume_http_seeds); |\n-|\t\t\tDECL_FLAG(default_flags); |\n-|#undef DECL_FLAG |\n-|#endif // TORRENT_ABI_VERSION |\n-| |\n-|\tstatic_assert(std::is_nothrow_move_constructible::value |\n-|\t\t, \"should be nothrow move constructible\"); |\n-| |\n-|\tstatic_assert(std::is_nothrow_move_constructible::value |\n-|\t\t, \"should be nothrow move constructible\"); |\n-| |\n-| |\n-| |\n-|namespace aux { |\n-| |\n-|\t// returns whether this add_torrent_params object has \"resume-data\", i.e. |\n-|\t// information about which pieces we have. |\n-|\tbool contains_resume_data(add_torrent_params const& atp) |\n-|\t{ |\n-|\t\treturn !atp.have_pieces.empty() |\n-|\t\t\t|| (atp.flags & torrent_flags::seed_mode); |\n-|\t} |\n-|} |\n-| |\n-|_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bp_\ba_\bc_\bk_\be_\bt_\b__\bb_\bu_\bf_\bf_\be_\br_\b._\bc_\bp_\bp_\b:_\b1_\b5_\b7_\b _\b _\b|_\bu_\bs_\be_\b _\bc_\bo_\bm_\bp_\ba_\br_\be_\b__\bl_\be_\bs_\bs_\b__\bw_\br_\ba_\bp_\b _\bf_\bo_\br_\b _\bt_\bh_\bi_\bs_\b _\bc_\bo_\bm_\bp_\ba_\br_\bi_\bs_\bo_\bn_\b _\ba_\bs_\b _\bw_\be_\bl_\bl_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* u\bus\bse\be c\bco\bom\bmp\bpa\bar\bre\be_\b_l\ble\bes\bss\bs_\b_w\bwr\bra\bap\bp f\bfo\bor\br t\bth\bhi\bis\bs c\bco\bom\bmp\bpa\bar\bri\bis\bso\bon\bn a\bas\bs w\bwe\bel\bll\bl *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/p\bpa\bac\bck\bke\bet\bt_\b_b\bbu\buf\bff\bfe\ber\br.\b.c\bcp\bpp\bp:\b:1\b15\b57\b7 *\b**\b**\b* |\n-|{ |\n-|\t\tINVARIANT_CHECK; |\n-|\t\tTORRENT_ASSERT_VAL(size <= 0xffff, size); |\n-|\t\tstd::uint32_t new_size = m_capacity == 0 ? 16 : m_capacity; |\n-| |\n-|\t\twhile (new_size < size) |\n-|\t\t\tnew_size <<= 1; |\n-| |\n-|\t\taux::unique_ptr new_storage(new packet_ptr[new_size]); |\n-| |\n-|\t\tfor (index_type i = m_first; i < (m_first + m_capacity); ++i) |\n-|\t\t\tnew_storage[i & (new_size - 1)] = std::move(m_storage[i & (m_capacity - 1)]); |\n-| |\n-|\t\tm_storage = std::move(new_storage); |\n-|\t\tm_capacity = new_size; |\n-|\t} |\n-| |\n-|\tpacket_ptr packet_buffer::remove(index_type idx) |\n-|\t{ |\n-|\t\tINVARIANT_CHECK; |\n-|if (idx >= m_first + m_capacity) |\n-|return packet_ptr(); |\n-| |\n-|\t\tif (compare_less_wrap(idx, m_first, 0xffff)) |\n-|\t\t\treturn packet_ptr(); |\n-| |\n-|\t\tstd::size_t const mask = m_capacity - 1; |\n-|\t\tpacket_ptr old_value = std::move(m_storage[idx & mask]); |\n-|\t\tm_storage[idx & mask].reset(); |\n-| |\n-|\t\tif (old_value) |\n-|\t\t{ |\n-|\t\t\t--m_size; |\n-|\t\t\tif (m_size == 0) m_last = m_first; |\n-|\t\t} |\n-| |\n-|\t\tif (idx == m_first && m_size != 0) |\n-|\t\t{ |\n-|\t\t\t++m_first; |\n-|\t\t\tfor (index_type i = 0; i < m_capacity; ++i, ++m_first) |\n-|\t\t\t\tif (m_storage[m_first & mask]) break; |\n-|\t\t\tm_first &= 0xffff; |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk_\b._\bc_\bp_\bp_\b:_\b3_\b0_\b5_\b _\b _\b|_\bd_\be_\bp_\br_\be_\bc_\ba_\bt_\be_\b _\bt_\bh_\bi_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* d\bde\bep\bpr\bre\bec\bca\bat\bte\be t\bth\bhi\bis\bs *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/s\bse\bet\btt\bti\bin\bng\bgs\bs_\b_p\bpa\bac\bck\bk.\b.c\bcp\bpp\bp:\b:3\b30\b05\b5 *\b**\b**\b* |\n+|SET(outgoing_port, 0, nullptr), |\n+|\t\tSET(num_outgoing_ports, 0, nullptr), |\n+|\t\tSET(peer_dscp, 0x04, &session_impl::update_peer_dscp), |\n+|\t\tSET(active_downloads, 3, &session_impl::trigger_auto_manage), |\n+|\t\tSET(active_seeds, 5, &session_impl::trigger_auto_manage), |\n+|\t\tSET(active_checking, 1, &session_impl::trigger_auto_manage), |\n+|\t\tSET(active_dht_limit, 88, nullptr), |\n+|\t\tSET(active_tracker_limit, 1600, nullptr), |\n+|\t\tSET(active_lsd_limit, 60, nullptr), |\n+|\t\tSET(active_limit, 500, &session_impl::trigger_auto_manage), |\n+|\t\tDEPRECATED_SET(active_loaded_limit, 0, &session_impl::trigger_auto_manage), |\n+|\t\tSET(auto_manage_interval, 30, nullptr), |\n+|\t\tSET(seed_time_limit, 24 * 60 * 60, nullptr), |\n+|\t\tSET(auto_scrape_interval, 1800, nullptr), |\n+|\t\tSET(auto_scrape_min_interval, 300, nullptr), |\n+|\t\tSET(max_peerlist_size, 3000, nullptr), |\n+|\t\tSET(max_paused_peerlist_size, 1000, nullptr), |\n+|\t\tSET(min_announce_interval, 5 * 60, nullptr), |\n+|\t\tSET(auto_manage_startup, 60, nullptr), |\n+|\t\tSET(seeding_piece_quota, 20, nullptr), |\n+|SET(max_rejects, 50, nullptr), |\n+|SET(recv_socket_buffer_size, 0, &session_impl::update_socket_buffer_size), |\n+|\t\tSET(send_socket_buffer_size, 0, &session_impl::update_socket_buffer_size), |\n+|\t\tSET(max_peer_recv_buffer_size, 2 * 1024 * 1024, nullptr), |\n+|\t\tDEPRECATED_SET(file_checks_delay_per_block, 0, nullptr), |\n+|\t\tDEPRECATED2_SET(read_cache_line_size, 32, nullptr), |\n+|\t\tDEPRECATED2_SET(write_cache_line_size, 16, nullptr), |\n+|\t\tSET(optimistic_disk_retry, 10 * 60, nullptr), |\n+|\t\tSET(max_suggest_pieces, 16, nullptr), |\n+|\t\tSET(local_service_announce_interval, 5 * 60, nullptr), |\n+|\t\tSET(dht_announce_interval, 15 * 60, &session_impl::update_dht_announce_interval), |\n+|\t\tSET(udp_tracker_token_expiry, 60, nullptr), |\n+|\t\tDEPRECATED_SET(default_cache_min_age, 1, nullptr), |\n+|\t\tSET(num_optimistic_unchoke_slots, 0, nullptr), |\n+|\t\tDEPRECATED_SET(default_est_reciprocation_rate, 16000, nullptr), |\n+|\t\tDEPRECATED_SET(increase_est_reciprocation_rate, 20, nullptr), |\n+|\t\tDEPRECATED_SET(decrease_est_reciprocation_rate, 3, nullptr), |\n+|\t\tSET(max_pex_peers, 50, nullptr), |\n+|\t\tSET(tick_interval, 500, nullptr), |\n+|\t\tSET(share_mode_target, 3, nullptr), |\n+|\t\tSET(upload_rate_limit, 0, &session_impl::update_upload_rate), |\n+|\t\tSET(download_rate_limit, 0, &session_impl::update_download_rate), |\n+|\t\tDEPRECATED_SET(local_upload_rate_limit, 0, &session_impl::update_local_upload_rate), |\n+|\t\tDEPRECATED_SET(local_download_rate_limit, 0, &session_impl::update_local_download_rate), |\n+|\t\tSET(dht_upload_rate_limit, 8000, &session_impl::update_dht_upload_rate_limit), |\n+|\t\tSET(unchoke_slots_limit, 8, &session_impl::update_unchoke_limit), |\n+|\t\tDEPRECATED_SET(half_open_limit, 0, nullptr), |\n+|\t\tSET(connections_limit, 200, &session_impl::update_connections_limit), |\n+|\t\tSET(connections_slack, 10, nullptr), |\n+|\t\tSET(utp_target_delay, 100, nullptr), |\n+|_\b\t_\b\t_\bS_\bE_\bT_\b(_\bu_\bt_\bp_\b__\bg_\ba_\bi_\bn_\b__\bf_\ba_\bc_\bt_\bo_\br_\b,_\b _\b3_\b0_\b0_\b0_\b,_\b _\bn_\bu_\bl_\bl_\bp_\bt_\br_\b)_\b,_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk_\b._\bc_\bp_\bp_\b:_\b5_\b9_\b0_\b _\b _\b|_\bi_\bt_\b _\bw_\bo_\bu_\bl_\bd_\b _\bb_\be_\b _\bn_\bi_\bc_\be_\b _\bt_\bo_\b _\br_\be_\bs_\be_\br_\bv_\be_\b(_\b)_\b _\bt_\bh_\be_\bs_\be_\b _\bv_\be_\bc_\bt_\bo_\br_\bs_\b _\bu_\bp_\b _\bf_\br_\bo_\bn_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* i\bit\bt w\bwo\bou\bul\bld\bd b\bbe\be n\bni\bic\bce\be t\bto\bo r\bre\bes\bse\ber\brv\bve\be(\b()\b) t\bth\bhe\bes\bse\be v\bve\bec\bct\bto\bor\brs\bs u\bup\bp f\bfr\bro\bon\bnt\bt *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/s\bse\bet\btt\bti\bin\bng\bgs\bs_\b_p\bpa\bac\bck\bk.\b.c\bcp\bpp\bp:\b:5\b59\b90\b0 *\b**\b**\b* |\n+|s.set_str(settings_pack::string_type_base | i, str_settings[i].default_value); |\n+|\t\t\tTORRENT_ASSERT(s.get_str(settings_pack::string_type_base + i) == str_settings[i].default_value); |\n |\t\t} |\n | |\n-|\t\tif (((idx + 1) & 0xffff) == m_last && m_size != 0) |\n+|\t\tfor (int i = 0; i < settings_pack::num_int_settings; ++i) |\n |\t\t{ |\n-|\t\t\t--m_last; |\n-|\t\t\tfor (index_type i = 0; i < m_capacity; ++i, --m_last) |\n-|\t\t\t\tif (m_storage[m_last & mask]) break; |\n-|\t\t\t++m_last; |\n-|_\b\t_\b\t_\b\t_\bm_\b__\bl_\ba_\bs_\bt_\b _\b&_\b=_\b _\b0_\bx_\bf_\bf_\bf_\bf_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bm_\ba_\bg_\bn_\be_\bt_\b__\bu_\br_\bi_\b._\bc_\bp_\bp_\b:_\b4_\b3_\b9_\b _\b _\b _\b _\b _\b|_\bw_\bh_\ba_\bt_\b'_\bs_\b _\bt_\bh_\be_\b _\br_\bi_\bg_\bh_\bt_\b _\bn_\bu_\bm_\bb_\be_\br_\b _\bh_\be_\br_\be_\b?_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* w\bwh\bha\bat\bt'\b's\bs t\bth\bhe\be r\bri\big\bgh\bht\bt n\bnu\bum\bmb\bbe\ber\br h\bhe\ber\bre\be?\b? *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/m\bma\bag\bgn\bne\bet\bt_\b_u\bur\bri\bi.\b.c\bcp\bpp\bp:\b:4\b43\b39\b9 *\b**\b**\b* |\n-|} |\n-|\t\t\telse if (string_equal_no_case(name, \"so\"_sv)) // select-only (files) |\n-|\t\t\t{ |\n-|\t\t\t\t// accept only digits, '-' and ',' |\n-|\t\t\t\tif (std::any_of(value.begin(), value.end(), [](char c) |\n-|\t\t\t\t\t{ return !is_digit(c) && c != '-' && c != ','; })) |\n-|\t\t\t\t\tcontinue; |\n-| |\n-|\t\t\t\t// make sure all file priorities are set to 0, except the ones |\n-|\t\t\t\t// we specify in the file_priorities |\n-|\t\t\t\tp.flags |= torrent_flags::default_dont_download; |\n-| |\n-|\t\t\t\tdo |\n-|\t\t\t\t{ |\n-|\t\t\t\t\tstring_view token; |\n-|\t\t\t\t\tstd::tie(token, value) = split_string(value, ','); |\n-| |\n-|\t\t\t\t\tif (token.empty()) continue; |\n-| |\n-|\t\t\t\t\tint idx1, idx2; |\n-|constexpr int max_index = 10000; // can't risk out of memory |\n-| |\n-|\t\t\t\t\tauto const divider = token.find_first_of('-'); |\n-|\t\t\t\t\tif (divider != std::string::npos) // it's a range |\n-|\t\t\t\t\t{ |\n-|\t\t\t\t\t\tif (divider == 0) // no start index |\n-|\t\t\t\t\t\t\tcontinue; |\n-|\t\t\t\t\t\tif (divider == token.size() - 1) // no end index |\n-|\t\t\t\t\t\t\tcontinue; |\n-| |\n-|\t\t\t\t\t\tidx1 = std::atoi(token.substr(0, divider).to_string().c_str()); |\n-|\t\t\t\t\t\tif (idx1 < 0 || idx1 > max_index) // invalid index |\n-|\t\t\t\t\t\t\tcontinue; |\n-|\t\t\t\t\t\tidx2 = std::atoi(token.substr(divider + 1).to_string().c_str()); |\n-|\t\t\t\t\t\tif (idx2 < 0 || idx2 > max_index) // invalid index |\n-|\t\t\t\t\t\t\tcontinue; |\n-| |\n-|\t\t\t\t\t\tif (idx1 > idx2) // wrong range limits |\n-|\t\t\t\t\t\t\tcontinue; |\n-|\t\t\t\t\t} |\n-|\t\t\t\t\telse // it's an index |\n-|\t\t\t\t\t{ |\n-|\t\t\t\t\t\tidx1 = std::atoi(token.to_string().c_str()); |\n-|\t\t\t\t\t\tif (idx1 < 0 || idx1 > max_index) // invalid index |\n-|\t\t\t\t\t\t\tcontinue; |\n-|\t\t\t\t\t\tidx2 = idx1; |\n-|\t\t\t\t\t} |\n-| |\n-|\t\t\t\t\tif (int(p.file_priorities.size()) <= idx2) |\n-|_\b\t_\b\t_\b\t_\b\t_\b\t_\b\t_\bp_\b._\bf_\bi_\bl_\be_\b__\bp_\br_\bi_\bo_\br_\bi_\bt_\bi_\be_\bs_\b._\br_\be_\bs_\bi_\bz_\be_\b(_\bs_\bt_\ba_\bt_\bi_\bc_\b__\bc_\ba_\bs_\bt_\b<_\bs_\bt_\bd_\b:_\b:_\bs_\bi_\bz_\be_\b__\bt_\b>_\b(_\bi_\bd_\bx_\b2_\b)_\b _\b+_\b _\b1_\b,_\b _\bd_\bo_\bn_\bt_\b__\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/ |move stats_counter_t out of counters |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bp_\be_\br_\bf_\bo_\br_\bm_\ba_\bn_\bc_\be_\b__\bc_\bo_\bu_\bn_\bt_\be_\br_\bs_\b._\bc_\bp_\bp_\b:_\b4_\b0_\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* m\bmo\bov\bve\be s\bst\bta\bat\bts\bs_\b_c\bco\bou\bun\bnt\bte\ber\br_\b_t\bt o\bou\but\bt o\bof\bf c\bco\bou\bun\bnt\bte\ber\brs\bs *\b**\b**\b**\b**\b* |\n-|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bs\bs_\br\br_\bc\bc_\b/\b/_\bp\bp_\be\be_\br\br_\bf\bf_\bo\bo_\br\br_\bm\bm_\ba\ba_\bn\bn_\bc\bc_\be\be_\b_\b__\bc\bc_\bo\bo_\bu\bu_\bn\bn_\bt\bt_\be\be_\br\br_\bs\bs_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b4\b4_\b0\b0_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/ |should bittorrent keep-alive messages have a counter too? |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bp_\be_\br_\bf_\bo_\br_\bm_\ba_\bn_\bc_\be_\b__\bc_\bo_\bu_\bn_\bt_\be_\br_\bs_\b._\bc_\bp_\bp_\b:_\b4_\b1_\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* s\bsh\bho\bou\bul\bld\bd b\bbi\bit\btt\bto\bor\brr\bre\ben\bnt\bt k\bke\bee\bep\bp-\b-a\bal\bli\biv\bve\be m\bme\bes\bss\bsa\bag\bge\bes\bs h\bha\bav\bve\be a\ba c\bco\bou\bun\bnt\bte\ber\br t\bto\boo\bo?\b? *\b**\b**\b**\b**\b* |\n-|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bs\bs_\br\br_\bc\bc_\b/\b/_\bp\bp_\be\be_\br\br_\bf\bf_\bo\bo_\br\br_\bm\bm_\ba\ba_\bn\bn_\bc\bc_\be\be_\b_\b__\bc\bc_\bo\bo_\bu\bu_\bn\bn_\bt\bt_\be\be_\br\br_\bs\bs_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b4\b4_\b1\b1_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/ |It would be nice if this could be an internal type. default_disk_constructor depends on it now |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bp_\be_\br_\bf_\bo_\br_\bm_\ba_\bn_\bc_\be_\b__\bc_\bo_\bu_\bn_\bt_\be_\br_\bs_\b._\bc_\bp_\bp_\b:_\b4_\b2_\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* I\bIt\bt w\bwo\bou\bul\bld\bd b\bbe\be n\bni\bic\bce\be i\bif\bf t\bth\bhi\bis\bs c\bco\bou\bul\bld\bd b\bbe\be a\ban\bn i\bin\bnt\bte\ber\brn\bna\bal\bl t\bty\byp\bpe\be.\b. d\bde\bef\bfa\bau\bul\blt\bt_\b_d\bdi\bis\bsk\bk_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br d\bde\bep\bpe\ben\bnd\bds\bs o\bon\bn i\bit\bt n\bno\bow\bw *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/p\bpe\ber\brf\bfo\bor\brm\bma\ban\bnc\bce\be_\b_c\bco\bou\bun\bnt\bte\ber\brs\bs.\b.c\bcp\bpp\bp:\b:4\b42\b2 *\b**\b**\b* |\n-|THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" |\n-|AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |\n-|IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |\n-|ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |\n-|LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |\n-|CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |\n-|SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |\n-|INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |\n-|CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |\n-|ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |\n-|POSSIBILITY OF SUCH DAMAGE. |\n-| |\n-|*/ |\n-| |\n-|#include \"libtorrent/performance_counters.hpp\" |\n-|#include \"libtorrent/assert.hpp\" |\n-|#include // for memset |\n-| |\n-|namespace libtorrent { |\n-| |\n-|counters::counters() TORRENT_COUNTER_NOEXCEPT |\n-|{ |\n-|#ifdef ATOMIC_LLONG_LOCK_FREE |\n-|\t\tfor (auto& counter : m_stats_counter) |\n-|\t\t\tcounter.store(0, std::memory_order_relaxed); |\n-|#else |\n-|\t\tm_stats_counter.fill(0); |\n-|#endif |\n-|\t} |\n-| |\n-|\tcounters::counters(counters const& c) TORRENT_COUNTER_NOEXCEPT |\n-|\t{ |\n-|#ifdef ATOMIC_LLONG_LOCK_FREE |\n-|\t\tfor (int i = 0; i < m_stats_counter.end_index(); ++i) |\n-|\t\t\tm_stats_counter[i].store( |\n-|\t\t\t\tc.m_stats_counter[i].load(std::memory_order_relaxed) |\n-|\t\t\t\t\t, std::memory_order_relaxed); |\n-|#else |\n-|\t\tstd::lock_guard l(c.m_mutex); |\n-|\t\tm_stats_counter = c.m_stats_counter; |\n-|#endif |\n-|\t} |\n-| |\n-|\tcounters& counters::operator=(counters const& c) & TORRENT_COUNTER_NOEXCEPT |\n-|\t{ |\n-|\t\tif (&c == this) return *this; |\n-|#ifdef ATOMIC_LLONG_LOCK_FREE |\n-|\t\tfor (int i = 0; i < m_stats_counter.end_index(); ++i) |\n-|\t\t\tm_stats_counter[i].store( |\n-|\t\t\t\tc.m_stats_counter[i].load(std::memory_order_relaxed) |\n-|_\b\t_\b\t_\b\t_\b\t_\b\t_\b,_\b _\bs_\bt_\bd_\b:_\b:_\bm_\be_\bm_\bo_\br_\by_\b__\bo_\br_\bd_\be_\br_\b__\br_\be_\bl_\ba_\bx_\be_\bd_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b1_\b9_\b5_\b1_\b _\b _\b _\b _\b _\b _\b _\b|_\bt_\bh_\bi_\bs_\b _\bc_\bo_\bu_\bl_\bd_\b _\bb_\be_\b _\bo_\bp_\bt_\bi_\bm_\bi_\bz_\be_\bd_\b _\bb_\by_\b _\bl_\bo_\bo_\bk_\bi_\bn_\bg_\b _\bu_\bp_\b _\bw_\bh_\bi_\bc_\bh_\b _\bf_\bi_\bl_\be_\bs_\b _\ba_\br_\be_\b _\bc_\bo_\bm_\bp_\bl_\be_\bt_\be_\b _\ba_\bn_\bd_\b _\bj_\bu_\bs_\bt_\b _\bl_\bo_\bo_\bk_\b _\ba_\bt_\b _\bt_\bh_\bo_\bs_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs c\bco\bou\bul\bld\bd b\bbe\be o\bop\bpt\bti\bim\bmi\biz\bze\bed\bd b\bby\by l\blo\boo\bok\bki\bin\bng\bg u\bup\bp w\bwh\bhi\bic\bch\bh f\bfi\bil\ble\bes\bs a\bar\bre\be c\bco\bom\bmp\bpl\ble\bet\bte\be a\ban\bnd\bd j\bju\bus\bst\bt l\blo\boo\bok\bk a\bat\bt t\bth\bho\bos\bse\be *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:1\b19\b95\b51\b1 *\b**\b**\b* |\n-|//\t\t\t\tTORRENT_ASSERT(picker().have_piece(i)); |\n-|\t\t\t\twe_have(i); |\n-|\t\t\t} |\n+|\t\t\ts.set_int(settings_pack::int_type_base | i, int_settings[i].default_value); |\n+|\t\t\tTORRENT_ASSERT(s.get_int(settings_pack::int_type_base + i) == int_settings[i].default_value); |\n |\t\t} |\n | |\n-|\t\tset_state(torrent_status::checking_resume_data); |\n-| |\n-|\t\taux::vector links; |\n-|#ifndef TORRENT_DISABLE_MUTABLE_TORRENTS |\n-|\t\tif (!m_torrent_file->similar_torrents().empty() |\n-|\t\t\t|| !m_torrent_file->collections().empty()) |\n+|\t\tfor (int i = 0; i < settings_pack::num_bool_settings; ++i) |\n |\t\t{ |\n-|\t\t\tresolve_links res(m_torrent_file); |\n-| |\n-|\t\t\tfor (auto const& ih : m_torrent_file->similar_torrents()) |\n-|\t\t\t{ |\n-|\t\t\t\tstd::shared_ptr t = m_ses.find_torrent(info_hash_t(ih)).lock(); |\n-|\t\t\t\tif (!t) continue; |\n-| |\n-|\t\t\t\t// Only attempt to reuse files from torrents that are seeding. |\n-|if (!t->is_seed()) continue; |\n-| |\n-|\t\t\t\tres.match(t->get_torrent_file(), t->save_path()); |\n-|\t\t\t} |\n-|\t\t\tfor (auto const& c : m_torrent_file->collections()) |\n-|\t\t\t{ |\n-|\t\t\t\tstd::vector> ts = m_ses.find_collection(c); |\n-| |\n-|\t\t\t\tfor (auto const& t : ts) |\n-|\t\t\t\t{ |\n-|_\b\t_\b\t_\b\t_\b\t_\b\t_\b/_\b/_\b _\bO_\bn_\bl_\by_\b _\ba_\bt_\bt_\be_\bm_\bp_\bt_\b _\bt_\bo_\b _\br_\be_\bu_\bs_\be_\b _\bf_\bi_\bl_\be_\bs_\b _\bf_\br_\bo_\bm_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\bs_\b _\bt_\bh_\ba_\bt_\b _\ba_\br_\be_\b _\bs_\be_\be_\bd_\bi_\bn_\bg_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b1_\b9_\b6_\b4_\b _\b _\b _\b _\b _\b _\b _\b|_\bt_\bh_\bi_\bs_\b _\bc_\bo_\bu_\bl_\bd_\b _\bb_\be_\b _\bo_\bp_\bt_\bi_\bm_\bi_\bz_\be_\bd_\b _\bb_\by_\b _\bl_\bo_\bo_\bk_\bi_\bn_\bg_\b _\bu_\bp_\b _\bw_\bh_\bi_\bc_\bh_\b _\bf_\bi_\bl_\be_\bs_\b _\ba_\br_\be_\b _\bc_\bo_\bm_\bp_\bl_\be_\bt_\be_\b _\ba_\bn_\bd_\b _\bj_\bu_\bs_\bt_\b _\bl_\bo_\bo_\bk_\b _\ba_\bt_\b _\bt_\bh_\bo_\bs_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs c\bco\bou\bul\bld\bd b\bbe\be o\bop\bpt\bti\bim\bmi\biz\bze\bed\bd b\bby\by l\blo\boo\bok\bki\bin\bng\bg u\bup\bp w\bwh\bhi\bic\bch\bh f\bfi\bil\ble\bes\bs a\bar\bre\be c\bco\bom\bmp\bpl\ble\bet\bte\be a\ban\bnd\bd j\bju\bus\bst\bt l\blo\boo\bok\bk a\bat\bt t\bth\bho\bos\bse\be *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:1\b19\b96\b64\b4 *\b**\b**\b* |\n-|{ |\n-|\t\t\tresolve_links res(m_torrent_file); |\n-| |\n-|\t\t\tfor (auto const& ih : m_torrent_file->similar_torrents()) |\n-|\t\t\t{ |\n-|\t\t\t\tstd::shared_ptr t = m_ses.find_torrent(info_hash_t(ih)).lock(); |\n-|\t\t\t\tif (!t) continue; |\n-| |\n-|\t\t\t\t// Only attempt to reuse files from torrents that are seeding. |\n-|\t\t\t\tif (!t->is_seed()) continue; |\n-| |\n-|\t\t\t\tres.match(t->get_torrent_file(), t->save_path()); |\n-|\t\t\t} |\n-|\t\t\tfor (auto const& c : m_torrent_file->collections()) |\n-|\t\t\t{ |\n-|\t\t\t\tstd::vector> ts = m_ses.find_collection(c); |\n-| |\n-|\t\t\t\tfor (auto const& t : ts) |\n-|\t\t\t\t{ |\n-|\t\t\t\t\t// Only attempt to reuse files from torrents that are seeding. |\n-|if (!t->is_seed()) continue; |\n-| |\n-|\t\t\t\t\tres.match(t->get_torrent_file(), t->save_path()); |\n-|\t\t\t\t} |\n-|\t\t\t} |\n-| |\n-|\t\t\tstd::vector const& l = res.get_links(); |\n-|\t\t\tif (!l.empty()) |\n-|\t\t\t{ |\n-|\t\t\t\tlinks.resize(m_torrent_file->files().num_files()); |\n-|\t\t\t\tfor (auto const& i : l) |\n-|\t\t\t\t{ |\n-|\t\t\t\t\tif (!i.ti) continue; |\n-|\t\t\t\t\tlinks[i.file_idx] = combine_path(i.save_path |\n-|\t\t\t\t\t\t, i.ti->files().file_path(i.file_idx)); |\n-|\t\t\t\t} |\n-|\t\t\t} |\n+|\t\t\ts.set_bool(settings_pack::bool_type_base | i, bool_settings[i].default_value); |\n+|\t\t\tTORRENT_ASSERT(s.get_bool(settings_pack::bool_type_base + i) == bool_settings[i].default_value); |\n |\t\t} |\n-|#endif // TORRENT_DISABLE_MUTABLE_TORRENTS |\n-| |\n-|#if TORRENT_USE_ASSERTS |\n-|\t\tTORRENT_ASSERT(m_outstanding_check_files == false); |\n-|\t\tm_outstanding_check_files = true; |\n-|#endif |\n-| |\n-|\t\tif (!m_add_torrent_params || !(m_add_torrent_params->flags & torrent_flags::no_verify_files)) |\n-|\t\t{ |\n-|\t\t\tm_ses.disk_thread().async_check_files( |\n-|\t\t\t\tm_storage, m_add_torrent_params ? m_add_torrent_params.get() : nullptr |\n-|\t\t\t\t, std::move(links), [self = shared_from_this()](status_t st, storage_error const& error) |\n-|_\b\t_\b\t_\b\t_\b\t_\b{_\b _\bs_\be_\bl_\bf_\b-_\b>_\bo_\bn_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b__\bc_\bh_\be_\bc_\bk_\be_\bd_\b(_\bs_\bt_\b,_\b _\be_\br_\br_\bo_\br_\b)_\b;_\b _\b}_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b2_\b7_\b2_\b8 |this pattern is repeated in a few places. Factor this into a function and generalize the concept of a torrent having a dedicated |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bl_\bi_\bs_\bt_\be_\bn_\b _\bp_\bo_\br_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs p\bpa\bat\btt\bte\ber\brn\bn i\bis\bs r\bre\bep\bpe\bea\bat\bte\bed\bd i\bin\bn a\ba f\bfe\bew\bw p\bpl\bla\bac\bce\bes\bs.\b. F\bFa\bac\bct\bto\bor\br t\bth\bhi\bis\bs i\bin\bnt\bto\bo a\ba f\bfu\bun\bnc\bct\bti\bio\bon\bn a\ban\bnd\bd g\bge\ben\bne\ber\bra\bal\bli\biz\bze\be t\bth\bhe\be c\bco\bon\bnc\bce\bep\bpt\bt o\bof\bf a\ba t\bto\bor\brr\bre\ben\bnt\bt h\bha\bav\bvi\bin\bng\bg a\ba d\bde\bed\bdi\bic\bca\bat\bte\bed\bd l\bli\bis\bst\bte\ben\bn p\bpo\bor\brt\bt *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:2\b27\b72\b28\b8 *\b**\b**\b* |\n-|// not ready for peers. Except, if we don't have metadata, |\n-|\t\t// we need peers to download from |\n-|\t\tif (!m_files_checked && valid_metadata()) return; |\n-| |\n-|\t\tif (!m_announce_to_lsd) return; |\n-| |\n-|\t\t// private torrents are never announced on LSD |\n-|\t\tif (m_torrent_file->is_valid() && m_torrent_file->priv()) return; |\n-| |\n-|#if TORRENT_USE_I2P |\n-|\t\t// i2p torrents are also never announced on LSD |\n-|\t\t// unless we allow mixed swarms |\n-|\t\tif (is_i2p() && !settings().get_bool(settings_pack::allow_i2p_mixed)) |\n-|\t\t\treturn; |\n-|#endif |\n-| |\n-|\t\tif (is_paused()) return; |\n-| |\n-|\t\tif (!m_ses.has_lsd()) return; |\n-| |\n-|#ifdef TORRENT_SSL_PEERS |\n-|int port = is_ssl_torrent() ? m_ses.ssl_listen_port() : m_ses.listen_port(); |\n-|#else |\n-|\t\tint port = m_ses.listen_port(); |\n-|#endif |\n-| |\n-|\t\t// announce with the local discovery service |\n-|\t\tm_torrent_file->info_hashes().for_each([&](sha1_hash const& ih, protocol_version) |\n-|\t\t{ |\n-|\t\t\tm_ses.announce_lsd(ih, port); |\n-|\t\t}); |\n |\t} |\n | |\n-|#ifndef TORRENT_DISABLE_DHT |\n-| |\n-|\tvoid torrent::dht_announce() |\n-|\t{ |\n-|\t\tTORRENT_ASSERT(is_single_thread()); |\n-|\t\tif (!m_ses.dht()) |\n-|\t\t{ |\n-|#ifndef TORRENT_DISABLE_LOGGING |\n-|\t\t\tdebug_log(\"DHT: no dht initialized\"); |\n-|#endif |\n-|\t\t\treturn; |\n-|\t\t} |\n-|\t\tif (!should_announce_dht()) |\n-|\t\t{ |\n-|#ifndef TORRENT_DISABLE_LOGGING |\n-|\t\t\tif (should_log()) |\n-|\t\t\t{ |\n-|_\b#_\bi_\bf_\b _\bT_\bO_\bR_\bR_\bE_\bN_\bT_\b__\bU_\bS_\bE_\b__\bI_\b2_\bP_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b3_\b8_\b8_\b5_\b _\b _\b _\b _\b _\b _\b _\b|_\ba_\bd_\bd_\b _\bo_\bn_\be_\b _\bp_\be_\be_\br_\b _\bp_\be_\br_\b _\bI_\bP_\b _\bt_\bh_\be_\b _\bh_\bo_\bs_\bt_\bn_\ba_\bm_\be_\b _\br_\be_\bs_\bo_\bl_\bv_\be_\bs_\b _\bt_\bo_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* a\bad\bdd\bd o\bon\bne\be p\bpe\bee\ber\br p\bpe\ber\br I\bIP\bP t\bth\bhe\be h\bho\bos\bst\btn\bna\bam\bme\be r\bre\bes\bso\bol\blv\bve\bes\bs t\bto\bo *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:3\b38\b88\b85\b5 *\b**\b**\b* |\n-|catch (...) { handle_exception(); } |\n-|#endif |\n-| |\n-|\tvoid torrent::on_peer_name_lookup(error_code const& e |\n-|\t\t, std::vector
    const& host_list, int const port |\n-|\t\t, protocol_version const v) try |\n+|\tsettings_pack default_settings() |\n |\t{ |\n-|\t\tTORRENT_ASSERT(is_single_thread()); |\n-| |\n-|\t\tINVARIANT_CHECK; |\n-| |\n-|\t\tCOMPLETE_ASYNC(\"torrent::on_peer_name_lookup\"); |\n-| |\n-|#ifndef TORRENT_DISABLE_LOGGING |\n-|\t\tif (e && should_log()) |\n-|\t\t\tdebug_log(\"peer name lookup error: %s\", e.message().c_str()); |\n-|#endif |\n-| |\n-|\t\tif (e || m_abort || host_list.empty() || m_ses.is_aborted()) return; |\n-| |\n-|tcp::endpoint host(host_list.front(), std::uint16_t(port)); |\n-| |\n-|\t\tif (m_ip_filter && m_ip_filter->access(host.address()) & ip_filter::blocked) |\n-|\t\t{ |\n-|#ifndef TORRENT_DISABLE_LOGGING |\n-|\t\t\tif (should_log()) |\n-|\t\t\t{ |\n-|\t\t\t\tdebug_log(\"blocked ip from tracker: %s\", host.address().to_string().c_str()); |\n-|\t\t\t} |\n-|#endif |\n-|\t\t\tif (m_ses.alerts().should_post()) |\n-|\t\t\t\tm_ses.alerts().emplace_alert(get_handle() |\n-|\t\t\t\t\t, host, peer_blocked_alert::ip_filter); |\n-|\t\t\treturn; |\n-|\t\t} |\n-| |\n-|\t\tif (add_peer(host, peer_info::tracker, v == protocol_version::V2 ? pex_lt_v2 : pex_flags_t(0))) |\n-|\t\t{ |\n-|\t\t\tstate_updated(); |\n-| |\n-|#ifndef TORRENT_DISABLE_LOGGING |\n-|\t\t\tif (should_log()) |\n-|\t\t\t{ |\n-|\t\t\t\tdebug_log(\"name-lookup add_peer() [ %s ] connect-candidates: %d\" |\n-|\t\t\t\t\t, host.address().to_string().c_str() |\n-|\t\t\t\t\t, m_peer_list ? m_peer_list->num_connect_candidates() : -1); |\n-|\t\t\t} |\n-|#endif |\n-|\t\t} |\n-|\t\tupdate_want_peers(); |\n-|_\b\t_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b4_\b5_\b8_\b1_\b _\b _\b _\b _\b _\b _\b _\b|_\bo_\bn_\bl_\by_\b _\bd_\bo_\b _\bt_\bh_\bi_\bs_\b _\bi_\bf_\b _\bt_\bh_\be_\b _\bp_\bi_\be_\bc_\be_\b _\bs_\bi_\bz_\be_\b _\b>_\b _\b1_\b _\bb_\bl_\bo_\bc_\bk_\bs_\b _\bT_\bh_\bi_\bs_\b _\bi_\bs_\b _\ba_\b _\bv_\b2_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\b _\bs_\bo_\b _\bw_\be_\b _\bc_\ba_\bn_\b _\br_\be_\bq_\bu_\be_\bs_\bt_\b _\bg_\be_\bt_\b _\bb_\bl_\bo_\bc_\bk_\b _\bl_\be_\bv_\be_\bl_\b _\bh_\ba_\bs_\bh_\be_\bs_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* o\bon\bnl\bly\by d\bdo\bo t\bth\bhi\bis\bs i\bif\bf t\bth\bhe\be p\bpi\bie\bec\bce\be s\bsi\biz\bze\be >\b> 1\b1 b\bbl\blo\boc\bck\bks\bs T\bTh\bhi\bis\bs i\bis\bs a\ba v\bv2\b2 t\bto\bor\brr\bre\ben\bnt\bt s\bso\bo w\bwe\be c\bca\ban\bn r\bre\beq\bqu\bue\bes\bst\bt g\bge\bet\bt b\bbl\blo\boc\bck\bk l\ble\bev\bve\bel\bl h\bha\bas\bsh\bhe\bes\bs.\b. *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:4\b45\b58\b81\b1 *\b**\b**\b* |\n+|\t\tsettings_pack ret; |\n+|for (int i = 0; i < settings_pack::num_string_settings; ++i) |\n |{ |\n-|\t\t\tstd::set ret; |\n-|\t\t\tif (!blocks.empty() && !downloaders.empty()) |\n-|\t\t\t{ |\n-|\t\t\t\tfor (auto const b : blocks) ret.insert(downloaders[std::size_t(b)]); |\n-|\t\t\t} |\n-|\t\t\telse |\n-|\t\t\t{ |\n-|\t\t\t\tstd::copy(downloaders.begin(), downloaders.end(), std::inserter(ret, ret.begin())); |\n-|\t\t\t} |\n-|\t\t\treturn ret; |\n-|\t\t}(); |\n-| |\n-|\t\t// if this piece wasn't downloaded from peers, we just found it on disk. |\n-|\t\t// In that case, we should just consider it as \"not-have\" and there's no |\n-|\t\t// need to try to get higher fidelity hashes (yet) |\n-|\t\tbool const found_on_disk = peers.size() == 1 && peers.count(nullptr); |\n-| |\n-|\t\tif (!torrent_file().info_hashes().has_v1() && blocks.empty() && !found_on_disk) |\n-|\t\t{ |\n-|verify_block_hashes(index); |\n-|} |\n-| |\n-|\t\t// the below code is penalizing peers that sent use bad data. |\n-|\t\t// increase the total amount of failed bytes |\n-|\t\tif (!found_on_disk) |\n-|\t\t{ |\n-|\t\t\tif (blocks.empty()) |\n-|\t\t\t\tadd_failed_bytes(m_torrent_file->piece_size(index)); |\n-|\t\t\telse |\n-|\t\t\t\tadd_failed_bytes(static_cast(blocks.size()) * default_block_size); |\n-| |\n-|#ifndef TORRENT_DISABLE_EXTENSIONS |\n-|\t\t\tfor (auto& ext : m_extensions) |\n-|\t\t\t{ |\n-|\t\t\t\text->on_piece_failed(index); |\n-|\t\t\t} |\n-|#endif |\n-| |\n-|\t\t\t// did we receive this piece from a single peer? |\n-|\t\t\t// if we know exactly which blocks failed the hash, we can also be certain |\n-|\t\t\t// that all peers in the list sent us bad data |\n-|\t\t\tbool const known_bad_peer = (!found_on_disk && peers.size() == 1) || !blocks.empty(); |\n-| |\n-|\t\t\tpenalize_peers(peers, index, known_bad_peer); |\n+|\t\t\tif (str_settings[i].default_value == nullptr) continue; |\n+|\t\t\tret.set_str(settings_pack::string_type_base + i, str_settings[i].default_value); |\n |\t\t} |\n | |\n-|\t\t// If m_storage isn't set here, it means we're shutting down |\n-|\t\tif (m_storage) |\n+|\t\tfor (int i = 0; i < settings_pack::num_int_settings; ++i) |\n |\t\t{ |\n-|_\b\t_\b\t_\b\t_\b/_\b/_\b _\bi_\bt_\b _\bd_\bo_\be_\bs_\bn_\b'_\bt_\b _\bm_\ba_\bk_\be_\b _\bm_\bu_\bc_\bh_\b _\bs_\be_\bn_\bs_\be_\b _\bt_\bo_\b _\bf_\ba_\bi_\bl_\b _\bt_\bo_\b _\bh_\ba_\bs_\bh_\b _\ba_\b _\bp_\bi_\be_\bc_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b7_\b5_\b2_\b5_\b _\b _\b _\b _\b _\b _\b _\b|_\bc_\bo_\bm_\be_\b _\bu_\bp_\b _\bw_\bi_\bt_\bh_\b _\ba_\b _\bb_\be_\bt_\bt_\be_\br_\b _\bw_\ba_\by_\b _\bo_\bf_\b _\bd_\bo_\bi_\bn_\bg_\b _\bt_\bh_\bi_\bs_\b,_\b _\bi_\bn_\bs_\bt_\be_\ba_\bd_\b _\bo_\bf_\b _\ba_\bn_\b _\bi_\bm_\bm_\be_\bd_\bi_\ba_\bt_\be_\bl_\by_\b _\bi_\bn_\bv_\bo_\bk_\be_\bd_\b _\bl_\ba_\bm_\bb_\bd_\ba_\b _\be_\bx_\bp_\br_\be_\bs_\bs_\bi_\bo_\bn_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* c\bco\bom\bme\be u\bup\bp w\bwi\bit\bth\bh a\ba b\bbe\bet\btt\bte\ber\br w\bwa\bay\by o\bof\bf d\bdo\boi\bin\bng\bg t\bth\bhi\bis\bs,\b, i\bin\bns\bst\bte\bea\bad\bd o\bof\bf a\ban\bn i\bim\bmm\bme\bed\bdi\bia\bat\bte\bel\bly\by i\bin\bnv\bvo\bok\bke\bed\bd l\bla\bam\bmb\bbd\bda\ba e\bex\bxp\bpr\bre\bes\bss\bsi\bio\bon\bn.\b. *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:7\b75\b52\b25\b5 *\b**\b**\b* |\n-||| peerinfo->confirmed_supports_utp)) |\n-|\t\t\t{ |\n-|\t\t\t\tsm = m_ses.utp_socket_manager(); |\n-|\t\t\t} |\n-| |\n-|\t\t\t// don't make a TCP connection if it's disabled |\n-|\t\t\tif (sm == nullptr && !settings().get_bool(settings_pack::enable_outgoing_tcp)) |\n-|\t\t\t{ |\n-|#ifndef TORRENT_DISABLE_LOGGING |\n-|\t\t\t\tif (should_log()) |\n-|\t\t\t\t{ |\n-|\t\t\t\t\tdebug_log(\"discarding peer \\\"%s\\\": TCP connections disabled \" |\n-|\t\t\t\t\t\t\"[ supports-utp: %d ]\", peerinfo->to_string().c_str() |\n-|\t\t\t\t\t\t, peerinfo->supports_utp); |\n-|\t\t\t\t} |\n-|#endif |\n-|\t\t\t\treturn false; |\n-|\t\t\t} |\n+|\t\t\tret.set_int(settings_pack::int_type_base + i, int_settings[i].default_value); |\n |\t\t} |\n | |\n-|aux::socket_type s = [&] { |\n-| |\n-|#if TORRENT_USE_I2P |\n-|\t\tif (peerinfo->is_i2p_addr) |\n+|\t\tfor (int i = 0; i < settings_pack::num_bool_settings; ++i) |\n |\t\t{ |\n-|\t\t\t// It's not entirely obvious why this peer connection is not marked as |\n-|\t\t\t// one. The main feature of a peer connection is that whether or not we |\n-|\t\t\t// proxy it is configurable. When we use i2p, we want to always prox |\n-|\t\t\t// everything via i2p. |\n-| |\n-|\t\t\taux::proxy_settings proxy; |\n-|\t\t\tproxy.hostname = settings().get_str(settings_pack::i2p_hostname); |\n-|\t\t\tproxy.port = std::uint16_t(settings().get_int(settings_pack::i2p_port)); |\n-|\t\t\tproxy.type = settings_pack::i2p_proxy; |\n-| |\n-|\t\t\taux::socket_type ret = instantiate_connection(m_ses.get_context() |\n-|\t\t\t\t, proxy, nullptr, nullptr, false, false); |\n-|\t\t\ti2p_stream& str = boost::get(ret); |\n-|\t\t\tstr.set_local_i2p_endpoint(m_ses.local_i2p_endpoint()); |\n-|\t\t\tstr.set_destination(static_cast(peerinfo)->dest()); |\n-|\t\t\tstr.set_command(i2p_stream::cmd_connect); |\n-|\t\t\tstr.set_session_id(m_ses.i2p_session()); |\n-|\t\t\treturn ret; |\n+|\t\t\tret.set_bool(settings_pack::bool_type_base + i, bool_settings[i].default_value); |\n |\t\t} |\n-|\t\telse |\n-|#endif |\n-|\t\t{ |\n-|\t\t\tvoid* userdata = nullptr; |\n-|#ifdef TORRENT_SSL_PEERS |\n-|\t\t\tif (is_ssl_torrent()) |\n-|_\b\t_\b\t_\b\t_\b{_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b9_\b1_\b1_\b8_\b _\b _\b _\b _\b _\b _\b _\b|_\bp_\be_\br_\bh_\ba_\bp_\bs_\b _\b0_\b _\bs_\bh_\bo_\bu_\bl_\bd_\b _\ba_\bc_\bt_\bu_\ba_\bl_\bl_\by_\b _\bm_\be_\ba_\bn_\b _\b0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* p\bpe\ber\brh\bha\bap\bps\bs 0\b0 s\bsh\bho\bou\bul\bld\bd a\bac\bct\btu\bua\bal\bll\bly\by m\bme\bea\ban\bn 0\b0 *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:9\b91\b11\b18\b8 *\b**\b**\b* |\n-|// finished torrents may not change their queue positions, as it's set to |\n-|\t\t// -1 |\n-|\t\tif ((m_abort || is_finished()) && p != no_pos) return; |\n-| |\n-|\t\tTORRENT_ASSERT((p == no_pos) == is_finished() |\n-|\t\t\t|| (!m_auto_managed && p == no_pos) |\n-|\t\t\t|| (m_abort && p == no_pos) |\n-|\t\t\t|| (!m_added && p == no_pos)); |\n-|\t\tif (p == m_sequence_number) return; |\n-| |\n-|\t\tTORRENT_ASSERT(p >= no_pos); |\n-| |\n-|\t\tstate_updated(); |\n-| |\n-|\t\tm_ses.set_queue_position(this, p); |\n-|\t} |\n-| |\n-|\tvoid torrent::set_max_uploads(int limit, bool const state_update) |\n-|\t{ |\n-|\t\tTORRENT_ASSERT(is_single_thread()); |\n-|if (limit <= 0) limit = (1 << 24) - 1; |\n-|if (int(m_max_uploads) == limit) return; |\n-|\t\tif (state_update) state_updated(); |\n-|\t\tm_max_uploads = aux::numeric_cast(limit); |\n-|#ifndef TORRENT_DISABLE_LOGGING |\n-|\t\tif (should_log() && state_update) |\n-|\t\t\tdebug_log(\"*** set-max-uploads: %d\", m_max_uploads); |\n-|#endif |\n-| |\n-|\t\tif (state_update) |\n-|\t\t\tset_need_save_resume(torrent_handle::if_config_changed); |\n-|\t} |\n-| |\n-|\tvoid torrent::set_max_connections(int limit, bool const state_update) |\n-|\t{ |\n-|_\b\t_\b\t_\bT_\bO_\bR_\bR_\bE_\bN_\bT_\b__\bA_\bS_\bS_\bE_\bR_\bT_\b(_\bi_\bs_\b__\bs_\bi_\bn_\bg_\bl_\be_\b__\bt_\bh_\br_\be_\ba_\bd_\b(_\b)_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b9_\b1_\b3_\b5_\b _\b _\b _\b _\b _\b _\b _\b|_\bp_\be_\br_\bh_\ba_\bp_\bs_\b _\b0_\b _\bs_\bh_\bo_\bu_\bl_\bd_\b _\ba_\bc_\bt_\bu_\ba_\bl_\bl_\by_\b _\bm_\be_\ba_\bn_\b _\b0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* p\bpe\ber\brh\bha\bap\bps\bs 0\b0 s\bsh\bho\bou\bul\bld\bd a\bac\bct\btu\bua\bal\bll\bly\by m\bme\bea\ban\bn 0\b0 *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:9\b91\b13\b35\b5 *\b**\b**\b* |\n-|\tvoid torrent::set_max_uploads(int limit, bool const state_update) |\n-|\t{ |\n-|\t\tTORRENT_ASSERT(is_single_thread()); |\n-|\t\tif (limit <= 0) limit = (1 << 24) - 1; |\n-|\t\tif (int(m_max_uploads) == limit) return; |\n-|\t\tif (state_update) state_updated(); |\n-|\t\tm_max_uploads = aux::numeric_cast(limit); |\n-|#ifndef TORRENT_DISABLE_LOGGING |\n-|\t\tif (should_log() && state_update) |\n-|\t\t\tdebug_log(\"*** set-max-uploads: %d\", m_max_uploads); |\n-|#endif |\n-| |\n-|\t\tif (state_update) |\n-|\t\t\tset_need_save_resume(torrent_handle::if_config_changed); |\n+|\t\treturn ret; |\n |\t} |\n | |\n-|\tvoid torrent::set_max_connections(int limit, bool const state_update) |\n+|\tvoid apply_pack(settings_pack const* pack, aux::session_settings& sett |\n+|\t\t, aux::session_impl* ses) |\n |\t{ |\n-|\t\tTORRENT_ASSERT(is_single_thread()); |\n-|if (limit <= 0) limit = (1 << 24) - 1; |\n-|if (int(m_max_connections) == limit) return; |\n-|\t\tif (state_update) state_updated(); |\n-|\t\tm_max_connections = aux::numeric_cast(limit); |\n-|\t\tupdate_want_peers(); |\n-| |\n-|#ifndef TORRENT_DISABLE_LOGGING |\n-|\t\tif (should_log() && state_update) |\n-|\t\t\tdebug_log(\"*** set-max-connections: %d\", m_max_connections); |\n-|#endif |\n+|\t\tusing fun_t = void (aux::session_impl::*)(); |\n+|\t\tstd::vector callbacks; |\n | |\n-|\t\tif (num_peers() > int(m_max_connections)) |\n+|\t\tsett.bulk_set([&](aux::session_settings_single_thread& s) |\n |\t\t{ |\n-|\t\t\tdisconnect_peers(num_peers() - m_max_connections |\n-|\t\t\t\t, errors::too_many_connections); |\n-|\t\t} |\n-| |\n-|\t\tif (state_update) |\n-|\t\t\tset_need_save_resume(torrent_handle::if_config_changed); |\n-|\t} |\n-| |\n-|\tvoid torrent::set_upload_limit(int const limit) |\n-|\t{ |\n-|\t\tset_limit_impl(limit, peer_connection::upload_channel); |\n-|#ifndef TORRENT_DISABLE_LOGGING |\n-|\t\tdebug_log(\"*** set-upload-limit: %d\", limit); |\n-|#endif |\n-|\t} |\n-| |\n-|\tvoid torrent::set_download_limit(int const limit) |\n-|_\b\t_\b{_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b1_\b1_\b0_\b6_\b1_\b _\b _\b _\b _\b _\b _\b|_\bi_\bn_\bs_\bt_\be_\ba_\bd_\b _\bo_\bf_\b _\br_\be_\bs_\bo_\br_\bt_\bi_\bn_\bg_\b _\bt_\bh_\be_\b _\bw_\bh_\bo_\bl_\be_\b _\bl_\bi_\bs_\bt_\b,_\b _\bi_\bn_\bs_\be_\br_\bt_\b _\bt_\bh_\be_\b _\bp_\be_\be_\br_\bs_\b _\bd_\bi_\br_\be_\bc_\bt_\bl_\by_\b _\bi_\bn_\bt_\bo_\b _\bt_\bh_\be_\b _\br_\bi_\bg_\bh_\bt_\b _\bp_\bl_\ba_\bc_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* i\bin\bns\bst\bte\bea\bad\bd o\bof\bf r\bre\bes\bso\bor\brt\bti\bin\bng\bg t\bth\bhe\be w\bwh\bho\bol\ble\be l\bli\bis\bst\bt,\b, i\bin\bns\bse\ber\brt\bt t\bth\bhe\be p\bpe\bee\ber\brs\bs d\bdi\bir\bre\bec\bct\btl\bly\by i\bin\bnt\bto\bo t\bth\bhe\be r\bri\big\bgh\bht\bt p\bpl\bla\bac\bce\be *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:1\b11\b10\b06\b61\b1 *\b**\b**\b* |\n-|std::printf(\"timed out [average-piece-time: %d ms ]\\n\" |\n-|\t\t\t\t\t, m_average_piece_time); |\n-|#endif |\n-|\t\t\t} |\n-| |\n-|\t\t\t// pick all blocks for this piece. the peers list is kept up to date |\n-|\t\t\t// and sorted. when we issue a request to a peer, its download queue |\n-|\t\t\t// time will increase and it may need to be bumped in the peers list, |\n-|\t\t\t// since it's ordered by download queue time |\n-|\t\t\tpick_time_critical_block(peers, ignore_peers |\n-|\t\t\t\t, peers_with_requests |\n-|\t\t\t\t, pi, &i, m_picker.get() |\n-|\t\t\t\t, blocks_in_piece, timed_out); |\n-| |\n-|\t\t\t// put back the peers we ignored into the peer list for the next piece |\n-|\t\t\tif (!ignore_peers.empty()) |\n-|\t\t\t{ |\n-|\t\t\t\tpeers.insert(peers.begin(), ignore_peers.begin(), ignore_peers.end()); |\n-|\t\t\t\tignore_peers.clear(); |\n-| |\n-|std::sort(peers.begin(), peers.end() |\n-|, [] (peer_connection const* lhs, peer_connection const* rhs) |\n-|\t\t\t\t\t{ return lhs->download_queue_time(16*1024) < rhs->download_queue_time(16*1024); }); |\n-|\t\t\t} |\n-| |\n-|\t\t\t// if this peer's download time exceeds 2 seconds, we're done. |\n-|\t\t\t// We don't want to build unreasonably long request queues |\n-|\t\t\tif (!peers.empty() && peers[0]->download_queue_time() > milliseconds(2000)) |\n-|\t\t\t\tbreak; |\n-|\t\t} |\n+|\t\t\tapply_pack_impl(pack, s, ses ? &callbacks : nullptr); |\n+|\t\t}); |\n | |\n-|\t\t// commit all the time critical requests |\n-|\t\tfor (auto p : peers_with_requests) |\n-|\t\t{ |\n-|\t\t\tp->send_block_requests(); |\n-|\t\t} |\n+|\t\t// call the callbacks once all the settings have been applied, and |\n+|_\b\t_\b\t_\b/_\b/_\b _\bo_\bn_\bl_\by_\b _\bo_\bn_\bc_\be_\b _\bp_\be_\br_\b _\bc_\ba_\bl_\bl_\bb_\ba_\bc_\bk_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bc_\br_\be_\ba_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b6_\b1_\b8_\b _\b|_\bt_\bh_\bi_\bs_\b _\bc_\ba_\bn_\b _\bb_\be_\b _\bo_\bp_\bt_\bi_\bm_\bi_\bz_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs c\bca\ban\bn b\bbe\be o\bop\bpt\bti\bim\bmi\biz\bze\bed\bd *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/c\bcr\bre\bea\bat\bte\be_\b_t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:6\b61\b18\b8 *\b**\b**\b* |\n+|std::string& attr = e[\"attr\"].string(); |\n+|\t\tif (flags & file_storage::flag_pad_file) attr += 'p'; |\n+|\t\tif (flags & file_storage::flag_hidden) attr += 'h'; |\n+|\t\tif (flags & file_storage::flag_executable) attr += 'x'; |\n+|\t\tif (include_symlinks && (flags & file_storage::flag_symlink)) attr += 'l'; |\n |\t} |\n-|#endif // TORRENT_DISABLE_STREAMING |\n | |\n-|\tstd::set torrent::web_seeds(web_seed_entry::type_t const type) const |\n-|\t{ |\n-|\t\tTORRENT_ASSERT(is_single_thread()); |\n-|\t\tstd::set ret; |\n-|\t\tfor (auto const& s : m_web_seeds) |\n-|\t\t{ |\n-|\t\t\tif (s.peer_info.banned) continue; |\n-|\t\t\tif (s.removed) continue; |\n-|\t\t\tif (s.type != type) continue; |\n-|\t\t\tret.insert(s.url); |\n-|\t\t} |\n-|_\b\t_\b\t_\br_\be_\bt_\bu_\br_\bn_\b _\br_\be_\bt_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bc_\bp_\bu_\bi_\bd_\b._\bc_\bp_\bp_\b:_\b1_\b3_\b1_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\be_\bn_\ba_\bb_\bl_\be_\b _\bw_\bh_\be_\bn_\b _\ba_\ba_\br_\bc_\bh_\b6_\b4_\b _\bi_\bs_\b _\br_\be_\ba_\bl_\bl_\by_\b _\bt_\be_\bs_\bt_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* e\ben\bna\bab\bbl\ble\be w\bwh\bhe\ben\bn a\baa\bar\brc\bch\bh6\b64\b4 i\bis\bs r\bre\bea\bal\bll\bly\by t\bte\bes\bst\bte\bed\bd *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/c\bcp\bpu\bui\bid\bd.\b.c\bcp\bpp\bp:\b:1\b13\b31\b1 *\b**\b**\b* |\n-|bool supports_mmx() noexcept |\n+|\tvoid add_symlink_path(entry& e, std::string symlink_path) |\n |\t{ |\n-|#if TORRENT_HAS_SSE |\n-|\t\tstd::uint32_t cpui[4] = {0}; |\n-|\t\tcpuid(cpui, 1); |\n-|\t\treturn (cpui[2] & (1 << 23)) != 0; |\n-|#else |\n-|\t\treturn false; |\n-|#endif |\n-|\t} |\n+|\t\tentry& sympath_e = e[\"symlink path\"]; |\n | |\n-|\tbool supports_arm_neon() noexcept |\n-|\t{ |\n-|#if TORRENT_HAS_ARM_NEON && TORRENT_HAS_AUXV |\n-|#if defined __arm__ |\n-|\t\t//return (getauxval(AT_HWCAP) & HWCAP_NEON); |\n-|\t\treturn (helper_getauxval(16) & (1 << 12)); |\n-|#elif defined __aarch64__ |\n-|\t\t//return (getauxval(AT_HWCAP) & HWCAP_ASIMD); |\n-|\t\t//return (getauxval(16) & (1 << 1)); |\n-|return false; |\n-|#endif |\n-|#else |\n-|\t\treturn false; |\n-|#endif |\n+|\t\tstd::string const link = lexically_relative(\"\", symlink_path); |\n+|\t\tfor (auto elems = lsplit_path(link); !elems.first.empty(); |\n+|\t\t\telems = lsplit_path(elems.second)) |\n+|\t\t\tsympath_e.list().emplace_back(elems.first); |\n |\t} |\n+|} |\n | |\n-|\tbool supports_arm_crc32c() noexcept |\n+|\tstd::vector create_torrent::generate_buf() const |\n |\t{ |\n-|#if TORRENT_HAS_ARM_CRC32 && TORRENT_HAS_AUXV |\n-|#if defined TORRENT_FORCE_ARM_CRC32 |\n-|\t\treturn true; |\n-|#elif defined __arm__ |\n-|\t\t//return (getauxval(AT_HWCAP2) & HWCAP2_CRC32); |\n-|\t\treturn (helper_getauxval(26) & (1 << 4)); |\n-|#elif defined __aarch64__ |\n-|\t\t//return (getauxval(AT_HWCAP) & HWCAP_CRC32); |\n-|\t\treturn (helper_getauxval(16) & (1 << 7)); |\n-|#endif |\n-|#else |\n-|\t\treturn false; |\n-|#endif |\n+|std::vector ret; |\n+|bencode(std::back_inserter(ret), generate()); |\n+|\t\treturn ret; |\n |\t} |\n | |\n-|} // anonymous namespace |\n-| |\n-|\tbool const sse42_support = supports_sse42(); |\n-|\tbool const mmx_support = supports_mmx(); |\n-|\tbool const arm_neon_support = supports_arm_neon(); |\n-|\tbool const arm_crc32c_support = supports_arm_crc32c(); |\n-|_\b}_\b _\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bh_\ba_\bs_\bh_\b__\bp_\bi_\bc_\bk_\be_\br_\b._\bc_\bp_\bp_\b:_\b3_\b0_\b9_\b _\b _\b _\b _\b|_\bu_\bs_\be_\b _\bs_\bt_\br_\bu_\bc_\bt_\bu_\br_\be_\bd_\b _\bb_\bi_\bn_\bd_\bi_\bn_\bg_\bs_\b _\bi_\bn_\b _\bC_\b+_\b+_\b1_\b7_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* u\bus\bse\be s\bst\btr\bru\buc\bct\btu\bur\bre\bed\bd b\bbi\bin\bnd\bdi\bin\bng\bgs\bs i\bin\bn C\bC+\b++\b+1\b17\b7 *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/h\bha\bas\bsh\bh_\b_p\bpi\bic\bck\bke\ber\br.\b.c\bcp\bpp\bp:\b:3\b30\b09\b9 *\b**\b**\b* |\n-|, int const offset, sha256_hash const& h) |\n+|\tentry create_torrent::generate() const |\n |\t{ |\n-|\t\tTORRENT_ASSERT(offset >= 0); |\n-|\t\tauto const f = m_files.file_index_at_piece(piece); |\n-| |\n-|\t\tif (m_files.pad_file_at(f)) |\n-|\t\t\treturn { set_block_hash_result::result::success, 0, 0 }; |\n-| |\n-|\t\tauto& merkle_tree = m_merkle_trees[f]; |\n-|\t\tpiece_index_t const file_first_piece = m_files.piece_index_at_file(f); |\n-|\t\tstd::int64_t const block_offset = static_cast(piece) * std::int64_t(m_files.piece_length()) |\n-|\t\t\t+ offset - m_files.file_offset(f); |\n-|\t\tint const block_index = aux::numeric_cast(block_offset / default_block_size); |\n-| |\n-|\t\tif (h.is_all_zeros()) |\n-|\t\t{ |\n-|\t\t\tTORRENT_ASSERT_FAIL(); |\n-|\t\t\treturn set_block_hash_result::block_hash_failed(); |\n-|\t\t} |\n-| |\n-|aux::merkle_tree::set_block_result result; |\n-|int leafs_index; |\n-|\t\tint leafs_size; |\n-|\t\tstd::tie(result, leafs_index, leafs_size) = merkle_tree.set_block(block_index, h); |\n-| |\n-|\t\tif (result == aux::merkle_tree::set_block_result::unknown) |\n-|\t\t\treturn set_block_hash_result::unknown(); |\n-|\t\tif (result == aux::merkle_tree::set_block_result::block_hash_failed) |\n-|\t\t\treturn set_block_hash_result::block_hash_failed(); |\n-| |\n-|\t\tauto const status = (result == aux::merkle_tree::set_block_result::hash_failed) |\n-|\t\t\t? set_block_hash_result::result::piece_hash_failed |\n-|\t\t\t: set_block_hash_result::result::success; |\n-| |\n-|\t\tint const blocks_per_piece = m_files.piece_length() / default_block_size; |\n+|\t\tif (m_files.num_files() == 0 || m_files.total_size() == 0) |\n+|\t\t\taux::throw_ex(errors::torrent_missing_file_tree); |\n | |\n-|\t\treturn { status |\n-|\t\t\t, int(leafs_index - static_cast(piece - file_first_piece) * blocks_per_piece) |\n-|\t\t\t, std::min(leafs_size, m_files.file_num_pieces(f) * blocks_per_piece - leafs_index) }; |\n-|\t} |\n+|\t\t// if all v2 hashes are set correctly, generate the v2 parts of the |\n+|\t\t// torrent |\n+|\t\tbool const make_v2 = validate_v2_hashes(m_files, m_file_piece_hash); |\n+|\t\tbool const make_v1 = validate_v1_hashes(m_files, m_piece_hash); |\n | |\n-|\tvoid hash_picker::hashes_rejected(hash_request const& req) |\n-|\t{ |\n-|\t\tTORRENT_ASSERT(req.base == m_piece_layer && req.index % 512 == 0); |\n+|\t\t// if neither v1 nor v2 hashes were set, we can't create a torrent |\n+|\t\tif (!make_v1 && !make_v2) |\n+|\t\t\taux::throw_ex(errors::invalid_hash_entry); |\n | |\n-|\t\tfor (int i = req.index; i < req.index + req.count; i += 512) |\n-|\t\t{ |\n-|\t\t\tm_piece_hash_requested[req.file][i / 512].last_request = min_time(); |\n-|\t\t\t--m_piece_hash_requested[req.file][i / 512].num_requests; |\n-|_\b\t_\b\t_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\be_\be_\br_\b._\bc_\bp_\bp_\b:_\b1_\b9_\b2_\b _\b _\b _\b|_\bh_\bo_\bw_\b _\bd_\bo_\b _\bw_\be_\b _\bd_\be_\ba_\bl_\b _\bw_\bi_\bt_\bh_\b _\bo_\bu_\br_\b _\be_\bx_\bt_\be_\br_\bn_\ba_\bl_\b _\ba_\bd_\bd_\br_\be_\bs_\bs_\b _\bc_\bh_\ba_\bn_\bg_\bi_\bn_\bg_\b?_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* h\bho\bow\bw d\bdo\bo w\bwe\be d\bde\bea\bal\bl w\bwi\bit\bth\bh o\bou\bur\br e\bex\bxt\bte\ber\brn\bna\bal\bl a\bad\bdd\bdr\bre\bes\bss\bs c\bch\bha\ban\bng\bgi\bin\bng\bg?\b? *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt_\b_p\bpe\bee\ber\br.\b.c\bcp\bpp\bp:\b:1\b19\b92\b2 *\b**\b**\b* |\n-|// connections. If it fails, we'll |\n-|\t\t// retry with encryption |\n-|\t\t, pe_support(false) |\n-|#endif |\n-|\t\t, is_v6_addr(false) |\n-|#if TORRENT_USE_I2P |\n-|\t\t, is_i2p_addr(false) |\n-|#endif |\n-|\t\t, on_parole(false) |\n-|\t\t, banned(false) |\n-|\t\t, supports_utp(true) // assume peers support utp |\n-|\t\t, confirmed_supports_utp(false) |\n-|\t\t, supports_holepunch(false) |\n-|\t\t, web_seed(false) |\n-|\t\t, protocol_v2(false) |\n-|\t{} |\n+|\t\tTORRENT_ASSERT(m_files.piece_length() > 0); |\n | |\n-|\tstd::uint32_t torrent_peer::rank(external_ip const& external, int external_port) const |\n-|\t{ |\n-|\t\tTORRENT_ASSERT(in_use); |\n-|if (peer_rank == 0) |\n-|peer_rank = peer_priority( |\n-|\t\t\t\ttcp::endpoint(external.external_address(this->address()), std::uint16_t(external_port)) |\n-|\t\t\t\t, tcp::endpoint(this->address(), this->port)); |\n-|\t\treturn peer_rank; |\n-|\t} |\n+|\t\tentry dict; |\n | |\n-|#ifndef TORRENT_DISABLE_LOGGING |\n-|\tstd::string torrent_peer::to_string() const |\n-|\t{ |\n-|\t\tTORRENT_ASSERT(in_use); |\n-|#if TORRENT_USE_I2P |\n-|\t\tif (is_i2p_addr) return dest().to_string(); |\n-|#endif // TORRENT_USE_I2P |\n-|\t\treturn address().to_string(); |\n-|\t} |\n-|#endif |\n+|\t\tif (!m_urls.empty()) dict[\"announce\"] = m_urls.front().first; |\n | |\n-|\tstd::int64_t torrent_peer::total_download() const |\n-|\t{ |\n-|\t\tTORRENT_ASSERT(in_use); |\n-|\t\tif (connection != nullptr) |\n-|\t\t{ |\n-|\t\t\tTORRENT_ASSERT(prev_amount_download == 0); |\n-|\t\t\treturn connection->statistics().total_payload_download(); |\n-|\t\t} |\n-|\t\telse |\n+|\t\tif (!m_nodes.empty()) |\n |\t\t{ |\n-|\t\t\treturn std::int64_t(prev_amount_download) << 10; |\n-|\t\t} |\n-|_\b\t_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|\t\t\tentry& nodes = dict[\"nodes\"]; |\n+|\t\t\tentry::list_type& nodes_list = nodes.list(); |\n+|\t\t\tfor (auto const& n : m_nodes) |\n+|_\b\t_\b\t_\b\t_\b{_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bh_\ba_\bn_\bd_\bl_\be_\b._\bc_\bp_\bp_\b:_\b4_\b9_\b9_\b _\b|_\bi_\bn_\b _\bC_\b+_\b+_\b1_\b4_\b,_\b _\bu_\bs_\be_\b _\bu_\bn_\bi_\bq_\bu_\be_\b__\bp_\bt_\br_\b _\ba_\bn_\bd_\b _\bm_\bo_\bv_\be_\b _\bi_\bt_\b _\bi_\bn_\bt_\bo_\b _\bt_\bh_\be_\b _\bl_\ba_\bm_\bb_\bd_\ba_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |*\b**\b**\b**\b**\b* i\bin\bn C\bC+\b++\b+1\b14\b4,\b, u\bus\bse\be u\bun\bni\biq\bqu\bue\be_\b_p\bpt\btr\br a\ban\bnd\bd m\bmo\bov\bve\be i\bit\bt i\bin\bnt\bto\bo t\bth\bhe\be l\bla\bam\bmb\bbd\bda\ba *\b**\b**\b**\b**\b* |\n |*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/s\bse\bes\bss\bsi\bio\bon\bn_\b_h\bha\ban\bnd\bdl\ble\be.\b.c\bcp\bpp\bp:\b:4\b49\b99\b9 *\b**\b**\b* |\n |#ifndef BOOST_NO_EXCEPTIONS |\n |\t\tif (params.save_path.empty()) |\n |\t\t\taux::throw_ex(error_code(errors::invalid_save_path)); |\n |#else |\n@@ -8358,103 +9158,176 @@\n |\t\tp.save_path = save_path; |\n |\t\tif (resume_data.type() != entry::undefined_t) |\n |\t\t{ |\n |\t\t\tbencode(std::back_inserter(p.resume_data), resume_data); |\n |\t\t} |\n |\t\tp.storage_mode = storage_mode; |\n |_\b\t_\b\t_\bi_\bf_\b _\b(_\ba_\bd_\bd_\b__\bp_\ba_\bu_\bs_\be_\bd_\b)_\b _\bp_\b._\bf_\bl_\ba_\bg_\bs_\b _\b|_\b=_\b _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs_\b:_\b:_\bf_\bl_\ba_\bg_\b__\bp_\ba_\bu_\bs_\be_\bd_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bc_\bh_\bo_\bk_\be_\br_\b._\bc_\bp_\bp_\b:_\b2_\b5_\b8_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bm_\ba_\bk_\be_\b _\bc_\bo_\bn_\bf_\bi_\bg_\bu_\br_\ba_\bb_\bl_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* m\bma\bak\bke\be c\bco\bon\bnf\bfi\big\bgu\bur\bra\bab\bbl\ble\be *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/c\bch\bho\bok\bke\ber\br.\b.c\bcp\bpp\bp:\b:2\b25\b58\b8 *\b**\b**\b* |\n-|// first reset the number of unchoke slots, because we'll calculate |\n-|\t\t\t// it purely based on the current state of our peers. |\n-|\t\t\tupload_slots = 0; |\n-| |\n-|\t\t\tint rate_threshold = sett.get_int(settings_pack::rate_choker_initial_threshold); |\n-| |\n-|\t\t\tstd::sort(peers.begin(), peers.end() |\n-|\t\t\t\t, [](peer_connection const* lhs, peer_connection const* rhs) |\n-|\t\t\t\t{ return upload_rate_compare(lhs, rhs); }); |\n-| |\n-|\t\t\tfor (auto const* p : peers) |\n-|\t\t\t{ |\n-|\t\t\t\tint const rate = int(p->uploaded_in_last_round() |\n-|\t\t\t\t\t* 1000 / total_milliseconds(unchoke_interval)); |\n+|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\bp_\be_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b._\bc_\bp_\bp_\b: |this should be the global download rate |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b1_\b0_\b5_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs s\bsh\bho\bou\bul\bld\bd b\bbe\be t\bth\bhe\be g\bgl\blo\bob\bba\bal\bl d\bdo\bow\bwn\bnl\blo\boa\bad\bd r\bra\bat\bte\be *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/p\bpe\bee\ber\br_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn.\b.c\bcp\bpp\bp:\b:1\b11\b10\b05\b5 *\b**\b**\b* |\n+|\t\tint rate = 0; |\n | |\n-|\t\t\t\t// always have at least 1 unchoke slot |\n-|\t\t\t\tif (rate < rate_threshold) break; |\n+|\t\t// if we haven't received any data recently, the current download rate |\n+|\t\t// is not representative |\n+|\t\tif (aux::time_now() - m_last_piece.get(m_connect) > seconds(30) && m_download_rate_peak > 0) |\n+|\t\t{ |\n+|\t\t\trate = m_download_rate_peak; |\n+|\t\t} |\n+|\t\telse if (aux::time_now() - m_last_unchoked.get(m_connect) < seconds(5) |\n+|\t\t\t&& m_statistics.total_payload_upload() < 2 * 0x4000) |\n+|\t\t{ |\n+|\t\t\t// if we're have only been unchoked for a short period of time, |\n+|\t\t\t// we don't know what rate we can get from this peer. Instead of assuming |\n+|\t\t\t// the lowest possible rate, assume the average. |\n | |\n-|\t\t\t\t++upload_slots; |\n+|\t\t\tint peers_with_requests = int(stats_counters()[counters::num_peers_down_requests]); |\n+|\t\t\t// avoid division by 0 |\n+|\t\t\tif (peers_with_requests == 0) peers_with_requests = 1; |\n | |\n-|rate_threshold += 2048; |\n+|rate = t->statistics().transfer_rate(stat::download_payload) / peers_with_requests; |\n |} |\n-|\t\t\t++upload_slots; |\n+|\t\telse |\n+|\t\t{ |\n+|\t\t\t// current download rate in bytes per seconds |\n+|\t\t\trate = m_statistics.transfer_rate(stat::download_payload); |\n |\t\t} |\n | |\n-|\t\t// sorts the peers that are eligible for unchoke by download rate and |\n-|\t\t// secondary by total upload. The reason for this is, if all torrents are |\n-|\t\t// being seeded, the download rate will be 0, and the peers we have sent |\n-|\t\t// the least to should be unchoked |\n+|\t\t// avoid division by zero |\n+|\t\tif (rate < 50) rate = 50; |\n | |\n-|\t\t// we use partial sort here, because we only care about the top |\n-|\t\t// upload_slots peers. |\n+|\t\t// average of current rate and peak |\n+|//\t\trate = (rate + m_download_rate_peak) / 2; |\n | |\n-|\t\tint const slots = std::min(upload_slots, int(peers.size())); |\n+|\t\treturn milliseconds((m_outstanding_bytes + extra_bytes |\n+|\t\t\t+ m_queued_time_critical * t->block_size() * 1000) / rate); |\n+|\t} |\n | |\n-|\t\tif (sett.get_int(settings_pack::seed_choking_algorithm) |\n-|\t\t\t== settings_pack::round_robin) |\n-|\t\t{ |\n-|\t\t\tint const pieces = sett.get_int(settings_pack::seeding_piece_quota); |\n+|\tvoid peer_connection::add_stat(std::int64_t const downloaded, std::int64_t const uploaded) |\n+|\t{ |\n+|\t\tTORRENT_ASSERT(is_single_thread()); |\n+|\t\tm_statistics.add_stat(downloaded, uploaded); |\n+|\t} |\n | |\n-|\t\t\tstd::nth_element(peers.begin(), peers.begin() |\n-|\t\t\t\t+ slots, peers.end() |\n-|\t\t\t\t, [pieces](peer_connection const* lhs, peer_connection const* rhs) |\n-|\t\t\t\t{ return unchoke_compare_rr(lhs, rhs, pieces); }); |\n-|\t\t} |\n-|\t\telse if (sett.get_int(settings_pack::seed_choking_algorithm) |\n-|\t\t\t== settings_pack::fastest_upload) |\n-|\t\t{ |\n-|\t\t\tstd::nth_element(peers.begin(), peers.begin() |\n-|\t\t\t\t+ slots, peers.end() |\n-|_\b\t_\b\t_\b\t_\b\t_\b,_\b _\b[_\b]_\b(_\bp_\be_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b _\bc_\bo_\bn_\bs_\bt_\b*_\b _\bl_\bh_\bs_\b,_\b _\bp_\be_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b _\bc_\bo_\bn_\bs_\bt_\b*_\b _\br_\bh_\bs_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b._\bc_\bp_\bp_\b:_\b5_\b4_\b0_\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bI_\bn_\b _\bC_\b+_\b+_\b1_\b7_\b._\b _\bu_\bs_\be_\b _\bi_\bf_\b _\bc_\bo_\bn_\bs_\bt_\be_\bx_\bp_\br_\b _\bi_\bn_\bs_\bt_\be_\ba_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* I\bIn\bn C\bC+\b++\b+1\b17\b7.\b. u\bus\bse\be i\bif\bf c\bco\bon\bns\bst\bte\bex\bxp\bpr\br i\bin\bns\bst\bte\bea\bad\bd *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/s\bse\bes\bss\bsi\bio\bon\bn.\b.c\bcp\bpp\bp:\b:5\b54\b40\b0 *\b**\b**\b* |\n-|{} |\n-|\tsession_proxy::session_proxy(session_proxy const&) = default; |\n-|\tsession_proxy& session_proxy::operator=(session_proxy const&) & = default; |\n-|\tsession_proxy::session_proxy(session_proxy&&) noexcept = default; |\n-|\tsession_proxy& session_proxy::operator=(session_proxy&&) & noexcept = default; |\n-|\tsession_proxy::~session_proxy() |\n+|\tsha1_hash peer_connection::associated_info_hash() const |\n |\t{ |\n-|\t\tif (m_thread && m_thread.use_count() == 1) |\n+|\t\tstd::shared_ptr t = associated_torrent().lock(); |\n+|\t\tTORRENT_ASSERT(t); |\n+|\t\tauto const& ih = t->info_hash(); |\n+|\t\t// if protocol_v2 is set on the peer, this better be a v2 torrent, |\n+|_\b\t_\b\t_\b/_\b/_\b _\bo_\bt_\bh_\be_\br_\bw_\bi_\bs_\be_\b _\bs_\bo_\bm_\be_\bt_\bh_\bi_\bn_\bg_\b _\bi_\bs_\bn_\b'_\bt_\b _\br_\bi_\bg_\bh_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\bp_\be_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b._\bc_\bp_\bp_\b: |sort the allowed fast set in priority order |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b3_\b5_\b3_\b6_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* s\bso\bor\brt\bt t\bth\bhe\be a\bal\bll\blo\bow\bwe\bed\bd f\bfa\bas\bst\bt s\bse\bet\bt i\bin\bn p\bpr\bri\bio\bor\bri\bit\bty\by o\bor\brd\bde\ber\br *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/p\bpe\bee\ber\br_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn.\b.c\bcp\bpp\bp:\b:3\b35\b53\b36\b6 *\b**\b**\b* |\n+|\t\t// if the peer has the piece and we want |\n+|\t\t// to download it, request it |\n+|\t\tif (index < m_have_piece.end_index() |\n+|\t\t\t&& m_have_piece[index] |\n+|\t\t\t&& !t->have_piece(index) |\n+|\t\t\t&& t->valid_metadata() |\n+|\t\t\t&& t->has_picker() |\n+|\t\t\t&& t->picker().piece_priority(index) > dont_download) |\n |\t\t{ |\n-|#if defined TORRENT_ASIO_DEBUGGING |\n-|\t\t\twait_for_asio_handlers(); |\n-|#endif |\n-|\t\t\tm_thread->join(); |\n+|\t\t\tt->peer_is_interesting(*this); |\n |\t\t} |\n |\t} |\n | |\n-|\tTORRENT_EXPORT std::unique_ptr default_disk_io_constructor( |\n-|\t\tio_context& ios, settings_interface const& sett, counters& cnt) |\n+|\tstd::vector const& peer_connection::allowed_fast() |\n |\t{ |\n-|#if TORRENT_HAVE_MMAP || TORRENT_HAVE_MAP_VIEW_OF_FILE |\n-|#include \"libtorrent/aux_/disable_deprecation_warnings_push.hpp\" |\n-|if (sizeof(void*) == 8) |\n-|\t\t\treturn mmap_disk_io_constructor(ios, sett, cnt); |\n-|\t\telse |\n-|\t\t\treturn posix_disk_io_constructor(ios, sett, cnt); |\n-|#include \"libtorrent/aux_/disable_warnings_pop.hpp\" |\n-|#else |\n-|\t\treturn posix_disk_io_constructor(ios, sett, cnt); |\n+|\t\tTORRENT_ASSERT(is_single_thread()); |\n+|\t\tstd::shared_ptr t = m_torrent.lock(); |\n+|\t\tTORRENT_ASSERT(t); |\n+| |\n+|return m_allowed_fast; |\n+|} |\n+| |\n+|\tbool peer_connection::can_request_time_critical() const |\n+|\t{ |\n+|\t\tTORRENT_ASSERT(is_single_thread()); |\n+|\t\tif (has_peer_choked() || !is_interesting()) return false; |\n+|\t\tif (int(m_download_queue.size()) + int(m_request_queue.size()) |\n+|\t\t\t> m_desired_queue_size * 2) return false; |\n+|\t\tif (on_parole()) return false; |\n+|\t\tif (m_disconnecting) return false; |\n+|\t\tstd::shared_ptr t = m_torrent.lock(); |\n+|\t\tTORRENT_ASSERT(t); |\n+|\t\tif (t->upload_mode()) return false; |\n+| |\n+|\t\t// ignore snubbed peers, since they're not likely to return pieces in a |\n+|\t\t// timely manner anyway |\n+|\t\tif (m_snubbed) return false; |\n+|\t\treturn true; |\n+|\t} |\n+| |\n+|\tbool peer_connection::make_time_critical(piece_block const& block) |\n+|\t{ |\n+|\t\tTORRENT_ASSERT(is_single_thread()); |\n+|\t\tauto const rit = std::find_if(m_request_queue.begin() |\n+|\t\t\t, m_request_queue.end(), aux::has_block(block)); |\n+|\t\tif (rit == m_request_queue.end()) return false; |\n+|#if TORRENT_USE_ASSERTS |\n+|\t\tstd::shared_ptr t = m_torrent.lock(); |\n+|\t\tTORRENT_ASSERT(t); |\n+|_\b\t_\b\t_\bT_\bO_\bR_\bR_\bE_\bN_\bT_\b__\bA_\bS_\bS_\bE_\bR_\bT_\b(_\bt_\b-_\b>_\bh_\ba_\bs_\b__\bp_\bi_\bc_\bk_\be_\br_\b(_\b)_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bu_\bt_\bp_\b__\bs_\bt_\br_\be_\ba_\bm_\b._\bc_\bp_\bp_\b:_\b1_\b4_\b6_\b7_\b _\b _\b _\b _\b|_\bt_\bh_\bi_\bs_\b _\bl_\bo_\bo_\bp_\b _\bi_\bs_\b _\bn_\bo_\bt_\b _\bv_\be_\br_\by_\b _\be_\bf_\bf_\bi_\bc_\bi_\be_\bn_\bt_\b._\b _\bI_\bt_\b _\bc_\bo_\bu_\bl_\bd_\b _\bb_\be_\b _\bf_\bi_\bx_\be_\bd_\b _\bb_\by_\b _\bh_\ba_\bv_\bi_\bn_\bg_\b _\ba_\b _\bs_\be_\bp_\ba_\br_\ba_\bt_\be_\b _\bl_\bi_\bs_\bt_\b _\bo_\bf_\b _\bs_\be_\bq_\bu_\be_\bn_\bc_\be_\b _\bn_\bu_\bm_\bb_\be_\br_\bs_\b _\bt_\bh_\ba_\bt_\b _\bn_\be_\be_\bd_\b _\br_\be_\bs_\be_\bn_\bd_\bi_\bn_\bg_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs l\blo\boo\bop\bp i\bis\bs n\bno\bot\bt v\bve\ber\bry\by e\bef\bff\bfi\bic\bci\bie\ben\bnt\bt.\b. I\bIt\bt c\bco\bou\bul\bld\bd b\bbe\be f\bfi\bix\bxe\bed\bd b\bby\by h\bha\bav\bvi\bin\bng\bg a\ba s\bse\bep\bpa\bar\bra\bat\bte\be l\bli\bis\bst\bt o\bof\bf s\bse\beq\bqu\bue\ben\bnc\bce\be n\bnu\bum\bmb\bbe\ber\brs\bs t\bth\bha\bat\bt n\bne\bee\bed\bd r\bre\bes\bse\ben\bnd\bdi\bin\bng\bg *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/u\but\btp\bp_\b_s\bst\btr\bre\bea\bam\bm.\b.c\bcp\bpp\bp:\b:1\b14\b46\b67\b7 *\b**\b**\b* |\n |#endif |\n+| |\n+|\tif (m_stalled) |\n+|\t{ |\n+|\t\tif (flags & pkt_ack) |\n+|\t\t\tdefer_ack(); |\n+|\t\treturn false; |\n |\t} |\n | |\n-|_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|\t// m_out_eof means we're trying to close the write side of this socket, |\n+|\t// we need to flush all payload before we can send the FIN packet, so don't |\n+|\t// store any payload in the nagle packet |\n+|\tbool const force = (flags & pkt_ack) || (flags & pkt_fin) || m_out_eof; |\n+| |\n+|\t// when we want to close the outgoing stream, we need to send the |\n+|\t// remaining nagle packet even though it won't fill a packet. |\n+|\tbool const force_flush_nagle = m_out_eof && m_write_buffer_size; |\n+| |\n+|\t// first see if we need to resend any packets |\n+| |\n+|for (int i = (m_acked_seq_nr + 1) & ACK_MASK; i != m_seq_nr; i = (i + 1) & ACK_MASK) |\n+|{ |\n+|\t\tpacket* p = m_outbuf.at(aux::numeric_cast(i)); |\n+|\t\tif (!p) continue; |\n+|\t\tif (!p->need_resend) continue; |\n+|\t\tif (!resend_packet(p)) |\n+|\t\t{ |\n+|\t\t\t// we couldn't resend the packet. It probably doesn't |\n+|\t\t\t// fit in our cwnd. If force is set, we need to continue |\n+|\t\t\t// to send our packet anyway, if we don't have force set, |\n+|\t\t\t// we might as well return |\n+|\t\t\tif (!force) return false; |\n+|\t\t\t// resend_packet might have failed |\n+|\t\t\tif (state() == state_t::error_wait || state() == state_t::deleting) return false; |\n+|\t\t\tif (m_stalled) return false; |\n+|\t\t\tbreak; |\n+|\t\t} |\n+| |\n+|\t\t// don't fast-resend this packet |\n+|\t\tif (m_fast_resend_seq_nr == i) |\n+|\t\t\tm_fast_resend_seq_nr = (m_fast_resend_seq_nr + 1) & ACK_MASK; |\n+|\t} |\n+| |\n+|\t// MTU DISCOVERY |\n+| |\n+|\t// under these conditions, the next packet we send should be an MTU probe. |\n+|\t// MTU probes get to use the mid-point packet size, whereas other packets |\n+|\t// use a conservative packet size of the largest known to work. The reason |\n+|\t// for the cwnd condition is to make sure the probe is surrounded by non- |\n+|\t// probes, to be able to distinguish a loss of the probe vs. just loss in |\n+|_\b\t_\b/_\b/_\b _\bg_\be_\bn_\be_\br_\ba_\bl_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\bp_\bo_\bs_\bi_\bx_\b__\bp_\ba_\br_\bt_\b__\bf_\bi_\bl_\be_\b._\bc_\bp_\bp_\b:_\b3_\b3_\b7|what do we do if someone is currently reading from the disk from this piece? does it matter? Since we won't actively erase the data |\n |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bf_\br_\bo_\bm_\b _\bd_\bi_\bs_\bk_\b,_\b _\bb_\bu_\bt_\b _\bi_\bt_\b _\bm_\ba_\by_\b _\bb_\be_\b _\bo_\bv_\be_\br_\bw_\br_\bi_\bt_\bt_\be_\bn_\b _\bs_\bo_\bo_\bn_\b,_\b _\bi_\bt_\b'_\bs_\b _\bp_\br_\bo_\bb_\ba_\bb_\bl_\by_\b _\bn_\bo_\bt_\b _\bt_\bh_\ba_\bt_\b _\bb_\bi_\bg_\b _\bo_\bf_\b _\ba_\b _\bd_\be_\ba_\bl_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |*\b**\b**\b**\b**\b* w\bwh\bha\bat\bt d\bdo\bo w\bwe\be d\bdo\bo i\bif\bf s\bso\bom\bme\beo\bon\bne\be i\bis\bs c\bcu\bur\brr\bre\ben\bnt\btl\bly\by r\bre\bea\bad\bdi\bin\bng\bg f\bfr\bro\bom\bm t\bth\bhe\be d\bdi\bis\bsk\bk f\bfr\bro\bom\bm t\bth\bhi\bis\bs p\bpi\bie\bec\bce\be?\b? d\bdo\boe\bes\bs i\bit\bt m\bma\bat\btt\bte\ber\br?\b? S\bSi\bin\bnc\bce\be w\bwe\be w\bwo\bon\bn'\b't\bt a\bac\bct\bti\biv\bve\bel\bly\by e\ber\bra\bas\bse\be t\bth\bhe\be d\bda\bat\bta\ba f\bfr\bro\bom\bm d\bdi\bis\bsk\bk,\b, b\bbu\but\bt i\bit\bt m\bma\bay\by b\bbe\be o\bov\bve\ber\brw\bwr\bri\bit\btt\bte\ben\bn |\n |s\bso\boo\bon\bn,\b, i\bit\bt'\b's\bs p\bpr\bro\bob\bba\bab\bbl\bly\by n\bno\bot\bt t\bth\bha\bat\bt b\bbi\big\bg o\bof\bf a\ba d\bde\bea\bal\bl *\b**\b**\b**\b**\b* |\n |*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/p\bpo\bos\bsi\bix\bx_\b_p\bpa\bar\brt\bt_\b_f\bfi\bil\ble\be.\b.c\bcp\bpp\bp:\b:3\b33\b37\b7 *\b**\b**\b* |\n |\t\t\tif (ec) return {}; |\n | |\n@@ -8556,453 +9429,294 @@\n |\t\tchar* ptr = header.data(); |\n |\t\twrite_uint32(m_max_pieces, ptr); |\n |\t\twrite_uint32(m_piece_size, ptr); |\n | |\n |\t\tfor (piece_index_t piece(0); piece < piece_index_t(m_max_pieces); ++piece) |\n |\t\t{ |\n |_\b\t_\b\t_\b\t_\ba_\bu_\bt_\bo_\b _\bc_\bo_\bn_\bs_\bt_\b _\bi_\b _\b=_\b _\bm_\b__\bp_\bi_\be_\bc_\be_\b__\bm_\ba_\bp_\b._\bf_\bi_\bn_\bd_\b(_\bp_\bi_\be_\bc_\be_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/ |introduce a web-seed default class which has a low download priority |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bw_\be_\bb_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b__\bb_\ba_\bs_\be_\b._\bc_\bp_\bp_\b:_\b7_\b2_\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* i\bin\bnt\btr\bro\bod\bdu\buc\bce\be a\ba w\bwe\beb\bb-\b-s\bse\bee\bed\bd d\bde\bef\bfa\bau\bul\blt\bt c\bcl\bla\bas\bss\bs w\bwh\bhi\bic\bch\bh h\bha\bas\bs a\ba l\blo\bow\bw d\bdo\bow\bwn\bnl\blo\boa\bad\bd p\bpr\bri\bio\bor\bri\bit\bty\by *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/w\bwe\beb\bb_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn_\b_b\bba\bas\bse\be.\b.c\bcp\bpp\bp:\b:7\b72\b2 *\b**\b**\b* |\n-|: peer_connection(pack) |\n-|\t\t, m_first_request(true) |\n-|\t\t, m_ssl(false) |\n-|\t\t, m_external_auth(web.auth) |\n-|\t\t, m_extra_headers(web.extra_headers) |\n-|\t\t, m_parser(http_parser::dont_parse_chunks) |\n-|\t\t, m_body_start(0) |\n-|\t{ |\n-|\t\tTORRENT_ASSERT(&web.peer_info == pack.peerinfo); |\n-|\t\t// when going through a proxy, we don't necessarily have an endpoint here, |\n-|\t\t// since the proxy might be resolving the hostname, not us |\n-|\t\tTORRENT_ASSERT(web.endpoints.empty() || web.endpoints.front() == pack.endp); |\n-| |\n-|\t\tINVARIANT_CHECK; |\n-| |\n-|\t\tTORRENT_ASSERT(is_outgoing()); |\n-| |\n-|\t\tTORRENT_ASSERT(!m_torrent.lock()->is_upload_only()); |\n-| |\n-|\t\t// we only want left-over bandwidth |\n-| |\n-|std::string protocol; |\n-|\t\terror_code ec; |\n-|\t\tstd::tie(protocol, m_basic_auth, m_host, m_port, m_path) |\n-|\t\t\t= parse_url_components(web.url, ec); |\n-|\t\tTORRENT_ASSERT(!ec); |\n-| |\n-|\t\tif (m_port == -1 && protocol == \"http\") |\n-|\t\t\tm_port = 80; |\n-| |\n-|#if TORRENT_USE_SSL |\n-|\t\tif (protocol == \"https\") |\n-|\t\t{ |\n-|\t\t\tm_ssl = true; |\n-|\t\t\tif (m_port == -1) m_port = 443; |\n-|\t\t} |\n-|#endif |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bu_\bt_\b__\bm_\be_\bt_\ba_\bd_\ba_\bt_\ba_\b._\bc_\bp_\bp_\b:_\b2_\b8_\b1_\b _\b _\b _\b _\b|_\bw_\be_\b _\br_\be_\ba_\bl_\bl_\by_\b _\bn_\be_\be_\bd_\b _\bt_\bo_\b _\bi_\bn_\bc_\br_\be_\bm_\be_\bn_\bt_\b _\bt_\bh_\be_\b _\br_\be_\bf_\bc_\bo_\bu_\bn_\bt_\be_\br_\b _\bo_\bn_\b _\bt_\bh_\be_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\b _\bw_\bh_\bi_\bl_\be_\b _\bt_\bh_\bi_\bs_\b _\bb_\bu_\bf_\bf_\be_\br_\b _\bi_\bs_\b _\bs_\bt_\bi_\bl_\bl_\b _\bi_\bn_\b _\bt_\bh_\be_\b _\bp_\be_\be_\br_\b'_\bs_\b _\bs_\be_\bn_\bd_\b _\bb_\bu_\bf_\bf_\be_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* w\bwe\be r\bre\bea\bal\bll\bly\by n\bne\bee\bed\bd t\bto\bo i\bin\bnc\bcr\bre\bem\bme\ben\bnt\bt t\bth\bhe\be r\bre\bef\bfc\bco\bou\bun\bnt\bte\ber\br o\bon\bn t\bth\bhe\be t\bto\bor\brr\bre\ben\bnt\bt w\bwh\bhi\bil\ble\be t\bth\bhi\bis\bs b\bbu\buf\bff\bfe\ber\br i\bis\bs s\bst\bti\bil\bll\bl i\bin\bn t\bth\bhe\be p\bpe\bee\ber\br'\b's\bs s\bse\ben\bnd\bd b\bbu\buf\bff\bfe\ber\br *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/u\but\bt_\b_m\bme\bet\bta\bad\bda\bat\bta\ba.\b.c\bcp\bpp\bp:\b:2\b28\b81\b1 *\b**\b**\b* |\n+|int const offset = piece * 16 * 1024; |\n+|\t\t\t\tmetadata = m_tp.metadata().data() + offset; |\n+|\t\t\t\tmetadata_piece_size = std::min( |\n+|\t\t\t\t\tint(m_tp.metadata().size()) - offset, 16 * 1024); |\n+|\t\t\t\tTORRENT_ASSERT(metadata_piece_size > 0); |\n+|\t\t\t\tTORRENT_ASSERT(offset >= 0); |\n+|\t\t\t\tTORRENT_ASSERT(offset + metadata_piece_size <= m_tp.metadata().size()); |\n+|\t\t\t} |\n | |\n-|\t\tif (!m_basic_auth.empty()) |\n-|\t\t\tm_basic_auth = base64encode(m_basic_auth); |\n+|\t\t\tchar msg[200]; |\n+|\t\t\tchar* header = msg; |\n+|\t\t\tchar* p = &msg[6]; |\n+|\t\t\tint const len = bencode(p, e); |\n+|\t\t\tint const total_size = 2 + len + metadata_piece_size; |\n+|\t\t\tnamespace io = aux; |\n+|\t\t\tio::write_uint32(total_size, header); |\n+|\t\t\tio::write_uint8(bt_peer_connection::msg_extended, header); |\n+|\t\t\tio::write_uint8(m_message_index, header); |\n | |\n-|\t\tm_server_string = m_host; |\n-|\t\taux::verify_encoding(m_server_string); |\n-|\t} |\n+|\t\t\tm_pc.send_buffer({msg, len + 6}); |\n+|if (metadata_piece_size) |\n+|{ |\n+|\t\t\t\tm_pc.append_const_send_buffer( |\n+|\t\t\t\t\tspan(const_cast(metadata), metadata_piece_size), metadata_piece_size); |\n+|\t\t\t} |\n | |\n-|\tint web_connection_base::timeout() const |\n-|\t{ |\n-|\t\t// since this is a web seed, change the timeout |\n-|\t\t// according to the settings. |\n-|\t\treturn m_settings.get_int(settings_pack::urlseed_timeout); |\n-|_\b\t_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\br_\ba_\bn_\bd_\bo_\bm_\b._\bc_\bp_\bp_\b:_\b1_\b4_\b1_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bi_\bm_\bp_\br_\bo_\bv_\be_\b _\bc_\ba_\bl_\bl_\bi_\bn_\bg_\b _\bR_\bA_\bN_\bD_\b__\bb_\by_\bt_\be_\bs_\b _\bm_\bu_\bl_\bt_\bi_\bp_\bl_\be_\b _\bt_\bi_\bm_\be_\bs_\b,_\b _\bu_\bs_\bi_\bn_\bg_\b _\bf_\ba_\bl_\bl_\bb_\ba_\bc_\bk_\b _\bf_\bo_\br_\b _\bn_\bo_\bw_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* i\bim\bmp\bpr\bro\bov\bve\be c\bca\bal\bll\bli\bin\bng\bg R\bRA\bAN\bND\bD_\b_b\bby\byt\bte\bes\bs m\bmu\bul\blt\bti\bip\bpl\ble\be t\bti\bim\bme\bes\bs,\b, u\bus\bsi\bin\bng\bg f\bfa\bal\bll\blb\bba\bac\bck\bk f\bfo\bor\br n\bno\bow\bw *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/r\bra\ban\bnd\bdo\bom\bm.\b.c\bcp\bpp\bp:\b:1\b14\b41\b1 *\b**\b**\b* |\n-|#else |\n-|\t\t\tstd::generate(buffer.begin(), buffer.end(), [] { return char(random(0xff)); }); |\n-|#endif |\n+|\t\t\tm_pc.stats_counters().inc_stats_counter(counters::num_outgoing_extended); |\n+|\t\t\tm_pc.stats_counters().inc_stats_counter(counters::num_outgoing_metadata); |\n |\t\t} |\n | |\n-|\t\tvoid crypto_random_bytes(span buffer) |\n+|\t\tbool on_extended(int const length |\n+|\t\t\t, int const extended_msg, span body) override |\n |\t\t{ |\n-|#ifdef TORRENT_BUILD_SIMULATOR |\n-|\t\t\t// In the simulator we want deterministic random numbers |\n-|\t\t\tstd::generate(buffer.begin(), buffer.end(), [] { return char(random(0xff)); }); |\n-|#elif TORRENT_USE_CNG |\n-|\t\t\taux::cng_gen_random(buffer); |\n-|#elif TORRENT_USE_CRYPTOAPI |\n-|\t\t\t// windows |\n-|\t\t\taux::crypt_gen_random(buffer); |\n-|#elif defined TORRENT_USE_LIBCRYPTO && !defined TORRENT_USE_WOLFSSL |\n-|// wolfSSL uses wc_RNG_GenerateBlock as the internal function for the |\n-|// openssl compatibility layer. This function API does not support |\n-|// an arbitrary buffer size (openssl does), it is limited by the |\n-|// constant RNG_MAX_BLOCK_LEN. |\n-| |\n-|// openssl |\n-|\t\t\tint r = RAND_bytes(reinterpret_cast(buffer.data()) |\n-|\t\t\t\t, int(buffer.size())); |\n-|\t\t\tif (r != 1) aux::throw_ex(errors::no_entropy); |\n-|#elif TORRENT_USE_GETRANDOM |\n-|\t\t\tssize_t const r = ::getrandom(buffer.data(), static_cast(buffer.size()), 0); |\n-|\t\t\tif (r == ssize_t(buffer.size())) return; |\n-|\t\t\tif (r == -1 && errno != ENOSYS) aux::throw_ex(error_code(errno, generic_category())); |\n-|\t\t\tstatic dev_random dev; |\n-|\t\t\tdev.read(buffer); |\n-|#elif TORRENT_USE_DEV_RANDOM |\n-|\t\t\tstatic dev_random dev; |\n-|\t\t\tdev.read(buffer); |\n-|#else |\n+|\t\t\tif (extended_msg != 2) return false; |\n+|\t\t\tif (m_message_index == 0) return false; |\n | |\n-|#if TORRENT_BROKEN_RANDOM_DEVICE |\n-|\t\t\t// even pseudo random numbers rely on being able to seed the random |\n-|\t\t\t// generator |\n-|#error \"no entropy source available\" |\n-|#else |\n-|#ifdef TORRENT_I_WANT_INSECURE_RANDOM_NUMBERS |\n-|\t\t\tstd::generate(buffer.begin(), buffer.end(), [] { return char(random(0xff)); }); |\n-|#else |\n-|#error \"no secure entropy source available. If you really want insecure random numbers, define TORRENT_I_WANT_INSECURE_RANDOM_NUMBERS\" |\n-|#endif |\n+|\t\t\tif (length > 17 * 1024) |\n+|\t\t\t{ |\n+|#ifndef TORRENT_DISABLE_LOGGING |\n+|\t\t\t\tm_pc.peer_log(peer_log_alert::incoming_message, \"UT_METADATA\" |\n+|\t\t\t\t\t, \"packet too big %d\", length); |\n |#endif |\n+|\t\t\t\tm_pc.disconnect(errors::invalid_metadata_message, operation_t::bittorrent, peer_connection_interface::peer_error); |\n+|\t\t\t\treturn true; |\n+|\t\t\t} |\n | |\n-|#endif |\n-|\t\t} |\n-|_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be_\b._\bc_\bp_\bp_\b:_\b5_\b8_\b9_\b _\b|_\bs_\bu_\bp_\bp_\bo_\br_\bt_\b _\bm_\bo_\bv_\bi_\bn_\bg_\b _\bf_\bi_\bl_\be_\bs_\b _\bi_\bn_\bt_\bo_\b _\bt_\bh_\bi_\bs_\b _\bc_\ba_\bl_\bl_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* s\bsu\bup\bpp\bpo\bor\brt\bt m\bmo\bov\bvi\bin\bng\bg f\bfi\bil\ble\bes\bs i\bin\bnt\bto\bo t\bth\bhi\bis\bs c\bca\bal\bll\bl *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt_\b_h\bha\ban\bnd\bdl\ble\be.\b.c\bcp\bpp\bp:\b:5\b58\b89\b9 *\b**\b**\b* |\n-|auto retp = &prio; |\n-|\t\tsync_call(&torrent::piece_priorities, retp); |\n-|\t\tstd::vector ret; |\n-|\t\tret.reserve(prio.size()); |\n-|\t\tfor (auto p : prio) |\n-|\t\t\tret.push_back(int(static_cast(p))); |\n-|\t\treturn ret; |\n-|\t} |\n-|#endif |\n+|\t\t\tif (!m_pc.packet_finished()) return true; |\n | |\n-|\tvoid torrent_handle::file_priority(file_index_t index, download_priority_t priority) const |\n-|\t{ |\n-|\t\tasync_call(&torrent::set_file_priority, index, priority); |\n+|\t\t\terror_code ec; |\n+|\t\t\tbdecode_node msg = bdecode(body, ec); |\n+|_\b\t_\b\t_\b\t_\bi_\bf_\b _\b(_\bm_\bs_\bg_\b._\bt_\by_\bp_\be_\b(_\b)_\b _\b!_\b=_\b _\bb_\bd_\be_\bc_\bo_\bd_\be_\b__\bn_\bo_\bd_\be_\b:_\b:_\bd_\bi_\bc_\bt_\b__\bt_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\bd_\bi_\bs_\ba_\bb_\bl_\be_\bd_\b__\bd_\bi_\bs_\bk_\b__\bi_\bo_\b._\bc_\bp_\bp_\b: |it would be nice to return a valid hash of zeroes here |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b0_\b6_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* i\bit\bt w\bwo\bou\bul\bld\bd b\bbe\be n\bni\bic\bce\be t\bto\bo r\bre\bet\btu\bur\brn\bn a\ba v\bva\bal\bli\bid\bd h\bha\bas\bsh\bh o\bof\bf z\bze\ber\bro\boe\bes\bs h\bhe\ber\bre\be *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/d\bdi\bis\bsa\bab\bbl\ble\bed\bd_\b_d\bdi\bis\bsk\bk_\b_i\bio\bo.\b.c\bcp\bpp\bp:\b:1\b10\b06\b6 *\b**\b**\b* |\n+|}); |\n |\t} |\n | |\n-|\tdownload_priority_t torrent_handle::file_priority(file_index_t index) const |\n+|\tbool async_write(storage_index_t |\n+|\t\t, peer_request const& r |\n+|\t\t, char const*, std::shared_ptr |\n+|\t\t, std::function handler |\n+|\t\t, disk_job_flags_t) override |\n |\t{ |\n-|\t\treturn sync_call_ret(dont_download, &torrent::file_priority, index); |\n-|\t} |\n+|\t\tTORRENT_ASSERT(r.length <= default_block_size); |\n+|\t\tTORRENT_UNUSED(r); |\n | |\n-|void torrent_handle::prioritize_files(std::vector const& files) const |\n-|{ |\n-|\t\tasync_call(&torrent::prioritize_files |\n-|\t\t\t, static_cast const&>(files)); |\n+|\t\tpost(m_ios, [h = std::move(handler)] { h(storage_error{}); }); |\n+|\t\treturn false; |\n |\t} |\n | |\n-|\tstd::vector torrent_handle::get_file_priorities() const |\n+|\tvoid async_hash(storage_index_t |\n+|\t\t, piece_index_t piece, span, disk_job_flags_t |\n+|\t\t, std::function handler) override |\n |\t{ |\n-|\t\taux::vector ret; |\n-|\t\tauto retp = &ret; |\n-|\t\tsync_call(&torrent::file_priorities, retp); |\n-|\t\treturn TORRENT_RVO(ret); |\n-|\t} |\n-| |\n-|#if TORRENT_ABI_VERSION == 1 |\n-| |\n-|// ============ start deprecation =============== |\n+|post(m_ios, [h = std::move(handler), piece] { h(piece, sha1_hash{}, storage_error{}); }); |\n+|} |\n | |\n-|\tvoid torrent_handle::prioritize_files(std::vector const& files) const |\n+|\tvoid async_hash2(storage_index_t, piece_index_t piece, int |\n+|\t\t, disk_job_flags_t |\n+|\t\t, std::function handler) override |\n |\t{ |\n-|\t\taux::vector file_prio; |\n-|\t\tfile_prio.reserve(files.size()); |\n-|\t\tfor (auto const p : files) { |\n-|\t\t\tfile_prio.push_back(download_priority_t(static_cast(p))); |\n-|\t\t} |\n-|\t\tasync_call(&torrent::prioritize_files, file_prio); |\n+|\t\tpost(m_ios, [h = std::move(handler), piece]() { h(piece, sha256_hash{}, storage_error{}); }); |\n |\t} |\n | |\n-|\tstd::vector torrent_handle::file_priorities() const |\n+|\tvoid async_move_storage(storage_index_t |\n+|\t\t, std::string p, move_flags_t |\n+|\t\t, std::function handler) override |\n |\t{ |\n-|_\b\t_\b\t_\ba_\bu_\bx_\b:_\b:_\bv_\be_\bc_\bt_\bo_\br_\b<_\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\b__\bp_\br_\bi_\bo_\br_\bi_\bt_\by_\b__\bt_\b,_\b _\bf_\bi_\bl_\be_\b__\bi_\bn_\bd_\be_\bx_\b__\bt_\b>_\b _\bp_\br_\bi_\bo_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\bu_\bt_\bp_\b__\bs_\bo_\bc_\bk_\be_\bt_\b__\bm_\ba_\bn_\ba_\bg_\be_\br_\b._\bc_\bp_\bp_\b:|this should not be heap allocated, sockets should be movable |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b2_\b0_\b4_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs s\bsh\bho\bou\bul\bld\bd n\bno\bot\bt b\bbe\be h\bhe\bea\bap\bp a\bal\bll\blo\boc\bca\bat\bte\bed\bd,\b, s\bso\boc\bck\bke\bet\bts\bs s\bsh\bho\bou\bul\bld\bd b\bbe\be m\bmo\bov\bva\bab\bbl\ble\be *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/u\but\btp\bp_\b_s\bso\boc\bck\bke\bet\bt_\b_m\bma\ban\bna\bag\bge\ber\br.\b.c\bcp\bpp\bp:\b:2\b20\b04\b4 *\b**\b**\b* |\n-|//\t\tUTP_LOGV(\"incoming packet id:%d source:%s\\n\", id, print_endpoint(ep).c_str()); |\n-| |\n-|\t\tif (!m_sett.get_bool(settings_pack::enable_incoming_utp)) |\n-|\t\t\treturn false; |\n-| |\n-|\t\t// if not found, see if it's a SYN packet, if it is, |\n-|\t\t// create a new utp_stream |\n-|\t\tif (ph->get_type() == ST_SYN) |\n-|\t\t{ |\n-|\t\t\t// possible SYN flood. Just ignore |\n-|\t\t\tif (int(m_utp_sockets.size()) > m_sett.get_int(settings_pack::connections_limit) * 2) |\n-|\t\t\t\treturn false; |\n-| |\n-|\t\t\tTORRENT_ASSERT(m_new_connection == -1); |\n-|\t\t\t// create the new socket with this ID |\n-|\t\t\tm_new_connection = id; |\n-| |\n-|//\t\t\tUTP_LOGV(\"not found, new connection id:%d\\n\", m_new_connection); |\n-| |\n-|aux::socket_type c(aux::instantiate_connection(m_ios, aux::proxy_settings(), m_ssl_context, this, true, false)); |\n-| |\n-|\t\t\tutp_stream* str = nullptr; |\n-|#ifdef TORRENT_SSL_PEERS |\n-|\t\t\tif (is_ssl(c)) |\n-|\t\t\t\tstr = &boost::get>(c).next_layer(); |\n-|\t\t\telse |\n-|#endif |\n-|\t\t\t\tstr = boost::get(&c); |\n-| |\n-|\t\t\tTORRENT_ASSERT(str); |\n-|\t\t\tint const mtu = mtu_for_dest(ep.address()); |\n-|\t\t\tstr->get_impl()->init_mtu(mtu); |\n-|\t\t\tstr->get_impl()->m_sock = std::move(socket); |\n-|\t\t\tbool const ret = str->get_impl()->incoming_packet(p, ep, receive_time); |\n-|\t\t\tif (!ret) return false; |\n-|\t\t\tm_last_socket = str->get_impl(); |\n-|\t\t\tm_cb(std::move(c)); |\n-|\t\t\t// the connection most likely changed its connection ID here |\n-|\t\t\t// we need to move it to the correct ID |\n-|\t\t\treturn true; |\n-|\t\t} |\n-| |\n-|\t\tif (ph->get_type() == ST_RESET) return false; |\n-| |\n-|\t\t// #error send reset |\n-| |\n-|\t\treturn false; |\n+|\t\tpost(m_ios, [h = std::move(handler), path = std::move(p)] () mutable |\n+|\t\t\t{ h(status_t::no_error, std::move(path), storage_error{}); }); |\n |\t} |\n | |\n-|_\b\t_\bv_\bo_\bi_\bd_\b _\bu_\bt_\bp_\b__\bs_\bo_\bc_\bk_\be_\bt_\b__\bm_\ba_\bn_\ba_\bg_\be_\br_\b:_\b:_\bs_\bu_\bb_\bs_\bc_\br_\bi_\bb_\be_\b__\bw_\br_\bi_\bt_\ba_\bb_\bl_\be_\b(_\bu_\bt_\bp_\b__\bs_\bo_\bc_\bk_\be_\bt_\b__\bi_\bm_\bp_\bl_\b*_\b _\bs_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bp_\be_\b__\bc_\br_\by_\bp_\bt_\bo_\b._\bc_\bp_\bp_\b:_\b6_\b0_\b _\b _\b _\b _\b _\b _\b _\b|_\bi_\bt_\b _\bw_\bo_\bu_\bl_\bd_\b _\bb_\be_\b _\bn_\bi_\bc_\be_\b _\bt_\bo_\b _\bg_\be_\bt_\b _\bt_\bh_\be_\b _\bl_\bi_\bt_\be_\br_\ba_\bl_\b _\bw_\bo_\br_\bk_\bi_\bn_\bg_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* i\bit\bt w\bwo\bou\bul\bld\bd b\bbe\be n\bni\bic\bce\be t\bto\bo g\bge\bet\bt t\bth\bhe\be l\bli\bit\bte\ber\bra\bal\bl w\bwo\bor\brk\bki\bin\bng\bg *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/p\bpe\be_\b_c\bcr\bry\byp\bpt\bto\bo.\b.c\bcp\bpp\bp:\b:6\b60\b0 *\b**\b**\b* |\n-|#include |\n-|#include |\n-| |\n-|#include \"libtorrent/aux_/disable_warnings_push.hpp\" |\n-| |\n-|#include |\n-|#include |\n-| |\n-|#include \"libtorrent/aux_/disable_warnings_pop.hpp\" |\n-| |\n-|#include \"libtorrent/random.hpp\" |\n-|#include \"libtorrent/aux_/alloca.hpp\" |\n-|#include \"libtorrent/pe_crypto.hpp\" |\n-|#include \"libtorrent/hasher.hpp\" |\n-| |\n-|namespace libtorrent { |\n-| |\n-|\tnamespace mp = boost::multiprecision; |\n-| |\n-|\tnamespace { |\n-|key_t const dh_prime |\n-|(\"0xFFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A63|36210000000000090563\");\n+|\tvoid async_release_files(storage_index_t, std::function handler) override |\n+|\t{ |\n+|\t\tpost(m_ios, [h = std::move(handler)] { h(); }); |\n |\t} |\n | |\n-|\tstd::array export_key(key_t const& k) |\n+|\tvoid async_delete_files(storage_index_t |\n+|\t\t, remove_flags_t, std::function handler) override |\n |\t{ |\n-|\t\tstd::array ret; |\n-|\t\tauto* begin = reinterpret_cast(ret.data()); |\n-|_\b\t_\b\t_\bs_\bt_\bd_\b:_\b:_\bu_\bi_\bn_\bt_\b8_\b__\bt_\b*_\b _\be_\bn_\bd_\b _\b=_\b _\bm_\bp_\b:_\b:_\be_\bx_\bp_\bo_\br_\bt_\b__\bb_\bi_\bt_\bs_\b(_\bk_\b,_\b _\bb_\be_\bg_\bi_\bn_\b,_\b _\b8_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bp_\be_\b__\bc_\br_\by_\bp_\bt_\bo_\b._\bc_\bp_\bp_\b:_\b7_\b1_\b _\b _\b _\b _\b _\b _\b _\b|_\bi_\bt_\b _\bw_\bo_\bu_\bl_\bd_\b _\bb_\be_\b _\bn_\bi_\bc_\be_\b _\bt_\bo_\b _\bb_\be_\b _\ba_\bb_\bl_\be_\b _\bt_\bo_\b _\be_\bx_\bp_\bo_\br_\bt_\b _\bt_\bo_\b _\ba_\b _\bf_\bi_\bx_\be_\bd_\b _\bw_\bi_\bd_\bt_\bh_\b _\bf_\bi_\be_\bl_\bd_\b,_\b _\bs_\bo_\b _\bw_\be_\b _\bw_\bo_\bu_\bl_\bd_\bn_\b'_\bt_\b _\bh_\ba_\bv_\be_\b _\bt_\bo_\b _\bs_\bh_\bi_\bf_\bt_\b _\bi_\bt_\b _\bl_\ba_\bt_\be_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* i\bit\bt w\bwo\bou\bul\bld\bd b\bbe\be n\bni\bic\bce\be t\bto\bo b\bbe\be a\bab\bbl\ble\be t\bto\bo e\bex\bxp\bpo\bor\brt\bt t\bto\bo a\ba f\bfi\bix\bxe\bed\bd w\bwi\bid\bdt\bth\bh f\bfi\bie\bel\bld\bd,\b, s\bso\bo w\bwe\be w\bwo\bou\bul\bld\bdn\bn'\b't\bt h\bha\bav\bve\be t\bto\bo s\bsh\bhi\bif\bft\bt i\bit\bt l\bla\bat\bte\ber\br *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/p\bpe\be_\b_c\bcr\bry\byp\bpt\bto\bo.\b.c\bcp\bpp\bp:\b:7\b71\b1 *\b**\b**\b* |\n-|#include \"libtorrent/random.hpp\" |\n-|#include \"libtorrent/aux_/alloca.hpp\" |\n-|#include \"libtorrent/pe_crypto.hpp\" |\n-|#include \"libtorrent/hasher.hpp\" |\n-| |\n-|namespace libtorrent { |\n-| |\n-|\tnamespace mp = boost::multiprecision; |\n-| |\n-|\tnamespace { |\n-|\t\tkey_t const dh_prime |\n-|\t\t\t |\n-|(\"0xFFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A63|36210000000000090563\");\n+|\t\tpost(m_ios, [h = std::move(handler)] { h(storage_error{}); }); |\n |\t} |\n | |\n-|\tstd::array export_key(key_t const& k) |\n+|\tvoid async_check_files(storage_index_t |\n+|_\b\t_\b\t_\b,_\b _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs_\b _\bc_\bo_\bn_\bs_\bt_\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bc_\bp_\bu_\bi_\bd_\b._\bc_\bp_\bp_\b:_\b1_\b3_\b1_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\be_\bn_\ba_\bb_\bl_\be_\b _\bw_\bh_\be_\bn_\b _\ba_\ba_\br_\bc_\bh_\b6_\b4_\b _\bi_\bs_\b _\br_\be_\ba_\bl_\bl_\by_\b _\bt_\be_\bs_\bt_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* e\ben\bna\bab\bbl\ble\be w\bwh\bhe\ben\bn a\baa\bar\brc\bch\bh6\b64\b4 i\bis\bs r\bre\bea\bal\bll\bly\by t\bte\bes\bst\bte\bed\bd *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/c\bcp\bpu\bui\bid\bd.\b.c\bcp\bpp\bp:\b:1\b13\b31\b1 *\b**\b**\b* |\n+|bool supports_mmx() noexcept |\n |\t{ |\n-|\t\tstd::array ret; |\n-|\t\tauto* begin = reinterpret_cast(ret.data()); |\n-|\t\tstd::uint8_t* end = mp::export_bits(k, begin, 8); |\n-| |\n-|if (end < begin + 96) |\n-|{ |\n-|\t\t\tint const len = int(end - begin); |\n-|#if defined __GNUC__ && __GNUC__ == 12 |\n-|#pragma GCC diagnostic push |\n-|#pragma GCC diagnostic ignored \"-Wstringop-overflow\" |\n-|#endif |\n-|\t\t\tstd::memmove(begin + 96 - len, begin, aux::numeric_cast(len)); |\n-|#if defined __GNUC__ && __GNUC__ == 12 |\n-|#pragma GCC diagnostic pop |\n+|#if TORRENT_HAS_SSE |\n+|\t\tstd::uint32_t cpui[4] = {0}; |\n+|\t\tcpuid(cpui, 1); |\n+|\t\treturn (cpui[2] & (1 << 23)) != 0; |\n+|#else |\n+|\t\treturn false; |\n |#endif |\n-|\t\t\tstd::memset(begin, 0, aux::numeric_cast(96 - len)); |\n-|\t\t} |\n-|\t\treturn ret; |\n |\t} |\n | |\n-|\tvoid rc4_init(const unsigned char* in, std::size_t len, rc4 *state); |\n-|\tstd::size_t rc4_encrypt(unsigned char *out, std::size_t outlen, rc4 *state); |\n-| |\n-|\t// Set the prime P and the generator, generate local public key |\n-|\tdh_key_exchange::dh_key_exchange() |\n+|\tbool supports_arm_neon() noexcept |\n |\t{ |\n-|\t\taux::array random_key; |\n-|\t\taux::random_bytes({reinterpret_cast(random_key.data()) |\n-|\t\t\t, static_cast(random_key.size())}); |\n-| |\n-|\t\t// create local key (random) |\n-|\t\tmp::import_bits(m_dh_local_secret, random_key.begin(), random_key.end()); |\n-| |\n-|\t\t// key = (2 ^ secret) % prime |\n-|_\b\t_\b\t_\bm_\b__\bd_\bh_\b__\bl_\bo_\bc_\ba_\bl_\b__\bk_\be_\by_\b _\b=_\b _\bm_\bp_\b:_\b:_\bp_\bo_\bw_\bm_\b(_\bk_\be_\by_\b__\bt_\b(_\b2_\b)_\b,_\b _\bm_\b__\bd_\bh_\b__\bl_\bo_\bc_\ba_\bl_\b__\bs_\be_\bc_\br_\be_\bt_\b,_\b _\bd_\bh_\b__\bp_\br_\bi_\bm_\be_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\be_\bn_\bu_\bm_\b__\bn_\be_\bt_\b._\bc_\bp_\bp_\b:_\b1_\b4_\b4_\b _\b _\b _\b _\b _\b _\b _\b|_\bi_\bn_\b _\bC_\b+_\b+_\b1_\b7_\b,_\b _\bu_\bs_\be_\b _\b__\b__\bh_\ba_\bs_\b__\bi_\bn_\bc_\bl_\bu_\bd_\be_\b _\bf_\bo_\br_\b _\bt_\bh_\bi_\bs_\b._\b _\bO_\bt_\bh_\be_\br_\b _\bo_\bp_\be_\br_\ba_\bt_\bi_\bn_\bg_\b _\bs_\by_\bs_\bt_\be_\bm_\bs_\b _\ba_\br_\be_\b _\bl_\bi_\bk_\be_\bl_\by_\b _\bt_\bo_\b _\br_\be_\bq_\bu_\bi_\br_\be_\b _\bt_\bh_\bi_\bs_\b _\ba_\bs_\b _\bw_\be_\bl_\bl_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* i\bin\bn C\bC+\b++\b+1\b17\b7,\b, u\bus\bse\be _\b__\b_h\bha\bas\bs_\b_i\bin\bnc\bcl\blu\bud\bde\be f\bfo\bor\br t\bth\bhi\bis\bs.\b. O\bOt\bth\bhe\ber\br o\bop\bpe\ber\bra\bat\bti\bin\bng\bg s\bsy\bys\bst\bte\bem\bms\bs a\bar\bre\be l\bli\bik\bke\bel\bly\by t\bto\bo r\bre\beq\bqu\bui\bir\bre\be t\bth\bhi\bis\bs a\bas\bs w\bwe\bel\bll\bl *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/e\ben\bnu\bum\bm_\b_n\bne\bet\bt.\b.c\bcp\bpp\bp:\b:1\b14\b44\b4 *\b**\b**\b* |\n-|#include |\n-|#include |\n-|#include |\n-|#include |\n-|#include |\n-| |\n-|#if defined TORRENT_ANDROID && !defined IFA_F_DADFAILED |\n-|#define IFA_F_DADFAILED 8 |\n-|#endif |\n-| |\n+|#if TORRENT_HAS_ARM_NEON && TORRENT_HAS_AUXV |\n+|#if defined __arm__ |\n+|\t\t//return (getauxval(AT_HWCAP) & HWCAP_NEON); |\n+|\t\treturn (helper_getauxval(16) & (1 << 12)); |\n+|#elif defined __aarch64__ |\n+|\t\t//return (getauxval(AT_HWCAP) & HWCAP_ASIMD); |\n+|\t\t//return (getauxval(16) & (1 << 1)); |\n+|return false; |\n |#endif |\n-| |\n-|#if TORRENT_USE_IFADDRS |\n-|#include |\n-|#include |\n-|#include |\n+|#else |\n+|\t\treturn false; |\n |#endif |\n+|\t} |\n | |\n-|#if TORRENT_USE_IFADDRS || TORRENT_USE_IFCONF || TORRENT_USE_NETLINK || TORRENT_USE_SYSCTL |\n-|#ifdef TORRENT_BEOS |\n-|#include |\n-|#endif |\n-|// capture this here where warnings are disabled (the macro generates warnings) |\n-|const unsigned long siocgifmtu = SIOCGIFMTU; |\n+|\tbool supports_arm_crc32c() noexcept |\n+|\t{ |\n+|#if TORRENT_HAS_ARM_CRC32 && TORRENT_HAS_AUXV |\n+|#if defined TORRENT_FORCE_ARM_CRC32 |\n+|\t\treturn true; |\n+|#elif defined __arm__ |\n+|\t\t//return (getauxval(AT_HWCAP2) & HWCAP2_CRC32); |\n+|\t\treturn (helper_getauxval(26) & (1 << 4)); |\n+|#elif defined __aarch64__ |\n+|\t\t//return (getauxval(AT_HWCAP) & HWCAP_CRC32); |\n+|\t\treturn (helper_getauxval(16) & (1 << 7)); |\n |#endif |\n-| |\n-|#include \"libtorrent/aux_/disable_warnings_pop.hpp\" |\n-| |\n-|#if defined(TORRENT_OS2) && !defined(IF_NAMESIZE) |\n-|#define IF_NAMESIZE IFNAMSIZ |\n+|#else |\n+|\t\treturn false; |\n |#endif |\n+|\t} |\n | |\n-|namespace libtorrent { |\n+|} // anonymous namespace |\n | |\n-|namespace { |\n+|\tbool const sse42_support = supports_sse42(); |\n+|\tbool const mmx_support = supports_mmx(); |\n+|\tbool const arm_neon_support = supports_arm_neon(); |\n+|\tbool const arm_crc32c_support = supports_arm_crc32c(); |\n+|_\b}_\b _\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b._\bc_\bp_\bp_\b:_\b8_\b8_\b7_\b _\b _\b _\b|_\bt_\bh_\bi_\bs_\b _\bs_\bh_\bo_\bu_\bl_\bd_\b _\bb_\be_\b _\bc_\bo_\bn_\bs_\bi_\bd_\be_\br_\be_\bd_\b _\ba_\b _\bf_\ba_\bi_\bl_\bu_\br_\be_\b,_\b _\ba_\bn_\bd_\b _\bt_\bh_\be_\b _\b._\bt_\bo_\br_\br_\be_\bn_\bt_\b _\bf_\bi_\bl_\be_\b _\br_\be_\bj_\be_\bc_\bt_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs s\bsh\bho\bou\bul\bld\bd b\bbe\be c\bco\bon\bns\bsi\bid\bde\ber\bre\bed\bd a\ba f\bfa\bai\bil\blu\bur\bre\be,\b, a\ban\bnd\bd t\bth\bhe\be .\b.t\bto\bor\brr\bre\ben\bnt\bt f\bfi\bil\ble\be r\bre\bej\bje\bec\bct\bte\bed\bd *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo.\b.c\bcp\bpp\bp:\b:8\b88\b87\b7 *\b**\b**\b* |\n+|std::string ext = extension(filename); |\n+|\t\t\tint cnt = 0; |\n+|\t\t\tfor (;;) |\n+|\t\t\t{ |\n+|\t\t\t\t++cnt; |\n+|\t\t\t\tchar new_ext[50]; |\n+|\t\t\t\tstd::snprintf(new_ext, sizeof(new_ext), \".%d%s\", cnt, ext.c_str()); |\n+|\t\t\t\tfilename = base + new_ext; |\n | |\n-|#if !defined TORRENT_WINDOWS && !defined TORRENT_BUILD_SIMULATOR |\n-|\tstruct socket_closer |\n-|\t{ |\n-|\t\tsocket_closer(int s) : m_socket(s) {} |\n-|\t\tsocket_closer(socket_closer const&) = delete; |\n-|\t\tsocket_closer(socket_closer &&) = delete; |\n-|\t\tsocket_closer& operator=(socket_closer const&) = delete; |\n-|\t\tsocket_closer& operator=(socket_closer &&) = delete; |\n-|\t\t~socket_closer() { ::close(m_socket); } |\n-|\tprivate: |\n-|\t\tint m_socket; |\n-|\t}; |\n-|#endif |\n+|\t\t\t\tboost::crc_optimal<32, 0x1EDC6F41, 0xFFFFFFFF, 0xFFFFFFFF, true, true> crc; |\n+|\t\t\t\tprocess_string_lowercase(crc, filename); |\n+|\t\t\t\tstd::uint32_t const new_hash = crc.checksum(); |\n+|\t\t\t\tif (files.find(new_hash) == files.end()) |\n+|\t\t\t\t{ |\n+|\t\t\t\t\tfiles.insert({new_hash, {i, 0}}); |\n+|\t\t\t\t\tbreak; |\n+|\t\t\t\t} |\n+|\t\t\t\t++num_collisions; |\n+|\t\t\t\tif (num_collisions > 100) |\n+|\t\t\t\t{ |\n+|} |\n+|} |\n | |\n-|_\b#_\bi_\bf_\b _\b!_\bd_\be_\bf_\bi_\bn_\be_\bd_\b _\bT_\bO_\bR_\bR_\bE_\bN_\bT_\b__\bB_\bU_\bI_\bL_\bD_\b__\bS_\bI_\bM_\bU_\bL_\bA_\bT_\bO_\bR_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\be_\bn_\bu_\bm_\b__\bn_\be_\bt_\b._\bc_\bp_\bp_\b:_\b2_\b6_\b8_\b _\b _\b _\b _\b _\b _\b _\b|_\bi_\bf_\b _\bw_\be_\b _\bg_\be_\bt_\b _\bh_\be_\br_\be_\b,_\b _\bt_\bh_\be_\b _\bc_\ba_\bl_\bl_\be_\br_\b _\bs_\bt_\bi_\bl_\bl_\b _\ba_\bs_\bs_\bu_\bm_\be_\bs_\b _\bt_\bh_\be_\b _\be_\br_\br_\bo_\br_\b _\bc_\bo_\bd_\be_\b _\bi_\bs_\b _\br_\be_\bp_\bo_\br_\bt_\be_\bd_\b _\bv_\bi_\ba_\b _\be_\br_\br_\bn_\bo_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* i\bif\bf w\bwe\be g\bge\bet\bt h\bhe\ber\bre\be,\b, t\bth\bhe\be c\bca\bal\bll\ble\ber\br s\bst\bti\bil\bll\bl a\bas\bss\bsu\bum\bme\bes\bs t\bth\bhe\be e\ber\brr\bro\bor\br c\bco\bod\bde\be i\bis\bs r\bre\bep\bpo\bor\brt\bte\bed\bd v\bvi\bia\ba e\ber\brr\brn\bno\bo *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/e\ben\bnu\bum\bm_\b_n\bne\bet\bt.\b.c\bcp\bpp\bp:\b:2\b26\b68\b8 *\b**\b**\b* |\n-|; |\n+|\t\t\tcopy_on_write(); |\n+|\t\t\tm_files.rename_file(i, filename); |\n+|\t\t} |\n |\t} |\n-|#endif |\n-| |\n-|#if TORRENT_USE_NETLINK |\n | |\n-|\tint read_nl_sock(int sock, std::uint32_t const seq, std::uint32_t const pid |\n-|\t\t, std::function on_msg) |\n+|\tvoid torrent_info::remap_files(file_storage const& f) |\n |\t{ |\n-|\t\tstd::array buf; |\n-|\t\tfor (;;) |\n-|\t\t{ |\n-|\t\t\tint const read_len = int(recv(sock, buf.data(), buf.size(), 0)); |\n-|\t\t\tif (read_len < 0) return -1; |\n+|\t\tINVARIANT_CHECK; |\n | |\n-|\t\t\tauto const* nl_hdr = reinterpret_cast(buf.data()); |\n-|\t\t\tint len = read_len; |\n+|\t\tTORRENT_ASSERT(is_loaded()); |\n+|\t\t// the new specified file storage must have the exact |\n+|\t\t// same size as the current file storage |\n+|\t\tTORRENT_ASSERT(m_files.total_size() == f.total_size()); |\n | |\n-|\t\t\tfor (; len > 0 && aux::nlmsg_ok(nl_hdr, len); nl_hdr = aux::nlmsg_next(nl_hdr, len)) |\n-|\t\t\t{ |\n-|if ((aux::nlmsg_ok(nl_hdr, read_len) == 0) || (nl_hdr->nlmsg_type == NLMSG_ERROR)) |\n-|return -1; |\n-|\t\t\t\t// this function doesn't handle multiple requests at the same time |\n-|_\b\t_\b\t_\b\t_\b\t_\b/_\b/_\b _\bs_\bo_\b _\br_\be_\bp_\bo_\br_\bt_\b _\ba_\bn_\b _\be_\br_\br_\bo_\br_\b _\bi_\bf_\b _\bt_\bh_\be_\b _\bm_\be_\bs_\bs_\ba_\bg_\be_\b _\bd_\bo_\be_\bs_\b _\bn_\bo_\bt_\b _\bh_\ba_\bv_\be_\b _\bt_\bh_\be_\b _\be_\bx_\bp_\be_\bc_\bt_\be_\bd_\b _\bs_\be_\bq_\b _\ba_\bn_\bd_\b _\bp_\bi_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\be_\bn_\bu_\bm_\b__\bn_\be_\bt_\b._\bc_\bp_\bp_\b:_\b2_\b7_\b4_\b _\b _\b _\b _\b _\b _\b _\b|_\bi_\bf_\b _\bw_\be_\b _\bg_\be_\bt_\b _\bh_\be_\br_\be_\b,_\b _\bt_\bh_\be_\b _\bc_\ba_\bl_\bl_\be_\br_\b _\bs_\bt_\bi_\bl_\bl_\b _\ba_\bs_\bs_\bu_\bm_\be_\bs_\b _\bt_\bh_\be_\b _\be_\br_\br_\bo_\br_\b _\bc_\bo_\bd_\be_\b _\bi_\bs_\b _\br_\be_\bp_\bo_\br_\bt_\be_\bd_\b _\bv_\bi_\ba_\b _\be_\br_\br_\bn_\bo_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* i\bif\bf w\bwe\be g\bge\bet\bt h\bhe\ber\bre\be,\b, t\bth\bhe\be c\bca\bal\bll\ble\ber\br s\bst\bti\bil\bll\bl a\bas\bss\bsu\bum\bme\bes\bs t\bth\bhe\be e\ber\brr\bro\bor\br c\bco\bod\bde\be i\bis\bs r\bre\bep\bpo\bor\brt\bte\bed\bd v\bvi\bia\ba e\ber\brr\brn\bno\bo *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/e\ben\bnu\bum\bm_\b_n\bne\bet\bt.\b.c\bcp\bpp\bp:\b:2\b27\b74\b4 *\b**\b**\b* |\n-|#if TORRENT_USE_NETLINK |\n+|\t\tif (m_files.total_size() != f.total_size()) return; |\n+|\t\tcopy_on_write(); |\n+|\t\tm_files = f; |\n+|\t\tm_files.set_num_pieces(m_orig_files->num_pieces()); |\n+|\t\tm_files.set_piece_length(m_orig_files->piece_length()); |\n+|\t} |\n | |\n-|\tint read_nl_sock(int sock, std::uint32_t const seq, std::uint32_t const pid |\n-|\t\t, std::function on_msg) |\n+|#if TORRENT_ABI_VERSION == 1 |\n+|\t// standard constructor that parses a torrent file |\n+|\ttorrent_info::torrent_info(entry const& torrent_file) |\n |\t{ |\n-|\t\tstd::array buf; |\n-|\t\tfor (;;) |\n-|\t\t{ |\n-|\t\t\tint const read_len = int(recv(sock, buf.data(), buf.size(), 0)); |\n-|\t\t\tif (read_len < 0) return -1; |\n-| |\n-|\t\t\tauto const* nl_hdr = reinterpret_cast(buf.data()); |\n-|\t\t\tint len = read_len; |\n+|\t\tstd::vector tmp; |\n+|\t\tstd::back_insert_iterator> out(tmp); |\n+|_\b\t_\b\t_\bb_\be_\bn_\bc_\bo_\bd_\be_\b(_\bo_\bu_\bt_\b,_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bi_\bl_\be_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/ |move stats_counter_t out of counters |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bp_\be_\br_\bf_\bo_\br_\bm_\ba_\bn_\bc_\be_\b__\bc_\bo_\bu_\bn_\bt_\be_\br_\bs_\b._\bc_\bp_\bp_\b:_\b4_\b0_\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* m\bmo\bov\bve\be s\bst\bta\bat\bts\bs_\b_c\bco\bou\bun\bnt\bte\ber\br_\b_t\bt o\bou\but\bt o\bof\bf c\bco\bou\bun\bnt\bte\ber\brs\bs *\b**\b**\b**\b**\b* |\n+|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bs\bs_\br\br_\bc\bc_\b/\b/_\bp\bp_\be\be_\br\br_\bf\bf_\bo\bo_\br\br_\bm\bm_\ba\ba_\bn\bn_\bc\bc_\be\be_\b_\b__\bc\bc_\bo\bo_\bu\bu_\bn\bn_\bt\bt_\be\be_\br\br_\bs\bs_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b4\b4_\b0\b0_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/ |should bittorrent keep-alive messages have a counter too? |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bp_\be_\br_\bf_\bo_\br_\bm_\ba_\bn_\bc_\be_\b__\bc_\bo_\bu_\bn_\bt_\be_\br_\bs_\b._\bc_\bp_\bp_\b:_\b4_\b1_\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* s\bsh\bho\bou\bul\bld\bd b\bbi\bit\btt\bto\bor\brr\bre\ben\bnt\bt k\bke\bee\bep\bp-\b-a\bal\bli\biv\bve\be m\bme\bes\bss\bsa\bag\bge\bes\bs h\bha\bav\bve\be a\ba c\bco\bou\bun\bnt\bte\ber\br t\bto\boo\bo?\b? *\b**\b**\b**\b**\b* |\n+|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bs\bs_\br\br_\bc\bc_\b/\b/_\bp\bp_\be\be_\br\br_\bf\bf_\bo\bo_\br\br_\bm\bm_\ba\ba_\bn\bn_\bc\bc_\be\be_\b_\b__\bc\bc_\bo\bo_\bu\bu_\bn\bn_\bt\bt_\be\be_\br\br_\bs\bs_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b4\b4_\b1\b1_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/ |It would be nice if this could be an internal type. default_disk_constructor depends on it now |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bp_\be_\br_\bf_\bo_\br_\bm_\ba_\bn_\bc_\be_\b__\bc_\bo_\bu_\bn_\bt_\be_\br_\bs_\b._\bc_\bp_\bp_\b:_\b4_\b2_\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* I\bIt\bt w\bwo\bou\bul\bld\bd b\bbe\be n\bni\bic\bce\be i\bif\bf t\bth\bhi\bis\bs c\bco\bou\bul\bld\bd b\bbe\be a\ban\bn i\bin\bnt\bte\ber\brn\bna\bal\bl t\bty\byp\bpe\be.\b. d\bde\bef\bfa\bau\bul\blt\bt_\b_d\bdi\bis\bsk\bk_\b_c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br d\bde\bep\bpe\ben\bnd\bds\bs o\bon\bn i\bit\bt n\bno\bow\bw *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/p\bpe\ber\brf\bfo\bor\brm\bma\ban\bnc\bce\be_\b_c\bco\bou\bun\bnt\bte\ber\brs\bs.\b.c\bcp\bpp\bp:\b:4\b42\b2 *\b**\b**\b* |\n+|THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" |\n+|AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |\n+|IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |\n+|ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |\n+|LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |\n+|CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |\n+|SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |\n+|INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |\n+|CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |\n+|ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |\n+|POSSIBILITY OF SUCH DAMAGE. |\n | |\n-|\t\t\tfor (; len > 0 && aux::nlmsg_ok(nl_hdr, len); nl_hdr = aux::nlmsg_next(nl_hdr, len)) |\n-|\t\t\t{ |\n-|\t\t\t\tif ((aux::nlmsg_ok(nl_hdr, read_len) == 0) || (nl_hdr->nlmsg_type == NLMSG_ERROR)) |\n-|\t\t\t\t\treturn -1; |\n-|\t\t\t\t// this function doesn't handle multiple requests at the same time |\n-|\t\t\t\t// so report an error if the message does not have the expected seq and pid |\n-|if (nl_hdr->nlmsg_seq != seq || nl_hdr->nlmsg_pid != pid) |\n-|return -1; |\n+|*/ |\n | |\n-|\t\t\t\tif (nl_hdr->nlmsg_type == NLMSG_DONE) return 0; |\n+|#include \"libtorrent/performance_counters.hpp\" |\n+|#include \"libtorrent/assert.hpp\" |\n+|#include // for memset |\n | |\n-|\t\t\t\ton_msg(nl_hdr); |\n+|namespace libtorrent { |\n | |\n-|\t\t\t\tif ((nl_hdr->nlmsg_flags & NLM_F_MULTI) == 0) return 0; |\n-|\t\t\t} |\n-|\t\t} |\n-|//\t\treturn 0; |\n+|counters::counters() TORRENT_COUNTER_NOEXCEPT |\n+|{ |\n+|#ifdef ATOMIC_LLONG_LOCK_FREE |\n+|\t\tfor (auto& counter : m_stats_counter) |\n+|\t\t\tcounter.store(0, std::memory_order_relaxed); |\n+|#else |\n+|\t\tm_stats_counter.fill(0); |\n+|#endif |\n |\t} |\n | |\n-|\tint nl_dump_request(int const sock, std::uint32_t const seq |\n-|\t\t, nlmsghdr* const request_msg, std::function on_msg) |\n+|\tcounters::counters(counters const& c) TORRENT_COUNTER_NOEXCEPT |\n |\t{ |\n-|\t\trequest_msg->nlmsg_flags = NLM_F_DUMP | NLM_F_REQUEST; |\n-|\t\trequest_msg->nlmsg_seq = seq; |\n-|\t\t// in theory nlmsg_pid should be set to the netlink port ID (NOT the process ID) |\n-|\t\t// of the sender, but the kernel ignores this field so it is typically set to |\n-|\t\t// zero |\n-|\t\trequest_msg->nlmsg_pid = 0; |\n-| |\n-|\t\tif (::send(sock, request_msg, request_msg->nlmsg_len, 0) < 0) |\n-|\t\t\treturn -1; |\n+|#ifdef ATOMIC_LLONG_LOCK_FREE |\n+|\t\tfor (int i = 0; i < m_stats_counter.end_index(); ++i) |\n+|\t\t\tm_stats_counter[i].store( |\n+|\t\t\t\tc.m_stats_counter[i].load(std::memory_order_relaxed) |\n+|\t\t\t\t\t, std::memory_order_relaxed); |\n+|#else |\n+|\t\tstd::lock_guard l(c.m_mutex); |\n+|\t\tm_stats_counter = c.m_stats_counter; |\n+|#endif |\n+|\t} |\n | |\n-|\t\t// get the socket's port ID so that we can verify it in the response |\n-|\t\tsockaddr_nl sock_addr; |\n-|\t\tsocklen_t sock_addr_len = sizeof(sock_addr); |\n-|\t\tif (::getsockname(sock, reinterpret_cast(&sock_addr), &sock_addr_len) < 0) |\n-|_\b\t_\b\t_\b\t_\br_\be_\bt_\bu_\br_\bn_\b _\b-_\b1_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|\tcounters& counters::operator=(counters const& c) & TORRENT_COUNTER_NOEXCEPT |\n+|\t{ |\n+|\t\tif (&c == this) return *this; |\n+|#ifdef ATOMIC_LLONG_LOCK_FREE |\n+|\t\tfor (int i = 0; i < m_stats_counter.end_index(); ++i) |\n+|\t\t\tm_stats_counter[i].store( |\n+|\t\t\t\tc.m_stats_counter[i].load(std::memory_order_relaxed) |\n+|_\b\t_\b\t_\b\t_\b\t_\b\t_\b,_\b _\bs_\bt_\bd_\b:_\b:_\bm_\be_\bm_\bo_\br_\by_\b__\bo_\br_\bd_\be_\br_\b__\br_\be_\bl_\ba_\bx_\be_\bd_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\ba_\bl_\be_\br_\bt_\b._\bc_\bp_\bp_\b:_\b4_\b0_\b4_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bm_\bo_\bv_\be_\b _\bt_\bh_\bi_\bs_\b _\bf_\bi_\be_\bl_\bd_\b _\bi_\bn_\bt_\bo_\b _\bt_\br_\ba_\bc_\bk_\be_\br_\b__\ba_\bl_\be_\br_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |*\b**\b**\b**\b**\b* m\bmo\bov\bve\be t\bth\bhi\bis\bs f\bfi\bie\bel\bld\bd i\bin\bnt\bto\bo t\btr\bra\bac\bck\bke\ber\br_\b_a\bal\ble\ber\brt\bt *\b**\b**\b**\b**\b* |\n |*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/a\bal\ble\ber\brt\bt.\b.c\bcp\bpp\bp:\b:4\b40\b04\b4 *\b**\b**\b* |\n |\t\treturn torrent_alert::message() + \": state changed to: \" |\n |\t\t\t+ state_str[state]; |\n |#endif |\n |\t} |\n@@ -9309,393 +10023,14 @@\n |\t\tTORRENT_ASSERT(index >= piece_index_t(0)); |\n |\t} |\n | |\n |\tstd::string hash_failed_alert::message() const |\n |\t{ |\n |#ifdef TORRENT_DISABLE_ALERT_MSG |\n |_\b\t_\b\t_\br_\be_\bt_\bu_\br_\bn_\b _\b{_\b}_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bc_\br_\be_\ba_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b6_\b1_\b8_\b _\b|_\bt_\bh_\bi_\bs_\b _\bc_\ba_\bn_\b _\bb_\be_\b _\bo_\bp_\bt_\bi_\bm_\bi_\bz_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs c\bca\ban\bn b\bbe\be o\bop\bpt\bti\bim\bmi\biz\bze\bed\bd *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/c\bcr\bre\bea\bat\bte\be_\b_t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:6\b61\b18\b8 *\b**\b**\b* |\n-|std::string& attr = e[\"attr\"].string(); |\n-|\t\tif (flags & file_storage::flag_pad_file) attr += 'p'; |\n-|\t\tif (flags & file_storage::flag_hidden) attr += 'h'; |\n-|\t\tif (flags & file_storage::flag_executable) attr += 'x'; |\n-|\t\tif (include_symlinks && (flags & file_storage::flag_symlink)) attr += 'l'; |\n-|\t} |\n-| |\n-|\tvoid add_symlink_path(entry& e, std::string symlink_path) |\n-|\t{ |\n-|\t\tentry& sympath_e = e[\"symlink path\"]; |\n-| |\n-|\t\tstd::string const link = lexically_relative(\"\", symlink_path); |\n-|\t\tfor (auto elems = lsplit_path(link); !elems.first.empty(); |\n-|\t\t\telems = lsplit_path(elems.second)) |\n-|\t\t\tsympath_e.list().emplace_back(elems.first); |\n-|\t} |\n-|} |\n-| |\n-|\tstd::vector create_torrent::generate_buf() const |\n-|\t{ |\n-|std::vector ret; |\n-|bencode(std::back_inserter(ret), generate()); |\n-|\t\treturn ret; |\n-|\t} |\n-| |\n-|\tentry create_torrent::generate() const |\n-|\t{ |\n-|\t\tif (m_files.num_files() == 0 || m_files.total_size() == 0) |\n-|\t\t\taux::throw_ex(errors::torrent_missing_file_tree); |\n-| |\n-|\t\t// if all v2 hashes are set correctly, generate the v2 parts of the |\n-|\t\t// torrent |\n-|\t\tbool const make_v2 = validate_v2_hashes(m_files, m_file_piece_hash); |\n-|\t\tbool const make_v1 = validate_v1_hashes(m_files, m_piece_hash); |\n-| |\n-|\t\t// if neither v1 nor v2 hashes were set, we can't create a torrent |\n-|\t\tif (!make_v1 && !make_v2) |\n-|\t\t\taux::throw_ex(errors::invalid_hash_entry); |\n-| |\n-|\t\tTORRENT_ASSERT(m_files.piece_length() > 0); |\n-| |\n-|\t\tentry dict; |\n-| |\n-|\t\tif (!m_urls.empty()) dict[\"announce\"] = m_urls.front().first; |\n-| |\n-|\t\tif (!m_nodes.empty()) |\n-|\t\t{ |\n-|\t\t\tentry& nodes = dict[\"nodes\"]; |\n-|\t\t\tentry::list_type& nodes_list = nodes.list(); |\n-|\t\t\tfor (auto const& n : m_nodes) |\n-|_\b\t_\b\t_\b\t_\b{_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\bd_\bi_\bs_\ba_\bb_\bl_\be_\bd_\b__\bd_\bi_\bs_\bk_\b__\bi_\bo_\b._\bc_\bp_\bp_\b: |it would be nice to return a valid hash of zeroes here |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b0_\b6_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* i\bit\bt w\bwo\bou\bul\bld\bd b\bbe\be n\bni\bic\bce\be t\bto\bo r\bre\bet\btu\bur\brn\bn a\ba v\bva\bal\bli\bid\bd h\bha\bas\bsh\bh o\bof\bf z\bze\ber\bro\boe\bes\bs h\bhe\ber\bre\be *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/d\bdi\bis\bsa\bab\bbl\ble\bed\bd_\b_d\bdi\bis\bsk\bk_\b_i\bio\bo.\b.c\bcp\bpp\bp:\b:1\b10\b06\b6 *\b**\b**\b* |\n-|}); |\n-|\t} |\n-| |\n-|\tbool async_write(storage_index_t |\n-|\t\t, peer_request const& r |\n-|\t\t, char const*, std::shared_ptr |\n-|\t\t, std::function handler |\n-|\t\t, disk_job_flags_t) override |\n-|\t{ |\n-|\t\tTORRENT_ASSERT(r.length <= default_block_size); |\n-|\t\tTORRENT_UNUSED(r); |\n-| |\n-|\t\tpost(m_ios, [h = std::move(handler)] { h(storage_error{}); }); |\n-|\t\treturn false; |\n-|\t} |\n-| |\n-|\tvoid async_hash(storage_index_t |\n-|\t\t, piece_index_t piece, span, disk_job_flags_t |\n-|\t\t, std::function handler) override |\n-|\t{ |\n-|post(m_ios, [h = std::move(handler), piece] { h(piece, sha1_hash{}, storage_error{}); }); |\n-|} |\n-| |\n-|\tvoid async_hash2(storage_index_t, piece_index_t piece, int |\n-|\t\t, disk_job_flags_t |\n-|\t\t, std::function handler) override |\n-|\t{ |\n-|\t\tpost(m_ios, [h = std::move(handler), piece]() { h(piece, sha256_hash{}, storage_error{}); }); |\n-|\t} |\n-| |\n-|\tvoid async_move_storage(storage_index_t |\n-|\t\t, std::string p, move_flags_t |\n-|\t\t, std::function handler) override |\n-|\t{ |\n-|\t\tpost(m_ios, [h = std::move(handler), path = std::move(p)] () mutable |\n-|\t\t\t{ h(status_t::no_error, std::move(path), storage_error{}); }); |\n-|\t} |\n-| |\n-|\tvoid async_release_files(storage_index_t, std::function handler) override |\n-|\t{ |\n-|\t\tpost(m_ios, [h = std::move(handler)] { h(); }); |\n-|\t} |\n-| |\n-|\tvoid async_delete_files(storage_index_t |\n-|\t\t, remove_flags_t, std::function handler) override |\n-|\t{ |\n-|\t\tpost(m_ios, [h = std::move(handler)] { h(storage_error{}); }); |\n-|\t} |\n-| |\n-|\tvoid async_check_files(storage_index_t |\n-|_\b\t_\b\t_\b,_\b _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs_\b _\bc_\bo_\bn_\bs_\bt_\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/ |technically, this isn't supposed to happen, but it seems to sometimes. Some of the accounting is probably wrong in certain cases |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bh_\bt_\bt_\bp_\b__\bs_\be_\be_\bd_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b._\bc_\bp_\bp_\b:_\b4_\b4_\b1_\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bte\bec\bch\bhn\bni\bic\bca\bal\bll\bly\by,\b, t\bth\bhi\bis\bs i\bis\bsn\bn'\b't\bt s\bsu\bup\bpp\bpo\bos\bse\bed\bd t\bto\bo h\bha\bap\bpp\bpe\ben\bn,\b, b\bbu\but\bt i\bit\bt s\bse\bee\bem\bms\bs t\bto\bo s\bso\bom\bme\bet\bti\bim\bme\bes\bs.\b. S\bSo\bom\bme\be o\bof\bf t\bth\bhe\be a\bac\bcc\bco\bou\bun\bnt\bti\bin\bng\bg i\bis\bs p\bpr\bro\bob\bba\bab\bbl\bly\by w\bwr\bro\bon\bng\bg i\bin\bn c\bce\ber\brt\bta\bai\bin\bn c\bca\bas\bse\bes\bs *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/h\bht\btt\btp\bp_\b_s\bse\bee\bed\bd_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn.\b.c\bcp\bpp\bp:\b:4\b44\b41\b1 *\b**\b**\b* |\n-|// cut out the chunk header from the receive buffer |\n-|\t\t\t\t\tTORRENT_ASSERT(m_chunk_pos + m_body_start < INT_MAX); |\n-|\t\t\t\t\tm_recv_buffer.cut(header_size, t->block_size() + 1024, aux::numeric_cast(m_chunk_pos + m_body_start)); |\n-|\t\t\t\t\trecv_buffer = m_recv_buffer.get(); |\n-|\t\t\t\t\trecv_buffer = recv_buffer.subspan(m_body_start); |\n-|\t\t\t\t\tm_chunk_pos += chunk_size; |\n-|\t\t\t\t\tif (chunk_size == 0) |\n-|\t\t\t\t\t{ |\n-|\t\t\t\t\t\tTORRENT_ASSERT(m_recv_buffer.get().size() < m_chunk_pos + m_body_start + 1 |\n-|\t\t\t\t\t\t\t|| m_recv_buffer.get()[static_cast(m_chunk_pos + m_body_start)] == 'H' |\n-|\t\t\t\t\t\t\t|| (m_parser.chunked_encoding() |\n-|\t\t\t\t\t\t\t\t&& m_recv_buffer.get()[static_cast(m_chunk_pos + m_body_start)] == '\\r')); |\n-|\t\t\t\t\t\tm_chunk_pos = -1; |\n-|\t\t\t\t\t} |\n-|\t\t\t\t} |\n-|\t\t\t} |\n-| |\n-|\t\t\tint payload = int(bytes_transferred); |\n-|\t\t\tif (payload > m_response_left) payload = int(m_response_left); |\n-|\t\t\tif (payload > front_request.length) payload = front_request.length; |\n-|if (payload > outstanding_bytes()) payload = outstanding_bytes(); |\n-|received_bytes(payload, 0); |\n-|\t\t\tincoming_piece_fragment(payload); |\n-|\t\t\tm_response_left -= payload; |\n-| |\n-|\t\t\tif (m_parser.status_code() == 503) |\n-|\t\t\t{ |\n-|\t\t\t\tif (!m_parser.finished()) return; |\n-| |\n-|\t\t\t\tint retry_time = std::atoi(std::string(recv_buffer.begin(), recv_buffer.end()).c_str()); |\n-|\t\t\t\tif (retry_time <= 0) retry_time = 60; |\n-|#ifndef TORRENT_DISABLE_LOGGING |\n-|\t\t\t\tpeer_log(peer_log_alert::info, \"CONNECT\", \"retrying in %d seconds\", retry_time); |\n-|#endif |\n-| |\n-|\t\t\t\treceived_bytes(0, int(bytes_transferred)); |\n-|\t\t\t\t// temporarily unavailable, retry later |\n-|\t\t\t\tt->retry_web_seed(this, seconds32(retry_time)); |\n-|\t\t\t\tdisconnect(error_code(m_parser.status_code(), http_category()), operation_t::bittorrent, failure); |\n-|\t\t\t\treturn; |\n-|\t\t\t} |\n-| |\n-| |\n-|\t\t\t// we only received the header, no data |\n-|\t\t\tif (recv_buffer.empty()) break; |\n-| |\n-|\t\t\tif (recv_buffer.size() < front_request.length) break; |\n-| |\n-|\t\t\t// if the response is chunked, we need to receive the last |\n-|\t\t\t// terminating chunk and the tail headers before we can proceed |\n-|_\b\t_\b\t_\b\t_\bi_\bf_\b _\b(_\bm_\b__\bp_\ba_\br_\bs_\be_\br_\b._\bc_\bh_\bu_\bn_\bk_\be_\bd_\b__\be_\bn_\bc_\bo_\bd_\bi_\bn_\bg_\b(_\b)_\b _\b&_\b&_\b _\bm_\b__\bc_\bh_\bu_\bn_\bk_\b__\bp_\bo_\bs_\b _\b>_\b=_\b _\b0_\b)_\b _\bb_\br_\be_\ba_\bk_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bi_\bp_\b__\bn_\bo_\bt_\bi_\bf_\bi_\be_\br_\b._\bc_\bp_\bp_\b:_\b4_\b1_\b _\b _\b _\b _\b _\b|_\bs_\bi_\bm_\bu_\bl_\ba_\bt_\bo_\br_\b _\bs_\bu_\bp_\bp_\bo_\br_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* s\bsi\bim\bmu\bul\bla\bat\bto\bor\br s\bsu\bup\bpp\bpo\bor\brt\bt *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/i\bip\bp_\b_n\bno\bot\bti\bif\bfi\bie\ber\br.\b.c\bcp\bpp\bp:\b:4\b41\b1 *\b**\b**\b* |\n-| from this software without specific prior written permission. |\n-| |\n-|THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" |\n-|AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |\n-|IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |\n-|ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |\n-|LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |\n-|CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |\n-|SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |\n-|INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |\n-|CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |\n-|ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |\n-|POSSIBILITY OF SUCH DAMAGE. |\n-| |\n-|*/ |\n-| |\n-|#include \"libtorrent/aux_/ip_notifier.hpp\" |\n-|#include \"libtorrent/assert.hpp\" |\n-| |\n-|#if defined TORRENT_BUILD_SIMULATOR |\n-|#elif TORRENT_USE_NETLINK |\n-|#include \"libtorrent/netlink.hpp\" |\n-|#include \"libtorrent/socket.hpp\" |\n-|#include |\n-|#include |\n-|#elif TORRENT_USE_SYSTEMCONFIGURATION || TORRENT_USE_SC_NETWORK_REACHABILITY |\n-|#include |\n-|#elif defined TORRENT_WINDOWS |\n-|#include \"libtorrent/aux_/throw.hpp\" |\n-|#include \"libtorrent/aux_/disable_warnings_push.hpp\" |\n-|#include |\n-|#ifdef TORRENT_WINRT |\n-|#include |\n-|#endif |\n-|#include |\n-|#include \"libtorrent/aux_/disable_warnings_pop.hpp\" |\n-|#endif |\n-| |\n-|#include \"libtorrent/aux_/netlink_utils.hpp\" |\n-| |\n-|namespace libtorrent { namespace aux { |\n-| |\n-|namespace { |\n-| |\n-|#if (TORRENT_USE_SYSTEMCONFIGURATION || TORRENT_USE_SC_NETWORK_REACHABILITY) && \\ |\n-|\t!defined TORRENT_BUILD_SIMULATOR |\n-| |\n-|// common utilities for Mac and iOS |\n-|template void CFRefRetain(T h) { CFRetain(h); } |\n-|_\bt_\be_\bm_\bp_\bl_\ba_\bt_\be_\b _\b<_\bt_\by_\bp_\be_\bn_\ba_\bm_\be_\b _\bT_\b>_\b _\bv_\bo_\bi_\bd_\b _\bC_\bF_\bR_\be_\bf_\bR_\be_\bl_\be_\ba_\bs_\be_\b(_\bT_\b _\bh_\b)_\b _\b{_\b _\bC_\bF_\bR_\be_\bl_\be_\ba_\bs_\be_\b(_\bh_\b)_\b;_\b _\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\bp_\be_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b._\bc_\bp_\bp_\b: |this should be the global download rate |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b1_\b0_\b5_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs s\bsh\bho\bou\bul\bld\bd b\bbe\be t\bth\bhe\be g\bgl\blo\bob\bba\bal\bl d\bdo\bow\bwn\bnl\blo\boa\bad\bd r\bra\bat\bte\be *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/p\bpe\bee\ber\br_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn.\b.c\bcp\bpp\bp:\b:1\b11\b10\b05\b5 *\b**\b**\b* |\n-|\t\tint rate = 0; |\n-| |\n-|\t\t// if we haven't received any data recently, the current download rate |\n-|\t\t// is not representative |\n-|\t\tif (aux::time_now() - m_last_piece.get(m_connect) > seconds(30) && m_download_rate_peak > 0) |\n-|\t\t{ |\n-|\t\t\trate = m_download_rate_peak; |\n-|\t\t} |\n-|\t\telse if (aux::time_now() - m_last_unchoked.get(m_connect) < seconds(5) |\n-|\t\t\t&& m_statistics.total_payload_upload() < 2 * 0x4000) |\n-|\t\t{ |\n-|\t\t\t// if we're have only been unchoked for a short period of time, |\n-|\t\t\t// we don't know what rate we can get from this peer. Instead of assuming |\n-|\t\t\t// the lowest possible rate, assume the average. |\n-| |\n-|\t\t\tint peers_with_requests = int(stats_counters()[counters::num_peers_down_requests]); |\n-|\t\t\t// avoid division by 0 |\n-|\t\t\tif (peers_with_requests == 0) peers_with_requests = 1; |\n-| |\n-|rate = t->statistics().transfer_rate(stat::download_payload) / peers_with_requests; |\n-|} |\n-|\t\telse |\n-|\t\t{ |\n-|\t\t\t// current download rate in bytes per seconds |\n-|\t\t\trate = m_statistics.transfer_rate(stat::download_payload); |\n-|\t\t} |\n-| |\n-|\t\t// avoid division by zero |\n-|\t\tif (rate < 50) rate = 50; |\n-| |\n-|\t\t// average of current rate and peak |\n-|//\t\trate = (rate + m_download_rate_peak) / 2; |\n-| |\n-|\t\treturn milliseconds((m_outstanding_bytes + extra_bytes |\n-|\t\t\t+ m_queued_time_critical * t->block_size() * 1000) / rate); |\n-|\t} |\n-| |\n-|\tvoid peer_connection::add_stat(std::int64_t const downloaded, std::int64_t const uploaded) |\n-|\t{ |\n-|\t\tTORRENT_ASSERT(is_single_thread()); |\n-|\t\tm_statistics.add_stat(downloaded, uploaded); |\n-|\t} |\n-| |\n-|\tsha1_hash peer_connection::associated_info_hash() const |\n-|\t{ |\n-|\t\tstd::shared_ptr t = associated_torrent().lock(); |\n-|\t\tTORRENT_ASSERT(t); |\n-|\t\tauto const& ih = t->info_hash(); |\n-|\t\t// if protocol_v2 is set on the peer, this better be a v2 torrent, |\n-|_\b\t_\b\t_\b/_\b/_\b _\bo_\bt_\bh_\be_\br_\bw_\bi_\bs_\be_\b _\bs_\bo_\bm_\be_\bt_\bh_\bi_\bn_\bg_\b _\bi_\bs_\bn_\b'_\bt_\b _\br_\bi_\bg_\bh_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\bp_\be_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b._\bc_\bp_\bp_\b: |sort the allowed fast set in priority order |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b3_\b5_\b3_\b6_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* s\bso\bor\brt\bt t\bth\bhe\be a\bal\bll\blo\bow\bwe\bed\bd f\bfa\bas\bst\bt s\bse\bet\bt i\bin\bn p\bpr\bri\bio\bor\bri\bit\bty\by o\bor\brd\bde\ber\br *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/p\bpe\bee\ber\br_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn.\b.c\bcp\bpp\bp:\b:3\b35\b53\b36\b6 *\b**\b**\b* |\n-|\t\t// if the peer has the piece and we want |\n-|\t\t// to download it, request it |\n-|\t\tif (index < m_have_piece.end_index() |\n-|\t\t\t&& m_have_piece[index] |\n-|\t\t\t&& !t->have_piece(index) |\n-|\t\t\t&& t->valid_metadata() |\n-|\t\t\t&& t->has_picker() |\n-|\t\t\t&& t->picker().piece_priority(index) > dont_download) |\n-|\t\t{ |\n-|\t\t\tt->peer_is_interesting(*this); |\n-|\t\t} |\n-|\t} |\n-| |\n-|\tstd::vector const& peer_connection::allowed_fast() |\n-|\t{ |\n-|\t\tTORRENT_ASSERT(is_single_thread()); |\n-|\t\tstd::shared_ptr t = m_torrent.lock(); |\n-|\t\tTORRENT_ASSERT(t); |\n-| |\n-|return m_allowed_fast; |\n-|} |\n-| |\n-|\tbool peer_connection::can_request_time_critical() const |\n-|\t{ |\n-|\t\tTORRENT_ASSERT(is_single_thread()); |\n-|\t\tif (has_peer_choked() || !is_interesting()) return false; |\n-|\t\tif (int(m_download_queue.size()) + int(m_request_queue.size()) |\n-|\t\t\t> m_desired_queue_size * 2) return false; |\n-|\t\tif (on_parole()) return false; |\n-|\t\tif (m_disconnecting) return false; |\n-|\t\tstd::shared_ptr t = m_torrent.lock(); |\n-|\t\tTORRENT_ASSERT(t); |\n-|\t\tif (t->upload_mode()) return false; |\n-| |\n-|\t\t// ignore snubbed peers, since they're not likely to return pieces in a |\n-|\t\t// timely manner anyway |\n-|\t\tif (m_snubbed) return false; |\n-|\t\treturn true; |\n-|\t} |\n-| |\n-|\tbool peer_connection::make_time_critical(piece_block const& block) |\n-|\t{ |\n-|\t\tTORRENT_ASSERT(is_single_thread()); |\n-|\t\tauto const rit = std::find_if(m_request_queue.begin() |\n-|\t\t\t, m_request_queue.end(), aux::has_block(block)); |\n-|\t\tif (rit == m_request_queue.end()) return false; |\n-|#if TORRENT_USE_ASSERTS |\n-|\t\tstd::shared_ptr t = m_torrent.lock(); |\n-|\t\tTORRENT_ASSERT(t); |\n-|_\b\t_\b\t_\bT_\bO_\bR_\bR_\bE_\bN_\bT_\b__\bA_\bS_\bS_\bE_\bR_\bT_\b(_\bt_\b-_\b>_\bh_\ba_\bs_\b__\bp_\bi_\bc_\bk_\be_\br_\b(_\b)_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bu_\bt_\b__\bm_\be_\bt_\ba_\bd_\ba_\bt_\ba_\b._\bc_\bp_\bp_\b:_\b2_\b8_\b1_\b _\b _\b _\b _\b|_\bw_\be_\b _\br_\be_\ba_\bl_\bl_\by_\b _\bn_\be_\be_\bd_\b _\bt_\bo_\b _\bi_\bn_\bc_\br_\be_\bm_\be_\bn_\bt_\b _\bt_\bh_\be_\b _\br_\be_\bf_\bc_\bo_\bu_\bn_\bt_\be_\br_\b _\bo_\bn_\b _\bt_\bh_\be_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\b _\bw_\bh_\bi_\bl_\be_\b _\bt_\bh_\bi_\bs_\b _\bb_\bu_\bf_\bf_\be_\br_\b _\bi_\bs_\b _\bs_\bt_\bi_\bl_\bl_\b _\bi_\bn_\b _\bt_\bh_\be_\b _\bp_\be_\be_\br_\b'_\bs_\b _\bs_\be_\bn_\bd_\b _\bb_\bu_\bf_\bf_\be_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* w\bwe\be r\bre\bea\bal\bll\bly\by n\bne\bee\bed\bd t\bto\bo i\bin\bnc\bcr\bre\bem\bme\ben\bnt\bt t\bth\bhe\be r\bre\bef\bfc\bco\bou\bun\bnt\bte\ber\br o\bon\bn t\bth\bhe\be t\bto\bor\brr\bre\ben\bnt\bt w\bwh\bhi\bil\ble\be t\bth\bhi\bis\bs b\bbu\buf\bff\bfe\ber\br i\bis\bs s\bst\bti\bil\bll\bl i\bin\bn t\bth\bhe\be p\bpe\bee\ber\br'\b's\bs s\bse\ben\bnd\bd b\bbu\buf\bff\bfe\ber\br *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/u\but\bt_\b_m\bme\bet\bta\bad\bda\bat\bta\ba.\b.c\bcp\bpp\bp:\b:2\b28\b81\b1 *\b**\b**\b* |\n-|int const offset = piece * 16 * 1024; |\n-|\t\t\t\tmetadata = m_tp.metadata().data() + offset; |\n-|\t\t\t\tmetadata_piece_size = std::min( |\n-|\t\t\t\t\tint(m_tp.metadata().size()) - offset, 16 * 1024); |\n-|\t\t\t\tTORRENT_ASSERT(metadata_piece_size > 0); |\n-|\t\t\t\tTORRENT_ASSERT(offset >= 0); |\n-|\t\t\t\tTORRENT_ASSERT(offset + metadata_piece_size <= m_tp.metadata().size()); |\n-|\t\t\t} |\n-| |\n-|\t\t\tchar msg[200]; |\n-|\t\t\tchar* header = msg; |\n-|\t\t\tchar* p = &msg[6]; |\n-|\t\t\tint const len = bencode(p, e); |\n-|\t\t\tint const total_size = 2 + len + metadata_piece_size; |\n-|\t\t\tnamespace io = aux; |\n-|\t\t\tio::write_uint32(total_size, header); |\n-|\t\t\tio::write_uint8(bt_peer_connection::msg_extended, header); |\n-|\t\t\tio::write_uint8(m_message_index, header); |\n-| |\n-|\t\t\tm_pc.send_buffer({msg, len + 6}); |\n-|if (metadata_piece_size) |\n-|{ |\n-|\t\t\t\tm_pc.append_const_send_buffer( |\n-|\t\t\t\t\tspan(const_cast(metadata), metadata_piece_size), metadata_piece_size); |\n-|\t\t\t} |\n-| |\n-|\t\t\tm_pc.stats_counters().inc_stats_counter(counters::num_outgoing_extended); |\n-|\t\t\tm_pc.stats_counters().inc_stats_counter(counters::num_outgoing_metadata); |\n-|\t\t} |\n-| |\n-|\t\tbool on_extended(int const length |\n-|\t\t\t, int const extended_msg, span body) override |\n-|\t\t{ |\n-|\t\t\tif (extended_msg != 2) return false; |\n-|\t\t\tif (m_message_index == 0) return false; |\n-| |\n-|\t\t\tif (length > 17 * 1024) |\n-|\t\t\t{ |\n-|#ifndef TORRENT_DISABLE_LOGGING |\n-|\t\t\t\tm_pc.peer_log(peer_log_alert::incoming_message, \"UT_METADATA\" |\n-|\t\t\t\t\t, \"packet too big %d\", length); |\n-|#endif |\n-|\t\t\t\tm_pc.disconnect(errors::invalid_metadata_message, operation_t::bittorrent, peer_connection_interface::peer_error); |\n-|\t\t\t\treturn true; |\n-|\t\t\t} |\n-| |\n-|\t\t\tif (!m_pc.packet_finished()) return true; |\n-| |\n-|\t\t\terror_code ec; |\n-|\t\t\tbdecode_node msg = bdecode(body, ec); |\n-|_\b\t_\b\t_\b\t_\bi_\bf_\b _\b(_\bm_\bs_\bg_\b._\bt_\by_\bp_\be_\b(_\b)_\b _\b!_\b=_\b _\bb_\bd_\be_\bc_\bo_\bd_\be_\b__\bn_\bo_\bd_\be_\b:_\b:_\bd_\bi_\bc_\bt_\b__\bt_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bm_\bm_\ba_\bp_\b__\bd_\bi_\bs_\bk_\b__\bi_\bo_\b._\bc_\bp_\bp_\b:_\b5_\b7_\b8_\b _\b _\b _\b|_\bi_\bn_\b _\bt_\bh_\be_\b _\bf_\bu_\bt_\bu_\br_\be_\b,_\b _\bp_\br_\bo_\bp_\ba_\bg_\ba_\bt_\be_\b _\be_\bx_\bc_\be_\bp_\bt_\bi_\bo_\bn_\bs_\b _\bb_\ba_\bc_\bk_\b _\bt_\bo_\b _\bt_\bh_\be_\b _\bh_\ba_\bn_\bd_\bl_\be_\br_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |*\b**\b**\b**\b**\b* i\bin\bn t\bth\bhe\be f\bfu\but\btu\bur\bre\be,\b, p\bpr\bro\bop\bpa\bag\bga\bat\bte\be e\bex\bxc\bce\bep\bpt\bti\bio\bon\bns\bs b\bba\bac\bck\bk t\bto\bo t\bth\bhe\be h\bha\ban\bnd\bdl\ble\ber\brs\bs *\b**\b**\b**\b**\b* |\n |*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/m\bmm\bma\bap\bp_\b_d\bdi\bis\bsk\bk_\b_i\bio\bo.\b.c\bcp\bpp\bp:\b:5\b57\b78\b8 *\b**\b**\b* |\n |#if DEBUG_DISK_THREAD |\n |\t\t{ |\n |\t\t\tstd::unique_lock l(m_job_mutex); |\n | |\n@@ -9823,707 +10158,372 @@\n |\t\tint const blocks_to_read = std::max(blocks_in_piece, blocks_in_piece2); |\n |\t\ttime_point const start_time = clock_type::now(); |\n |\t\tfor (int i = 0; i < blocks_to_read; ++i) |\n |\t\t{ |\n |\t\t\tbool const v2_block = i < blocks_in_piece2; |\n | |\n |_\b\t_\b\t_\b\t_\bD_\bL_\bO_\bG_\b(_\b\"_\bd_\bo_\b__\bh_\ba_\bs_\bh_\b:_\b _\br_\be_\ba_\bd_\bi_\bn_\bg_\b _\b(_\bp_\bi_\be_\bc_\be_\b:_\b _\b%_\bd_\b _\bb_\bl_\bo_\bc_\bk_\b:_\b _\b%_\bd_\b)_\b\\_\bn_\b\"_\b,_\b _\bi_\bn_\bt_\b(_\bj_\b-_\b>_\bp_\bi_\be_\bc_\be_\b)_\b,_\b _\bi_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b._\bc_\bp_\bp_\b:_\b4_\b5_\b7_\b _\b _\b _\b|_\bm_\ba_\by_\bb_\be_\b _\bi_\bt_\b _\bw_\bo_\bu_\bl_\bd_\b _\bb_\be_\b _\bn_\bi_\bc_\be_\b _\bt_\bo_\b _\bh_\ba_\bv_\be_\b _\ba_\b _\bb_\be_\bt_\bt_\be_\br_\b _\bi_\bn_\bd_\be_\bx_\b _\bh_\be_\br_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* m\bma\bay\byb\bbe\be i\bit\bt w\bwo\bou\bul\bld\bd b\bbe\be n\bni\bic\bce\be t\bto\bo h\bha\bav\bve\be a\ba b\bbe\bet\btt\bte\ber\br i\bin\bnd\bde\bex\bx h\bhe\ber\bre\be *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/f\bfi\bil\ble\be_\b_s\bst\bto\bor\bra\bag\bge\be.\b.c\bcp\bpp\bp:\b:4\b45\b57\b7 *\b**\b**\b* |\n-|// find the file iterator and file offset |\n-|\t\taux::file_entry target; |\n-|\t\ttarget.offset = aux::numeric_cast(offset); |\n-|\t\tTORRENT_ASSERT(!compare_file_offset(target, m_files.front())); |\n-| |\n-|\t\tauto file_iter = std::upper_bound( |\n-|\t\t\tm_files.begin(), m_files.end(), target, compare_file_offset); |\n-| |\n-|\t\tTORRENT_ASSERT(file_iter != m_files.begin()); |\n-|\t\t--file_iter; |\n-|\t\treturn file_index_t{int(file_iter - m_files.begin())}; |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be_\b._\bc_\bp_\bp_\b:_\b5_\b8_\b9_\b _\b|_\bs_\bu_\bp_\bp_\bo_\br_\bt_\b _\bm_\bo_\bv_\bi_\bn_\bg_\b _\bf_\bi_\bl_\be_\bs_\b _\bi_\bn_\bt_\bo_\b _\bt_\bh_\bi_\bs_\b _\bc_\ba_\bl_\bl_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* s\bsu\bup\bpp\bpo\bor\brt\bt m\bmo\bov\bvi\bin\bng\bg f\bfi\bil\ble\bes\bs i\bin\bnt\bto\bo t\bth\bhi\bis\bs c\bca\bal\bll\bl *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/t\bto\bor\brr\bre\ben\bnt\bt_\b_h\bha\ban\bnd\bdl\ble\be.\b.c\bcp\bpp\bp:\b:5\b58\b89\b9 *\b**\b**\b* |\n+|auto retp = &prio; |\n+|\t\tsync_call(&torrent::piece_priorities, retp); |\n+|\t\tstd::vector ret; |\n+|\t\tret.reserve(prio.size()); |\n+|\t\tfor (auto p : prio) |\n+|\t\t\tret.push_back(int(static_cast(p))); |\n+|\t\treturn ret; |\n |\t} |\n+|#endif |\n | |\n-|\tfile_index_t file_storage::file_index_at_piece(piece_index_t const piece) const |\n+|\tvoid torrent_handle::file_priority(file_index_t index, download_priority_t priority) const |\n |\t{ |\n-|\t\treturn file_index_at_offset(static_cast(piece) * std::int64_t(piece_length())); |\n+|\t\tasync_call(&torrent::set_file_priority, index, priority); |\n |\t} |\n | |\n-|\tfile_index_t file_storage::file_index_for_root(sha256_hash const& root_hash) const |\n+|\tdownload_priority_t torrent_handle::file_priority(file_index_t index) const |\n |\t{ |\n-|for (file_index_t const i : file_range()) |\n-|{ |\n-|\t\t\tif (root(i) == root_hash) return i; |\n-|\t\t} |\n-|\t\treturn file_index_t{-1}; |\n+|\t\treturn sync_call_ret(dont_download, &torrent::file_priority, index); |\n |\t} |\n | |\n-|\tpiece_index_t file_storage::piece_index_at_file(file_index_t f) const |\n-|\t{ |\n-|\t\treturn piece_index_t{aux::numeric_cast(file_offset(f) / piece_length())}; |\n+|void torrent_handle::prioritize_files(std::vector const& files) const |\n+|{ |\n+|\t\tasync_call(&torrent::prioritize_files |\n+|\t\t\t, static_cast const&>(files)); |\n |\t} |\n | |\n-|#if TORRENT_ABI_VERSION <= 2 |\n-|\tchar const* file_storage::file_name_ptr(file_index_t const index) const |\n+|\tstd::vector torrent_handle::get_file_priorities() const |\n |\t{ |\n-|\t\treturn m_files[index].name; |\n+|\t\taux::vector ret; |\n+|\t\tauto retp = &ret; |\n+|\t\tsync_call(&torrent::file_priorities, retp); |\n+|\t\treturn TORRENT_RVO(ret); |\n |\t} |\n | |\n-|\tint file_storage::file_name_len(file_index_t const index) const |\n-|\t{ |\n-|\t\tif (m_files[index].name_len == aux::file_entry::name_is_owned) |\n-|\t\t\treturn -1; |\n-|\t\treturn m_files[index].name_len; |\n-|\t} |\n-|#endif |\n+|#if TORRENT_ABI_VERSION == 1 |\n | |\n-|\tstd::vector file_storage::map_block(piece_index_t const piece |\n-|\t\t, std::int64_t const offset, std::int64_t size) const |\n-|\t{ |\n-|\t\tTORRENT_ASSERT_PRECOND(piece >= piece_index_t{0}); |\n-|_\b\t_\b\t_\bT_\bO_\bR_\bR_\bE_\bN_\bT_\b__\bA_\bS_\bS_\bE_\bR_\bT_\b__\bP_\bR_\bE_\bC_\bO_\bN_\bD_\b(_\bp_\bi_\be_\bc_\be_\b _\b<_\b _\be_\bn_\bd_\b__\bp_\bi_\be_\bc_\be_\b(_\b)_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b._\bc_\bp_\bp_\b:_\b1_\b2_\b4_\b2_\b _\b _\b|_\bt_\bh_\bi_\bs_\b _\bw_\bo_\bu_\bl_\bd_\b _\bb_\be_\b _\bm_\bo_\br_\be_\b _\be_\bf_\bf_\bi_\bc_\bi_\be_\bn_\bt_\b _\bi_\bf_\b _\bm_\b__\bp_\ba_\bt_\bh_\bs_\b _\bw_\ba_\bs_\b _\bs_\bo_\br_\bt_\be_\bd_\b _\bf_\bi_\br_\bs_\bt_\b,_\b _\bs_\bu_\bc_\bh_\b _\bt_\bh_\ba_\bt_\b _\ba_\b _\bl_\bo_\bw_\be_\br_\b _\bp_\ba_\bt_\bh_\b _\bi_\bn_\bd_\be_\bx_\b _\ba_\bl_\bw_\ba_\by_\bs_\b _\bm_\be_\ba_\bn_\bt_\b _\bs_\bo_\br_\bt_\be_\bd_\b-_\bb_\be_\bf_\bo_\br_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs w\bwo\bou\bul\bld\bd b\bbe\be m\bmo\bor\bre\be e\bef\bff\bfi\bic\bci\bie\ben\bnt\bt i\bif\bf m\bm_\b_p\bpa\bat\bth\bhs\bs w\bwa\bas\bs s\bso\bor\brt\bte\bed\bd f\bfi\bir\brs\bst\bt,\b, s\bsu\buc\bch\bh t\bth\bha\bat\bt a\ba l\blo\bow\bwe\ber\br p\bpa\bat\bth\bh i\bin\bnd\bde\bex\bx a\bal\blw\bwa\bay\bys\bs m\bme\bea\ban\bnt\bt s\bso\bor\brt\bte\bed\bd-\b-b\bbe\bef\bfo\bor\bre\be *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/f\bfi\bil\ble\be_\b_s\bst\bto\bor\bra\bag\bge\be.\b.c\bcp\bpp\bp:\b:1\b12\b24\b42\b2 *\b**\b**\b* |\n-|} |\n+|// ============ start deprecation =============== |\n | |\n-|\tvoid file_storage::canonicalize_impl(bool const backwards_compatible) |\n+|\tvoid torrent_handle::prioritize_files(std::vector const& files) const |\n |\t{ |\n-|\t\tTORRENT_ASSERT(piece_length() >= 16 * 1024); |\n-| |\n-|\t\t// use this vector to track the new ordering of files |\n-|\t\t// this allows the use of STL algorithms despite them |\n-|\t\t// not supporting a custom swap functor |\n-|\t\taux::vector new_order(end_file()); |\n-|\t\tfor (auto i : file_range()) |\n-|\t\t\tnew_order[i] = i; |\n-| |\n-|\t\t// remove any existing pad files |\n-|\t\t{ |\n-|\t\t\tauto pad_begin = std::partition(new_order.begin(), new_order.end() |\n-|\t\t\t\t, [this](file_index_t i) { return !m_files[i].pad_file; }); |\n-|\t\t\tnew_order.erase(pad_begin, new_order.end()); |\n-|\t\t} |\n-| |\n-| |\n-|// sort files by path/name |\n-|\t\tstd::sort(new_order.begin(), new_order.end() |\n-|\t\t\t, [this](file_index_t l, file_index_t r) |\n-|\t\t{ |\n-|\t\t\t// assuming m_paths are unique! |\n-|\t\t\tauto const& lf = m_files[l]; |\n-|\t\t\tauto const& rf = m_files[r]; |\n-|\t\t\tif (lf.path_index != rf.path_index) |\n-|\t\t\t{ |\n-|\t\t\t\tint const ret = path_compare(m_paths[lf.path_index], lf.filename() |\n-|\t\t\t\t\t, m_paths[rf.path_index], rf.filename()); |\n-|\t\t\t\tif (ret != 0) return ret < 0; |\n-|\t\t\t} |\n-|\t\t\treturn lf.filename() < rf.filename(); |\n-|\t\t}); |\n-| |\n-|\t\taux::vector new_files; |\n-|\t\taux::vector new_file_hashes; |\n-|\t\taux::vector new_mtime; |\n-| |\n-|\t\t// reserve enough space for the worst case after padding |\n-|\t\tnew_files.reserve(new_order.size() * 2 - 1); |\n-|\t\tif (!m_file_hashes.empty()) |\n-|\t\t\tnew_file_hashes.reserve(new_order.size() * 2 - 1); |\n-|\t\tif (!m_mtime.empty()) |\n-|\t\t\tnew_mtime.reserve(new_order.size() * 2 - 1); |\n-| |\n-|\t\t// re-compute offsets and insert pad files as necessary |\n-|_\b\t_\b\t_\bs_\bt_\bd_\b:_\b:_\bi_\bn_\bt_\b6_\b4_\b__\bt_\b _\bo_\bf_\bf_\b _\b=_\b _\b0_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b._\bc_\bp_\bp_\b:_\b1_\b3_\b4_\b5_\b _\b _\b|_\bi_\bn_\b _\bC_\b+_\b+_\b1_\b7_\b _\bt_\bh_\bi_\bs_\b _\bc_\bo_\bu_\bl_\bd_\b _\bb_\be_\b _\bs_\bt_\br_\bi_\bn_\bg_\b__\bv_\bi_\be_\bw_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* i\bin\bn C\bC+\b++\b+1\b17\b7 t\bth\bhi\bis\bs c\bco\bou\bul\bld\bd b\bbe\be s\bst\btr\bri\bin\bng\bg_\b_v\bvi\bie\bew\bw *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/f\bfi\bil\ble\be_\b_s\bst\bto\bor\bra\bag\bge\be.\b.c\bcp\bpp\bp:\b:1\b13\b34\b45\b5 *\b**\b**\b* |\n-|add_pad_file(i); |\n+|\t\taux::vector file_prio; |\n+|\t\tfile_prio.reserve(files.size()); |\n+|\t\tfor (auto const p : files) { |\n+|\t\t\tfile_prio.push_back(download_priority_t(static_cast(p))); |\n |\t\t} |\n-| |\n-|\t\tm_files = std::move(new_files); |\n-|\t\tm_file_hashes = std::move(new_file_hashes); |\n-|\t\tm_mtime = std::move(new_mtime); |\n-| |\n-|\t\tm_total_size = off; |\n+|\t\tasync_call(&torrent::prioritize_files, file_prio); |\n |\t} |\n | |\n-|\tvoid file_storage::sanitize_symlinks() |\n+|\tstd::vector torrent_handle::file_priorities() const |\n |\t{ |\n-|\t\t// symlinks are unusual, this function is optimized assuming there are no |\n-|\t\t// symbolic links in the torrent. If we find one symbolic link, we'll |\n-|\t\t// build the hash table of files it's allowed to refer to, but don't pay |\n-|\t\t// that price up-front. |\n-|\t\tstd::unordered_map file_map; |\n-|\t\tbool file_map_initialized = false; |\n-| |\n-|\t\t// lazily instantiated set of all valid directories a symlink may point to |\n-|std::unordered_set dir_map; |\n-|bool dir_map_initialized = false; |\n-| |\n-|\t\t// symbolic links that points to directories |\n-|\t\tstd::unordered_map dir_links; |\n-| |\n-|\t\t// we validate symlinks in (potentially) 2 passes over the files. |\n-|\t\t// remaining symlinks to validate after the first pass |\n-|\t\tstd::vector symlinks_to_validate; |\n-| |\n-|\t\tfor (auto const i : file_range()) |\n+|_\b\t_\b\t_\ba_\bu_\bx_\b:_\b:_\bv_\be_\bc_\bt_\bo_\br_\b<_\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\b__\bp_\br_\bi_\bo_\br_\bi_\bt_\by_\b__\bt_\b,_\b _\bf_\bi_\bl_\be_\b__\bi_\bn_\bd_\be_\bx_\b__\bt_\b>_\b _\bp_\br_\bi_\bo_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/ |why is this a linked list? |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bu_\bd_\bp_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b._\bc_\bp_\bp_\b:_\b6_\b3_\b3_\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* w\bwh\bhy\by i\bis\bs t\bth\bhi\bis\bs a\ba l\bli\bin\bnk\bke\bed\bd l\bli\bis\bst\bt?\b? *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/u\bud\bdp\bp_\b_t\btr\bra\bac\bck\bke\ber\br_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn.\b.c\bcp\bpp\bp:\b:6\b63\b33\b3 *\b**\b**\b* |\n+|ipv6_peer_entry e{}; |\n+|\t\t\t\tstd::memcpy(e.ip.data(), buf.data(), 16); |\n+|\t\t\t\tbuf = buf.subspan(16); |\n+|\t\t\t\te.port = aux::read_uint16(buf); |\n+|\t\t\t\tresp.peers6.push_back(e); |\n+|\t\t\t} |\n+|\t\t} |\n+|\t\telse |\n |\t\t{ |\n-|\t\t\tif (!(file_flags(i) & file_storage::flag_symlink)) continue; |\n-| |\n-|\t\t\tif (!file_map_initialized) |\n+|\t\t\tresp.peers4.reserve(static_cast(num_peers)); |\n+|\t\t\tfor (int i = 0; i < num_peers; ++i) |\n |\t\t\t{ |\n-|\t\t\t\tfor (auto const j : file_range()) |\n-|\t\t\t\t\tfile_map.insert({internal_file_path(j), j}); |\n-|\t\t\t\tfile_map_initialized = true; |\n+|\t\t\t\tipv4_peer_entry e{}; |\n+|\t\t\t\tstd::memcpy(e.ip.data(), buf.data(), 4); |\n+|\t\t\t\tbuf = buf.subspan(4); |\n+|\t\t\t\te.port = aux::read_uint16(buf); |\n+|\t\t\t\tresp.peers4.push_back(e); |\n |\t\t\t} |\n+|\t\t} |\n | |\n-|\t\t\taux::file_entry const& fe = m_files[i]; |\n-|\t\t\tTORRENT_ASSERT(fe.symlink_index < int(m_symlinks.size())); |\n+|std::list
    ip_list; |\n+|std::transform(m_endpoints.begin(), m_endpoints.end(), std::back_inserter(ip_list) |\n+|\t\t\t, [](tcp::endpoint const& ep) { return ep.address(); } ); |\n | |\n-|\t\t\t// symlink targets are only allowed to point to files or directories in |\n-|\t\t\t// this torrent. |\n-|\t\t\t{ |\n-|\t\t\t\tstd::string target = m_symlinks[fe.symlink_index]; |\n+|\t\tcb->tracker_response(tracker_req(), m_target.address(), ip_list, resp); |\n | |\n-|\t\t\t\tif (is_complete(target)) |\n-|_\b\t_\b\t_\b\t_\b\t_\b{_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bu_\bd_\bp_\b__\bs_\bo_\bc_\bk_\be_\bt_\b._\bc_\bp_\bp_\b:_\b6_\b5_\b9_\b _\b _\b _\b _\b _\b|_\bp_\be_\br_\bh_\ba_\bp_\bs_\b _\ba_\bn_\b _\ba_\bt_\bt_\be_\bm_\bp_\bt_\b _\bs_\bh_\bo_\bu_\bl_\bd_\b _\bb_\be_\b _\bm_\ba_\bd_\be_\b _\bt_\bo_\b _\bb_\bi_\bn_\bd_\b _\bm_\b__\bs_\bo_\bc_\bk_\bs_\b5_\b__\bs_\bo_\bc_\bk_\b _\bt_\bo_\b _\bt_\bh_\be_\b _\bd_\be_\bv_\bi_\bc_\be_\b _\bo_\bf_\b _\bm_\b__\bl_\bi_\bs_\bt_\be_\bn_\b__\bs_\bo_\bc_\bk_\be_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* p\bpe\ber\brh\bha\bap\bps\bs a\ban\bn a\bat\btt\bte\bem\bmp\bpt\bt s\bsh\bho\bou\bul\bld\bd b\bbe\be m\bma\bad\bde\be t\bto\bo b\bbi\bin\bnd\bd m\bm_\b_s\bso\boc\bck\bks\bs5\b5_\b_s\bso\boc\bck\bk t\bto\bo t\bth\bhe\be d\bde\bev\bvi\bic\bce\be o\bof\bf m\bm_\b_l\bli\bis\bst\bte\ben\bn_\b_s\bso\boc\bck\bke\bet\bt *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/u\bud\bdp\bp_\b_s\bso\boc\bck\bke\bet\bt.\b.c\bcp\bpp\bp:\b:6\b65\b59\b9 *\b**\b**\b* |\n-|if (ec) |\n-|\t{ |\n-|\t\tif (m_alerts.should_post()) |\n-|\t\t\tm_alerts.emplace_alert(m_proxy_addr, operation_t::sock_option, ec); |\n-|\t\tec.clear(); |\n+|\t\tclose(); |\n+|\t\treturn true; |\n |\t} |\n-|#endif |\n-|#endif |\n | |\n-|\ttcp::endpoint const bind_ep(m_listen_socket.get_local_endpoint().address(), 0); |\n-|\tm_socks5_sock.bind(bind_ep, ec); |\n-|\tif (ec) |\n+|\tbool udp_tracker_connection::on_scrape_response(span buf) |\n |\t{ |\n-|\t\tif (m_alerts.should_post()) |\n-|\t\t\tm_alerts.emplace_alert(m_proxy_addr, operation_t::sock_bind, ec); |\n-|\t\t++m_failures; |\n-|\t\tretry_connection(); |\n-|\t\treturn; |\n-|\t} |\n-| |\n-| |\n-|ADD_OUTSTANDING_ASYNC(\"socks5::on_connected\"); |\n-|\tm_socks5_sock.async_connect(m_proxy_addr |\n-|\t\t, std::bind(&socks5::on_connected, self(), _1)); |\n+|\t\trestart_read_timeout(); |\n+|\t\tauto const action = static_cast(aux::read_int32(buf)); |\n+|\t\tstd::uint32_t const transaction = aux::read_uint32(buf); |\n | |\n-|\tADD_OUTSTANDING_ASYNC(\"socks5::on_connect_timeout\"); |\n-|\tm_timer.expires_after(seconds(10)); |\n-|\tm_timer.async_wait(std::bind(&socks5::on_connect_timeout |\n-|\t\t, self(), _1)); |\n-|} |\n+|\t\tif (transaction != m_transaction_id) |\n+|\t\t{ |\n+|\t\t\tfail(error_code(errors::invalid_tracker_transaction_id), operation_t::bittorrent); |\n+|\t\t\treturn false; |\n+|\t\t} |\n | |\n-|void socks5::on_connect_timeout(error_code const& e) |\n-|{ |\n-|\tCOMPLETE_ASYNC(\"socks5::on_connect_timeout\"); |\n+|\t\tif (action == action_t::error) |\n+|\t\t{ |\n+|\t\t\tfail(error_code(errors::tracker_failure), operation_t::bittorrent |\n+|\t\t\t\t, std::string(buf.data(), static_cast(buf.size())).c_str()); |\n+|\t\t\treturn true; |\n+|\t\t} |\n | |\n-|\tif (e == boost::asio::error::operation_aborted) return; |\n+|\t\tif (action != action_t::scrape) |\n+|_\b\t_\b\t_\b{_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\bu_\bt_\bp_\b__\bs_\bo_\bc_\bk_\be_\bt_\b__\bm_\ba_\bn_\ba_\bg_\be_\br_\b._\bc_\bp_\bp_\b:|this should not be heap allocated, sockets should be movable |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b2_\b0_\b4_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs s\bsh\bho\bou\bul\bld\bd n\bno\bot\bt b\bbe\be h\bhe\bea\bap\bp a\bal\bll\blo\boc\bca\bat\bte\bed\bd,\b, s\bso\boc\bck\bke\bet\bts\bs s\bsh\bho\bou\bul\bld\bd b\bbe\be m\bmo\bov\bva\bab\bbl\ble\be *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/u\but\btp\bp_\b_s\bso\boc\bck\bke\bet\bt_\b_m\bma\ban\bna\bag\bge\ber\br.\b.c\bcp\bpp\bp:\b:2\b20\b04\b4 *\b**\b**\b* |\n+|//\t\tUTP_LOGV(\"incoming packet id:%d source:%s\\n\", id, print_endpoint(ep).c_str()); |\n | |\n-|\tif (m_abort) return; |\n+|\t\tif (!m_sett.get_bool(settings_pack::enable_incoming_utp)) |\n+|\t\t\treturn false; |\n | |\n-|\tif (m_alerts.should_post()) |\n-|\t\tm_alerts.emplace_alert(m_proxy_addr, operation_t::connect, errors::timed_out); |\n+|\t\t// if not found, see if it's a SYN packet, if it is, |\n+|\t\t// create a new utp_stream |\n+|\t\tif (ph->get_type() == ST_SYN) |\n+|\t\t{ |\n+|\t\t\t// possible SYN flood. Just ignore |\n+|\t\t\tif (int(m_utp_sockets.size()) > m_sett.get_int(settings_pack::connections_limit) * 2) |\n+|\t\t\t\treturn false; |\n | |\n-|\terror_code ignore; |\n-|\tm_socks5_sock.close(ignore); |\n+|\t\t\tTORRENT_ASSERT(m_new_connection == -1); |\n+|\t\t\t// create the new socket with this ID |\n+|\t\t\tm_new_connection = id; |\n | |\n-|\t++m_failures; |\n-|\tretry_connection(); |\n-|} |\n+|//\t\t\tUTP_LOGV(\"not found, new connection id:%d\\n\", m_new_connection); |\n | |\n-|void socks5::on_connected(error_code const& e) |\n-|_\b{_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk_\b._\bc_\bp_\bp_\b:_\b3_\b0_\b5_\b _\b _\b|_\bd_\be_\bp_\br_\be_\bc_\ba_\bt_\be_\b _\bt_\bh_\bi_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* d\bde\bep\bpr\bre\bec\bca\bat\bte\be t\bth\bhi\bis\bs *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/s\bse\bet\btt\bti\bin\bng\bgs\bs_\b_p\bpa\bac\bck\bk.\b.c\bcp\bpp\bp:\b:3\b30\b05\b5 *\b**\b**\b* |\n-|SET(outgoing_port, 0, nullptr), |\n-|\t\tSET(num_outgoing_ports, 0, nullptr), |\n-|\t\tSET(peer_dscp, 0x04, &session_impl::update_peer_dscp), |\n-|\t\tSET(active_downloads, 3, &session_impl::trigger_auto_manage), |\n-|\t\tSET(active_seeds, 5, &session_impl::trigger_auto_manage), |\n-|\t\tSET(active_checking, 1, &session_impl::trigger_auto_manage), |\n-|\t\tSET(active_dht_limit, 88, nullptr), |\n-|\t\tSET(active_tracker_limit, 1600, nullptr), |\n-|\t\tSET(active_lsd_limit, 60, nullptr), |\n-|\t\tSET(active_limit, 500, &session_impl::trigger_auto_manage), |\n-|\t\tDEPRECATED_SET(active_loaded_limit, 0, &session_impl::trigger_auto_manage), |\n-|\t\tSET(auto_manage_interval, 30, nullptr), |\n-|\t\tSET(seed_time_limit, 24 * 60 * 60, nullptr), |\n-|\t\tSET(auto_scrape_interval, 1800, nullptr), |\n-|\t\tSET(auto_scrape_min_interval, 300, nullptr), |\n-|\t\tSET(max_peerlist_size, 3000, nullptr), |\n-|\t\tSET(max_paused_peerlist_size, 1000, nullptr), |\n-|\t\tSET(min_announce_interval, 5 * 60, nullptr), |\n-|\t\tSET(auto_manage_startup, 60, nullptr), |\n-|\t\tSET(seeding_piece_quota, 20, nullptr), |\n-|SET(max_rejects, 50, nullptr), |\n-|SET(recv_socket_buffer_size, 0, &session_impl::update_socket_buffer_size), |\n-|\t\tSET(send_socket_buffer_size, 0, &session_impl::update_socket_buffer_size), |\n-|\t\tSET(max_peer_recv_buffer_size, 2 * 1024 * 1024, nullptr), |\n-|\t\tDEPRECATED_SET(file_checks_delay_per_block, 0, nullptr), |\n-|\t\tDEPRECATED2_SET(read_cache_line_size, 32, nullptr), |\n-|\t\tDEPRECATED2_SET(write_cache_line_size, 16, nullptr), |\n-|\t\tSET(optimistic_disk_retry, 10 * 60, nullptr), |\n-|\t\tSET(max_suggest_pieces, 16, nullptr), |\n-|\t\tSET(local_service_announce_interval, 5 * 60, nullptr), |\n-|\t\tSET(dht_announce_interval, 15 * 60, &session_impl::update_dht_announce_interval), |\n-|\t\tSET(udp_tracker_token_expiry, 60, nullptr), |\n-|\t\tDEPRECATED_SET(default_cache_min_age, 1, nullptr), |\n-|\t\tSET(num_optimistic_unchoke_slots, 0, nullptr), |\n-|\t\tDEPRECATED_SET(default_est_reciprocation_rate, 16000, nullptr), |\n-|\t\tDEPRECATED_SET(increase_est_reciprocation_rate, 20, nullptr), |\n-|\t\tDEPRECATED_SET(decrease_est_reciprocation_rate, 3, nullptr), |\n-|\t\tSET(max_pex_peers, 50, nullptr), |\n-|\t\tSET(tick_interval, 500, nullptr), |\n-|\t\tSET(share_mode_target, 3, nullptr), |\n-|\t\tSET(upload_rate_limit, 0, &session_impl::update_upload_rate), |\n-|\t\tSET(download_rate_limit, 0, &session_impl::update_download_rate), |\n-|\t\tDEPRECATED_SET(local_upload_rate_limit, 0, &session_impl::update_local_upload_rate), |\n-|\t\tDEPRECATED_SET(local_download_rate_limit, 0, &session_impl::update_local_download_rate), |\n-|\t\tSET(dht_upload_rate_limit, 8000, &session_impl::update_dht_upload_rate_limit), |\n-|\t\tSET(unchoke_slots_limit, 8, &session_impl::update_unchoke_limit), |\n-|\t\tDEPRECATED_SET(half_open_limit, 0, nullptr), |\n-|\t\tSET(connections_limit, 200, &session_impl::update_connections_limit), |\n-|\t\tSET(connections_slack, 10, nullptr), |\n-|\t\tSET(utp_target_delay, 100, nullptr), |\n-|_\b\t_\b\t_\bS_\bE_\bT_\b(_\bu_\bt_\bp_\b__\bg_\ba_\bi_\bn_\b__\bf_\ba_\bc_\bt_\bo_\br_\b,_\b _\b3_\b0_\b0_\b0_\b,_\b _\bn_\bu_\bl_\bl_\bp_\bt_\br_\b)_\b,_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk_\b._\bc_\bp_\bp_\b:_\b5_\b9_\b0_\b _\b _\b|_\bi_\bt_\b _\bw_\bo_\bu_\bl_\bd_\b _\bb_\be_\b _\bn_\bi_\bc_\be_\b _\bt_\bo_\b _\br_\be_\bs_\be_\br_\bv_\be_\b(_\b)_\b _\bt_\bh_\be_\bs_\be_\b _\bv_\be_\bc_\bt_\bo_\br_\bs_\b _\bu_\bp_\b _\bf_\br_\bo_\bn_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* i\bit\bt w\bwo\bou\bul\bld\bd b\bbe\be n\bni\bic\bce\be t\bto\bo r\bre\bes\bse\ber\brv\bve\be(\b()\b) t\bth\bhe\bes\bse\be v\bve\bec\bct\bto\bor\brs\bs u\bup\bp f\bfr\bro\bon\bnt\bt *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/s\bse\bet\btt\bti\bin\bng\bgs\bs_\b_p\bpa\bac\bck\bk.\b.c\bcp\bpp\bp:\b:5\b59\b90\b0 *\b**\b**\b* |\n-|s.set_str(settings_pack::string_type_base | i, str_settings[i].default_value); |\n-|\t\t\tTORRENT_ASSERT(s.get_str(settings_pack::string_type_base + i) == str_settings[i].default_value); |\n-|\t\t} |\n+|aux::socket_type c(aux::instantiate_connection(m_ios, aux::proxy_settings(), m_ssl_context, this, true, false)); |\n | |\n-|\t\tfor (int i = 0; i < settings_pack::num_int_settings; ++i) |\n-|\t\t{ |\n-|\t\t\ts.set_int(settings_pack::int_type_base | i, int_settings[i].default_value); |\n-|\t\t\tTORRENT_ASSERT(s.get_int(settings_pack::int_type_base + i) == int_settings[i].default_value); |\n-|\t\t} |\n+|\t\t\tutp_stream* str = nullptr; |\n+|#ifdef TORRENT_SSL_PEERS |\n+|\t\t\tif (is_ssl(c)) |\n+|\t\t\t\tstr = &boost::get>(c).next_layer(); |\n+|\t\t\telse |\n+|#endif |\n+|\t\t\t\tstr = boost::get(&c); |\n | |\n-|\t\tfor (int i = 0; i < settings_pack::num_bool_settings; ++i) |\n-|\t\t{ |\n-|\t\t\ts.set_bool(settings_pack::bool_type_base | i, bool_settings[i].default_value); |\n-|\t\t\tTORRENT_ASSERT(s.get_bool(settings_pack::bool_type_base + i) == bool_settings[i].default_value); |\n+|\t\t\tTORRENT_ASSERT(str); |\n+|\t\t\tint const mtu = mtu_for_dest(ep.address()); |\n+|\t\t\tstr->get_impl()->init_mtu(mtu); |\n+|\t\t\tstr->get_impl()->m_sock = std::move(socket); |\n+|\t\t\tbool const ret = str->get_impl()->incoming_packet(p, ep, receive_time); |\n+|\t\t\tif (!ret) return false; |\n+|\t\t\tm_last_socket = str->get_impl(); |\n+|\t\t\tm_cb(std::move(c)); |\n+|\t\t\t// the connection most likely changed its connection ID here |\n+|\t\t\t// we need to move it to the correct ID |\n+|\t\t\treturn true; |\n |\t\t} |\n-|\t} |\n | |\n-|\tsettings_pack default_settings() |\n-|\t{ |\n-|\t\tsettings_pack ret; |\n-|for (int i = 0; i < settings_pack::num_string_settings; ++i) |\n-|{ |\n-|\t\t\tif (str_settings[i].default_value == nullptr) continue; |\n-|\t\t\tret.set_str(settings_pack::string_type_base + i, str_settings[i].default_value); |\n-|\t\t} |\n+|\t\tif (ph->get_type() == ST_RESET) return false; |\n | |\n-|\t\tfor (int i = 0; i < settings_pack::num_int_settings; ++i) |\n-|\t\t{ |\n-|\t\t\tret.set_int(settings_pack::int_type_base + i, int_settings[i].default_value); |\n-|\t\t} |\n+|\t\t// #error send reset |\n | |\n-|\t\tfor (int i = 0; i < settings_pack::num_bool_settings; ++i) |\n-|\t\t{ |\n-|\t\t\tret.set_bool(settings_pack::bool_type_base + i, bool_settings[i].default_value); |\n-|\t\t} |\n-|\t\treturn ret; |\n+|\t\treturn false; |\n |\t} |\n | |\n-|\tvoid apply_pack(settings_pack const* pack, aux::session_settings& sett |\n-|\t\t, aux::session_impl* ses) |\n+|_\b\t_\bv_\bo_\bi_\bd_\b _\bu_\bt_\bp_\b__\bs_\bo_\bc_\bk_\be_\bt_\b__\bm_\ba_\bn_\ba_\bg_\be_\br_\b:_\b:_\bs_\bu_\bb_\bs_\bc_\br_\bi_\bb_\be_\b__\bw_\br_\bi_\bt_\ba_\bb_\bl_\be_\b(_\bu_\bt_\bp_\b__\bs_\bo_\bc_\bk_\be_\bt_\b__\bi_\bm_\bp_\bl_\b*_\b _\bs_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/ |introduce a web-seed default class which has a low download priority |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bw_\be_\bb_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b__\bb_\ba_\bs_\be_\b._\bc_\bp_\bp_\b:_\b7_\b2_\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* i\bin\bnt\btr\bro\bod\bdu\buc\bce\be a\ba w\bwe\beb\bb-\b-s\bse\bee\bed\bd d\bde\bef\bfa\bau\bul\blt\bt c\bcl\bla\bas\bss\bs w\bwh\bhi\bic\bch\bh h\bha\bas\bs a\ba l\blo\bow\bw d\bdo\bow\bwn\bnl\blo\boa\bad\bd p\bpr\bri\bio\bor\bri\bit\bty\by *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/w\bwe\beb\bb_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn_\b_b\bba\bas\bse\be.\b.c\bcp\bpp\bp:\b:7\b72\b2 *\b**\b**\b* |\n+|: peer_connection(pack) |\n+|\t\t, m_first_request(true) |\n+|\t\t, m_ssl(false) |\n+|\t\t, m_external_auth(web.auth) |\n+|\t\t, m_extra_headers(web.extra_headers) |\n+|\t\t, m_parser(http_parser::dont_parse_chunks) |\n+|\t\t, m_body_start(0) |\n |\t{ |\n-|\t\tusing fun_t = void (aux::session_impl::*)(); |\n-|\t\tstd::vector callbacks; |\n+|\t\tTORRENT_ASSERT(&web.peer_info == pack.peerinfo); |\n+|\t\t// when going through a proxy, we don't necessarily have an endpoint here, |\n+|\t\t// since the proxy might be resolving the hostname, not us |\n+|\t\tTORRENT_ASSERT(web.endpoints.empty() || web.endpoints.front() == pack.endp); |\n | |\n-|\t\tsett.bulk_set([&](aux::session_settings_single_thread& s) |\n-|\t\t{ |\n-|\t\t\tapply_pack_impl(pack, s, ses ? &callbacks : nullptr); |\n-|\t\t}); |\n+|\t\tINVARIANT_CHECK; |\n | |\n-|\t\t// call the callbacks once all the settings have been applied, and |\n-|_\b\t_\b\t_\b/_\b/_\b _\bo_\bn_\bl_\by_\b _\bo_\bn_\bc_\be_\b _\bp_\be_\br_\b _\bc_\ba_\bl_\bl_\bb_\ba_\bc_\bk_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bu_\bt_\bp_\b__\bs_\bt_\br_\be_\ba_\bm_\b._\bc_\bp_\bp_\b:_\b1_\b4_\b6_\b7_\b _\b _\b _\b _\b|_\bt_\bh_\bi_\bs_\b _\bl_\bo_\bo_\bp_\b _\bi_\bs_\b _\bn_\bo_\bt_\b _\bv_\be_\br_\by_\b _\be_\bf_\bf_\bi_\bc_\bi_\be_\bn_\bt_\b._\b _\bI_\bt_\b _\bc_\bo_\bu_\bl_\bd_\b _\bb_\be_\b _\bf_\bi_\bx_\be_\bd_\b _\bb_\by_\b _\bh_\ba_\bv_\bi_\bn_\bg_\b _\ba_\b _\bs_\be_\bp_\ba_\br_\ba_\bt_\be_\b _\bl_\bi_\bs_\bt_\b _\bo_\bf_\b _\bs_\be_\bq_\bu_\be_\bn_\bc_\be_\b _\bn_\bu_\bm_\bb_\be_\br_\bs_\b _\bt_\bh_\ba_\bt_\b _\bn_\be_\be_\bd_\b _\br_\be_\bs_\be_\bn_\bd_\bi_\bn_\bg_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs l\blo\boo\bop\bp i\bis\bs n\bno\bot\bt v\bve\ber\bry\by e\bef\bff\bfi\bic\bci\bie\ben\bnt\bt.\b. I\bIt\bt c\bco\bou\bul\bld\bd b\bbe\be f\bfi\bix\bxe\bed\bd b\bby\by h\bha\bav\bvi\bin\bng\bg a\ba s\bse\bep\bpa\bar\bra\bat\bte\be l\bli\bis\bst\bt o\bof\bf s\bse\beq\bqu\bue\ben\bnc\bce\be n\bnu\bum\bmb\bbe\ber\brs\bs t\bth\bha\bat\bt n\bne\bee\bed\bd r\bre\bes\bse\ben\bnd\bdi\bin\bng\bg *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/u\but\btp\bp_\b_s\bst\btr\bre\bea\bam\bm.\b.c\bcp\bpp\bp:\b:1\b14\b46\b67\b7 *\b**\b**\b* |\n-|#endif |\n+|\t\tTORRENT_ASSERT(is_outgoing()); |\n | |\n-|\tif (m_stalled) |\n-|\t{ |\n-|\t\tif (flags & pkt_ack) |\n-|\t\t\tdefer_ack(); |\n-|\t\treturn false; |\n-|\t} |\n+|\t\tTORRENT_ASSERT(!m_torrent.lock()->is_upload_only()); |\n | |\n-|\t// m_out_eof means we're trying to close the write side of this socket, |\n-|\t// we need to flush all payload before we can send the FIN packet, so don't |\n-|\t// store any payload in the nagle packet |\n-|\tbool const force = (flags & pkt_ack) || (flags & pkt_fin) || m_out_eof; |\n+|\t\t// we only want left-over bandwidth |\n | |\n-|\t// when we want to close the outgoing stream, we need to send the |\n-|\t// remaining nagle packet even though it won't fill a packet. |\n-|\tbool const force_flush_nagle = m_out_eof && m_write_buffer_size; |\n+|std::string protocol; |\n+|\t\terror_code ec; |\n+|\t\tstd::tie(protocol, m_basic_auth, m_host, m_port, m_path) |\n+|\t\t\t= parse_url_components(web.url, ec); |\n+|\t\tTORRENT_ASSERT(!ec); |\n | |\n-|\t// first see if we need to resend any packets |\n+|\t\tif (m_port == -1 && protocol == \"http\") |\n+|\t\t\tm_port = 80; |\n | |\n-|for (int i = (m_acked_seq_nr + 1) & ACK_MASK; i != m_seq_nr; i = (i + 1) & ACK_MASK) |\n-|{ |\n-|\t\tpacket* p = m_outbuf.at(aux::numeric_cast(i)); |\n-|\t\tif (!p) continue; |\n-|\t\tif (!p->need_resend) continue; |\n-|\t\tif (!resend_packet(p)) |\n+|#if TORRENT_USE_SSL |\n+|\t\tif (protocol == \"https\") |\n |\t\t{ |\n-|\t\t\t// we couldn't resend the packet. It probably doesn't |\n-|\t\t\t// fit in our cwnd. If force is set, we need to continue |\n-|\t\t\t// to send our packet anyway, if we don't have force set, |\n-|\t\t\t// we might as well return |\n-|\t\t\tif (!force) return false; |\n-|\t\t\t// resend_packet might have failed |\n-|\t\t\tif (state() == state_t::error_wait || state() == state_t::deleting) return false; |\n-|\t\t\tif (m_stalled) return false; |\n-|\t\t\tbreak; |\n+|\t\t\tm_ssl = true; |\n+|\t\t\tif (m_port == -1) m_port = 443; |\n |\t\t} |\n+|#endif |\n | |\n-|\t\t// don't fast-resend this packet |\n-|\t\tif (m_fast_resend_seq_nr == i) |\n-|\t\t\tm_fast_resend_seq_nr = (m_fast_resend_seq_nr + 1) & ACK_MASK; |\n-|\t} |\n-| |\n-|\t// MTU DISCOVERY |\n+|\t\tif (!m_basic_auth.empty()) |\n+|\t\t\tm_basic_auth = base64encode(m_basic_auth); |\n | |\n-|\t// under these conditions, the next packet we send should be an MTU probe. |\n-|\t// MTU probes get to use the mid-point packet size, whereas other packets |\n-|\t// use a conservative packet size of the largest known to work. The reason |\n-|\t// for the cwnd condition is to make sure the probe is surrounded by non- |\n-|\t// probes, to be able to distinguish a loss of the probe vs. just loss in |\n-|_\b\t_\b/_\b/_\b _\bg_\be_\bn_\be_\br_\ba_\bl_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bp_\bi_\be_\bc_\be_\b__\bp_\bi_\bc_\bk_\be_\br_\b._\bc_\bp_\bp_\b:_\b1_\b2_\b1_\b _\b _\b _\b|_\bf_\bi_\bn_\bd_\b _\ba_\b _\bb_\be_\bt_\bt_\be_\br_\b _\bp_\bl_\ba_\bc_\be_\b _\bf_\bo_\br_\b _\bt_\bh_\bi_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* f\bfi\bin\bnd\bd a\ba b\bbe\bet\btt\bte\ber\br p\bpl\bla\bac\bce\be f\bfo\bor\br t\bth\bhi\bis\bs *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/p\bpi\bie\bec\bce\be_\b_p\bpi\bic\bck\bke\ber\br.\b.c\bcp\bpp\bp:\b:1\b12\b21\b1 *\b**\b**\b* |\n-|if (limit == 0) |\n-|\t\t\t{ |\n-|\t\t\t\tstd::cerr << \" ...\"; |\n-|\t\t\t\tbreak; |\n-|\t\t\t} |\n-|\t\t\tif (*i == -1) break; |\n-|\t\t\twhile (j != p.m_priority_boundaries.end() && *j <= index) |\n-|\t\t\t{ |\n-|\t\t\t\tstd::cerr << \"| \"; |\n-|\t\t\t\t++j; |\n-|\t\t\t} |\n-|\t\t\tstd::cerr << *i << \"(\" << p.m_piece_map[*i].index << \") \"; |\n-|\t\t\t--limit; |\n-|\t\t} |\n-|\t\tstd::cerr << std::endl; |\n+|\t\tm_server_string = m_host; |\n+|\t\taux::verify_encoding(m_server_string); |\n |\t} |\n-|} |\n-|#endif // TORRENT_PICKER_LOG |\n-|namespace libtorrent { |\n | |\n-|const piece_block piece_block::invalid( |\n-|std::numeric_limits::max() |\n-|\t\t, std::numeric_limits::max()); |\n-| |\n-|\tconstexpr prio_index_t piece_picker::piece_pos::we_have_index; |\n-| |\n-|\tconstexpr picker_options_t piece_picker::rarest_first; |\n-|\tconstexpr picker_options_t piece_picker::reverse; |\n-|\tconstexpr picker_options_t piece_picker::on_parole; |\n-|\tconstexpr picker_options_t piece_picker::prioritize_partials; |\n-|\tconstexpr picker_options_t piece_picker::sequential; |\n-|\tconstexpr picker_options_t piece_picker::align_expanded_pieces; |\n-|\tconstexpr picker_options_t piece_picker::piece_extent_affinity; |\n-| |\n-|\tconstexpr download_queue_t piece_picker::piece_pos::piece_downloading; |\n-|\tconstexpr download_queue_t piece_picker::piece_pos::piece_full; |\n-|\tconstexpr download_queue_t piece_picker::piece_pos::piece_finished; |\n-|\tconstexpr download_queue_t piece_picker::piece_pos::piece_zero_prio; |\n-|\tconstexpr download_queue_t piece_picker::piece_pos::num_download_categories; |\n-|\tconstexpr download_queue_t piece_picker::piece_pos::piece_open; |\n-|\tconstexpr download_queue_t piece_picker::piece_pos::piece_downloading_reverse; |\n-|\tconstexpr download_queue_t piece_picker::piece_pos::piece_full_reverse; |\n-| |\n-|\t// the max number of blocks to create an affinity for |\n-|\tconstexpr int max_piece_affinity_extent = 4 * 1024 * 1024 / default_block_size; |\n-| |\n-|\tpiece_picker::piece_picker(std::int64_t const total_size, int const piece_size) |\n-|\t\t: m_priority_boundaries(1, m_pieces.end_index()) |\n+|\tint web_connection_base::timeout() const |\n |\t{ |\n-|\t\tTORRENT_ASSERT(total_size > 0); |\n-|_\b\t_\b\t_\bT_\bO_\bR_\bR_\bE_\bN_\bT_\b__\bA_\bS_\bS_\bE_\bR_\bT_\b(_\bp_\bi_\be_\bc_\be_\b__\bs_\bi_\bz_\be_\b _\b>_\b _\b0_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-| | |this could probably be optimized by incrementally calling partial_sort to sort one more element in the list. Because chances are |\n-|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\bp_\bi_\be_\bc_\be_\b__\bp_\bi_\bc_\bk_\be_\br_\b._\bc_\bp_\bp_\b:_\b2_\b0_\b6_\b7 |that we'll just need a single piece, and once we've picked from it we're done. Sorting the rest of the list in that case is a waste |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bo_\bf_\b _\bt_\bi_\bm_\be_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs c\bco\bou\bul\bld\bd p\bpr\bro\bob\bba\bab\bbl\bly\by b\bbe\be o\bop\bpt\bti\bim\bmi\biz\bze\bed\bd b\bby\by i\bin\bnc\bcr\bre\bem\bme\ben\bnt\bta\bal\bll\bly\by c\bca\bal\bll\bli\bin\bng\bg p\bpa\bar\brt\bti\bia\bal\bl_\b_s\bso\bor\brt\bt t\bto\bo s\bso\bor\brt\bt o\bon\bne\be m\bmo\bor\bre\be e\bel\ble\bem\bme\ben\bnt\bt i\bin\bn t\bth\bhe\be l\bli\bis\bst\bt.\b. B\bBe\bec\bca\bau\bus\bse\be c\bch\bha\ban\bnc\bce\bes\bs a\bar\bre\be t\bth\bha\bat\bt w\bwe\be'\b'l\bll\bl j\bju\bus\bst\bt n\bne\bee\bed\bd a\ba s\bsi\bin\bng\bgl\ble\be p\bpi\bie\bec\bce\be,\b, a\ban\bnd\bd|\n-|o\bon\bnc\bce\be w\bwe\be'\b'v\bve\be p\bpi\bic\bck\bke\bed\bd f\bfr\bro\bom\bm i\bit\bt w\bwe\be'\b'r\bre\be d\bdo\bon\bne\be.\b. S\bSo\bor\brt\bti\bin\bng\bg t\bth\bhe\be r\bre\bes\bst\bt o\bof\bf t\bth\bhe\be l\bli\bis\bst\bt i\bin\bn t\bth\bha\bat\bt c\bca\bas\bse\be i\bis\bs a\ba w\bwa\bas\bst\bte\be o\bof\bf t\bti\bim\bme\be.\b. *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/p\bpi\bie\bec\bce\be_\b_p\bpi\bic\bck\bke\ber\br.\b.c\bcp\bpp\bp:\b:2\b20\b06\b67\b7 *\b**\b**\b* |\n-|// now, copy over the pointers. We also apply a filter here to not |\n-|\t\t\t// include ineligible pieces in certain modes. For instance, a piece |\n-|\t\t\t// that the current peer doesn't have is not included. |\n-|\t\t\tfor (auto& dp : m_downloads[piece_pos::piece_downloading]) |\n-|\t\t\t{ |\n-|\t\t\t\tpc.inc_stats_counter(counters::piece_picker_partial_loops); |\n-| |\n-|\t\t\t\tif (!is_piece_free(dp.index, pieces)) continue; |\n-| |\n-|\t\t\t\tTORRENT_ASSERT(m_piece_map[dp.index].download_queue() |\n-|\t\t\t\t\t== piece_pos::piece_downloading); |\n+|\t\t// since this is a web seed, change the timeout |\n+|\t\t// according to the settings. |\n+|\t\treturn m_settings.get_int(settings_pack::urlseed_timeout); |\n+|_\b\t_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bi_\bp_\b__\bn_\bo_\bt_\bi_\bf_\bi_\be_\br_\b._\bc_\bp_\bp_\b:_\b4_\b1_\b _\b _\b _\b _\b _\b|_\bs_\bi_\bm_\bu_\bl_\ba_\bt_\bo_\br_\b _\bs_\bu_\bp_\bp_\bo_\br_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* s\bsi\bim\bmu\bul\bla\bat\bto\bor\br s\bsu\bup\bpp\bpo\bor\brt\bt *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/i\bip\bp_\b_n\bno\bot\bti\bif\bfi\bie\ber\br.\b.c\bcp\bpp\bp:\b:4\b41\b1 *\b**\b**\b* |\n+| from this software without specific prior written permission. |\n | |\n-|\t\t\t\tordered_partials[num_ordered_partials++] = &dp; |\n-|\t\t\t} |\n+|THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" |\n+|AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |\n+|IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |\n+|ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |\n+|LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |\n+|CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |\n+|SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |\n+|INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |\n+|CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |\n+|ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |\n+|POSSIBILITY OF SUCH DAMAGE. |\n | |\n-|\t\t\t// now, sort the list. |\n-|\t\t\tif (options & rarest_first) |\n-|\t\t\t{ |\n-|\t\t\t\tret |= picker_log_alert::rarest_first_partials; |\n+|*/ |\n | |\n-|std::sort(ordered_partials.begin(), ordered_partials.begin() + num_ordered_partials |\n-|, std::bind(&piece_picker::partial_compare_rarest_first, this |\n-|\t\t\t\t\t\t, _1, _2)); |\n-|\t\t\t} |\n+|#include \"libtorrent/aux_/ip_notifier.hpp\" |\n+|#include \"libtorrent/assert.hpp\" |\n | |\n-|\t\t\tfor (int i = 0; i < num_ordered_partials; ++i) |\n-|\t\t\t{ |\n-|\t\t\t\tret |= picker_log_alert::prioritize_partials; |\n+|#if defined TORRENT_BUILD_SIMULATOR |\n+|#elif TORRENT_USE_NETLINK |\n+|#include \"libtorrent/netlink.hpp\" |\n+|#include \"libtorrent/socket.hpp\" |\n+|#include |\n+|#include |\n+|#elif TORRENT_USE_SYSTEMCONFIGURATION || TORRENT_USE_SC_NETWORK_REACHABILITY |\n+|#include |\n+|#elif defined TORRENT_WINDOWS |\n+|#include \"libtorrent/aux_/throw.hpp\" |\n+|#include \"libtorrent/aux_/disable_warnings_push.hpp\" |\n+|#include |\n+|#ifdef TORRENT_WINRT |\n+|#include |\n+|#endif |\n+|#include |\n+|#include \"libtorrent/aux_/disable_warnings_pop.hpp\" |\n+|#endif |\n | |\n-|\t\t\t\tnum_blocks = add_blocks_downloading(*ordered_partials[i], pieces |\n-|\t\t\t\t\t, interesting_blocks, backup_blocks, backup_blocks2 |\n-|\t\t\t\t\t, num_blocks, prefer_contiguous_blocks, peer, options); |\n-|\t\t\t\tif (num_blocks <= 0) return ret; |\n-|\t\t\t\tif (int(backup_blocks.size()) >= num_blocks |\n-|\t\t\t\t\t&& int(backup_blocks2.size()) >= num_blocks) |\n-|\t\t\t\t\tbreak; |\n-|\t\t\t} |\n+|#include \"libtorrent/aux_/netlink_utils.hpp\" |\n | |\n-|\t\t\tnum_blocks = append_blocks(interesting_blocks, backup_blocks |\n-|\t\t\t\t, num_blocks); |\n-|\t\t\tif (num_blocks <= 0) return ret; |\n+|namespace libtorrent { namespace aux { |\n | |\n-|\t\t\tnum_blocks = append_blocks(interesting_blocks, backup_blocks2 |\n-|\t\t\t\t, num_blocks); |\n-|\t\t\tif (num_blocks <= 0) return ret; |\n-|\t\t} |\n+|namespace { |\n | |\n-|\t\tif (!suggested_pieces.empty()) |\n-|\t\t{ |\n-|\t\t\tfor (piece_index_t i : suggested_pieces) |\n-|_\b\t_\b\t_\b\t_\b{_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bp_\bi_\be_\bc_\be_\b__\bp_\bi_\bc_\bk_\be_\br_\b._\bc_\bp_\bp_\b:_\b2_\b2_\b1_\b1_\b _\b _\b|_\bI_\bs_\b _\bi_\bt_\b _\ba_\b _\bg_\bo_\bo_\bd_\b _\bi_\bd_\be_\ba_\b _\bt_\bh_\ba_\bt_\b _\bt_\bh_\bi_\bs_\b _\ba_\bf_\bf_\bi_\bn_\bi_\bt_\by_\b _\bt_\ba_\bk_\be_\bs_\b _\bp_\br_\be_\bc_\be_\bd_\be_\bn_\bc_\be_\b _\bo_\bv_\be_\br_\b _\bp_\bi_\be_\bc_\be_\b _\bp_\br_\bi_\bo_\br_\bi_\bt_\by_\b?_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* I\bIs\bs i\bit\bt a\ba g\bgo\boo\bod\bd i\bid\bde\bea\ba t\bth\bha\bat\bt t\bth\bhi\bis\bs a\baf\bff\bfi\bin\bni\bit\bty\by t\bta\bak\bke\bes\bs p\bpr\bre\bec\bce\bed\bde\ben\bnc\bce\be o\bov\bve\ber\br p\bpi\bie\bec\bce\be p\bpr\bri\bio\bor\bri\bit\bty\by?\b? *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/p\bpi\bie\bec\bce\be_\b_p\bpi\bic\bck\bke\ber\br.\b.c\bcp\bpp\bp:\b:2\b22\b21\b11\b1 *\b**\b**\b* |\n-|prio_index_t const end = priority_end(i); |\n-|\t\t\t\t\tfor (prio_index_t p = prev(end); p >= start; --p) |\n-|\t\t\t\t\t{ |\n-|\t\t\t\t\t\tpc.inc_stats_counter(counters::piece_picker_reverse_rare_loops); |\n+|#if (TORRENT_USE_SYSTEMCONFIGURATION || TORRENT_USE_SC_NETWORK_REACHABILITY) && \\ |\n+|\t!defined TORRENT_BUILD_SIMULATOR |\n | |\n-|\t\t\t\t\t\tif (!is_piece_free(m_pieces[p], pieces)) continue; |\n+|// common utilities for Mac and iOS |\n+|template void CFRefRetain(T h) { CFRetain(h); } |\n+|_\bt_\be_\bm_\bp_\bl_\ba_\bt_\be_\b _\b<_\bt_\by_\bp_\be_\bn_\ba_\bm_\be_\b _\bT_\b>_\b _\bv_\bo_\bi_\bd_\b _\bC_\bF_\bR_\be_\bf_\bR_\be_\bl_\be_\ba_\bs_\be_\b(_\bT_\b _\bh_\b)_\b _\b{_\b _\bC_\bF_\bR_\be_\bl_\be_\ba_\bs_\be_\b(_\bh_\b)_\b;_\b _\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bp_\be_\b__\bc_\br_\by_\bp_\bt_\bo_\b._\bc_\bp_\bp_\b:_\b6_\b0_\b _\b _\b _\b _\b _\b _\b _\b|_\bi_\bt_\b _\bw_\bo_\bu_\bl_\bd_\b _\bb_\be_\b _\bn_\bi_\bc_\be_\b _\bt_\bo_\b _\bg_\be_\bt_\b _\bt_\bh_\be_\b _\bl_\bi_\bt_\be_\br_\ba_\bl_\b _\bw_\bo_\br_\bk_\bi_\bn_\bg_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* i\bit\bt w\bwo\bou\bul\bld\bd b\bbe\be n\bni\bic\bce\be t\bto\bo g\bge\bet\bt t\bth\bhe\be l\bli\bit\bte\ber\bra\bal\bl w\bwo\bor\brk\bki\bin\bng\bg *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/p\bpe\be_\b_c\bcr\bry\byp\bpt\bto\bo.\b.c\bcp\bpp\bp:\b:6\b60\b0 *\b**\b**\b* |\n+|#include |\n+|#include |\n | |\n-|\t\t\t\t\t\tret |= picker_log_alert::reverse_rarest_first; |\n+|#include \"libtorrent/aux_/disable_warnings_push.hpp\" |\n | |\n-|\t\t\t\t\t\tnum_blocks = add_blocks(m_pieces[p], pieces |\n-|\t\t\t\t\t\t\t, interesting_blocks, backup_blocks |\n-|\t\t\t\t\t\t\t, backup_blocks2, num_blocks |\n-|\t\t\t\t\t\t\t, prefer_contiguous_blocks, peer, ignored_pieces |\n-|\t\t\t\t\t\t\t, options); |\n-|\t\t\t\t\t\tif (num_blocks <= 0) return ret; |\n-|\t\t\t\t\t} |\n-|\t\t\t\t} |\n-|\t\t\t} |\n-|\t\t\telse |\n-|\t\t\t{ |\n-|if (options & piece_extent_affinity) |\n-|{ |\n-|\t\t\t\t\tint to_erase = -1; |\n-|\t\t\t\t\tint idx = -1; |\n-|\t\t\t\t\tfor (piece_extent_t const e : m_recent_extents) |\n-|\t\t\t\t\t{ |\n-|\t\t\t\t\t\t++idx; |\n-|\t\t\t\t\t\tbool have_all = true; |\n-|\t\t\t\t\t\tfor (piece_index_t const p : extent_for(e)) |\n-|\t\t\t\t\t\t{ |\n-|\t\t\t\t\t\t\tif (!m_piece_map[p].have()) have_all = false; |\n-|\t\t\t\t\t\t\tif (!is_piece_free(p, pieces)) continue; |\n+|#include |\n+|#include |\n | |\n-|\t\t\t\t\t\t\tret |= picker_log_alert::extent_affinity; |\n+|#include \"libtorrent/aux_/disable_warnings_pop.hpp\" |\n | |\n-|\t\t\t\t\t\t\tnum_blocks = add_blocks(p, pieces |\n-|\t\t\t\t\t\t\t\t, interesting_blocks, backup_blocks |\n-|\t\t\t\t\t\t\t\t, backup_blocks2, num_blocks |\n-|\t\t\t\t\t\t\t\t, prefer_contiguous_blocks, peer, ignored_pieces |\n-|\t\t\t\t\t\t\t\t, options); |\n-|\t\t\t\t\t\t\tif (num_blocks <= 0) |\n-|\t\t\t\t\t\t\t{ |\n-|\t\t\t\t\t\t\t\t// if we have all pieces belonging to this extent, remove it |\n-|\t\t\t\t\t\t\t\tif (to_erase != -1) m_recent_extents.erase(m_recent_extents.begin() + to_erase); |\n-|\t\t\t\t\t\t\t\treturn ret; |\n-|\t\t\t\t\t\t\t} |\n-|\t\t\t\t\t\t} |\n-|\t\t\t\t\t\t// if we have all pieces belonging to this extent, remove it |\n-|\t\t\t\t\t\tif (have_all) to_erase = idx; |\n-|\t\t\t\t\t} |\n-|_\b\t_\b\t_\b\t_\b\t_\b\t_\bi_\bf_\b _\b(_\bt_\bo_\b__\be_\br_\ba_\bs_\be_\b _\b!_\b=_\b _\b-_\b1_\b)_\b _\bm_\b__\br_\be_\bc_\be_\bn_\bt_\b__\be_\bx_\bt_\be_\bn_\bt_\bs_\b._\be_\br_\ba_\bs_\be_\b(_\bm_\b__\br_\be_\bc_\be_\bn_\bt_\b__\be_\bx_\bt_\be_\bn_\bt_\bs_\b._\bb_\be_\bg_\bi_\bn_\b(_\b)_\b _\b+_\b _\bt_\bo_\b__\be_\br_\ba_\bs_\be_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bp_\bi_\be_\bc_\be_\b__\bp_\bi_\bc_\bk_\be_\br_\b._\bc_\bp_\bp_\b:_\b2_\b5_\b6_\b6_\b _\b _\b|_\bw_\bh_\be_\bn_\b _\be_\bx_\bp_\ba_\bn_\bd_\bi_\bn_\bg_\b _\bp_\bi_\be_\bc_\be_\bs_\b _\bf_\bo_\br_\b _\bc_\ba_\bc_\bh_\be_\b _\bs_\bt_\br_\bi_\bp_\be_\b _\br_\be_\ba_\bs_\bo_\bn_\bs_\b,_\b _\bt_\bh_\be_\b _\b!_\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\bi_\bn_\bg_\b _\bc_\bo_\bn_\bd_\bi_\bt_\bi_\bo_\bn_\b _\bd_\bo_\be_\bs_\bn_\b'_\bt_\b _\bm_\ba_\bk_\be_\b _\bm_\bu_\bc_\bh_\b _\bs_\be_\bn_\bs_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* w\bwh\bhe\ben\bn e\bex\bxp\bpa\ban\bnd\bdi\bin\bng\bg p\bpi\bie\bec\bce\bes\bs f\bfo\bor\br c\bca\bac\bch\bhe\be s\bst\btr\bri\bip\bpe\be r\bre\bea\bas\bso\bon\bns\bs,\b, t\bth\bhe\be !\b!d\bdo\bow\bwn\bnl\blo\boa\bad\bdi\bin\bng\bg c\bco\bon\bnd\bdi\bit\bti\bio\bon\bn d\bdo\boe\bes\bsn\bn'\b't\bt m\bma\bak\bke\be m\bmu\buc\bch\bh s\bse\ben\bns\bse\be *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/p\bpi\bie\bec\bce\be_\b_p\bpi\bic\bck\bke\ber\br.\b.c\bcp\bpp\bp:\b:2\b25\b56\b66\b6 *\b**\b**\b* |\n-|TORRENT_ASSERT(index < m_piece_map.end_index()); |\n-|\t\tif (next(index) == m_piece_map.end_index()) |\n-|\t\t\treturn m_blocks_in_last_piece; |\n-|\t\telse |\n-|\t\t\treturn blocks_per_piece(); |\n-|\t} |\n+|#include \"libtorrent/random.hpp\" |\n+|#include \"libtorrent/aux_/alloca.hpp\" |\n+|#include \"libtorrent/pe_crypto.hpp\" |\n+|#include \"libtorrent/hasher.hpp\" |\n | |\n-|\tbool piece_picker::is_piece_free(piece_index_t const piece |\n-|\t\t, typed_bitfield const& bitmask) const |\n-|\t{ |\n-|\t\treturn bitmask[piece] |\n-|\t\t\t&& !m_piece_map[piece].have() |\n-|\t\t\t&& !m_piece_map[piece].filtered(); |\n-|\t} |\n+|namespace libtorrent { |\n | |\n-|\tbool piece_picker::can_pick(piece_index_t const piece |\n-|\t\t, typed_bitfield const& bitmask) const |\n-|\t{ |\n-|\t\treturn bitmask[piece] |\n-|\t\t\t&& !m_piece_map[piece].have() |\n-|&& !m_piece_map[piece].downloading() |\n-|&& !m_piece_map[piece].filtered(); |\n-|\t} |\n+|\tnamespace mp = boost::multiprecision; |\n | |\n-|#if TORRENT_USE_INVARIANT_CHECKS |\n-|\tvoid piece_picker::check_peers() |\n-|\t{ |\n-|\t\tfor (auto const& b : m_block_info) |\n-|\t\t{ |\n-|\t\t\tTORRENT_ASSERT(b.peer == nullptr || static_cast(b.peer)->in_use); |\n-|\t\t} |\n+|\tnamespace { |\n+|key_t const dh_prime |\n+|(\"0xFFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A63|36210000000000090563\");\n |\t} |\n-|#endif |\n | |\n-|\tvoid piece_picker::clear_peer(torrent_peer* peer) |\n+|\tstd::array export_key(key_t const& k) |\n |\t{ |\n-|\t\tfor (auto& b : m_block_info) |\n-|\t\t{ |\n-|\t\t\tif (b.peer == peer) b.peer = nullptr; |\n-|\t\t} |\n-|\t} |\n-| |\n-|\t// the first bool is true if this is the only peer that has requested and downloaded |\n-|\t// blocks from this piece. |\n-|\t// the second bool is true if this is the only active peer that is requesting |\n-|_\b\t_\b/_\b/_\b _\ba_\bn_\bd_\b _\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\bi_\bn_\bg_\b _\bb_\bl_\bo_\bc_\bk_\bs_\b _\bf_\br_\bo_\bm_\b _\bt_\bh_\bi_\bs_\b _\bp_\bi_\be_\bc_\be_\b._\b _\bA_\bc_\bt_\bi_\bv_\be_\b _\bm_\be_\ba_\bn_\bs_\b _\bh_\ba_\bv_\bi_\bn_\bg_\b _\ba_\b _\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bp_\bi_\be_\bc_\be_\b__\bp_\bi_\bc_\bk_\be_\br_\b._\bc_\bp_\bp_\b:_\b3_\b1_\b4_\b4_\b _\b _\b|_\bs_\bh_\bo_\bu_\bl_\bd_\b _\b5_\b _\bb_\be_\b _\bc_\bo_\bn_\bf_\bi_\bg_\bu_\br_\ba_\bb_\bl_\be_\b?_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* s\bsh\bho\bou\bul\bld\bd 5\b5 b\bbe\be c\bco\bon\bnf\bfi\big\bgu\bur\bra\bab\bbl\ble\be?\b? *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/p\bpi\bie\bec\bce\be_\b_p\bpi\bic\bck\bke\ber\br.\b.c\bcp\bpp\bp:\b:3\b31\b14\b44\b4 *\b**\b**\b* |\n-|bool have_all = true; |\n-| |\n-|\t\tfor (auto const piece : extent_for(this_extent)) |\n-|\t\t{ |\n-|\t\t\tif (piece == p) continue; |\n-| |\n-|\t\t\tif (!m_piece_map[piece].have()) have_all = false; |\n-| |\n-|\t\t\t// if at least one piece in this extent has a different priority than |\n-|\t\t\t// the one we just started downloading, don't create an affinity for |\n-|\t\t\t// adjacent pieces. This probably means the pieces belong to different |\n-|\t\t\t// files, or that some other mechanism determining the priority should |\n-|\t\t\t// take precedence. |\n-|\t\t\tif (piece_priority(piece) != this_prio) return; |\n-|\t\t} |\n+|\t\tstd::array ret; |\n+|\t\tauto* begin = reinterpret_cast(ret.data()); |\n+|_\b\t_\b\t_\bs_\bt_\bd_\b:_\b:_\bu_\bi_\bn_\bt_\b8_\b__\bt_\b*_\b _\be_\bn_\bd_\b _\b=_\b _\bm_\bp_\b:_\b:_\be_\bx_\bp_\bo_\br_\bt_\b__\bb_\bi_\bt_\bs_\b(_\bk_\b,_\b _\bb_\be_\bg_\bi_\bn_\b,_\b _\b8_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bp_\be_\b__\bc_\br_\by_\bp_\bt_\bo_\b._\bc_\bp_\bp_\b:_\b7_\b1_\b _\b _\b _\b _\b _\b _\b _\b|_\bi_\bt_\b _\bw_\bo_\bu_\bl_\bd_\b _\bb_\be_\b _\bn_\bi_\bc_\be_\b _\bt_\bo_\b _\bb_\be_\b _\ba_\bb_\bl_\be_\b _\bt_\bo_\b _\be_\bx_\bp_\bo_\br_\bt_\b _\bt_\bo_\b _\ba_\b _\bf_\bi_\bx_\be_\bd_\b _\bw_\bi_\bd_\bt_\bh_\b _\bf_\bi_\be_\bl_\bd_\b,_\b _\bs_\bo_\b _\bw_\be_\b _\bw_\bo_\bu_\bl_\bd_\bn_\b'_\bt_\b _\bh_\ba_\bv_\be_\b _\bt_\bo_\b _\bs_\bh_\bi_\bf_\bt_\b _\bi_\bt_\b _\bl_\ba_\bt_\be_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* i\bit\bt w\bwo\bou\bul\bld\bd b\bbe\be n\bni\bic\bce\be t\bto\bo b\bbe\be a\bab\bbl\ble\be t\bto\bo e\bex\bxp\bpo\bor\brt\bt t\bto\bo a\ba f\bfi\bix\bxe\bed\bd w\bwi\bid\bdt\bth\bh f\bfi\bie\bel\bld\bd,\b, s\bso\bo w\bwe\be w\bwo\bou\bul\bld\bdn\bn'\b't\bt h\bha\bav\bve\be t\bto\bo s\bsh\bhi\bif\bft\bt i\bit\bt l\bla\bat\bte\ber\br *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/p\bpe\be_\b_c\bcr\bry\byp\bpt\bto\bo.\b.c\bcp\bpp\bp:\b:7\b71\b1 *\b**\b**\b* |\n+|#include \"libtorrent/random.hpp\" |\n+|#include \"libtorrent/aux_/alloca.hpp\" |\n+|#include \"libtorrent/pe_crypto.hpp\" |\n+|#include \"libtorrent/hasher.hpp\" |\n | |\n-|\t\t// if we already have all the *other* pieces in this extent, there's no |\n-|\t\t// need to inflate their priorities |\n-|\t\tif (have_all) return; |\n+|namespace libtorrent { |\n | |\n-|if (m_recent_extents.size() < 5) |\n-|m_recent_extents.push_back(this_extent); |\n+|\tnamespace mp = boost::multiprecision; |\n | |\n-|\t\t// limit the number of extent affinities active at any given time to limit |\n-|\t\t// the cost of checking them. Also, don't replace them, commit to |\n-|\t\t// finishing them before starting another extent. This is analogous to |\n-|\t\t// limiting the number of partial pieces. |\n+|\tnamespace { |\n+|\t\tkey_t const dh_prime |\n+|\t\t\t |\n+|(\"0xFFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A63|36210000000000090563\");\n |\t} |\n | |\n-|\t// options may be 0 or piece_picker::reverse |\n-|\t// returns false if the block could not be marked as downloading |\n-|\tbool piece_picker::mark_as_downloading(piece_block const block |\n-|\t\t, torrent_peer* peer, picker_options_t const options) |\n+|\tstd::array export_key(key_t const& k) |\n |\t{ |\n-|#ifdef TORRENT_PICKER_LOG |\n-|\t\tstd::cerr << \"[\" << this << \"] \" << \"mark_as_downloading( {\" |\n-|\t\t\t<< block.piece_index << \", \" << block.block_index << \"} )\" << std::endl; |\n-|#endif |\n-| |\n-|\t\tTORRENT_ASSERT(peer == nullptr || peer->in_use); |\n-|\t\tTORRENT_ASSERT(block.block_index != piece_block::invalid.block_index); |\n-|\t\tTORRENT_ASSERT(block.piece_index != piece_block::invalid.piece_index); |\n-|\t\tTORRENT_ASSERT(block.piece_index < m_piece_map.end_index()); |\n-|\t\tTORRENT_ASSERT(block.block_index < blocks_in_piece(block.piece_index)); |\n-|\t\tTORRENT_ASSERT(!m_piece_map[block.piece_index].have()); |\n-| |\n-|\t\tpiece_pos& p = m_piece_map[block.piece_index]; |\n-|\t\tif (p.download_queue() == piece_pos::piece_open) |\n-|\t\t{ |\n-|#ifdef TORRENT_EXPENSIVE_INVARIANT_CHECKS |\n-|_\b\t_\b\t_\b\t_\bI_\bN_\bV_\bA_\bR_\bI_\bA_\bN_\bT_\b__\bC_\bH_\bE_\bC_\bK_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bl_\bo_\ba_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bc_\bp_\bp_\b:_\b1_\b2_\b1_\b _\b _\b _\b|_\bm_\bo_\bv_\be_\b _\bt_\bh_\be_\b _\bl_\bo_\ba_\bd_\bi_\bn_\bg_\b _\bl_\bo_\bg_\bi_\bc_\b _\bf_\br_\bo_\bm_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b _\bc_\bo_\bn_\bs_\bt_\br_\bu_\bc_\bt_\bo_\br_\b _\bi_\bn_\bt_\bo_\b _\bh_\be_\br_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* m\bmo\bov\bve\be t\bth\bhe\be l\blo\boa\bad\bdi\bin\bng\bg l\blo\bog\bgi\bic\bc f\bfr\bro\bom\bm t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br i\bin\bnt\bto\bo h\bhe\ber\bre\be *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/l\blo\boa\bad\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt.\b.c\bcp\bpp\bp:\b:1\b12\b21\b1 *\b**\b**\b* |\n-|mask.resize(std::size_t(full_size), false); |\n-|\t\t\t\tfor (int i = merkle_first_leaf(piece_layer_size) |\n-|\t\t\t\t\t, end = i + num_pieces; i < end; ++i) |\n-|\t\t\t\t{ |\n-|\t\t\t\t\tmask[std::size_t(i)] = true; |\n-|\t\t\t\t} |\n-|\t\t\t} |\n-|\t\t\tti->free_piece_layers(); |\n-|\t\t} |\n-|\t\tatp.info_hashes = atp.ti->info_hashes(); |\n-|\t} |\n-|} |\n-| |\n-|\tadd_torrent_params load_torrent_file(std::string const& filename) |\n-|\t{ return load_torrent_file(filename, load_torrent_limits{}); } |\n-|\tadd_torrent_params load_torrent_buffer(span buffer) |\n-|\t{ return load_torrent_buffer(buffer, load_torrent_limits{}); } |\n-|\tadd_torrent_params load_torrent_parsed(bdecode_node const& torrent_file) |\n-|\t{ return load_torrent_parsed(torrent_file, load_torrent_limits{}); } |\n+|\t\tstd::array ret; |\n+|\t\tauto* begin = reinterpret_cast(ret.data()); |\n+|\t\tstd::uint8_t* end = mp::export_bits(k, begin, 8); |\n | |\n-|add_torrent_params load_torrent_file(std::string const& filename, load_torrent_limits const& cfg) |\n+|if (end < begin + 96) |\n |{ |\n-|\t\tadd_torrent_params ret; |\n-|\t\tret.ti = std::make_shared(filename, cfg); |\n-|\t\tupdate_atp(ret); |\n+|\t\t\tint const len = int(end - begin); |\n+|#if defined __GNUC__ && __GNUC__ == 12 |\n+|#pragma GCC diagnostic push |\n+|#pragma GCC diagnostic ignored \"-Wstringop-overflow\" |\n+|#endif |\n+|\t\t\tstd::memmove(begin + 96 - len, begin, aux::numeric_cast(len)); |\n+|#if defined __GNUC__ && __GNUC__ == 12 |\n+|#pragma GCC diagnostic pop |\n+|#endif |\n+|\t\t\tstd::memset(begin, 0, aux::numeric_cast(96 - len)); |\n+|\t\t} |\n |\t\treturn ret; |\n |\t} |\n | |\n-|\tadd_torrent_params load_torrent_buffer(span buffer, load_torrent_limits const& cfg) |\n-|\t{ |\n-|\t\tadd_torrent_params ret; |\n-|\t\tret.ti = std::make_shared(buffer, cfg, from_span); |\n-|\t\tupdate_atp(ret); |\n-|\t\treturn ret; |\n-|\t} |\n+|\tvoid rc4_init(const unsigned char* in, std::size_t len, rc4 *state); |\n+|\tstd::size_t rc4_encrypt(unsigned char *out, std::size_t outlen, rc4 *state); |\n | |\n-|\tadd_torrent_params load_torrent_parsed(bdecode_node const& torrent_file, load_torrent_limits const& cfg) |\n+|\t// Set the prime P and the generator, generate local public key |\n+|\tdh_key_exchange::dh_key_exchange() |\n |\t{ |\n-|\t\tadd_torrent_params ret; |\n-|\t\tret.ti = std::make_shared(torrent_file, cfg); |\n-|\t\tupdate_atp(ret); |\n-|\t\treturn ret; |\n-|\t} |\n+|\t\taux::array random_key; |\n+|\t\taux::random_bytes({reinterpret_cast(random_key.data()) |\n+|\t\t\t, static_cast(random_key.size())}); |\n | |\n-|_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|\t\t// create local key (random) |\n+|\t\tmp::import_bits(m_dh_local_secret, random_key.begin(), random_key.end()); |\n+| |\n+|\t\t// key = (2 ^ secret) % prime |\n+|_\b\t_\b\t_\bm_\b__\bd_\bh_\b__\bl_\bo_\bc_\ba_\bl_\b__\bk_\be_\by_\b _\b=_\b _\bm_\bp_\b:_\b:_\bp_\bo_\bw_\bm_\b(_\bk_\be_\by_\b__\bt_\b(_\b2_\b)_\b,_\b _\bm_\b__\bd_\bh_\b__\bl_\bo_\bc_\ba_\bl_\b__\bs_\be_\bc_\br_\be_\bt_\b,_\b _\bd_\bh_\b__\bp_\br_\bi_\bm_\be_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bk_\ba_\bd_\be_\bm_\bl_\bi_\ba_\b/_\bn_\bo_\bd_\be_\b._\bc_\bp_\bp_\b:_\b1_\b1_\b7_\b7_\b _\b|_\bk_\be_\be_\bp_\b _\bt_\bh_\be_\b _\br_\be_\bt_\bu_\br_\bn_\be_\bd_\b _\bv_\ba_\bl_\bu_\be_\b _\bt_\bo_\b _\bp_\ba_\bs_\bs_\b _\ba_\bs_\b _\ba_\b _\bl_\bi_\bm_\bi_\bt_\b _\bt_\bo_\b _\bw_\br_\bi_\bt_\be_\b__\bn_\bo_\bd_\be_\bs_\b__\be_\bn_\bt_\br_\bi_\be_\bs_\b _\bw_\bh_\be_\bn_\b _\bi_\bm_\bp_\bl_\be_\bm_\be_\bn_\bt_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |*\b**\b**\b**\b**\b* k\bke\bee\bep\bp t\bth\bhe\be r\bre\bet\btu\bur\brn\bne\bed\bd v\bva\bal\blu\bue\be t\bto\bo p\bpa\bas\bss\bs a\bas\bs a\ba l\bli\bim\bmi\bit\bt t\bto\bo w\bwr\bri\bit\bte\be_\b_n\bno\bod\bde\bes\bs_\b_e\ben\bnt\btr\bri\bie\bes\bs w\bwh\bhe\ben\bn i\bim\bmp\bpl\ble\bem\bme\ben\bnt\bte\bed\bd *\b**\b**\b**\b**\b* |\n |*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/k\bka\bad\bde\bem\bml\bli\bia\ba/\b/n\bno\bod\bde\be.\b.c\bcp\bpp\bp:\b:1\b11\b17\b77\b7 *\b**\b**\b* |\n |} |\n |\t} |\n |\telse if (query == \"sample_infohashes\") |\n |\t{ |\n@@ -10673,14 +10673,122 @@\n | |\n |\taddress_v4::bytes_type b4{}; |\n |\taddress_v6::bytes_type b6{}; |\n |\tif (ip_.is_v6()) |\n |\t{ |\n |\t\tb6 = ip_.to_v6().to_bytes(); |\n |_\b\t_\b\t_\bi_\bp_\b _\b=_\b _\bb_\b6_\b._\bd_\ba_\bt_\ba_\b(_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\bk_\ba_\bd_\be_\bm_\bl_\bi_\ba_\b/ |pick the closest node rather than the first |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bd_\bh_\bt_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\b._\bc_\bp_\bp_\b:_\b3_\b1_\b7_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* p\bpi\bic\bck\bk t\bth\bhe\be c\bcl\blo\bos\bse\bes\bst\bt n\bno\bod\bde\be r\bra\bat\bth\bhe\ber\br t\bth\bha\ban\bn t\bth\bhe\be f\bfi\bir\brs\bst\bt *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/k\bka\bad\bde\bem\bml\bli\bia\ba/\b/d\bdh\bht\bt_\b_t\btr\bra\bac\bck\bke\ber\br.\b.c\bcp\bpp\bp:\b:3\b31\b17\b7 *\b**\b**\b* |\n+|#ifndef TORRENT_DISABLE_LOGGING |\n+|\t\tm_log->log(dht_logger::tracker, \"*** new write key*** %d nodes\" |\n+|\t\t\t, int(m_nodes.size())); |\n+|#endif |\n+|\t} |\n+| |\n+|\tvoid dht_tracker::update_storage_node_ids() |\n+|\t{ |\n+|\t\tstd::vector ids; |\n+|\t\tfor (auto& n : m_nodes) |\n+|\t\t\tids.push_back(n.second.dht.nid()); |\n+|\t\tm_storage.update_node_ids(ids); |\n+|\t} |\n+| |\n+|\tnode* dht_tracker::get_node(node_id const& id, std::string const& family_name) |\n+|\t{ |\n+|\t\tTORRENT_UNUSED(id); |\n+|\t\tfor (auto& n : m_nodes) |\n+|\t\t{ |\n+|if (n.second.dht.protocol_family_name() == family_name) |\n+|return &n.second.dht; |\n+|\t\t} |\n+| |\n+|\t\treturn nullptr; |\n+|\t} |\n+| |\n+|\tvoid dht_tracker::get_peers(sha1_hash const& ih |\n+|\t\t, std::function const&)> f) |\n+|\t{ |\n+|\t\tfor (auto& n : m_nodes) |\n+|\t\t\tn.second.dht.get_peers(ih, f, {}, {}); |\n+|\t} |\n+| |\n+|\tvoid dht_tracker::announce(sha1_hash const& ih, int listen_port |\n+|\t\t, announce_flags_t const flags |\n+|\t\t, std::function const&)> f) |\n+|\t{ |\n+|\t\tfor (auto& n : m_nodes) |\n+|\t\t\tn.second.dht.announce(ih, listen_port, flags, f); |\n+|\t} |\n+| |\n+|\tvoid dht_tracker::sample_infohashes(udp::endpoint const& ep, sha1_hash const& target |\n+|\t\t, std::function |\n+|\t\t\t, std::vector>)> f) |\n+|\t{ |\n+|\t\tfor (auto& n : m_nodes) |\n+|\t\t{ |\n+|_\b\t_\b\t_\b\t_\bi_\bf_\b _\b(_\be_\bp_\b._\bp_\br_\bo_\bt_\bo_\bc_\bo_\bl_\b(_\b)_\b _\b!_\b=_\b _\b(_\bn_\b._\bf_\bi_\br_\bs_\bt_\b._\bg_\be_\bt_\b__\be_\bx_\bt_\be_\br_\bn_\ba_\bl_\b__\ba_\bd_\bd_\br_\be_\bs_\bs_\b(_\b)_\b._\bi_\bs_\b__\bv_\b4_\b(_\b)_\b _\b?_\b _\bu_\bd_\bp_\b:_\b:_\bv_\b4_\b(_\b)_\b _\b:_\b _\bu_\bd_\bp_\b:_\b:_\bv_\b6_\b(_\b)_\b)_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bk_\ba_\bd_\be_\bm_\bl_\bi_\ba_\b/_\bi_\bt_\be_\bm_\b._\bc_\bp_\bp_\b:_\b1_\b4_\b3_\b _\b _\b|_\bi_\bm_\bp_\bl_\be_\bm_\be_\bn_\bt_\b _\bc_\bt_\bo_\br_\b _\bf_\bo_\br_\b _\be_\bn_\bt_\br_\by_\b _\bf_\br_\bo_\bm_\b _\bb_\bd_\be_\bc_\bo_\bd_\be_\b__\bn_\bo_\bd_\be_\b?_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* i\bim\bmp\bpl\ble\bem\bme\ben\bnt\bt c\bct\bto\bor\br f\bfo\bor\br e\ben\bnt\btr\bry\by f\bfr\bro\bom\bm b\bbd\bde\bec\bco\bod\bde\be_\b_n\bno\bod\bde\be?\b? *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/k\bka\bad\bde\bem\bml\bli\bia\ba/\b/i\bit\bte\bem\bm.\b.c\bcp\bpp\bp:\b:1\b14\b43\b3 *\b**\b**\b* |\n+|, secret_key const& sk) |\n+|{ |\n+|\tchar str[1200]; |\n+|\tint const len = canonical_string(v, seq, salt, str); |\n+| |\n+|\treturn ed25519_sign({str, len}, pk, sk); |\n+|} |\n+| |\n+|item::item(public_key const& pk, span salt) |\n+|\t: m_salt(salt.data(), static_cast(salt.size())) |\n+|\t, m_pk(pk) |\n+|\t, m_mutable(true) |\n+|{} |\n+| |\n+|item::item(entry v) |\n+|\t: m_value(std::move(v)) |\n+|{} |\n+| |\n+|item::item(bdecode_node const& v) |\n+|{ |\n+|m_value = v; |\n+|} |\n+| |\n+|item::item(entry v, span salt |\n+|\t, sequence_number const seq, public_key const& pk, secret_key const& sk) |\n+|{ |\n+|\tassign(std::move(v), salt, seq, pk, sk); |\n+|} |\n+| |\n+|void item::assign(entry v) |\n+|{ |\n+|\tm_mutable = false; |\n+|\tm_value = std::move(v); |\n+|} |\n+| |\n+|void item::assign(entry v, span salt |\n+|\t, sequence_number const seq, public_key const& pk, secret_key const& sk) |\n+|{ |\n+|\tstd::array buffer; |\n+|\tint const bsize = bencode(buffer.begin(), v); |\n+|\tTORRENT_ASSERT(bsize <= 1000); |\n+|\tm_sig = sign_mutable_item(span(buffer).first(bsize) |\n+|\t\t, salt, seq, pk, sk); |\n+|\tm_salt.assign(salt.data(), static_cast(salt.size())); |\n+|\tm_pk = pk; |\n+|\tm_seq = seq; |\n+|\tm_mutable = true; |\n+|\tm_value = std::move(v); |\n+|} |\n+| |\n+|_\bv_\bo_\bi_\bd_\b _\bi_\bt_\be_\bm_\b:_\b:_\ba_\bs_\bs_\bi_\bg_\bn_\b(_\bb_\bd_\be_\bc_\bo_\bd_\be_\b__\bn_\bo_\bd_\be_\b _\bc_\bo_\bn_\bs_\bt_\b&_\b _\bv_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\bk_\ba_\bd_\be_\bm_\bl_\bi_\ba_\b/ |This is temporary. For now, only report the largest routing table (of potentially multiple ones, for multi-homed systems) in next |\n |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\br_\bo_\bu_\bt_\bi_\bn_\bg_\b__\bt_\ba_\bb_\bl_\be_\b._\bc_\bp_\bp_\b:_\b2_\b8_\b9_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bm_\ba_\bj_\bo_\br_\b _\bv_\be_\br_\bs_\bi_\bo_\bn_\b,_\b _\bb_\br_\be_\ba_\bk_\b _\bt_\bh_\be_\b _\bA_\bB_\bI_\b _\ba_\bn_\bd_\b _\bs_\bu_\bp_\bp_\bo_\br_\bt_\b _\br_\be_\bp_\bo_\br_\bt_\bi_\bn_\bg_\b _\ba_\bl_\bl_\b _\bo_\bf_\b _\bt_\bh_\be_\bm_\b _\bi_\bn_\b _\bt_\bh_\be_\b _\bd_\bh_\bt_\b__\bs_\bt_\ba_\bt_\bs_\b__\ba_\bl_\be_\br_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |*\b**\b**\b**\b**\b* T\bTh\bhi\bis\bs i\bis\bs t\bte\bem\bmp\bpo\bor\bra\bar\bry\by.\b. F\bFo\bor\br n\bno\bow\bw,\b, o\bon\bnl\bly\by r\bre\bep\bpo\bor\brt\bt t\bth\bhe\be l\bla\bar\brg\bge\bes\bst\bt r\bro\bou\but\bti\bin\bng\bg t\bta\bab\bbl\ble\be (\b(o\bof\bf p\bpo\bot\bte\ben\bnt\bti\bia\bal\bll\bly\by m\bmu\bul\blt\bti\bip\bpl\ble\be o\bon\bne\bes\bs,\b, f\bfo\bor\br m\bmu\bul\blt\bti\bi-\b-h\bho\bom\bme\bed\bd s\bsy\bys\bst\bte\bem\bms\bs)\b) i\bin\bn n\bne\bex\bxt\bt m\bma\baj\bjo\bor\br v\bve\ber\brs\bsi\bio\bon\bn,\b, b\bbr\bre\bea\bak\bk t\bth\bhe\be A\bAB\bBI\bI a\ban\bnd\bd |\n |s\bsu\bup\bpp\bpo\bor\brt\bt r\bre\bep\bpo\bor\brt\bti\bin\bng\bg a\bal\bll\bl o\bof\bf t\bth\bhe\bem\bm i\bin\bn t\bth\bhe\be d\bdh\bht\bt_\b_s\bst\bta\bat\bts\bs_\b_a\bal\ble\ber\brt\bt *\b**\b**\b**\b**\b* |\n |*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/k\bka\bad\bde\bem\bml\bli\bia\ba/\b/r\bro\bou\but\bti\bin\bng\bg_\b_t\bta\bab\bbl\ble\be.\b.c\bcp\bpp\bp:\b:2\b28\b89\b9 *\b**\b**\b* |\n |, m_bucket_size(bucket_size) |\n |{ |\n@@ -10820,122 +10928,14 @@\n |\t\t&& m_buckets.back().replacements.empty()) |\n |\t{ |\n |\t\tm_buckets.erase(m_buckets.end() - 1); |\n |\t} |\n |} |\n | |\n |_\bv_\bo_\bi_\bd_\b _\br_\bo_\bu_\bt_\bi_\bn_\bg_\b__\bt_\ba_\bb_\bl_\be_\b:_\b:_\br_\be_\bm_\bo_\bv_\be_\b__\bn_\bo_\bd_\be_\b(_\bn_\bo_\bd_\be_\b__\be_\bn_\bt_\br_\by_\b*_\b _\bn_\b,_\b _\bb_\bu_\bc_\bk_\be_\bt_\b__\bt_\b*_\b _\bb_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bl_\be_\bv_\ba_\bn_\bc_\be_\b\u00a0_\b0_\b|_\b._\b._\b/_\bs_\br_\bc_\b/_\bk_\ba_\bd_\be_\bm_\bl_\bi_\ba_\b/_\bi_\bt_\be_\bm_\b._\bc_\bp_\bp_\b:_\b1_\b4_\b3_\b _\b _\b|_\bi_\bm_\bp_\bl_\be_\bm_\be_\bn_\bt_\b _\bc_\bt_\bo_\br_\b _\bf_\bo_\br_\b _\be_\bn_\bt_\br_\by_\b _\bf_\br_\bo_\bm_\b _\bb_\bd_\be_\bc_\bo_\bd_\be_\b__\bn_\bo_\bd_\be_\b?_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* i\bim\bmp\bpl\ble\bem\bme\ben\bnt\bt c\bct\bto\bor\br f\bfo\bor\br e\ben\bnt\btr\bry\by f\bfr\bro\bom\bm b\bbd\bde\bec\bco\bod\bde\be_\b_n\bno\bod\bde\be?\b? *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/k\bka\bad\bde\bem\bml\bli\bia\ba/\b/i\bit\bte\bem\bm.\b.c\bcp\bpp\bp:\b:1\b14\b43\b3 *\b**\b**\b* |\n-|, secret_key const& sk) |\n-|{ |\n-|\tchar str[1200]; |\n-|\tint const len = canonical_string(v, seq, salt, str); |\n-| |\n-|\treturn ed25519_sign({str, len}, pk, sk); |\n-|} |\n-| |\n-|item::item(public_key const& pk, span salt) |\n-|\t: m_salt(salt.data(), static_cast(salt.size())) |\n-|\t, m_pk(pk) |\n-|\t, m_mutable(true) |\n-|{} |\n-| |\n-|item::item(entry v) |\n-|\t: m_value(std::move(v)) |\n-|{} |\n-| |\n-|item::item(bdecode_node const& v) |\n-|{ |\n-|m_value = v; |\n-|} |\n-| |\n-|item::item(entry v, span salt |\n-|\t, sequence_number const seq, public_key const& pk, secret_key const& sk) |\n-|{ |\n-|\tassign(std::move(v), salt, seq, pk, sk); |\n-|} |\n-| |\n-|void item::assign(entry v) |\n-|{ |\n-|\tm_mutable = false; |\n-|\tm_value = std::move(v); |\n-|} |\n-| |\n-|void item::assign(entry v, span salt |\n-|\t, sequence_number const seq, public_key const& pk, secret_key const& sk) |\n-|{ |\n-|\tstd::array buffer; |\n-|\tint const bsize = bencode(buffer.begin(), v); |\n-|\tTORRENT_ASSERT(bsize <= 1000); |\n-|\tm_sig = sign_mutable_item(span(buffer).first(bsize) |\n-|\t\t, salt, seq, pk, sk); |\n-|\tm_salt.assign(salt.data(), static_cast(salt.size())); |\n-|\tm_pk = pk; |\n-|\tm_seq = seq; |\n-|\tm_mutable = true; |\n-|\tm_value = std::move(v); |\n-|} |\n-| |\n-|_\bv_\bo_\bi_\bd_\b _\bi_\bt_\be_\bm_\b:_\b:_\ba_\bs_\bs_\bi_\bg_\bn_\b(_\bb_\bd_\be_\bc_\bo_\bd_\be_\b__\bn_\bo_\bd_\be_\b _\bc_\bo_\bn_\bs_\bt_\b&_\b _\bv_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\bk_\ba_\bd_\be_\bm_\bl_\bi_\ba_\b/ |pick the closest node rather than the first |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bd_\bh_\bt_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\b._\bc_\bp_\bp_\b:_\b3_\b1_\b7_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* p\bpi\bic\bck\bk t\bth\bhe\be c\bcl\blo\bos\bse\bes\bst\bt n\bno\bod\bde\be r\bra\bat\bth\bhe\ber\br t\bth\bha\ban\bn t\bth\bhe\be f\bfi\bir\brs\bst\bt *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/k\bka\bad\bde\bem\bml\bli\bia\ba/\b/d\bdh\bht\bt_\b_t\btr\bra\bac\bck\bke\ber\br.\b.c\bcp\bpp\bp:\b:3\b31\b17\b7 *\b**\b**\b* |\n-|#ifndef TORRENT_DISABLE_LOGGING |\n-|\t\tm_log->log(dht_logger::tracker, \"*** new write key*** %d nodes\" |\n-|\t\t\t, int(m_nodes.size())); |\n-|#endif |\n-|\t} |\n-| |\n-|\tvoid dht_tracker::update_storage_node_ids() |\n-|\t{ |\n-|\t\tstd::vector ids; |\n-|\t\tfor (auto& n : m_nodes) |\n-|\t\t\tids.push_back(n.second.dht.nid()); |\n-|\t\tm_storage.update_node_ids(ids); |\n-|\t} |\n-| |\n-|\tnode* dht_tracker::get_node(node_id const& id, std::string const& family_name) |\n-|\t{ |\n-|\t\tTORRENT_UNUSED(id); |\n-|\t\tfor (auto& n : m_nodes) |\n-|\t\t{ |\n-|if (n.second.dht.protocol_family_name() == family_name) |\n-|return &n.second.dht; |\n-|\t\t} |\n-| |\n-|\t\treturn nullptr; |\n-|\t} |\n-| |\n-|\tvoid dht_tracker::get_peers(sha1_hash const& ih |\n-|\t\t, std::function const&)> f) |\n-|\t{ |\n-|\t\tfor (auto& n : m_nodes) |\n-|\t\t\tn.second.dht.get_peers(ih, f, {}, {}); |\n-|\t} |\n-| |\n-|\tvoid dht_tracker::announce(sha1_hash const& ih, int listen_port |\n-|\t\t, announce_flags_t const flags |\n-|\t\t, std::function const&)> f) |\n-|\t{ |\n-|\t\tfor (auto& n : m_nodes) |\n-|\t\t\tn.second.dht.announce(ih, listen_port, flags, f); |\n-|\t} |\n-| |\n-|\tvoid dht_tracker::sample_infohashes(udp::endpoint const& ep, sha1_hash const& target |\n-|\t\t, std::function |\n-|\t\t\t, std::vector>)> f) |\n-|\t{ |\n-|\t\tfor (auto& n : m_nodes) |\n-|\t\t{ |\n-|_\b\t_\b\t_\b\t_\bi_\bf_\b _\b(_\be_\bp_\b._\bp_\br_\bo_\bt_\bo_\bc_\bo_\bl_\b(_\b)_\b _\b!_\b=_\b _\b(_\bn_\b._\bf_\bi_\br_\bs_\bt_\b._\bg_\be_\bt_\b__\be_\bx_\bt_\be_\br_\bn_\ba_\bl_\b__\ba_\bd_\bd_\br_\be_\bs_\bs_\b(_\b)_\b._\bi_\bs_\b__\bv_\b4_\b(_\b)_\b _\b?_\b _\bu_\bd_\bp_\b:_\b:_\bv_\b4_\b(_\b)_\b _\b:_\b _\bu_\bd_\bp_\b:_\b:_\bv_\b6_\b(_\b)_\b)_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\bk_\ba_\bd_\be_\bm_\bl_\bi_\ba_\b/_\bp_\bu_\bt_\b__\bd_\ba_\bt_\ba_\b._\bc_\bp_\bp_\b: |what if o is not an instance of put_data_observer? This need to be redesigned for better type safety. |\n |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b9_\b2_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |*\b**\b**\b**\b**\b* w\bwh\bha\bat\bt i\bif\bf o\bo i\bis\bs n\bno\bot\bt a\ban\bn i\bin\bns\bst\bta\ban\bnc\bce\be o\bof\bf p\bpu\but\bt_\b_d\bda\bat\bta\ba_\b_o\bob\bbs\bse\ber\brv\bve\ber\br?\b? T\bTh\bhi\bis\bs n\bne\bee\bed\bd t\bto\bo b\bbe\be r\bre\bed\bde\bes\bsi\big\bgn\bne\bed\bd f\bfo\bor\br b\bbe\bet\btt\bte\ber\br t\bty\byp\bpe\be s\bsa\baf\bfe\bet\bty\by.\b. *\b**\b**\b**\b**\b* |\n |*\b**\b**\b* .\b..\b./\b/s\bsr\brc\bc/\b/k\bka\bad\bde\bem\bml\bli\bia\ba/\b/p\bpu\but\bt_\b_d\bda\bat\bta\ba.\b.c\bcp\bpp\bp:\b:9\b92\b2 *\b**\b**\b* |\n |} |\n |} |\n | |\n@@ -10977,108 +10977,205 @@\n | |\n |\tm_node.stats_counters().inc_stats_counter(counters::dht_put_out); |\n | |\n |\treturn m_node.m_rpc.invoke(e, o->target_ep(), o); |\n |} |\n | |\n |_\b}_\b _\b}_\b _\b/_\b/_\b _\bn_\ba_\bm_\be_\bs_\bp_\ba_\bc_\be_\b _\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b:_\b:_\bd_\bh_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |some space could be saved here by making gauges 32 bits |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bp_\be_\br_\bf_\bo_\br_\bm_\ba_\bn_\bc_\be_\b__\bc_\bo_\bu_\bn_\bt_\be_\br_\bs_\b._\bh_\bp_\bp_\b:_\b4_\b8_\b5_\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* s\bso\bom\bme\be s\bsp\bpa\bac\bce\be c\bco\bou\bul\bld\bd b\bbe\be s\bsa\bav\bve\bed\bd h\bhe\ber\bre\be b\bby\by m\bma\bak\bki\bin\bng\bg g\bga\bau\bug\bge\bes\bs 3\b32\b2 b\bbi\bit\bts\bs *\b**\b**\b**\b**\b* |\n-|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bi\bi_\bn\bn_\bc\bc_\bl\bl_\bu\bu_\bd\bd_\be\be_\b/\b/_\bl\bl_\bi\bi_\bb\bb_\bt\bt_\bo\bo_\br\br_\br\br_\be\be_\bn\bn_\bt\bt_\b/\b/_\bp\bp_\be\be_\br\br_\bf\bf_\bo\bo_\br\br_\bm\bm_\ba\ba_\bn\bn_\bc\bc_\be\be_\b_\b__\bc\bc_\bo\bo_\bu\bu_\bn\bn_\bt\bt_\be\be_\br\br_\bs\bs_\b.\b._\bh\bh_\bp\bp_\bp\bp_\b:\b:_\b4\b4_\b8\b8_\b5\b5_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |restore these to regular integers. Instead have one copy of the counters per thread and collect them at convenient synchronization |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bp_\be_\br_\bf_\bo_\br_\bm_\ba_\bn_\bc_\be_\b__\bc_\bo_\bu_\bn_\bt_\be_\br_\bs_\b._\bh_\bp_\bp_\b:_\b4_\b8_\b6_\b _\b _\b|_\bp_\bo_\bi_\bn_\bt_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* r\bre\bes\bst\bto\bor\bre\be t\bth\bhe\bes\bse\be t\bto\bo r\bre\beg\bgu\bul\bla\bar\br i\bin\bnt\bte\beg\bge\ber\brs\bs.\b. I\bIn\bns\bst\bte\bea\bad\bd h\bha\bav\bve\be o\bon\bne\be c\bco\bop\bpy\by o\bof\bf t\bth\bhe\be c\bco\bou\bun\bnt\bte\ber\brs\bs p\bpe\ber\br t\bth\bhr\bre\bea\bad\bd a\ban\bnd\bd c\bco\bol\bll\ble\bec\bct\bt t\bth\bhe\bem\bm a\bat\bt c\bco\bon\bnv\bve\ben\bni\bie\ben\bnt\bt s\bsy\byn\bnc\bch\bhr\bro\bon\bni\biz\bza\bat\bti\bio\bon\bn p\bpo\boi\bin\bnt\bts\bs *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/p\bpe\ber\brf\bfo\bor\brm\bma\ban\bnc\bce\be_\b_c\bco\bou\bun\bnt\bte\ber\brs\bs.\b.h\bhp\bpp\bp:\b:4\b48\b86\b6 *\b**\b**\b* |\n-|#ifdef ATOMIC_LLONG_LOCK_FREE |\n-|#define TORRENT_COUNTER_NOEXCEPT noexcept |\n-|#else |\n-|#define TORRENT_COUNTER_NOEXCEPT |\n-|#endif |\n+|relevance\u00a00|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |it would be nice to remember the bind port and bind once we know where the proxy is m_sock.bind(endpoint, ec); |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bp_\br_\bo_\bx_\by_\b__\bb_\ba_\bs_\be_\b._\bh_\bp_\bp_\b:_\b2_\b2_\b7_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* i\bit\bt w\bwo\bou\bul\bld\bd b\bbe\be n\bni\bic\bce\be t\bto\bo r\bre\bem\bme\bem\bmb\bbe\ber\br t\bth\bhe\be b\bbi\bin\bnd\bd p\bpo\bor\brt\bt a\ban\bnd\bd b\bbi\bin\bnd\bd o\bon\bnc\bce\be w\bwe\be k\bkn\bno\bow\bw w\bwh\bhe\ber\bre\be t\bth\bhe\be p\bpr\bro\box\bxy\by i\bis\bs m\bm_\b_s\bso\boc\bck\bk.\b.b\bbi\bin\bnd\bd(\b(e\ben\bnd\bdp\bpo\boi\bin\bnt\bt,\b, e\bec\bc)\b);\b; *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/p\bpr\bro\box\bxy\by_\b_b\bba\bas\bse\be.\b.h\bhp\bpp\bp:\b:2\b22\b27\b7 *\b**\b**\b* |\n+|TORRENT_ASSERT(m_magic == 0x1337); |\n+|\t\tm_sock.cancel(); |\n+|\t} |\n | |\n-|\t\tcounters() TORRENT_COUNTER_NOEXCEPT; |\n+|\tvoid cancel(error_code& ec) |\n+|\t{ |\n+|\t\tTORRENT_ASSERT(m_magic == 0x1337); |\n+|\t\tm_sock.cancel(ec); |\n+|\t} |\n | |\n-|\t\tcounters(counters const&) TORRENT_COUNTER_NOEXCEPT; |\n-|\t\tcounters& operator=(counters const&) & TORRENT_COUNTER_NOEXCEPT; |\n+|\tvoid bind(endpoint_type const& /* endpoint */, error_code& /* ec */) |\n+|\t{ |\n+|\t\tTORRENT_ASSERT(m_magic == 0x1337); |\n+|\t\t// the reason why we ignore binds here is because we don't |\n+|\t\t// (necessarily) yet know what address family the proxy |\n+|\t\t// will resolve to, and binding to the wrong one would |\n+|\t\t// break our connection attempt later. The caller here |\n+|\t\t// doesn't necessarily know that we're proxying, so this |\n+|\t\t// bind address is based on the final endpoint, not the |\n+|\t\t// proxy. |\n+|} |\n | |\n-|\t\t// returns the new value |\n-|\t\tstd::int64_t inc_stats_counter(int c, std::int64_t value = 1) TORRENT_COUNTER_NOEXCEPT; |\n-|\t\tstd::int64_t operator[](int i) const TORRENT_COUNTER_NOEXCEPT; |\n+|#ifndef BOOST_NO_EXCEPTIONS |\n+|\tvoid open(protocol_type const&) |\n+|\t{ |\n+|\t\tTORRENT_ASSERT(m_magic == 0x1337); |\n+|//\t\tm_sock.open(p); |\n+|\t} |\n+|#endif |\n | |\n-|\t\tvoid set_value(int c, std::int64_t value) TORRENT_COUNTER_NOEXCEPT; |\n-|\t\tvoid blend_stats_counter(int c, std::int64_t value, int ratio) TORRENT_COUNTER_NOEXCEPT; |\n+|\tvoid open(protocol_type const&, error_code&) |\n+|\t{ |\n+|\t\tTORRENT_ASSERT(m_magic == 0x1337); |\n+|\t\t// we need to ignore this for the same reason as stated |\n+|\t\t// for ignoring bind() |\n+|//\t\tm_sock.open(p, ec); |\n+|\t} |\n+| |\n+|#ifndef BOOST_NO_EXCEPTIONS |\n+|\tvoid close() |\n+|\t{ |\n+|\t\tTORRENT_ASSERT(m_magic == 0x1337); |\n+|\t\tm_remote_endpoint = endpoint_type(); |\n+|\t\tm_sock.close(); |\n+|\t\tm_resolver.cancel(); |\n+|\t} |\n+|#endif |\n+| |\n+|\tvoid close(error_code& ec) |\n+|\t{ |\n+|_\b\t_\b\t_\bT_\bO_\bR_\bR_\bE_\bN_\bT_\b__\bA_\bS_\bS_\bE_\bR_\bT_\b(_\bm_\b__\bm_\ba_\bg_\bi_\bc_\b _\b=_\b=_\b _\b0_\bx_\b1_\b3_\b3_\b7_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |should this be allocated lazily? |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bp_\bi_\be_\bc_\be_\b__\bp_\bi_\bc_\bk_\be_\br_\b._\bh_\bp_\bp_\b:_\b8_\b2_\b3_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* s\bsh\bho\bou\bul\bld\bd t\bth\bhi\bis\bs b\bbe\be a\bal\bll\blo\boc\bca\bat\bte\bed\bd l\bla\baz\bzi\bil\bly\by?\b? *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/p\bpi\bie\bec\bce\be_\b_p\bpi\bic\bck\bke\ber\br.\b.h\bhp\bpp\bp:\b:8\b82\b23\b3 *\b**\b**\b* |\n+|// download list it may live in now |\n+|\t\tstd::vector::iterator update_piece_state( |\n+|\t\t\tstd::vector::iterator dp); |\n | |\n |\tprivate: |\n | |\n-|#ifdef ATOMIC_LLONG_LOCK_FREE |\n-|aux::array, num_counters> m_stats_counter; |\n-|#else |\n-|\t\t// if the atomic type isn't lock-free, use a single lock instead, for |\n-|\t\t// the whole array |\n-|\t\tmutable std::mutex m_mutex; |\n-|\t\taux::array m_stats_counter; |\n+|#if TORRENT_USE_ASSERTS || TORRENT_USE_INVARIANT_CHECKS |\n+|\t\tindex_range categories() const |\n+|\t\t{ return {{}, piece_picker::piece_pos::num_download_categories}; } |\n |#endif |\n-|\t}; |\n-|} |\n | |\n-|_\b#_\be_\bn_\bd_\bi_\bf_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |include the number of peers received from this tracker, at last announce |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\be_\bn_\bt_\br_\by_\b._\bh_\bp_\bp_\b:_\b7_\b6_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* i\bin\bnc\bcl\blu\bud\bde\be t\bth\bhe\be n\bnu\bum\bmb\bbe\ber\br o\bof\bf p\bpe\bee\ber\brs\bs r\bre\bec\bce\bei\biv\bve\bed\bd f\bfr\bro\bom\bm t\bth\bhi\bis\bs t\btr\bra\bac\bck\bke\ber\br,\b, a\bat\bt l\bla\bas\bst\bt a\ban\bnn\bno\bou\bun\bnc\bce\be *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by.\b.h\bhp\bpp\bp:\b:7\b76\b6 *\b**\b**\b* |\n-|\tstruct TORRENT_EXPORT announce_infohash |\n-|\t{ |\n-|\t\t// internal |\n-|\t\tTORRENT_UNEXPORT announce_infohash(); |\n+|\t\t// the following vectors are mutable because they sometimes may |\n+|\t\t// be updated lazily, triggered by const functions |\n | |\n-|\t\t// if this tracker has returned an error or warning message |\n-|\t\t// that message is stored here |\n-|\t\tstd::string message; |\n+|\t\t// this maps indices to number of peers that has this piece and |\n+|\t\t// index into the m_piece_info vectors. |\n+|\t\t// piece_pos::we_have_index means that we have the piece, so it |\n+|\t\t// doesn't exist in the piece_info buckets |\n+|\t\t// pieces with the filtered flag set doesn't have entries in |\n+|\t\t// the m_piece_info buckets either |\n+|mutable aux::vector m_piece_map; |\n | |\n-|\t\t// if this tracker failed the last time it was contacted |\n-|\t\t// this error code specifies what error occurred |\n-|\t\terror_code last_error; |\n+|\t\t// tracks the number of bytes in a specific piece that are part of a pad |\n+|\t\t// file. The padding is assumed to be at the end of the piece, and the |\n+|\t\t// blocks covered by the pad bytes are not picked by the piece picker |\n+|\t\tstd::unordered_map m_pads_in_piece; |\n | |\n-|\t\t// the time of next tracker announce |\n-|\t\ttime_point32 next_announce = (time_point32::min)(); |\n+|\t\t// when the adjacent_piece affinity is enabled, this contains the most |\n+|\t\t// recent \"extents\" of adjacent pieces that have been requested from |\n+|\t\t// this is mutable because it's updated by functions to pick pieces, which |\n+|\t\t// are const. That's an efficient place to update it, since it's being |\n+|\t\t// traversed already. |\n+|\t\tmutable std::vector m_recent_extents; |\n | |\n-|\t\t// no announces before this time |\n-|\t\ttime_point32 min_announce = (time_point32::min)(); |\n+|\t\t// the number of bytes of pad file set in this piece picker |\n+|\t\tstd::int64_t m_num_pad_bytes = 0; |\n | |\n+|\t\t// the number of pad blocks that we already have |\n+|\t\tstd::int64_t m_have_pad_bytes = 0; |\n | |\n-|// these are either -1 or the scrape information this tracker last |\n-|\t\t// responded with. *incomplete* is the current number of downloaders in |\n-|\t\t// the swarm, *complete* is the current number of seeds in the swarm and |\n-|\t\t// *downloaded* is the cumulative number of completed downloads of this |\n-|\t\t// torrent, since the beginning of time (from this tracker's point of |\n-|\t\t// view). |\n+|\t\t// the number of pad blocks part of filtered pieces we don't have |\n+|\t\tstd::int64_t m_filtered_pad_bytes = 0; |\n | |\n-|\t\t// if this tracker has returned scrape data, these fields are filled in |\n-|\t\t// with valid numbers. Otherwise they are set to -1. ``incomplete`` counts |\n-|\t\t// the number of current downloaders. ``complete`` counts the number of |\n-|\t\t// current peers completed the download, or \"seeds\". ``downloaded`` is the |\n-|\t\t// cumulative number of completed downloads. |\n-|\t\tint scrape_incomplete = -1; |\n-|\t\tint scrape_complete = -1; |\n-|\t\tint scrape_downloaded = -1; |\n+|\t\t// the number of pad blocks we have that are also filtered |\n+|\t\tstd::int64_t m_have_filtered_pad_bytes = 0; |\n | |\n-|\t\t// the number of times in a row we have failed to announce to this |\n-|\t\t// tracker. |\n-|\t\tstd::uint8_t fails : 7; |\n+|\t\t// the number of seeds. These are not added to |\n+|\t\t// the availability counters of the pieces |\n+|\t\tint m_seeds = 0; |\n | |\n-|\t\t// true while we're waiting for a response from the tracker. |\n-|\t\tbool updating : 1; |\n+|_\b\t_\b\t_\b/_\b/_\b _\bt_\bh_\bi_\bs_\b _\bv_\be_\bc_\bt_\bo_\br_\b _\bc_\bo_\bn_\bt_\ba_\bi_\bn_\bs_\b _\ba_\bl_\bl_\b _\bp_\bi_\be_\bc_\be_\b _\bi_\bn_\bd_\bi_\bc_\be_\bs_\b _\bt_\bh_\ba_\bt_\b _\ba_\br_\be_\b _\bp_\bi_\bc_\bk_\ba_\bb_\bl_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |it would be more intuitive to account \"wanted\" pieces instead of filtered |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bp_\bi_\be_\bc_\be_\b__\bp_\bi_\bc_\bk_\be_\br_\b._\bh_\bp_\bp_\b:_\b8_\b9_\b5_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* i\bit\bt w\bwo\bou\bul\bld\bd b\bbe\be m\bmo\bor\bre\be i\bin\bnt\btu\bui\bit\bti\biv\bve\be t\bto\bo a\bac\bcc\bco\bou\bun\bnt\bt \"\b\"w\bwa\ban\bnt\bte\bed\bd\"\b\" p\bpi\bie\bec\bce\bes\bs i\bin\bns\bst\bte\bea\bad\bd o\bof\bf f\bfi\bil\blt\bte\ber\bre\bed\bd *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/p\bpi\bie\bec\bce\be_\b_p\bpi\bic\bck\bke\ber\br.\b.h\bhp\bpp\bp:\b:8\b89\b95\b5 *\b**\b**\b* |\n+|\t\t// this holds the information of the blocks in partially downloaded |\n+|\t\t// pieces. the downloading_piece::info index point into this vector for |\n+|\t\t// its storage |\n+|\t\taux::vector m_block_info; |\n | |\n-|\t\t// set to true when we get a valid response from an announce |\n-|\t\t// with event=started. If it is set, we won't send start in the subsequent |\n-|\t\t// announces. |\n-|\t\tbool start_sent : 1; |\n+|\t\t// these are block ranges in m_block_info that are free. The numbers |\n+|\t\t// in here, when multiplied by blocks_per_piece is the index to the |\n+|\t\t// first block in the range that's free to use by a new downloading_piece. |\n+|\t\t// this is a free-list. |\n+|\t\tstd::vector m_free_block_infos; |\n | |\n-|\t\t// set to true when we send a event=completed. |\n-|_\b\t_\b\t_\bb_\bo_\bo_\bl_\b _\bc_\bo_\bm_\bp_\bl_\be_\bt_\be_\b__\bs_\be_\bn_\bt_\b _\b:_\b _\b1_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|\t\tstd::uint16_t m_blocks_in_last_piece = 0; |\n+|\t\tint m_piece_size = 0; |\n+|\t\tstd::int64_t m_total_size = 0; |\n+| |\n+|\t\t// the number of filtered pieces that we don't already |\n+|\t\t// have. total_number_of_pieces - number_of_pieces_we_have |\n+|\t\t// - num_filtered is supposed to the number of pieces |\n+|\t\t// we still want to download |\n+|int m_num_filtered = 0; |\n+| |\n+|\t\t// the number of pieces we have that also are filtered |\n+|\t\tint m_num_have_filtered = 0; |\n+| |\n+|\t\t// we have all pieces in the range [0, m_cursor) |\n+|\t\t// m_cursor is the first piece we don't have |\n+|\t\tpiece_index_t m_cursor{0}; |\n+| |\n+|\t\t// we have all pieces in the range [m_reverse_cursor, end) |\n+|\t\t// m_reverse_cursor is the first piece where we also have |\n+|\t\t// all the subsequent pieces |\n+|\t\tpiece_index_t m_reverse_cursor{0}; |\n+| |\n+|\t\t// the number of pieces we have (i.e. passed hash check). |\n+|\t\t// This includes pieces that we have filtered but still have |\n+|\t\tint m_num_have = 0; |\n+| |\n+|\t\t// if this is set to true, it means update_pieces() |\n+|\t\t// has to be called before accessing m_pieces. |\n+|\t\tmutable bool m_dirty = false; |\n+|\tpublic: |\n+| |\n+|\t\tenum { max_pieces = (std::numeric_limits::max)() - 1 }; |\n+| |\n+|\t}; |\n+|} |\n+| |\n+|_\b#_\be_\bn_\bd_\bi_\bf_\b _\b/_\b/_\b _\bT_\bO_\bR_\bR_\bE_\bN_\bT_\b__\bP_\bI_\bE_\bC_\bE_\b__\bP_\bI_\bC_\bK_\bE_\bR_\b__\bH_\bP_\bP_\b__\bI_\bN_\bC_\bL_\bU_\bD_\bE_\bD_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |move to aux |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bs_\bo_\bc_\bk_\be_\bt_\b__\bt_\by_\bp_\be_\b._\bh_\bp_\bp_\b:_\b6_\b0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* m\bmo\bov\bve\be t\bto\bo a\bau\bux\bx *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/s\bso\boc\bck\bke\bet\bt_\b_t\bty\byp\bpe\be.\b.h\bhp\bpp\bp:\b:6\b60\b0 *\b**\b**\b* |\n+|namespace libtorrent { |\n+| |\n+|// A type describing kinds of sockets involved in various operations or events. |\n+|enum class socket_type_t : std::uint8_t { |\n+|\ttcp, |\n+|\tsocks5, |\n+|\thttp, |\n+|\tutp, |\n+|\ti2p, |\n+|\ttcp_ssl, |\n+|\tsocks5_ssl, |\n+|\thttp_ssl, |\n+|\tutp_ssl, |\n+| |\n+|#if TORRENT_ABI_VERSION <= 2 |\n+|\tudp TORRENT_DEPRECATED_ENUM = utp, |\n+|#endif |\n+|}; |\n+| |\n+|// return a short human readable name for types of socket |\n+|char const* socket_type_name(socket_type_t); |\n+| |\n+|} |\n+| |\n+|_\b#_\be_\bn_\bd_\bi_\bf_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |relevance\u00a00|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |support batched adding of block hashes for reduced overhead? |\n |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bh_\ba_\bs_\bh_\b__\bp_\bi_\bc_\bk_\be_\br_\b._\bh_\bp_\bp_\b:_\b1_\b5_\b5_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |*\b**\b**\b**\b**\b* s\bsu\bup\bpp\bpo\bor\brt\bt b\bba\bat\btc\bch\bhe\bed\bd a\bad\bdd\bdi\bin\bng\bg o\bof\bf b\bbl\blo\boc\bck\bk h\bha\bas\bsh\bhe\bes\bs f\bfo\bor\br r\bre\bed\bdu\buc\bce\bed\bd o\bov\bve\ber\brh\bhe\bea\bad\bd?\b? *\b**\b**\b**\b**\b* |\n |*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/h\bha\bas\bsh\bh_\b_p\bpi\bic\bck\bke\ber\br.\b.h\bhp\bpp\bp:\b:1\b15\b55\b5 *\b**\b**\b* |\n |// the number of hashes in the range |\n |\t\tint count = 0; |\n |\t\tint proof_layers = 0; |\n@@ -11126,14 +11223,123 @@\n | |\n |\t\tstruct priority_block_request |\n |\t\t{ |\n |\t\t\tpriority_block_request(file_index_t const f, int const b) |\n |\t\t\t\t: file(f), block(b) {} |\n |\t\t\tfile_index_t file; |\n |_\b\t_\b\t_\b\t_\bi_\bn_\bt_\b _\bb_\bl_\bo_\bc_\bk_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |include the number of peers received from this tracker, at last announce |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\be_\bn_\bt_\br_\by_\b._\bh_\bp_\bp_\b:_\b7_\b6_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* i\bin\bnc\bcl\blu\bud\bde\be t\bth\bhe\be n\bnu\bum\bmb\bbe\ber\br o\bof\bf p\bpe\bee\ber\brs\bs r\bre\bec\bce\bei\biv\bve\bed\bd f\bfr\bro\bom\bm t\bth\bhi\bis\bs t\btr\bra\bac\bck\bke\ber\br,\b, a\bat\bt l\bla\bas\bst\bt a\ban\bnn\bno\bou\bun\bnc\bce\be *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by.\b.h\bhp\bpp\bp:\b:7\b76\b6 *\b**\b**\b* |\n+|\tstruct TORRENT_EXPORT announce_infohash |\n+|\t{ |\n+|\t\t// internal |\n+|\t\tTORRENT_UNEXPORT announce_infohash(); |\n+| |\n+|\t\t// if this tracker has returned an error or warning message |\n+|\t\t// that message is stored here |\n+|\t\tstd::string message; |\n+| |\n+|\t\t// if this tracker failed the last time it was contacted |\n+|\t\t// this error code specifies what error occurred |\n+|\t\terror_code last_error; |\n+| |\n+|\t\t// the time of next tracker announce |\n+|\t\ttime_point32 next_announce = (time_point32::min)(); |\n+| |\n+|\t\t// no announces before this time |\n+|\t\ttime_point32 min_announce = (time_point32::min)(); |\n+| |\n+| |\n+|// these are either -1 or the scrape information this tracker last |\n+|\t\t// responded with. *incomplete* is the current number of downloaders in |\n+|\t\t// the swarm, *complete* is the current number of seeds in the swarm and |\n+|\t\t// *downloaded* is the cumulative number of completed downloads of this |\n+|\t\t// torrent, since the beginning of time (from this tracker's point of |\n+|\t\t// view). |\n+| |\n+|\t\t// if this tracker has returned scrape data, these fields are filled in |\n+|\t\t// with valid numbers. Otherwise they are set to -1. ``incomplete`` counts |\n+|\t\t// the number of current downloaders. ``complete`` counts the number of |\n+|\t\t// current peers completed the download, or \"seeds\". ``downloaded`` is the |\n+|\t\t// cumulative number of completed downloads. |\n+|\t\tint scrape_incomplete = -1; |\n+|\t\tint scrape_complete = -1; |\n+|\t\tint scrape_downloaded = -1; |\n+| |\n+|\t\t// the number of times in a row we have failed to announce to this |\n+|\t\t// tracker. |\n+|\t\tstd::uint8_t fails : 7; |\n+| |\n+|\t\t// true while we're waiting for a response from the tracker. |\n+|\t\tbool updating : 1; |\n+| |\n+|\t\t// set to true when we get a valid response from an announce |\n+|\t\t// with event=started. If it is set, we won't send start in the subsequent |\n+|\t\t// announces. |\n+|\t\tbool start_sent : 1; |\n+| |\n+|\t\t// set to true when we send a event=completed. |\n+|_\b\t_\b\t_\bb_\bo_\bo_\bl_\b _\bc_\bo_\bm_\bp_\bl_\be_\bt_\be_\b__\bs_\be_\bn_\bt_\b _\b:_\b _\b1_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |replace this by the standard string_view in C++17 |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bs_\bt_\br_\bi_\bn_\bg_\b__\bv_\bi_\be_\bw_\b._\bh_\bp_\bp_\b:_\b4_\b0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* r\bre\bep\bpl\bla\bac\bce\be t\bth\bhi\bis\bs b\bby\by t\bth\bhe\be s\bst\bta\ban\bnd\bda\bar\brd\bd s\bst\btr\bri\bin\bng\bg_\b_v\bvi\bie\bew\bw i\bin\bn C\bC+\b++\b+1\b17\b7 *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/s\bst\btr\bri\bin\bng\bg_\b_v\bvi\bie\bew\bw.\b.h\bhp\bpp\bp:\b:4\b40\b0 *\b**\b**\b* |\n+|AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |\n+|IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |\n+|ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |\n+|LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |\n+|CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |\n+|SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |\n+|INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |\n+|CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |\n+|ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |\n+|POSSIBILITY OF SUCH DAMAGE. |\n+| |\n+|*/ |\n+| |\n+|#ifndef TORRENT_STRING_VIEW_HPP_INCLUDED |\n+|#define TORRENT_STRING_VIEW_HPP_INCLUDED |\n+| |\n+|#include |\n+| |\n+|#include \"libtorrent/aux_/disable_warnings_push.hpp\" |\n+| |\n+| |\n+|#if BOOST_VERSION < 106100 |\n+|#include |\n+|#include // for strchr |\n+|namespace libtorrent { |\n+| |\n+|using string_view = boost::string_ref; |\n+|using wstring_view = boost::wstring_ref; |\n+| |\n+|// internal |\n+|inline string_view::size_type find_first_of(string_view const v, char const c |\n+|\t, string_view::size_type pos) |\n+|{ |\n+|\twhile (pos < v.size()) |\n+|\t{ |\n+|\t\tif (v[pos] == c) return pos; |\n+|\t\t++pos; |\n+|\t} |\n+|\treturn string_view::npos; |\n+|} |\n+| |\n+|// internal |\n+|inline string_view::size_type find_first_of(string_view const v, char const* c |\n+|\t, string_view::size_type pos) |\n+|{ |\n+|\twhile (pos < v.size()) |\n+|\t{ |\n+|\t\tif (std::strchr(c, v[pos]) != nullptr) return pos; |\n+|\t\t++pos; |\n+|\t} |\n+|_\b\t_\br_\be_\bt_\bu_\br_\bn_\b _\bs_\bt_\br_\bi_\bn_\bg_\b__\bv_\bi_\be_\bw_\b:_\b:_\bn_\bp_\bo_\bs_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |relevance\u00a00|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |hide this declaration when deprecated functions are disabled, and remove its internal use |\n |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bi_\bd_\be_\bn_\bt_\bi_\bf_\by_\b__\bc_\bl_\bi_\be_\bn_\bt_\b._\bh_\bp_\bp_\b:_\b4_\b8_\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |*\b**\b**\b**\b**\b* h\bhi\bid\bde\be t\bth\bhi\bis\bs d\bde\bec\bcl\bla\bar\bra\bat\bti\bio\bon\bn w\bwh\bhe\ben\bn d\bde\bep\bpr\bre\bec\bca\bat\bte\bed\bd f\bfu\bun\bnc\bct\bti\bio\bon\bns\bs a\bar\bre\be d\bdi\bis\bsa\bab\bbl\ble\bed\bd,\b, a\ban\bnd\bd r\bre\bem\bmo\bov\bve\be i\bit\bts\bs i\bin\bnt\bte\ber\brn\bna\bal\bl u\bus\bse\be *\b**\b**\b**\b**\b* |\n |*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/i\bid\bde\ben\bnt\bti\bif\bfy\by_\b_c\bcl\bli\bie\ben\bnt\bt.\b.h\bhp\bpp\bp:\b:4\b48\b8 *\b**\b**\b* |\n |CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |\n |ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |\n |POSSIBILITY OF SUCH DAMAGE. |\n@@ -11181,14 +11387,381 @@\n |\t// not be able to identify peers with non- standard encodings. Only Azureus |\n |\t// style, Shadow's style and Mainline style. |\n |\tTORRENT_DEPRECATED_EXPORT |\n |\tboost::optional |\n |\t\tclient_fingerprint(peer_id const& p); |\n | |\n |_\b#_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b _\b\"_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bu_\bx_\b__\b/_\bd_\bi_\bs_\ba_\bb_\bl_\be_\b__\bw_\ba_\br_\bn_\bi_\bn_\bg_\bs_\b__\bp_\bo_\bp_\b._\bh_\bp_\bp_\b\"_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |change the type to std::shared_ptr in C++17 it is used as if immutable, it cannot be const for technical reasons right now. |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b._\bh_\bp_\bp_\b:_\b7_\b2_\b9_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* c\bch\bha\ban\bng\bge\be t\bth\bhe\be t\bty\byp\bpe\be t\bto\bo s\bst\btd\bd:\b::\b:s\bsh\bha\bar\bre\bed\bd_\b_p\bpt\btr\br i\bin\bn C\bC+\b++\b+1\b17\b7 i\bit\bt i\bis\bs u\bus\bse\bed\bd a\bas\bs i\bif\bf i\bim\bmm\bmu\but\bta\bab\bbl\ble\be,\b, i\bit\bt c\bca\ban\bnn\bno\bot\bt b\bbe\be c\bco\bon\bns\bst\bt f\bfo\bor\br t\bte\bec\bch\bhn\bni\bic\bca\bal\bl r\bre\bea\bas\bso\bon\bns\bs r\bri\big\bgh\bht\bt n\bno\bow\bw.\b. *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo.\b.h\bhp\bpp\bp:\b:7\b72\b29\b9 *\b**\b**\b* |\n+|\t\t// these are the collections from outside of the info-dict. These are |\n+|\t\t// owning strings, since we only keep the info-section around, these |\n+|\t\t// cannot be pointers into that buffer. |\n+|\t\tstd::vector m_owned_collections; |\n+| |\n+|#if TORRENT_ABI_VERSION <= 2 |\n+|\t\t// if this is a merkle torrent, this is the merkle |\n+|\t\t// tree. It has space for merkle_num_nodes(merkle_num_leafs(num_pieces)) |\n+|\t\t// hashes |\n+|\t\taux::vector m_merkle_tree; |\n+|#endif |\n+| |\n+|\t\t// v2 merkle tree for each file |\n+|\t\t// the actual hash buffers are always divisible by 32 (sha256_hash::size()) |\n+|\t\taux::vector, file_index_t> m_piece_layers; |\n+| |\n+|\t\t// this is a copy of the info section from the torrent. |\n+|\t\t// it use maintained in this flat format in order to |\n+|\t\t// make it available through the metadata extension |\n+|boost::shared_array m_info_section; |\n+| |\n+|\t\t// if a comment is found in the torrent file |\n+|\t\t// this will be set to that comment |\n+|\t\tstd::string m_comment; |\n+| |\n+|\t\t// an optional string naming the software used |\n+|\t\t// to create the torrent file |\n+|\t\tstd::string m_created_by; |\n+| |\n+|\t\t// the info section parsed. points into m_info_section |\n+|\t\t// parsed lazily |\n+|\t\tmutable bdecode_node m_info_dict; |\n+| |\n+|\t\t// if a creation date is found in the torrent file |\n+|\t\t// this will be set to that, otherwise it'll be |\n+|\t\t// 1970, Jan 1 |\n+|\t\tstd::time_t m_creation_date = 0; |\n+| |\n+|\t\t// the hash(es) that identify this torrent |\n+|\t\tinfo_hash_t m_info_hash; |\n+| |\n+|\t\t// this is the offset into the m_info_section buffer to the first byte of |\n+|\t\t// the first SHA-1 hash |\n+|\t\tstd::int32_t m_piece_hashes = 0; |\n+| |\n+|\t\t// the number of bytes in m_info_section |\n+|\t\tstd::int32_t m_info_section_size = 0; |\n+| |\n+|\t\t// this is used when creating a torrent. If there's |\n+|_\b\t_\b\t_\b/_\b/_\b _\bo_\bn_\bl_\by_\b _\bo_\bn_\be_\b _\bf_\bi_\bl_\be_\b _\bt_\bh_\be_\br_\be_\b _\ba_\br_\be_\b _\bc_\ba_\bs_\be_\bs_\b _\bw_\bh_\be_\br_\be_\b _\bi_\bt_\b'_\bs_\b _\bi_\bm_\bp_\bo_\bs_\bs_\bi_\bb_\bl_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |we could bind the socket here, since we know what the target endpoint is of the proxy |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bs_\bo_\bc_\bk_\bs_\b5_\b__\bs_\bt_\br_\be_\ba_\bm_\b._\bh_\bp_\bp_\b:_\b1_\b9_\b7_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* w\bwe\be c\bco\bou\bul\bld\bd b\bbi\bin\bnd\bd t\bth\bhe\be s\bso\boc\bck\bke\bet\bt h\bhe\ber\bre\be,\b, s\bsi\bin\bnc\bce\be w\bwe\be k\bkn\bno\bow\bw w\bwh\bha\bat\bt t\bth\bhe\be t\bta\bar\brg\bge\bet\bt e\ben\bnd\bdp\bpo\boi\bin\bnt\bt i\bis\bs o\bof\bf t\bth\bhe\be p\bpr\bro\box\bxy\by *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/s\bso\boc\bck\bks\bs5\b5_\b_s\bst\btr\bre\bea\bam\bm.\b.h\bhp\bpp\bp:\b:1\b19\b97\b7 *\b**\b**\b* |\n+|}, std::move(handler))); |\n+|\t} |\n+| |\n+|private: |\n+| |\n+|\ttemplate |\n+|\tvoid name_lookup(error_code const& e, tcp::resolver::results_type ips |\n+|\t\t, Handler h) |\n+|\t{ |\n+|\t\tCOMPLETE_ASYNC(\"socks5_stream::name_lookup\"); |\n+|\t\tif (handle_error(e, std::move(h))) return; |\n+| |\n+|\t\tauto i = ips.begin(); |\n+|\t\tif (!m_sock.is_open()) |\n+|\t\t{ |\n+|\t\t\terror_code ec; |\n+|\t\t\tm_sock.open(i->endpoint().protocol(), ec); |\n+|\t\t\tif (handle_error(ec, std::move(h))) return; |\n+|\t\t} |\n+| |\n+|ADD_OUTSTANDING_ASYNC(\"socks5_stream::connected\"); |\n+|m_sock.async_connect(i->endpoint(), wrap_allocator( |\n+|\t\t\t[this](error_code const& ec, Handler hn) |\n+|\t\t\t{ connected(ec, std::move(hn)); }, std::move(h))); |\n+|\t} |\n+| |\n+|\ttemplate |\n+|\tvoid connected(error_code const& e, Handler h) |\n+|\t{ |\n+|\t\tCOMPLETE_ASYNC(\"socks5_stream::connected\"); |\n+|\t\tif (handle_error(e, std::move(h))) return; |\n+| |\n+|\t\tusing namespace libtorrent::aux; |\n+|\t\tif (m_version == 5) |\n+|\t\t{ |\n+|\t\t\t// send SOCKS5 authentication methods |\n+|\t\t\tm_buffer.resize(m_user.empty()?3:4); |\n+|\t\t\tchar* p = &m_buffer[0]; |\n+|\t\t\twrite_uint8(5, p); // SOCKS VERSION 5 |\n+|\t\t\tif (m_user.empty()) |\n+|\t\t\t{ |\n+|\t\t\t\twrite_uint8(1, p); // 1 authentication method (no auth) |\n+|\t\t\t\twrite_uint8(0, p); // no authentication |\n+|\t\t\t} |\n+|\t\t\telse |\n+|\t\t\t{ |\n+|\t\t\t\twrite_uint8(2, p); // 2 authentication methods |\n+|\t\t\t\twrite_uint8(0, p); // no authentication |\n+|\t\t\t\twrite_uint8(2, p); // username/password |\n+|\t\t\t} |\n+|_\b\t_\b\t_\b\t_\bA_\bD_\bD_\b__\bO_\bU_\bT_\bS_\bT_\bA_\bN_\bD_\bI_\bN_\bG_\b__\bA_\bS_\bY_\bN_\bC_\b(_\b\"_\bs_\bo_\bc_\bk_\bs_\b5_\b__\bs_\bt_\br_\be_\ba_\bm_\b:_\b:_\bh_\ba_\bn_\bd_\bs_\bh_\ba_\bk_\be_\b1_\b\"_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |make this a raw pointer (to save size in the first cache line) and make the constructor take a raw pointer. torrent objects should |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bp_\be_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b._\bh_\bp_\bp_\b:_\b2_\b1_\b8_\b _\b _\b _\b _\b _\b _\b _\b|_\ba_\bl_\bw_\ba_\by_\bs_\b _\bo_\bu_\bt_\bl_\bi_\bv_\be_\b _\bt_\bh_\be_\bi_\br_\b _\bp_\be_\be_\br_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* m\bma\bak\bke\be t\bth\bhi\bis\bs a\ba r\bra\baw\bw p\bpo\boi\bin\bnt\bte\ber\br (\b(t\bto\bo s\bsa\bav\bve\be s\bsi\biz\bze\be i\bin\bn t\bth\bhe\be f\bfi\bir\brs\bst\bt c\bca\bac\bch\bhe\be l\bli\bin\bne\be)\b) a\ban\bnd\bd m\bma\bak\bke\be t\bth\bhe\be c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br t\bta\bak\bke\be a\ba r\bra\baw\bw p\bpo\boi\bin\bnt\bte\ber\br.\b. t\bto\bor\brr\bre\ben\bnt\bt o\bob\bbj\bje\bec\bct\bts\bs s\bsh\bho\bou\bul\bld\bd a\bal\blw\bwa\bay\bys\bs o\bou\but\btl\bli\biv\bve\be t\bth\bhe\bei\bir\br p\bpe\bee\ber\brs\bs *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/p\bpe\bee\ber\br_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn.\b.h\bhp\bpp\bp:\b:2\b21\b18\b8 *\b**\b**\b* |\n+|, m_snubbed(false) |\n+|\t\t\t, m_interesting(false) |\n+|\t\t\t, m_choked(true) |\n+|\t\t\t, m_ignore_stats(false) |\n+|\t\t{} |\n+| |\n+|\t\t// explicitly disallow assignment, to silence msvc warning |\n+|\t\tpeer_connection_hot_members& operator=(peer_connection_hot_members const&) = delete; |\n+| |\n+|\tprotected: |\n+| |\n+|\t\t// the pieces the other end have |\n+|\t\ttyped_bitfield m_have_piece; |\n+| |\n+|\t\t// this is the torrent this connection is |\n+|\t\t// associated with. If the connection is an |\n+|\t\t// incoming connection, this is set to zero |\n+|\t\t// until the info_hash is received. Then it's |\n+|\t\t// set to the torrent it belongs to. |\n+| |\n+|std::weak_ptr m_torrent; |\n+| |\n+|\tpublic: |\n+| |\n+|\t\t// a back reference to the session |\n+|\t\t// the peer belongs to. |\n+|\t\taux::session_interface& m_ses; |\n+| |\n+|\t\t// settings that apply to this peer |\n+|\t\taux::session_settings const& m_settings; |\n+| |\n+|\tprotected: |\n+| |\n+|\t\t// this is true if this connection has been added |\n+|\t\t// to the list of connections that will be closed. |\n+|\t\tbool m_disconnecting:1; |\n+| |\n+|\t\t// this is true until this socket has become |\n+|\t\t// writable for the first time (i.e. the |\n+|\t\t// connection completed). While connecting |\n+|\t\t// the timeout will not be triggered. This is |\n+|\t\t// because windows XP SP2 may delay connection |\n+|\t\t// attempts, which means that the connection |\n+|\t\t// may not even have been attempted when the |\n+|\t\t// time out is reached. |\n+|\t\tbool m_connecting:1; |\n+| |\n+|\t\t// this is set to true if the last time we tried to |\n+|\t\t// pick a piece to download, we could only find |\n+|\t\t// blocks that were already requested from other |\n+|_\b\t_\b\t_\b/_\b/_\b _\bp_\be_\be_\br_\bs_\b._\b _\bI_\bn_\b _\bt_\bh_\bi_\bs_\b _\bc_\ba_\bs_\be_\b,_\b _\bw_\be_\b _\bs_\bh_\bo_\bu_\bl_\bd_\b _\bn_\bo_\bt_\b _\bt_\br_\by_\b _\bt_\bo_\b _\bp_\bi_\bc_\bk_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |factor this out into its own class with a virtual interface torrent and session should implement this interface |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bp_\be_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b._\bh_\bp_\bp_\b:_\b1_\b0_\b2_\b6_\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* f\bfa\bac\bct\bto\bor\br t\bth\bhi\bis\bs o\bou\but\bt i\bin\bnt\bto\bo i\bit\bts\bs o\bow\bwn\bn c\bcl\bla\bas\bss\bs w\bwi\bit\bth\bh a\ba v\bvi\bir\brt\btu\bua\bal\bl i\bin\bnt\bte\ber\brf\bfa\bac\bce\be t\bto\bor\brr\bre\ben\bnt\bt a\ban\bnd\bd s\bse\bes\bss\bsi\bio\bon\bn s\bsh\bho\bou\bul\bld\bd i\bim\bmp\bpl\ble\bem\bme\ben\bnt\bt t\bth\bhi\bis\bs i\bin\bnt\bte\ber\brf\bfa\bac\bce\be *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/p\bpe\bee\ber\br_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn.\b.h\bhp\bpp\bp:\b:1\b10\b02\b26\b6 *\b**\b**\b* |\n+|\t\t// the local endpoint for this peer, i.e. our address |\n+|\t\t// and our port. If this is set for outgoing connections |\n+|\t\t// before the connection completes, it means we want to |\n+|\t\t// force the connection to be bound to the specified interface. |\n+|\t\t// if it ends up being bound to a different local IP, the connection |\n+|\t\t// is closed. |\n+|\t\ttcp::endpoint m_local; |\n+| |\n+|\t\t// remote peer's id |\n+|\t\tpeer_id m_peer_id; |\n+| |\n+|\tprotected: |\n+| |\n+|\t\ttemplate |\n+|\t\tvoid wrap(Fun f, Args&&... a); |\n+| |\n+|\t\t// statistics about upload and download speeds |\n+|\t\t// and total amount of uploads and downloads for |\n+|\t\t// this peer |\n+|stat m_statistics; |\n+| |\n+|\t\t// the number of outstanding bytes expected |\n+|\t\t// to be received by extensions |\n+|\t\tint m_extension_outstanding_bytes = 0; |\n+| |\n+|\t\t// the number of time critical requests |\n+|\t\t// queued up in the m_request_queue that |\n+|\t\t// soon will be committed to the download |\n+|\t\t// queue. This is included in download_queue_time() |\n+|\t\t// so that it can be used while adding more |\n+|\t\t// requests and take the previous requests |\n+|\t\t// into account without submitting it all |\n+|\t\t// immediately |\n+|\t\tstd::uint16_t m_queued_time_critical = 0; |\n+| |\n+|\t\t// the number of bytes we are currently reading |\n+|\t\t// from disk, that will be added to the send |\n+|\t\t// buffer as soon as they complete |\n+|\t\tint m_reading_bytes = 0; |\n+| |\n+|\t\t// options used for the piece picker. These flags will |\n+|\t\t// be augmented with flags controlled by other settings |\n+|\t\t// like sequential download etc. These are here to |\n+|\t\t// let plugins control flags that should always be set |\n+|\t\tpicker_options_t m_picker_options{}; |\n+| |\n+|\t\t// the number of invalid piece-requests |\n+|\t\t// we have got from this peer. If the request |\n+|\t\t// queue gets empty, and there have been |\n+|_\b\t_\b\t_\b/_\b/_\b _\bi_\bn_\bv_\ba_\bl_\bi_\bd_\b _\br_\be_\bq_\bu_\be_\bs_\bt_\bs_\b,_\b _\bw_\be_\b _\bc_\ba_\bn_\b _\ba_\bs_\bs_\bu_\bm_\be_\b _\bt_\bh_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |support using the windows API for UPnP operations as well |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bu_\bp_\bn_\bp_\b._\bh_\bp_\bp_\b:_\b1_\b6_\b2_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* s\bsu\bup\bpp\bpo\bor\brt\bt u\bus\bsi\bin\bng\bg t\bth\bhe\be w\bwi\bin\bnd\bdo\bow\bws\bs A\bAP\bPI\bI f\bfo\bor\br U\bUP\bPn\bnP\bP o\bop\bpe\ber\bra\bat\bti\bio\bon\bns\bs a\bas\bs w\bwe\bel\bll\bl *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/u\bup\bpn\bnp\bp.\b.h\bhp\bpp\bp:\b:1\b16\b62\b2 *\b**\b**\b* |\n+|{ |\n+|\tbool in_error_code = false; |\n+|\tbool exit = false; |\n+|\tint error_code = -1; |\n+|}; |\n+| |\n+|struct ip_address_parse_state: error_code_parse_state |\n+|{ |\n+|\tbool in_ip_address = false; |\n+|\tstd::string ip_address; |\n+|}; |\n+| |\n+|TORRENT_EXTRA_EXPORT void find_control_url(int type, string_view, parse_state& state); |\n+| |\n+|TORRENT_EXTRA_EXPORT void find_error_code(int type, string_view string |\n+|\t, error_code_parse_state& state); |\n+| |\n+|TORRENT_EXTRA_EXPORT void find_ip_address(int type, string_view string |\n+|\t, ip_address_parse_state& state); |\n+| |\n+|struct TORRENT_EXTRA_EXPORT upnp final |\n+|: std::enable_shared_from_this |\n+|\t, single_threaded |\n+|{ |\n+|\tupnp(io_context& ios |\n+|\t\t, aux::session_settings const& settings |\n+|\t\t, aux::portmap_callback& cb |\n+|\t\t, address_v4 listen_address |\n+|\t\t, address_v4 netmask |\n+|\t\t, std::string listen_device |\n+|\t\t, aux::listen_socket_handle ls); |\n+|\t~upnp(); |\n+| |\n+|\tvoid start(); |\n+| |\n+|\t// Attempts to add a port mapping for the specified protocol. Valid protocols are |\n+|\t// ``upnp::tcp`` and ``upnp::udp`` for the UPnP class and ``natpmp::tcp`` and |\n+|\t// ``natpmp::udp`` for the NAT-PMP class. |\n+|\t// |\n+|\t// ``external_port`` is the port on the external address that will be mapped. This |\n+|\t// is a hint, you are not guaranteed that this port will be available, and it may |\n+|\t// end up being something else. In the portmap_alert_ notification, the actual |\n+|\t// external port is reported. |\n+|\t// |\n+|\t// ``local_port`` is the port in the local machine that the mapping should forward |\n+|\t// to. |\n+|\t// |\n+|\t// The return value is an index that identifies this port mapping. This is used |\n+|\t// to refer to mappings that fails or succeeds in the portmap_error_alert_ and |\n+|\t// portmap_alert_ respectively. If The mapping fails immediately, the return value |\n+|_\b\t_\b/_\b/_\b _\bi_\bs_\b _\b-_\b1_\b,_\b _\bw_\bh_\bi_\bc_\bh_\b _\bm_\be_\ba_\bn_\bs_\b _\bf_\ba_\bi_\bl_\bu_\br_\be_\b._\b _\bT_\bh_\be_\br_\be_\b _\bw_\bi_\bl_\bl_\b _\bn_\bo_\bt_\b _\bb_\be_\b _\ba_\bn_\by_\b _\be_\br_\br_\bo_\br_\b _\ba_\bl_\be_\br_\bt_\b _\bn_\bo_\bt_\bi_\bf_\bi_\bc_\ba_\bt_\bi_\bo_\bn_\b _\bf_\bo_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |make this a string_view |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bi_\b2_\bp_\b__\bs_\bt_\br_\be_\ba_\bm_\b._\bh_\bp_\bp_\b:_\b5_\b3_\b3_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* m\bma\bak\bke\be t\bth\bhi\bis\bs a\ba s\bst\btr\bri\bin\bng\bg_\b_v\bvi\bie\bew\bw *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/i\bi2\b2p\bp_\b_s\bst\btr\bre\bea\bam\bm.\b.h\bhp\bpp\bp:\b:5\b53\b33\b3 *\b**\b**\b* |\n+|\t\tchar tmp[20]; |\n+|\t\taux::random_bytes(tmp); |\n+|\t\tm_session_id.resize(sizeof(tmp)*2); |\n+|\t\taux::to_hex(tmp, &m_session_id[0]); |\n+| |\n+|\t\tm_sam_socket = std::make_shared(m_io_service); |\n+|\t\tm_sam_socket->set_proxy(m_hostname, m_port); |\n+|\t\tm_sam_socket->set_command(i2p_stream::cmd_create_session); |\n+|\t\tm_sam_socket->set_session_id(m_session_id.c_str()); |\n+|\t\tm_sam_socket->set_session_options(session_options); |\n+| |\n+|\t\tADD_OUTSTANDING_ASYNC(\"i2p_stream::on_sam_connect\"); |\n+|\t\tm_sam_socket->async_connect(tcp::endpoint(), wrap_allocator( |\n+|\t\t\t[this,s=m_sam_socket](error_code const& ec, Handler hn) { |\n+|\t\t\t\ton_sam_connect(ec, s, std::move(hn)); |\n+|\t\t\t}, std::move(handler))); |\n+|\t} |\n+|\tvoid close(error_code&); |\n+| |\n+|char const* session_id() const { return m_session_id.c_str(); } |\n+|std::string const& local_endpoint() const { return m_i2p_local_endpoint; } |\n+| |\n+|\ttemplate |\n+|\tvoid async_name_lookup(char const* name, Handler handler) |\n+|\t{ |\n+|\t\tif (m_state == sam_idle && m_name_lookup.empty() && is_open()) |\n+|\t\t\tdo_name_lookup(name, std::move(handler)); |\n+|\t\telse |\n+|\t\t\tm_name_lookup.emplace_back(std::string(name) |\n+|\t\t\t\t, std::move(handler)); |\n+|\t} |\n+| |\n+|private: |\n+| |\n+|\ttemplate |\n+|\tvoid on_sam_connect(error_code const& ec, std::shared_ptr, Handler h) |\n+|\t{ |\n+|\t\tCOMPLETE_ASYNC(\"i2p_stream::on_sam_connect\"); |\n+|\t\tm_state = sam_idle; |\n+| |\n+|\t\tif (ec) |\n+|\t\t{ |\n+|\t\t\th(ec); |\n+|\t\t\treturn; |\n+|\t\t} |\n+| |\n+|\t\tdo_name_lookup(\"ME\", wrap_allocator( |\n+|\t\t\t[this](error_code const& e, char const* dst, Handler hn) { |\n+|\t\t\t\tset_local_endpoint(e, dst, std::move(hn)); |\n+|_\b\t_\b\t_\b\t_\b}_\b,_\b _\bs_\bt_\bd_\b:_\b:_\bm_\bo_\bv_\be_\b(_\bh_\b)_\b)_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |some space could be saved here by making gauges 32 bits |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bp_\be_\br_\bf_\bo_\br_\bm_\ba_\bn_\bc_\be_\b__\bc_\bo_\bu_\bn_\bt_\be_\br_\bs_\b._\bh_\bp_\bp_\b:_\b4_\b8_\b5_\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* s\bso\bom\bme\be s\bsp\bpa\bac\bce\be c\bco\bou\bul\bld\bd b\bbe\be s\bsa\bav\bve\bed\bd h\bhe\ber\bre\be b\bby\by m\bma\bak\bki\bin\bng\bg g\bga\bau\bug\bge\bes\bs 3\b32\b2 b\bbi\bit\bts\bs *\b**\b**\b**\b**\b* |\n+|_\b*\b*_\b*\b*_\b*\b*_\b _\b.\b._\b.\b._\b/\b/_\bi\bi_\bn\bn_\bc\bc_\bl\bl_\bu\bu_\bd\bd_\be\be_\b/\b/_\bl\bl_\bi\bi_\bb\bb_\bt\bt_\bo\bo_\br\br_\br\br_\be\be_\bn\bn_\bt\bt_\b/\b/_\bp\bp_\be\be_\br\br_\bf\bf_\bo\bo_\br\br_\bm\bm_\ba\ba_\bn\bn_\bc\bc_\be\be_\b_\b__\bc\bc_\bo\bo_\bu\bu_\bn\bn_\bt\bt_\be\be_\br\br_\bs\bs_\b.\b._\bh\bh_\bp\bp_\bp\bp_\b:\b:_\b4\b4_\b8\b8_\b5\b5_\b _\b*\b*_\b*\b*_\b*\b*_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |restore these to regular integers. Instead have one copy of the counters per thread and collect them at convenient synchronization |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bp_\be_\br_\bf_\bo_\br_\bm_\ba_\bn_\bc_\be_\b__\bc_\bo_\bu_\bn_\bt_\be_\br_\bs_\b._\bh_\bp_\bp_\b:_\b4_\b8_\b6_\b _\b _\b|_\bp_\bo_\bi_\bn_\bt_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* r\bre\bes\bst\bto\bor\bre\be t\bth\bhe\bes\bse\be t\bto\bo r\bre\beg\bgu\bul\bla\bar\br i\bin\bnt\bte\beg\bge\ber\brs\bs.\b. I\bIn\bns\bst\bte\bea\bad\bd h\bha\bav\bve\be o\bon\bne\be c\bco\bop\bpy\by o\bof\bf t\bth\bhe\be c\bco\bou\bun\bnt\bte\ber\brs\bs p\bpe\ber\br t\bth\bhr\bre\bea\bad\bd a\ban\bnd\bd c\bco\bol\bll\ble\bec\bct\bt t\bth\bhe\bem\bm a\bat\bt c\bco\bon\bnv\bve\ben\bni\bie\ben\bnt\bt s\bsy\byn\bnc\bch\bhr\bro\bon\bni\biz\bza\bat\bti\bio\bon\bn p\bpo\boi\bin\bnt\bts\bs *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/p\bpe\ber\brf\bfo\bor\brm\bma\ban\bnc\bce\be_\b_c\bco\bou\bun\bnt\bte\ber\brs\bs.\b.h\bhp\bpp\bp:\b:4\b48\b86\b6 *\b**\b**\b* |\n+|#ifdef ATOMIC_LLONG_LOCK_FREE |\n+|#define TORRENT_COUNTER_NOEXCEPT noexcept |\n+|#else |\n+|#define TORRENT_COUNTER_NOEXCEPT |\n+|#endif |\n+| |\n+|\t\tcounters() TORRENT_COUNTER_NOEXCEPT; |\n+| |\n+|\t\tcounters(counters const&) TORRENT_COUNTER_NOEXCEPT; |\n+|\t\tcounters& operator=(counters const&) & TORRENT_COUNTER_NOEXCEPT; |\n+| |\n+|\t\t// returns the new value |\n+|\t\tstd::int64_t inc_stats_counter(int c, std::int64_t value = 1) TORRENT_COUNTER_NOEXCEPT; |\n+|\t\tstd::int64_t operator[](int i) const TORRENT_COUNTER_NOEXCEPT; |\n+| |\n+|\t\tvoid set_value(int c, std::int64_t value) TORRENT_COUNTER_NOEXCEPT; |\n+|\t\tvoid blend_stats_counter(int c, std::int64_t value, int ratio) TORRENT_COUNTER_NOEXCEPT; |\n+| |\n+|\tprivate: |\n+| |\n+|#ifdef ATOMIC_LLONG_LOCK_FREE |\n+|aux::array, num_counters> m_stats_counter; |\n+|#else |\n+|\t\t// if the atomic type isn't lock-free, use a single lock instead, for |\n+|\t\t// the whole array |\n+|\t\tmutable std::mutex m_mutex; |\n+|\t\taux::array m_stats_counter; |\n+|#endif |\n+|\t}; |\n+|} |\n+| |\n+|_\b#_\be_\bn_\bd_\bi_\bf_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |relevance\u00a00|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |make this a raw pointer. perhaps keep the shared_ptr around further down the object to maintain an owner |\n |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bt_\bo_\br_\br_\be_\bn_\bt_\b._\bh_\bp_\bp_\b:_\b2_\b8_\b0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |*\b**\b**\b**\b**\b* m\bma\bak\bke\be t\bth\bhi\bis\bs a\ba r\bra\baw\bw p\bpo\boi\bin\bnt\bte\ber\br.\b. p\bpe\ber\brh\bha\bap\bps\bs k\bke\bee\bep\bp t\bth\bhe\be s\bsh\bha\bar\bre\bed\bd_\b_p\bpt\btr\br a\bar\bro\bou\bun\bnd\bd f\bfu\bur\brt\bth\bhe\ber\br d\bdo\bow\bwn\bn t\bth\bhe\be o\bob\bbj\bje\bec\bct\bt t\bto\bo m\bma\bai\bin\bnt\bta\bai\bin\bn a\ban\bn o\bow\bwn\bne\ber\br *\b**\b**\b**\b**\b* |\n |*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/t\bto\bor\brr\bre\ben\bnt\bt.\b.h\bhp\bpp\bp:\b:2\b28\b80\b0 *\b**\b**\b* |\n |#endif |\n |\t}; |\n | |\n@@ -11454,451 +12027,14 @@\n |\t\t// remember that this is an SSL torrent, so that we don't |\n |\t\t// accidentally start seeding it without any authentication. |\n |\t\tbool m_ssl_torrent:1; |\n | |\n |\t\t// this is set to true if we're trying to delete the |\n |\t\t// files belonging to it. When set, don't write any |\n |_\b\t_\b\t_\b/_\b/_\b _\bm_\bo_\br_\be_\b _\bb_\bl_\bo_\bc_\bk_\bs_\b _\bt_\bo_\b _\bd_\bi_\bs_\bk_\b!_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |support using the windows API for UPnP operations as well |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bu_\bp_\bn_\bp_\b._\bh_\bp_\bp_\b:_\b1_\b6_\b2_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* s\bsu\bup\bpp\bpo\bor\brt\bt u\bus\bsi\bin\bng\bg t\bth\bhe\be w\bwi\bin\bnd\bdo\bow\bws\bs A\bAP\bPI\bI f\bfo\bor\br U\bUP\bPn\bnP\bP o\bop\bpe\ber\bra\bat\bti\bio\bon\bns\bs a\bas\bs w\bwe\bel\bll\bl *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/u\bup\bpn\bnp\bp.\b.h\bhp\bpp\bp:\b:1\b16\b62\b2 *\b**\b**\b* |\n-|{ |\n-|\tbool in_error_code = false; |\n-|\tbool exit = false; |\n-|\tint error_code = -1; |\n-|}; |\n-| |\n-|struct ip_address_parse_state: error_code_parse_state |\n-|{ |\n-|\tbool in_ip_address = false; |\n-|\tstd::string ip_address; |\n-|}; |\n-| |\n-|TORRENT_EXTRA_EXPORT void find_control_url(int type, string_view, parse_state& state); |\n-| |\n-|TORRENT_EXTRA_EXPORT void find_error_code(int type, string_view string |\n-|\t, error_code_parse_state& state); |\n-| |\n-|TORRENT_EXTRA_EXPORT void find_ip_address(int type, string_view string |\n-|\t, ip_address_parse_state& state); |\n-| |\n-|struct TORRENT_EXTRA_EXPORT upnp final |\n-|: std::enable_shared_from_this |\n-|\t, single_threaded |\n-|{ |\n-|\tupnp(io_context& ios |\n-|\t\t, aux::session_settings const& settings |\n-|\t\t, aux::portmap_callback& cb |\n-|\t\t, address_v4 listen_address |\n-|\t\t, address_v4 netmask |\n-|\t\t, std::string listen_device |\n-|\t\t, aux::listen_socket_handle ls); |\n-|\t~upnp(); |\n-| |\n-|\tvoid start(); |\n-| |\n-|\t// Attempts to add a port mapping for the specified protocol. Valid protocols are |\n-|\t// ``upnp::tcp`` and ``upnp::udp`` for the UPnP class and ``natpmp::tcp`` and |\n-|\t// ``natpmp::udp`` for the NAT-PMP class. |\n-|\t// |\n-|\t// ``external_port`` is the port on the external address that will be mapped. This |\n-|\t// is a hint, you are not guaranteed that this port will be available, and it may |\n-|\t// end up being something else. In the portmap_alert_ notification, the actual |\n-|\t// external port is reported. |\n-|\t// |\n-|\t// ``local_port`` is the port in the local machine that the mapping should forward |\n-|\t// to. |\n-|\t// |\n-|\t// The return value is an index that identifies this port mapping. This is used |\n-|\t// to refer to mappings that fails or succeeds in the portmap_error_alert_ and |\n-|\t// portmap_alert_ respectively. If The mapping fails immediately, the return value |\n-|_\b\t_\b/_\b/_\b _\bi_\bs_\b _\b-_\b1_\b,_\b _\bw_\bh_\bi_\bc_\bh_\b _\bm_\be_\ba_\bn_\bs_\b _\bf_\ba_\bi_\bl_\bu_\br_\be_\b._\b _\bT_\bh_\be_\br_\be_\b _\bw_\bi_\bl_\bl_\b _\bn_\bo_\bt_\b _\bb_\be_\b _\ba_\bn_\by_\b _\be_\br_\br_\bo_\br_\b _\ba_\bl_\be_\br_\bt_\b _\bn_\bo_\bt_\bi_\bf_\bi_\bc_\ba_\bt_\bi_\bo_\bn_\b _\bf_\bo_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |it would be nice to remember the bind port and bind once we know where the proxy is m_sock.bind(endpoint, ec); |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bp_\br_\bo_\bx_\by_\b__\bb_\ba_\bs_\be_\b._\bh_\bp_\bp_\b:_\b2_\b2_\b7_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* i\bit\bt w\bwo\bou\bul\bld\bd b\bbe\be n\bni\bic\bce\be t\bto\bo r\bre\bem\bme\bem\bmb\bbe\ber\br t\bth\bhe\be b\bbi\bin\bnd\bd p\bpo\bor\brt\bt a\ban\bnd\bd b\bbi\bin\bnd\bd o\bon\bnc\bce\be w\bwe\be k\bkn\bno\bow\bw w\bwh\bhe\ber\bre\be t\bth\bhe\be p\bpr\bro\box\bxy\by i\bis\bs m\bm_\b_s\bso\boc\bck\bk.\b.b\bbi\bin\bnd\bd(\b(e\ben\bnd\bdp\bpo\boi\bin\bnt\bt,\b, e\bec\bc)\b);\b; *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/p\bpr\bro\box\bxy\by_\b_b\bba\bas\bse\be.\b.h\bhp\bpp\bp:\b:2\b22\b27\b7 *\b**\b**\b* |\n-|TORRENT_ASSERT(m_magic == 0x1337); |\n-|\t\tm_sock.cancel(); |\n-|\t} |\n-| |\n-|\tvoid cancel(error_code& ec) |\n-|\t{ |\n-|\t\tTORRENT_ASSERT(m_magic == 0x1337); |\n-|\t\tm_sock.cancel(ec); |\n-|\t} |\n-| |\n-|\tvoid bind(endpoint_type const& /* endpoint */, error_code& /* ec */) |\n-|\t{ |\n-|\t\tTORRENT_ASSERT(m_magic == 0x1337); |\n-|\t\t// the reason why we ignore binds here is because we don't |\n-|\t\t// (necessarily) yet know what address family the proxy |\n-|\t\t// will resolve to, and binding to the wrong one would |\n-|\t\t// break our connection attempt later. The caller here |\n-|\t\t// doesn't necessarily know that we're proxying, so this |\n-|\t\t// bind address is based on the final endpoint, not the |\n-|\t\t// proxy. |\n-|} |\n-| |\n-|#ifndef BOOST_NO_EXCEPTIONS |\n-|\tvoid open(protocol_type const&) |\n-|\t{ |\n-|\t\tTORRENT_ASSERT(m_magic == 0x1337); |\n-|//\t\tm_sock.open(p); |\n-|\t} |\n-|#endif |\n-| |\n-|\tvoid open(protocol_type const&, error_code&) |\n-|\t{ |\n-|\t\tTORRENT_ASSERT(m_magic == 0x1337); |\n-|\t\t// we need to ignore this for the same reason as stated |\n-|\t\t// for ignoring bind() |\n-|//\t\tm_sock.open(p, ec); |\n-|\t} |\n-| |\n-|#ifndef BOOST_NO_EXCEPTIONS |\n-|\tvoid close() |\n-|\t{ |\n-|\t\tTORRENT_ASSERT(m_magic == 0x1337); |\n-|\t\tm_remote_endpoint = endpoint_type(); |\n-|\t\tm_sock.close(); |\n-|\t\tm_resolver.cancel(); |\n-|\t} |\n-|#endif |\n-| |\n-|\tvoid close(error_code& ec) |\n-|\t{ |\n-|_\b\t_\b\t_\bT_\bO_\bR_\bR_\bE_\bN_\bT_\b__\bA_\bS_\bS_\bE_\bR_\bT_\b(_\bm_\b__\bm_\ba_\bg_\bi_\bc_\b _\b=_\b=_\b _\b0_\bx_\b1_\b3_\b3_\b7_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |make this a raw pointer (to save size in the first cache line) and make the constructor take a raw pointer. torrent objects should |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bp_\be_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b._\bh_\bp_\bp_\b:_\b2_\b1_\b8_\b _\b _\b _\b _\b _\b _\b _\b|_\ba_\bl_\bw_\ba_\by_\bs_\b _\bo_\bu_\bt_\bl_\bi_\bv_\be_\b _\bt_\bh_\be_\bi_\br_\b _\bp_\be_\be_\br_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* m\bma\bak\bke\be t\bth\bhi\bis\bs a\ba r\bra\baw\bw p\bpo\boi\bin\bnt\bte\ber\br (\b(t\bto\bo s\bsa\bav\bve\be s\bsi\biz\bze\be i\bin\bn t\bth\bhe\be f\bfi\bir\brs\bst\bt c\bca\bac\bch\bhe\be l\bli\bin\bne\be)\b) a\ban\bnd\bd m\bma\bak\bke\be t\bth\bhe\be c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br t\bta\bak\bke\be a\ba r\bra\baw\bw p\bpo\boi\bin\bnt\bte\ber\br.\b. t\bto\bor\brr\bre\ben\bnt\bt o\bob\bbj\bje\bec\bct\bts\bs s\bsh\bho\bou\bul\bld\bd a\bal\blw\bwa\bay\bys\bs o\bou\but\btl\bli\biv\bve\be t\bth\bhe\bei\bir\br p\bpe\bee\ber\brs\bs *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/p\bpe\bee\ber\br_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn.\b.h\bhp\bpp\bp:\b:2\b21\b18\b8 *\b**\b**\b* |\n-|, m_snubbed(false) |\n-|\t\t\t, m_interesting(false) |\n-|\t\t\t, m_choked(true) |\n-|\t\t\t, m_ignore_stats(false) |\n-|\t\t{} |\n-| |\n-|\t\t// explicitly disallow assignment, to silence msvc warning |\n-|\t\tpeer_connection_hot_members& operator=(peer_connection_hot_members const&) = delete; |\n-| |\n-|\tprotected: |\n-| |\n-|\t\t// the pieces the other end have |\n-|\t\ttyped_bitfield m_have_piece; |\n-| |\n-|\t\t// this is the torrent this connection is |\n-|\t\t// associated with. If the connection is an |\n-|\t\t// incoming connection, this is set to zero |\n-|\t\t// until the info_hash is received. Then it's |\n-|\t\t// set to the torrent it belongs to. |\n-| |\n-|std::weak_ptr m_torrent; |\n-| |\n-|\tpublic: |\n-| |\n-|\t\t// a back reference to the session |\n-|\t\t// the peer belongs to. |\n-|\t\taux::session_interface& m_ses; |\n-| |\n-|\t\t// settings that apply to this peer |\n-|\t\taux::session_settings const& m_settings; |\n-| |\n-|\tprotected: |\n-| |\n-|\t\t// this is true if this connection has been added |\n-|\t\t// to the list of connections that will be closed. |\n-|\t\tbool m_disconnecting:1; |\n-| |\n-|\t\t// this is true until this socket has become |\n-|\t\t// writable for the first time (i.e. the |\n-|\t\t// connection completed). While connecting |\n-|\t\t// the timeout will not be triggered. This is |\n-|\t\t// because windows XP SP2 may delay connection |\n-|\t\t// attempts, which means that the connection |\n-|\t\t// may not even have been attempted when the |\n-|\t\t// time out is reached. |\n-|\t\tbool m_connecting:1; |\n-| |\n-|\t\t// this is set to true if the last time we tried to |\n-|\t\t// pick a piece to download, we could only find |\n-|\t\t// blocks that were already requested from other |\n-|_\b\t_\b\t_\b/_\b/_\b _\bp_\be_\be_\br_\bs_\b._\b _\bI_\bn_\b _\bt_\bh_\bi_\bs_\b _\bc_\ba_\bs_\be_\b,_\b _\bw_\be_\b _\bs_\bh_\bo_\bu_\bl_\bd_\b _\bn_\bo_\bt_\b _\bt_\br_\by_\b _\bt_\bo_\b _\bp_\bi_\bc_\bk_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |factor this out into its own class with a virtual interface torrent and session should implement this interface |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bp_\be_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b._\bh_\bp_\bp_\b:_\b1_\b0_\b2_\b6_\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* f\bfa\bac\bct\bto\bor\br t\bth\bhi\bis\bs o\bou\but\bt i\bin\bnt\bto\bo i\bit\bts\bs o\bow\bwn\bn c\bcl\bla\bas\bss\bs w\bwi\bit\bth\bh a\ba v\bvi\bir\brt\btu\bua\bal\bl i\bin\bnt\bte\ber\brf\bfa\bac\bce\be t\bto\bor\brr\bre\ben\bnt\bt a\ban\bnd\bd s\bse\bes\bss\bsi\bio\bon\bn s\bsh\bho\bou\bul\bld\bd i\bim\bmp\bpl\ble\bem\bme\ben\bnt\bt t\bth\bhi\bis\bs i\bin\bnt\bte\ber\brf\bfa\bac\bce\be *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/p\bpe\bee\ber\br_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn.\b.h\bhp\bpp\bp:\b:1\b10\b02\b26\b6 *\b**\b**\b* |\n-|\t\t// the local endpoint for this peer, i.e. our address |\n-|\t\t// and our port. If this is set for outgoing connections |\n-|\t\t// before the connection completes, it means we want to |\n-|\t\t// force the connection to be bound to the specified interface. |\n-|\t\t// if it ends up being bound to a different local IP, the connection |\n-|\t\t// is closed. |\n-|\t\ttcp::endpoint m_local; |\n-| |\n-|\t\t// remote peer's id |\n-|\t\tpeer_id m_peer_id; |\n-| |\n-|\tprotected: |\n-| |\n-|\t\ttemplate |\n-|\t\tvoid wrap(Fun f, Args&&... a); |\n-| |\n-|\t\t// statistics about upload and download speeds |\n-|\t\t// and total amount of uploads and downloads for |\n-|\t\t// this peer |\n-|stat m_statistics; |\n-| |\n-|\t\t// the number of outstanding bytes expected |\n-|\t\t// to be received by extensions |\n-|\t\tint m_extension_outstanding_bytes = 0; |\n-| |\n-|\t\t// the number of time critical requests |\n-|\t\t// queued up in the m_request_queue that |\n-|\t\t// soon will be committed to the download |\n-|\t\t// queue. This is included in download_queue_time() |\n-|\t\t// so that it can be used while adding more |\n-|\t\t// requests and take the previous requests |\n-|\t\t// into account without submitting it all |\n-|\t\t// immediately |\n-|\t\tstd::uint16_t m_queued_time_critical = 0; |\n-| |\n-|\t\t// the number of bytes we are currently reading |\n-|\t\t// from disk, that will be added to the send |\n-|\t\t// buffer as soon as they complete |\n-|\t\tint m_reading_bytes = 0; |\n-| |\n-|\t\t// options used for the piece picker. These flags will |\n-|\t\t// be augmented with flags controlled by other settings |\n-|\t\t// like sequential download etc. These are here to |\n-|\t\t// let plugins control flags that should always be set |\n-|\t\tpicker_options_t m_picker_options{}; |\n-| |\n-|\t\t// the number of invalid piece-requests |\n-|\t\t// we have got from this peer. If the request |\n-|\t\t// queue gets empty, and there have been |\n-|_\b\t_\b\t_\b/_\b/_\b _\bi_\bn_\bv_\ba_\bl_\bi_\bd_\b _\br_\be_\bq_\bu_\be_\bs_\bt_\bs_\b,_\b _\bw_\be_\b _\bc_\ba_\bn_\b _\ba_\bs_\bs_\bu_\bm_\be_\b _\bt_\bh_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |replace this by the standard string_view in C++17 |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bs_\bt_\br_\bi_\bn_\bg_\b__\bv_\bi_\be_\bw_\b._\bh_\bp_\bp_\b:_\b4_\b0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* r\bre\bep\bpl\bla\bac\bce\be t\bth\bhi\bis\bs b\bby\by t\bth\bhe\be s\bst\bta\ban\bnd\bda\bar\brd\bd s\bst\btr\bri\bin\bng\bg_\b_v\bvi\bie\bew\bw i\bin\bn C\bC+\b++\b+1\b17\b7 *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/s\bst\btr\bri\bin\bng\bg_\b_v\bvi\bie\bew\bw.\b.h\bhp\bpp\bp:\b:4\b40\b0 *\b**\b**\b* |\n-|AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |\n-|IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |\n-|ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |\n-|LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |\n-|CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |\n-|SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |\n-|INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |\n-|CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |\n-|ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |\n-|POSSIBILITY OF SUCH DAMAGE. |\n-| |\n-|*/ |\n-| |\n-|#ifndef TORRENT_STRING_VIEW_HPP_INCLUDED |\n-|#define TORRENT_STRING_VIEW_HPP_INCLUDED |\n-| |\n-|#include |\n-| |\n-|#include \"libtorrent/aux_/disable_warnings_push.hpp\" |\n-| |\n-| |\n-|#if BOOST_VERSION < 106100 |\n-|#include |\n-|#include // for strchr |\n-|namespace libtorrent { |\n-| |\n-|using string_view = boost::string_ref; |\n-|using wstring_view = boost::wstring_ref; |\n-| |\n-|// internal |\n-|inline string_view::size_type find_first_of(string_view const v, char const c |\n-|\t, string_view::size_type pos) |\n-|{ |\n-|\twhile (pos < v.size()) |\n-|\t{ |\n-|\t\tif (v[pos] == c) return pos; |\n-|\t\t++pos; |\n-|\t} |\n-|\treturn string_view::npos; |\n-|} |\n-| |\n-|// internal |\n-|inline string_view::size_type find_first_of(string_view const v, char const* c |\n-|\t, string_view::size_type pos) |\n-|{ |\n-|\twhile (pos < v.size()) |\n-|\t{ |\n-|\t\tif (std::strchr(c, v[pos]) != nullptr) return pos; |\n-|\t\t++pos; |\n-|\t} |\n-|_\b\t_\br_\be_\bt_\bu_\br_\bn_\b _\bs_\bt_\br_\bi_\bn_\bg_\b__\bv_\bi_\be_\bw_\b:_\b:_\bn_\bp_\bo_\bs_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |make this a string_view |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bi_\b2_\bp_\b__\bs_\bt_\br_\be_\ba_\bm_\b._\bh_\bp_\bp_\b:_\b5_\b3_\b3_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* m\bma\bak\bke\be t\bth\bhi\bis\bs a\ba s\bst\btr\bri\bin\bng\bg_\b_v\bvi\bie\bew\bw *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/i\bi2\b2p\bp_\b_s\bst\btr\bre\bea\bam\bm.\b.h\bhp\bpp\bp:\b:5\b53\b33\b3 *\b**\b**\b* |\n-|\t\tchar tmp[20]; |\n-|\t\taux::random_bytes(tmp); |\n-|\t\tm_session_id.resize(sizeof(tmp)*2); |\n-|\t\taux::to_hex(tmp, &m_session_id[0]); |\n-| |\n-|\t\tm_sam_socket = std::make_shared(m_io_service); |\n-|\t\tm_sam_socket->set_proxy(m_hostname, m_port); |\n-|\t\tm_sam_socket->set_command(i2p_stream::cmd_create_session); |\n-|\t\tm_sam_socket->set_session_id(m_session_id.c_str()); |\n-|\t\tm_sam_socket->set_session_options(session_options); |\n-| |\n-|\t\tADD_OUTSTANDING_ASYNC(\"i2p_stream::on_sam_connect\"); |\n-|\t\tm_sam_socket->async_connect(tcp::endpoint(), wrap_allocator( |\n-|\t\t\t[this,s=m_sam_socket](error_code const& ec, Handler hn) { |\n-|\t\t\t\ton_sam_connect(ec, s, std::move(hn)); |\n-|\t\t\t}, std::move(handler))); |\n-|\t} |\n-|\tvoid close(error_code&); |\n-| |\n-|char const* session_id() const { return m_session_id.c_str(); } |\n-|std::string const& local_endpoint() const { return m_i2p_local_endpoint; } |\n-| |\n-|\ttemplate |\n-|\tvoid async_name_lookup(char const* name, Handler handler) |\n-|\t{ |\n-|\t\tif (m_state == sam_idle && m_name_lookup.empty() && is_open()) |\n-|\t\t\tdo_name_lookup(name, std::move(handler)); |\n-|\t\telse |\n-|\t\t\tm_name_lookup.emplace_back(std::string(name) |\n-|\t\t\t\t, std::move(handler)); |\n-|\t} |\n-| |\n-|private: |\n-| |\n-|\ttemplate |\n-|\tvoid on_sam_connect(error_code const& ec, std::shared_ptr, Handler h) |\n-|\t{ |\n-|\t\tCOMPLETE_ASYNC(\"i2p_stream::on_sam_connect\"); |\n-|\t\tm_state = sam_idle; |\n-| |\n-|\t\tif (ec) |\n-|\t\t{ |\n-|\t\t\th(ec); |\n-|\t\t\treturn; |\n-|\t\t} |\n-| |\n-|\t\tdo_name_lookup(\"ME\", wrap_allocator( |\n-|\t\t\t[this](error_code const& e, char const* dst, Handler hn) { |\n-|\t\t\t\tset_local_endpoint(e, dst, std::move(hn)); |\n-|_\b\t_\b\t_\b\t_\b}_\b,_\b _\bs_\bt_\bd_\b:_\b:_\bm_\bo_\bv_\be_\b(_\bh_\b)_\b)_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |we could bind the socket here, since we know what the target endpoint is of the proxy |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bs_\bo_\bc_\bk_\bs_\b5_\b__\bs_\bt_\br_\be_\ba_\bm_\b._\bh_\bp_\bp_\b:_\b1_\b9_\b7_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* w\bwe\be c\bco\bou\bul\bld\bd b\bbi\bin\bnd\bd t\bth\bhe\be s\bso\boc\bck\bke\bet\bt h\bhe\ber\bre\be,\b, s\bsi\bin\bnc\bce\be w\bwe\be k\bkn\bno\bow\bw w\bwh\bha\bat\bt t\bth\bhe\be t\bta\bar\brg\bge\bet\bt e\ben\bnd\bdp\bpo\boi\bin\bnt\bt i\bis\bs o\bof\bf t\bth\bhe\be p\bpr\bro\box\bxy\by *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/s\bso\boc\bck\bks\bs5\b5_\b_s\bst\btr\bre\bea\bam\bm.\b.h\bhp\bpp\bp:\b:1\b19\b97\b7 *\b**\b**\b* |\n-|}, std::move(handler))); |\n-|\t} |\n-| |\n-|private: |\n-| |\n-|\ttemplate |\n-|\tvoid name_lookup(error_code const& e, tcp::resolver::results_type ips |\n-|\t\t, Handler h) |\n-|\t{ |\n-|\t\tCOMPLETE_ASYNC(\"socks5_stream::name_lookup\"); |\n-|\t\tif (handle_error(e, std::move(h))) return; |\n-| |\n-|\t\tauto i = ips.begin(); |\n-|\t\tif (!m_sock.is_open()) |\n-|\t\t{ |\n-|\t\t\terror_code ec; |\n-|\t\t\tm_sock.open(i->endpoint().protocol(), ec); |\n-|\t\t\tif (handle_error(ec, std::move(h))) return; |\n-|\t\t} |\n-| |\n-|ADD_OUTSTANDING_ASYNC(\"socks5_stream::connected\"); |\n-|m_sock.async_connect(i->endpoint(), wrap_allocator( |\n-|\t\t\t[this](error_code const& ec, Handler hn) |\n-|\t\t\t{ connected(ec, std::move(hn)); }, std::move(h))); |\n-|\t} |\n-| |\n-|\ttemplate |\n-|\tvoid connected(error_code const& e, Handler h) |\n-|\t{ |\n-|\t\tCOMPLETE_ASYNC(\"socks5_stream::connected\"); |\n-|\t\tif (handle_error(e, std::move(h))) return; |\n-| |\n-|\t\tusing namespace libtorrent::aux; |\n-|\t\tif (m_version == 5) |\n-|\t\t{ |\n-|\t\t\t// send SOCKS5 authentication methods |\n-|\t\t\tm_buffer.resize(m_user.empty()?3:4); |\n-|\t\t\tchar* p = &m_buffer[0]; |\n-|\t\t\twrite_uint8(5, p); // SOCKS VERSION 5 |\n-|\t\t\tif (m_user.empty()) |\n-|\t\t\t{ |\n-|\t\t\t\twrite_uint8(1, p); // 1 authentication method (no auth) |\n-|\t\t\t\twrite_uint8(0, p); // no authentication |\n-|\t\t\t} |\n-|\t\t\telse |\n-|\t\t\t{ |\n-|\t\t\t\twrite_uint8(2, p); // 2 authentication methods |\n-|\t\t\t\twrite_uint8(0, p); // no authentication |\n-|\t\t\t\twrite_uint8(2, p); // username/password |\n-|\t\t\t} |\n-|_\b\t_\b\t_\b\t_\bA_\bD_\bD_\b__\bO_\bU_\bT_\bS_\bT_\bA_\bN_\bD_\bI_\bN_\bG_\b__\bA_\bS_\bY_\bN_\bC_\b(_\b\"_\bs_\bo_\bc_\bk_\bs_\b5_\b__\bs_\bt_\br_\be_\ba_\bm_\b:_\b:_\bh_\ba_\bn_\bd_\bs_\bh_\ba_\bk_\be_\b1_\b\"_\b)_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |change the type to std::shared_ptr in C++17 it is used as if immutable, it cannot be const for technical reasons right now. |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b._\bh_\bp_\bp_\b:_\b7_\b2_\b9_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* c\bch\bha\ban\bng\bge\be t\bth\bhe\be t\bty\byp\bpe\be t\bto\bo s\bst\btd\bd:\b::\b:s\bsh\bha\bar\bre\bed\bd_\b_p\bpt\btr\br i\bin\bn C\bC+\b++\b+1\b17\b7 i\bit\bt i\bis\bs u\bus\bse\bed\bd a\bas\bs i\bif\bf i\bim\bmm\bmu\but\bta\bab\bbl\ble\be,\b, i\bit\bt c\bca\ban\bnn\bno\bot\bt b\bbe\be c\bco\bon\bns\bst\bt f\bfo\bor\br t\bte\bec\bch\bhn\bni\bic\bca\bal\bl r\bre\bea\bas\bso\bon\bns\bs r\bri\big\bgh\bht\bt n\bno\bow\bw.\b. *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo.\b.h\bhp\bpp\bp:\b:7\b72\b29\b9 *\b**\b**\b* |\n-|\t\t// these are the collections from outside of the info-dict. These are |\n-|\t\t// owning strings, since we only keep the info-section around, these |\n-|\t\t// cannot be pointers into that buffer. |\n-|\t\tstd::vector m_owned_collections; |\n-| |\n-|#if TORRENT_ABI_VERSION <= 2 |\n-|\t\t// if this is a merkle torrent, this is the merkle |\n-|\t\t// tree. It has space for merkle_num_nodes(merkle_num_leafs(num_pieces)) |\n-|\t\t// hashes |\n-|\t\taux::vector m_merkle_tree; |\n-|#endif |\n-| |\n-|\t\t// v2 merkle tree for each file |\n-|\t\t// the actual hash buffers are always divisible by 32 (sha256_hash::size()) |\n-|\t\taux::vector, file_index_t> m_piece_layers; |\n-| |\n-|\t\t// this is a copy of the info section from the torrent. |\n-|\t\t// it use maintained in this flat format in order to |\n-|\t\t// make it available through the metadata extension |\n-|boost::shared_array m_info_section; |\n-| |\n-|\t\t// if a comment is found in the torrent file |\n-|\t\t// this will be set to that comment |\n-|\t\tstd::string m_comment; |\n-| |\n-|\t\t// an optional string naming the software used |\n-|\t\t// to create the torrent file |\n-|\t\tstd::string m_created_by; |\n-| |\n-|\t\t// the info section parsed. points into m_info_section |\n-|\t\t// parsed lazily |\n-|\t\tmutable bdecode_node m_info_dict; |\n-| |\n-|\t\t// if a creation date is found in the torrent file |\n-|\t\t// this will be set to that, otherwise it'll be |\n-|\t\t// 1970, Jan 1 |\n-|\t\tstd::time_t m_creation_date = 0; |\n-| |\n-|\t\t// the hash(es) that identify this torrent |\n-|\t\tinfo_hash_t m_info_hash; |\n-| |\n-|\t\t// this is the offset into the m_info_section buffer to the first byte of |\n-|\t\t// the first SHA-1 hash |\n-|\t\tstd::int32_t m_piece_hashes = 0; |\n-| |\n-|\t\t// the number of bytes in m_info_section |\n-|\t\tstd::int32_t m_info_section_size = 0; |\n-| |\n-|\t\t// this is used when creating a torrent. If there's |\n-|_\b\t_\b\t_\b/_\b/_\b _\bo_\bn_\bl_\by_\b _\bo_\bn_\be_\b _\bf_\bi_\bl_\be_\b _\bt_\bh_\be_\br_\be_\b _\ba_\br_\be_\b _\bc_\ba_\bs_\be_\bs_\b _\bw_\bh_\be_\br_\be_\b _\bi_\bt_\b'_\bs_\b _\bi_\bm_\bp_\bo_\bs_\bs_\bi_\bb_\bl_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n | |_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ | |\n |relevance\u00a00|_\bp_\be_\be_\br_\b__\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b__\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be_\b._\bh_\bp_\bp_\b:|make this interface smaller! |\n |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b5_\b1_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |*\b**\b**\b**\b**\b* m\bma\bak\bke\be t\bth\bhi\bis\bs i\bin\bnt\bte\ber\brf\bfa\bac\bce\be s\bsm\bma\bal\bll\ble\ber\br!\b! *\b**\b**\b**\b**\b* |\n |*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/p\bpe\bee\ber\br_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn_\b_i\bin\bnt\bte\ber\brf\bfa\bac\bce\be.\b.h\bhp\bpp\bp:\b:5\b51\b1 *\b**\b**\b* |\n |*/ |\n | |\n@@ -11946,150 +12082,14 @@\n |\t\tvirtual stat const& statistics() const = 0; |\n |\t\tvirtual void get_peer_info(peer_info& p) const = 0; |\n |#ifndef TORRENT_DISABLE_LOGGING |\n |\t\tvirtual bool should_log(peer_log_alert::direction_t direction) const = 0; |\n |\t\tvirtual void peer_log(peer_log_alert::direction_t direction |\n |\t\t\t, char const* event, char const* fmt = \"\", ...) const noexcept TORRENT_FORMAT(4,5) = 0; |\n |_\b#_\be_\bn_\bd_\bi_\bf_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |move to aux |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bs_\bo_\bc_\bk_\be_\bt_\b__\bt_\by_\bp_\be_\b._\bh_\bp_\bp_\b:_\b6_\b0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* m\bmo\bov\bve\be t\bto\bo a\bau\bux\bx *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/s\bso\boc\bck\bke\bet\bt_\b_t\bty\byp\bpe\be.\b.h\bhp\bpp\bp:\b:6\b60\b0 *\b**\b**\b* |\n-|namespace libtorrent { |\n-| |\n-|// A type describing kinds of sockets involved in various operations or events. |\n-|enum class socket_type_t : std::uint8_t { |\n-|\ttcp, |\n-|\tsocks5, |\n-|\thttp, |\n-|\tutp, |\n-|\ti2p, |\n-|\ttcp_ssl, |\n-|\tsocks5_ssl, |\n-|\thttp_ssl, |\n-|\tutp_ssl, |\n-| |\n-|#if TORRENT_ABI_VERSION <= 2 |\n-|\tudp TORRENT_DEPRECATED_ENUM = utp, |\n-|#endif |\n-|}; |\n-| |\n-|// return a short human readable name for types of socket |\n-|char const* socket_type_name(socket_type_t); |\n-| |\n-|} |\n-| |\n-|_\b#_\be_\bn_\bd_\bi_\bf_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |should this be allocated lazily? |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bp_\bi_\be_\bc_\be_\b__\bp_\bi_\bc_\bk_\be_\br_\b._\bh_\bp_\bp_\b:_\b8_\b2_\b3_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* s\bsh\bho\bou\bul\bld\bd t\bth\bhi\bis\bs b\bbe\be a\bal\bll\blo\boc\bca\bat\bte\bed\bd l\bla\baz\bzi\bil\bly\by?\b? *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/p\bpi\bie\bec\bce\be_\b_p\bpi\bic\bck\bke\ber\br.\b.h\bhp\bpp\bp:\b:8\b82\b23\b3 *\b**\b**\b* |\n-|// download list it may live in now |\n-|\t\tstd::vector::iterator update_piece_state( |\n-|\t\t\tstd::vector::iterator dp); |\n-| |\n-|\tprivate: |\n-| |\n-|#if TORRENT_USE_ASSERTS || TORRENT_USE_INVARIANT_CHECKS |\n-|\t\tindex_range categories() const |\n-|\t\t{ return {{}, piece_picker::piece_pos::num_download_categories}; } |\n-|#endif |\n-| |\n-|\t\t// the following vectors are mutable because they sometimes may |\n-|\t\t// be updated lazily, triggered by const functions |\n-| |\n-|\t\t// this maps indices to number of peers that has this piece and |\n-|\t\t// index into the m_piece_info vectors. |\n-|\t\t// piece_pos::we_have_index means that we have the piece, so it |\n-|\t\t// doesn't exist in the piece_info buckets |\n-|\t\t// pieces with the filtered flag set doesn't have entries in |\n-|\t\t// the m_piece_info buckets either |\n-|mutable aux::vector m_piece_map; |\n-| |\n-|\t\t// tracks the number of bytes in a specific piece that are part of a pad |\n-|\t\t// file. The padding is assumed to be at the end of the piece, and the |\n-|\t\t// blocks covered by the pad bytes are not picked by the piece picker |\n-|\t\tstd::unordered_map m_pads_in_piece; |\n-| |\n-|\t\t// when the adjacent_piece affinity is enabled, this contains the most |\n-|\t\t// recent \"extents\" of adjacent pieces that have been requested from |\n-|\t\t// this is mutable because it's updated by functions to pick pieces, which |\n-|\t\t// are const. That's an efficient place to update it, since it's being |\n-|\t\t// traversed already. |\n-|\t\tmutable std::vector m_recent_extents; |\n-| |\n-|\t\t// the number of bytes of pad file set in this piece picker |\n-|\t\tstd::int64_t m_num_pad_bytes = 0; |\n-| |\n-|\t\t// the number of pad blocks that we already have |\n-|\t\tstd::int64_t m_have_pad_bytes = 0; |\n-| |\n-|\t\t// the number of pad blocks part of filtered pieces we don't have |\n-|\t\tstd::int64_t m_filtered_pad_bytes = 0; |\n-| |\n-|\t\t// the number of pad blocks we have that are also filtered |\n-|\t\tstd::int64_t m_have_filtered_pad_bytes = 0; |\n-| |\n-|\t\t// the number of seeds. These are not added to |\n-|\t\t// the availability counters of the pieces |\n-|\t\tint m_seeds = 0; |\n-| |\n-|_\b\t_\b\t_\b/_\b/_\b _\bt_\bh_\bi_\bs_\b _\bv_\be_\bc_\bt_\bo_\br_\b _\bc_\bo_\bn_\bt_\ba_\bi_\bn_\bs_\b _\ba_\bl_\bl_\b _\bp_\bi_\be_\bc_\be_\b _\bi_\bn_\bd_\bi_\bc_\be_\bs_\b _\bt_\bh_\ba_\bt_\b _\ba_\br_\be_\b _\bp_\bi_\bc_\bk_\ba_\bb_\bl_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |it would be more intuitive to account \"wanted\" pieces instead of filtered |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bp_\bi_\be_\bc_\be_\b__\bp_\bi_\bc_\bk_\be_\br_\b._\bh_\bp_\bp_\b:_\b8_\b9_\b5_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* i\bit\bt w\bwo\bou\bul\bld\bd b\bbe\be m\bmo\bor\bre\be i\bin\bnt\btu\bui\bit\bti\biv\bve\be t\bto\bo a\bac\bcc\bco\bou\bun\bnt\bt \"\b\"w\bwa\ban\bnt\bte\bed\bd\"\b\" p\bpi\bie\bec\bce\bes\bs i\bin\bns\bst\bte\bea\bad\bd o\bof\bf f\bfi\bil\blt\bte\ber\bre\bed\bd *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/p\bpi\bie\bec\bce\be_\b_p\bpi\bic\bck\bke\ber\br.\b.h\bhp\bpp\bp:\b:8\b89\b95\b5 *\b**\b**\b* |\n-|\t\t// this holds the information of the blocks in partially downloaded |\n-|\t\t// pieces. the downloading_piece::info index point into this vector for |\n-|\t\t// its storage |\n-|\t\taux::vector m_block_info; |\n-| |\n-|\t\t// these are block ranges in m_block_info that are free. The numbers |\n-|\t\t// in here, when multiplied by blocks_per_piece is the index to the |\n-|\t\t// first block in the range that's free to use by a new downloading_piece. |\n-|\t\t// this is a free-list. |\n-|\t\tstd::vector m_free_block_infos; |\n-| |\n-|\t\tstd::uint16_t m_blocks_in_last_piece = 0; |\n-|\t\tint m_piece_size = 0; |\n-|\t\tstd::int64_t m_total_size = 0; |\n-| |\n-|\t\t// the number of filtered pieces that we don't already |\n-|\t\t// have. total_number_of_pieces - number_of_pieces_we_have |\n-|\t\t// - num_filtered is supposed to the number of pieces |\n-|\t\t// we still want to download |\n-|int m_num_filtered = 0; |\n-| |\n-|\t\t// the number of pieces we have that also are filtered |\n-|\t\tint m_num_have_filtered = 0; |\n-| |\n-|\t\t// we have all pieces in the range [0, m_cursor) |\n-|\t\t// m_cursor is the first piece we don't have |\n-|\t\tpiece_index_t m_cursor{0}; |\n-| |\n-|\t\t// we have all pieces in the range [m_reverse_cursor, end) |\n-|\t\t// m_reverse_cursor is the first piece where we also have |\n-|\t\t// all the subsequent pieces |\n-|\t\tpiece_index_t m_reverse_cursor{0}; |\n-| |\n-|\t\t// the number of pieces we have (i.e. passed hash check). |\n-|\t\t// This includes pieces that we have filtered but still have |\n-|\t\tint m_num_have = 0; |\n-| |\n-|\t\t// if this is set to true, it means update_pieces() |\n-|\t\t// has to be called before accessing m_pieces. |\n-|\t\tmutable bool m_dirty = false; |\n-|\tpublic: |\n-| |\n-|\t\tenum { max_pieces = (std::numeric_limits::max)() - 1 }; |\n-| |\n-|\t}; |\n-|} |\n-| |\n-|_\b#_\be_\bn_\bd_\bi_\bf_\b _\b/_\b/_\b _\bT_\bO_\bR_\bR_\bE_\bN_\bT_\b__\bP_\bI_\bE_\bC_\bE_\b__\bP_\bI_\bC_\bK_\bE_\bR_\b__\bH_\bP_\bP_\b__\bI_\bN_\bC_\bL_\bU_\bD_\bE_\bD_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |relevance\u00a00|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/ |since this is a public function, it should probably be moved out of this header and into one with other public functions. |\n |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bk_\ba_\bd_\be_\bm_\bl_\bi_\ba_\b/_\bi_\bt_\be_\bm_\b._\bh_\bp_\bp_\b:_\b6_\b1_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |*\b**\b**\b**\b**\b* s\bsi\bin\bnc\bce\be t\bth\bhi\bis\bs i\bis\bs a\ba p\bpu\bub\bbl\bli\bic\bc f\bfu\bun\bnc\bct\bti\bio\bon\bn,\b, i\bit\bt s\bsh\bho\bou\bul\bld\bd p\bpr\bro\bob\bba\bab\bbl\bly\by b\bbe\be m\bmo\bov\bve\bed\bd o\bou\but\bt o\bof\bf t\bth\bhi\bis\bs h\bhe\bea\bad\bde\ber\br a\ban\bnd\bd i\bin\bnt\bto\bo o\bon\bne\be w\bwi\bit\bth\bh o\bot\bth\bhe\ber\br p\bpu\bub\bbl\bli\bic\bc f\bfu\bun\bnc\bct\bti\bio\bon\bns\bs.\b. *\b**\b**\b**\b**\b* |\n |*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/k\bka\bad\bde\bem\bml\bli\bia\ba/\b/i\bit\bte\bem\bm.\b.h\bhp\bpp\bp:\b:6\b61\b1 *\b**\b**\b* |\n |#include |\n |#include |\n | |\n@@ -12343,68 +12343,114 @@\n |\t\t\tint m_peak_up_rate = 0; |\n |#endif |\n | |\n |\t\t\tvoid on_tick(error_code const& e); |\n | |\n |\t\t\tvoid try_connect_more_peers(); |\n |_\b\t_\b\t_\b\t_\bv_\bo_\bi_\bd_\b _\ba_\bu_\bt_\bo_\b__\bm_\ba_\bn_\ba_\bg_\be_\b__\bc_\bh_\be_\bc_\bk_\bi_\bn_\bg_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\bs_\b(_\bs_\bt_\bd_\b:_\b:_\bv_\be_\bc_\bt_\bo_\br_\b<_\bt_\bo_\br_\br_\be_\bn_\bt_\b*_\b>_\b&_\b _\bl_\bi_\bs_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bu_\bx_\b__\b/ |in C++17, Handler and Storage could just use \"auto\" |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\ba_\bl_\bl_\bo_\bc_\ba_\bt_\bi_\bn_\bg_\b__\bh_\ba_\bn_\bd_\bl_\be_\br_\b._\bh_\bp_\bp_\b:_\b3_\b1_\b6_\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* i\bin\bn C\bC+\b++\b+1\b17\b7,\b, H\bHa\ban\bnd\bdl\ble\ber\br a\ban\bnd\bd S\bSt\bto\bor\bra\bag\bge\be c\bco\bou\bul\bld\bd j\bju\bus\bst\bt u\bus\bse\be \"\b\"a\bau\but\bto\bo\"\b\" *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/a\bau\bux\bx_\b_/\b/a\bal\bll\blo\boc\bca\bat\bti\bin\bng\bg_\b_h\bha\ban\bnd\bdl\ble\ber\br.\b.h\bhp\bpp\bp:\b:3\b31\b16\b6 *\b**\b**\b* |\n-|\tprivate: |\n+|relevance\u00a00|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bu_\bx_\b__\b/ |figure out which version of clang this is supported in |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bd_\be_\bp_\br_\be_\bc_\ba_\bt_\be_\bd_\b._\bh_\bp_\bp_\b:_\b4_\b7_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* f\bfi\big\bgu\bur\bre\be o\bou\but\bt w\bwh\bhi\bic\bch\bh v\bve\ber\brs\bsi\bio\bon\bn o\bof\bf c\bcl\bla\ban\bng\bg t\bth\bhi\bis\bs i\bis\bs s\bsu\bup\bpp\bpo\bor\brt\bte\bed\bd i\bin\bn *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/a\bau\bux\bx_\b_/\b/d\bde\bep\bpr\bre\bec\bca\bat\bte\bed\bd.\b.h\bhp\bpp\bp:\b:4\b47\b7 *\b**\b**\b* |\n+|CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |\n+|ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |\n+|POSSIBILITY OF SUCH DAMAGE. |\n | |\n-|\t\tHandler handler; |\n-|\t\thandler_storage* storage; |\n-|#ifndef BOOST_NO_EXCEPTIONS |\n-|\t\terror_handler_interface* error_handler; |\n+|*/ |\n+| |\n+|#ifndef TORRENT_DEPRECATED_HPP_INCLUDED |\n+|#define TORRENT_DEPRECATED_HPP_INCLUDED |\n+| |\n+|#if !defined TORRENT_BUILDING_LIBRARY |\n+|# define TORRENT_DEPRECATED [[deprecated]] |\n+|#else |\n+|# define TORRENT_DEPRECATED |\n |#endif |\n-|\t}; |\n | |\n-|\ttemplate |\n-|\taux::allocating_handler |\n-|\tmake_handler(Handler handler |\n-|\t\t, handler_storage& storage |\n-|\t\t, error_handler_interface& err_handler) |\n-|\t{ |\n-|\t\treturn aux::allocating_handler( |\n-|\t\t\tstd::forward(handler), &storage, &err_handler); |\n-|\t} |\n+|#if defined __clang__ |\n | |\n-|template |\n-|\tstruct handler |\n-|\t{ |\n-|\t\texplicit handler(std::shared_ptr p) : ptr_(std::move(p)) {} |\n+|// ====== CLANG ======== |\n | |\n-|\t\tstd::shared_ptr ptr_; |\n+|# if !defined TORRENT_BUILDING_LIBRARY |\n+|# define TORRENT_DEPRECATED_ENUM __attribute__ ((deprecated)) |\n+|# endif |\n | |\n-|\t\ttemplate |\n-|\t\tvoid operator()(A&&... a) |\n-|\t\t{ |\n-|#ifdef BOOST_NO_EXCEPTIONS |\n-|\t\t\t(ptr_.get()->*Handler)(std::forward(a)...); |\n-|#else |\n-|\t\t\ttry |\n-|\t\t\t{ |\n-|\t\t\t\t(ptr_.get()->*Handler)(std::forward(a)...); |\n-|\t\t\t} |\n-|\t\t\tcatch (system_error const& e) |\n-|\t\t\t{ |\n-|\t\t\t\t(ptr_.get()->*ErrorHandler)(e.code()); |\n-|\t\t\t} |\n-|\t\t\tcatch (std::exception const& e) |\n-|\t\t\t{ |\n-|\t\t\t\t(ptr_.get()->*ExceptHandler)(e); |\n-|_\b\t_\b\t_\b\t_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|#elif defined __GNUC__ |\n+| |\n+|// ======== GCC ======== |\n+| |\n+|// deprecation markup is only enabled when libtorrent |\n+|// headers are included by clients, not while building |\n+|// libtorrent itself |\n+|# if __GNUC__ >= 6 && !defined TORRENT_BUILDING_LIBRARY |\n+|# define TORRENT_DEPRECATED_ENUM __attribute__ ((deprecated)) |\n+|# endif |\n+| |\n+|#endif |\n+| |\n+|#ifndef TORRENT_DEPRECATED_ENUM |\n+|#define TORRENT_DEPRECATED_ENUM |\n+|#endif |\n+| |\n+|_\b#_\be_\bn_\bd_\bi_\bf_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bu_\bx_\b__\b/ |it would be nice to not have this be part of session_interface |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be_\b._\bh_\bp_\bp_\b:_\b2_\b1_\b2_\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* i\bit\bt w\bwo\bou\bul\bld\bd b\bbe\be n\bni\bic\bce\be t\bto\bo n\bno\bot\bt h\bha\bav\bve\be t\bth\bhi\bis\bs b\bbe\be p\bpa\bar\brt\bt o\bof\bf s\bse\bes\bss\bsi\bio\bon\bn_\b_i\bin\bnt\bte\ber\brf\bfa\bac\bce\be *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/a\bau\bux\bx_\b_/\b/s\bse\bes\bss\bsi\bio\bon\bn_\b_i\bin\bnt\bte\ber\brf\bfa\bac\bce\be.\b.h\bhp\bpp\bp:\b:2\b21\b12\b2 *\b**\b**\b* |\n+|virtual void deferred_submit_jobs() = 0; |\n+| |\n+|\t\tvirtual std::uint16_t listen_port() const = 0; |\n+|\t\tvirtual std::uint16_t ssl_listen_port() const = 0; |\n+| |\n+|\t\tvirtual int listen_port(aux::transport ssl, address const& local_addr) = 0; |\n+| |\n+|\t\tvirtual void for_each_listen_socket(std::function f) = 0; |\n+| |\n+|\t\t// ask for which interface and port to bind outgoing peer connections on |\n+|\t\tvirtual tcp::endpoint bind_outgoing_socket(socket_type& s, address const& |\n+|\t\t\tremote_address, error_code& ec) const = 0; |\n+|\t\tvirtual bool verify_bound_address(address const& addr, bool utp |\n+|\t\t\t, error_code& ec) = 0; |\n+| |\n+|#ifndef TORRENT_DISABLE_MUTABLE_TORRENTS |\n+|\t\tvirtual std::vector> find_collection( |\n+|\t\t\tstd::string const& collection) const = 0; |\n+|#endif |\n+| |\n+|virtual proxy_settings proxy() const = 0; |\n+| |\n+|#if TORRENT_USE_I2P |\n+|\t\tvirtual char const* i2p_session() const = 0; |\n+|\t\tvirtual std::string const& local_i2p_endpoint() const = 0; |\n+|#endif |\n+| |\n+|\t\tvirtual void prioritize_connections(std::weak_ptr t) = 0; |\n+| |\n+|\t\tvirtual void trigger_auto_manage() = 0; |\n+| |\n+|\t\tvirtual void apply_settings_pack(std::shared_ptr pack) = 0; |\n+|\t\tvirtual session_settings const& settings() const = 0; |\n+| |\n+|\t\tvirtual void queue_tracker_request(tracker_request req |\n+|\t\t\t, std::weak_ptr c) = 0; |\n+| |\n+|\t\t// peer-classes |\n+|\t\tvirtual void set_peer_classes(peer_class_set* s, address const& a, socket_type_t st) = 0; |\n+|\t\tvirtual peer_class_pool const& peer_classes() const = 0; |\n+|\t\tvirtual peer_class_pool& peer_classes() = 0; |\n+|\t\tvirtual bool ignore_unchoke_slots_set(peer_class_set const& set) const = 0; |\n+|\t\tvirtual int copy_pertinent_channels(peer_class_set const& set |\n+|\t\t\t, int channel, bandwidth_channel** dst, int m) = 0; |\n+|\t\tvirtual int use_quota_overhead(peer_class_set& set, int amount_down, int amount_up) = 0; |\n+| |\n+|\t\tvirtual bandwidth_manager* get_bandwidth_manager(int channel) = 0; |\n+| |\n+|\t\tvirtual void sent_bytes(int bytes_payload, int bytes_protocol) = 0; |\n+|\t\tvirtual void received_bytes(int bytes_payload, int bytes_protocol) = 0; |\n+|_\b\t_\b\t_\bv_\bi_\br_\bt_\bu_\ba_\bl_\b _\bv_\bo_\bi_\bd_\b _\bt_\br_\ba_\bn_\bc_\bi_\be_\bv_\be_\b__\bi_\bp_\b__\bp_\ba_\bc_\bk_\be_\bt_\b(_\bi_\bn_\bt_\b _\bb_\by_\bt_\be_\bs_\b,_\b _\bb_\bo_\bo_\bl_\b _\bi_\bp_\bv_\b6_\b)_\b _\b=_\b _\b0_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |relevance\u00a00|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bu_\bx_\b__\b/ |include the number of peers received from this tracker, at last announce |\n |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\be_\bn_\bt_\br_\by_\b._\bh_\bp_\bp_\b:_\b7_\b4_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |*\b**\b**\b**\b**\b* i\bin\bnc\bcl\blu\bud\bde\be t\bth\bhe\be n\bnu\bum\bmb\bbe\ber\br o\bof\bf p\bpe\bee\ber\brs\bs r\bre\bec\bce\bei\biv\bve\bed\bd f\bfr\bro\bom\bm t\bth\bhi\bis\bs t\btr\bra\bac\bck\bke\ber\br,\b, a\bat\bt l\bla\bas\bst\bt a\ban\bnn\bno\bou\bun\bnc\bce\be *\b**\b**\b**\b**\b* |\n |*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/a\bau\bux\bx_\b_/\b/a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by.\b.h\bhp\bpp\bp:\b:7\b74\b4 *\b**\b**\b* |\n |namespace aux { |\n | |\n |\tstruct TORRENT_EXTRA_EXPORT announce_infohash |\n@@ -12452,14 +12498,68 @@\n |\t\t// set to true when we get a valid response from an announce |\n |\t\t// with event=started. If it is set, we won't send start in the subsequent |\n |\t\t// announces. |\n |\t\tbool start_sent : 1; |\n | |\n |\t\t// set to true when we send a event=completed. |\n |_\b\t_\b\t_\bb_\bo_\bo_\bl_\b _\bc_\bo_\bm_\bp_\bl_\be_\bt_\be_\b__\bs_\be_\bn_\bt_\b _\b:_\b _\b1_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bu_\bx_\b__\b/ |in C++17, Handler and Storage could just use \"auto\" |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\ba_\bl_\bl_\bo_\bc_\ba_\bt_\bi_\bn_\bg_\b__\bh_\ba_\bn_\bd_\bl_\be_\br_\b._\bh_\bp_\bp_\b:_\b3_\b1_\b6_\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* i\bin\bn C\bC+\b++\b+1\b17\b7,\b, H\bHa\ban\bnd\bdl\ble\ber\br a\ban\bnd\bd S\bSt\bto\bor\bra\bag\bge\be c\bco\bou\bul\bld\bd j\bju\bus\bst\bt u\bus\bse\be \"\b\"a\bau\but\bto\bo\"\b\" *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/a\bau\bux\bx_\b_/\b/a\bal\bll\blo\boc\bca\bat\bti\bin\bng\bg_\b_h\bha\ban\bnd\bdl\ble\ber\br.\b.h\bhp\bpp\bp:\b:3\b31\b16\b6 *\b**\b**\b* |\n+|\tprivate: |\n+| |\n+|\t\tHandler handler; |\n+|\t\thandler_storage* storage; |\n+|#ifndef BOOST_NO_EXCEPTIONS |\n+|\t\terror_handler_interface* error_handler; |\n+|#endif |\n+|\t}; |\n+| |\n+|\ttemplate |\n+|\taux::allocating_handler |\n+|\tmake_handler(Handler handler |\n+|\t\t, handler_storage& storage |\n+|\t\t, error_handler_interface& err_handler) |\n+|\t{ |\n+|\t\treturn aux::allocating_handler( |\n+|\t\t\tstd::forward(handler), &storage, &err_handler); |\n+|\t} |\n+| |\n+|template |\n+|\tstruct handler |\n+|\t{ |\n+|\t\texplicit handler(std::shared_ptr p) : ptr_(std::move(p)) {} |\n+| |\n+|\t\tstd::shared_ptr ptr_; |\n+| |\n+|\t\ttemplate |\n+|\t\tvoid operator()(A&&... a) |\n+|\t\t{ |\n+|#ifdef BOOST_NO_EXCEPTIONS |\n+|\t\t\t(ptr_.get()->*Handler)(std::forward(a)...); |\n+|#else |\n+|\t\t\ttry |\n+|\t\t\t{ |\n+|\t\t\t\t(ptr_.get()->*Handler)(std::forward(a)...); |\n+|\t\t\t} |\n+|\t\t\tcatch (system_error const& e) |\n+|\t\t\t{ |\n+|\t\t\t\t(ptr_.get()->*ErrorHandler)(e.code()); |\n+|\t\t\t} |\n+|\t\t\tcatch (std::exception const& e) |\n+|\t\t\t{ |\n+|\t\t\t\t(ptr_.get()->*ExceptHandler)(e); |\n+|_\b\t_\b\t_\b\t_\b}_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |relevance\u00a00|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bu_\bx_\b__\b/ |ensure the alignment is good here |\n |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bp_\bo_\bo_\bl_\b._\bh_\bp_\bp_\b:_\b4_\b9_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |*\b**\b**\b**\b**\b* e\ben\bns\bsu\bur\bre\be t\bth\bhe\be a\bal\bli\big\bgn\bnm\bme\ben\bnt\bt i\bis\bs g\bgo\boo\bod\bd h\bhe\ber\bre\be *\b**\b**\b**\b**\b* |\n |*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/a\bau\bux\bx_\b_/\b/p\bpo\boo\bol\bl.\b.h\bhp\bpp\bp:\b:4\b49\b9 *\b**\b**\b* |\n |POSSIBILITY OF SUCH DAMAGE. |\n | |\n |*/ |\n@@ -12491,14 +12591,69 @@\n |template |\n |using object_pool = boost::object_pool; |\n | |\n |} |\n |} |\n | |\n |_\b#_\be_\bn_\bd_\bi_\bf_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|relevance\u00a00|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bu_\bx_\b__\b/ |it would be nice to make this private |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bu_\bt_\bp_\b__\bs_\bt_\br_\be_\ba_\bm_\b._\bh_\bp_\bp_\b:_\b6_\b9_\b3_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* i\bit\bt w\bwo\bou\bul\bld\bd b\bbe\be n\bni\bic\bce\be t\bto\bo m\bma\bak\bke\be t\bth\bhi\bis\bs p\bpr\bri\biv\bva\bat\bte\be *\b**\b**\b**\b**\b* |\n+|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/a\bau\bux\bx_\b_/\b/u\but\btp\bp_\b_s\bst\btr\bre\bea\bam\bm.\b.h\bhp\bpp\bp:\b:6\b69\b93\b3 *\b**\b**\b* |\n+|bool consume_incoming_data( |\n+|\t\tutp_header const* ph, std::uint8_t const* ptr, int payload_size, time_point now); |\n+|\tvoid update_mtu_limits(); |\n+|\tvoid experienced_loss(std::uint32_t seq_nr, time_point now); |\n+| |\n+|\tvoid send_deferred_ack(); |\n+|\tvoid socket_drained(); |\n+| |\n+|\tvoid set_userdata(utp_stream* s) { m_userdata = s; } |\n+|\tvoid abort(); |\n+|\tudp::endpoint remote_endpoint() const; |\n+| |\n+|\tstd::uint16_t receive_id() const { return m_recv_id; } |\n+|\tbool match(udp::endpoint const& ep, std::uint16_t id) const; |\n+| |\n+|\t// non-copyable |\n+|\tutp_socket_impl(utp_socket_impl const&) = delete; |\n+|\tutp_socket_impl const& operator=(utp_socket_impl const&) = delete; |\n+| |\n+|\t// The underlying UDP socket this uTP socket is bound to |\n+|std::weak_ptr m_sock; |\n+| |\n+|\tvoid add_write_buffer(void const* buf, int len); |\n+|\tvoid add_read_buffer(void* buf, int len); |\n+| |\n+|\tint send_delay() const { return m_send_delay; } |\n+|\tint recv_delay() const { return m_recv_delay; } |\n+| |\n+|\tvoid issue_read(); |\n+|\tvoid issue_write(); |\n+|\tvoid subscribe_writeable(); |\n+| |\n+|\tbool check_fin_sent() const; |\n+| |\n+|\tvoid do_connect(tcp::endpoint const& ep); |\n+| |\n+|\tstd::size_t read_some(bool const clear_buffers, error_code& ec); |\n+|\tstd::size_t write_some(bool const clear_buffers); // Warning: non-blocking |\n+|\tint receive_buffer_size() const { return m_receive_buffer_size; } |\n+| |\n+|\tbool null_buffers() const { return m_null_buffers; } |\n+| |\n+|private: |\n+| |\n+|\t// it's important that these match the enums in performance_counters for |\n+|\t// num_utp_idle etc. |\n+|\tenum class state_t { |\n+|\t\t// not yet connected |\n+|\t\tnone, |\n+|\t\t// sent a syn packet, not received any acks |\n+|_\b\t_\b\t_\bs_\by_\bn_\b__\bs_\be_\bn_\bt_\b,_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |relevance\u00a00|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bu_\bx_\b__\b/ |remove this constructor. Don't support \"uninitialized\" trees. This also requires not constructing these for pad-files and small |\n |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bm_\be_\br_\bk_\bl_\be_\b__\bt_\br_\be_\be_\b._\bh_\bp_\bp_\b:_\b8_\b5_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bf_\bi_\bl_\be_\bs_\b _\ba_\bs_\b _\bw_\be_\bl_\bl_\b._\b _\bS_\bo_\b,_\b _\ba_\b _\bs_\bp_\ba_\br_\bs_\be_\b _\bh_\ba_\bs_\bh_\b _\bl_\bi_\bs_\bt_\b _\bi_\bn_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |*\b**\b**\b**\b**\b* r\bre\bem\bmo\bov\bve\be t\bth\bhi\bis\bs c\bco\bon\bns\bst\btr\bru\buc\bct\bto\bor\br.\b. D\bDo\bon\bn'\b't\bt s\bsu\bup\bpp\bpo\bor\brt\bt \"\b\"u\bun\bni\bin\bni\bit\bti\bia\bal\bli\biz\bze\bed\bd\"\b\" t\btr\bre\bee\bes\bs.\b. T\bTh\bhi\bis\bs a\bal\bls\bso\bo r\bre\beq\bqu\bui\bir\bre\bes\bs n\bno\bot\bt c\bco\bon\bns\bst\btr\bru\buc\bct\bti\bin\bng\bg t\bth\bhe\bes\bse\be f\bfo\bor\br p\bpa\bad\bd-\b-f\bfi\bil\ble\bes\bs a\ban\bnd\bd s\bsm\bma\bal\bll\bl f\bfi\bil\ble\bes\bs a\bas\bs w\bwe\bel\bll\bl.\b. S\bSo\bo,\b, a\ba s\bsp\bpa\bar\brs\bse\be h\bha\bas\bsh\bh l\bli\bis\bst\bt i\bin\bn |\n |t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo *\b**\b**\b**\b**\b* |\n |*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/a\bau\bux\bx_\b_/\b/m\bme\ber\brk\bkl\ble\be_\b_t\btr\bre\bee\be.\b.h\bhp\bpp\bp:\b:8\b85\b5 *\b**\b**\b* |\n |// The invariant of the tree is that all interior nodes (i.e. all but the very |\n |// bottom leaf nodes, representing block hashes) are either set and valid, or |\n@@ -12599,162 +12754,7 @@\n | |\n |\t\t// we don't have any hashes in this tree. m_tree should be empty |\n |\t\t// an empty tree still always have the root hash (available as root()) |\n |\t\tempty_tree, |\n | |\n |\t\t// in this mode, m_tree represents the full tree, including padding. |\n |_\b\t_\b\t_\bf_\bu_\bl_\bl_\b__\bt_\br_\be_\be_\b,_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bu_\bx_\b__\b/ |it would be nice to not have this be part of session_interface |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be_\b._\bh_\bp_\bp_\b:_\b2_\b1_\b2_\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* i\bit\bt w\bwo\bou\bul\bld\bd b\bbe\be n\bni\bic\bce\be t\bto\bo n\bno\bot\bt h\bha\bav\bve\be t\bth\bhi\bis\bs b\bbe\be p\bpa\bar\brt\bt o\bof\bf s\bse\bes\bss\bsi\bio\bon\bn_\b_i\bin\bnt\bte\ber\brf\bfa\bac\bce\be *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/a\bau\bux\bx_\b_/\b/s\bse\bes\bss\bsi\bio\bon\bn_\b_i\bin\bnt\bte\ber\brf\bfa\bac\bce\be.\b.h\bhp\bpp\bp:\b:2\b21\b12\b2 *\b**\b**\b* |\n-|virtual void deferred_submit_jobs() = 0; |\n-| |\n-|\t\tvirtual std::uint16_t listen_port() const = 0; |\n-|\t\tvirtual std::uint16_t ssl_listen_port() const = 0; |\n-| |\n-|\t\tvirtual int listen_port(aux::transport ssl, address const& local_addr) = 0; |\n-| |\n-|\t\tvirtual void for_each_listen_socket(std::function f) = 0; |\n-| |\n-|\t\t// ask for which interface and port to bind outgoing peer connections on |\n-|\t\tvirtual tcp::endpoint bind_outgoing_socket(socket_type& s, address const& |\n-|\t\t\tremote_address, error_code& ec) const = 0; |\n-|\t\tvirtual bool verify_bound_address(address const& addr, bool utp |\n-|\t\t\t, error_code& ec) = 0; |\n-| |\n-|#ifndef TORRENT_DISABLE_MUTABLE_TORRENTS |\n-|\t\tvirtual std::vector> find_collection( |\n-|\t\t\tstd::string const& collection) const = 0; |\n-|#endif |\n-| |\n-|virtual proxy_settings proxy() const = 0; |\n-| |\n-|#if TORRENT_USE_I2P |\n-|\t\tvirtual char const* i2p_session() const = 0; |\n-|\t\tvirtual std::string const& local_i2p_endpoint() const = 0; |\n-|#endif |\n-| |\n-|\t\tvirtual void prioritize_connections(std::weak_ptr t) = 0; |\n-| |\n-|\t\tvirtual void trigger_auto_manage() = 0; |\n-| |\n-|\t\tvirtual void apply_settings_pack(std::shared_ptr pack) = 0; |\n-|\t\tvirtual session_settings const& settings() const = 0; |\n-| |\n-|\t\tvirtual void queue_tracker_request(tracker_request req |\n-|\t\t\t, std::weak_ptr c) = 0; |\n-| |\n-|\t\t// peer-classes |\n-|\t\tvirtual void set_peer_classes(peer_class_set* s, address const& a, socket_type_t st) = 0; |\n-|\t\tvirtual peer_class_pool const& peer_classes() const = 0; |\n-|\t\tvirtual peer_class_pool& peer_classes() = 0; |\n-|\t\tvirtual bool ignore_unchoke_slots_set(peer_class_set const& set) const = 0; |\n-|\t\tvirtual int copy_pertinent_channels(peer_class_set const& set |\n-|\t\t\t, int channel, bandwidth_channel** dst, int m) = 0; |\n-|\t\tvirtual int use_quota_overhead(peer_class_set& set, int amount_down, int amount_up) = 0; |\n-| |\n-|\t\tvirtual bandwidth_manager* get_bandwidth_manager(int channel) = 0; |\n-| |\n-|\t\tvirtual void sent_bytes(int bytes_payload, int bytes_protocol) = 0; |\n-|\t\tvirtual void received_bytes(int bytes_payload, int bytes_protocol) = 0; |\n-|_\b\t_\b\t_\bv_\bi_\br_\bt_\bu_\ba_\bl_\b _\bv_\bo_\bi_\bd_\b _\bt_\br_\ba_\bn_\bc_\bi_\be_\bv_\be_\b__\bi_\bp_\b__\bp_\ba_\bc_\bk_\be_\bt_\b(_\bi_\bn_\bt_\b _\bb_\by_\bt_\be_\bs_\b,_\b _\bb_\bo_\bo_\bl_\b _\bi_\bp_\bv_\b6_\b)_\b _\b=_\b _\b0_\b;_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bu_\bx_\b__\b/ |it would be nice to make this private |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bu_\bt_\bp_\b__\bs_\bt_\br_\be_\ba_\bm_\b._\bh_\bp_\bp_\b:_\b6_\b9_\b3_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* i\bit\bt w\bwo\bou\bul\bld\bd b\bbe\be n\bni\bic\bce\be t\bto\bo m\bma\bak\bke\be t\bth\bhi\bis\bs p\bpr\bri\biv\bva\bat\bte\be *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/a\bau\bux\bx_\b_/\b/u\but\btp\bp_\b_s\bst\btr\bre\bea\bam\bm.\b.h\bhp\bpp\bp:\b:6\b69\b93\b3 *\b**\b**\b* |\n-|bool consume_incoming_data( |\n-|\t\tutp_header const* ph, std::uint8_t const* ptr, int payload_size, time_point now); |\n-|\tvoid update_mtu_limits(); |\n-|\tvoid experienced_loss(std::uint32_t seq_nr, time_point now); |\n-| |\n-|\tvoid send_deferred_ack(); |\n-|\tvoid socket_drained(); |\n-| |\n-|\tvoid set_userdata(utp_stream* s) { m_userdata = s; } |\n-|\tvoid abort(); |\n-|\tudp::endpoint remote_endpoint() const; |\n-| |\n-|\tstd::uint16_t receive_id() const { return m_recv_id; } |\n-|\tbool match(udp::endpoint const& ep, std::uint16_t id) const; |\n-| |\n-|\t// non-copyable |\n-|\tutp_socket_impl(utp_socket_impl const&) = delete; |\n-|\tutp_socket_impl const& operator=(utp_socket_impl const&) = delete; |\n-| |\n-|\t// The underlying UDP socket this uTP socket is bound to |\n-|std::weak_ptr m_sock; |\n-| |\n-|\tvoid add_write_buffer(void const* buf, int len); |\n-|\tvoid add_read_buffer(void* buf, int len); |\n-| |\n-|\tint send_delay() const { return m_send_delay; } |\n-|\tint recv_delay() const { return m_recv_delay; } |\n-| |\n-|\tvoid issue_read(); |\n-|\tvoid issue_write(); |\n-|\tvoid subscribe_writeable(); |\n-| |\n-|\tbool check_fin_sent() const; |\n-| |\n-|\tvoid do_connect(tcp::endpoint const& ep); |\n-| |\n-|\tstd::size_t read_some(bool const clear_buffers, error_code& ec); |\n-|\tstd::size_t write_some(bool const clear_buffers); // Warning: non-blocking |\n-|\tint receive_buffer_size() const { return m_receive_buffer_size; } |\n-| |\n-|\tbool null_buffers() const { return m_null_buffers; } |\n-| |\n-|private: |\n-| |\n-|\t// it's important that these match the enums in performance_counters for |\n-|\t// num_utp_idle etc. |\n-|\tenum class state_t { |\n-|\t\t// not yet connected |\n-|\t\tnone, |\n-|\t\t// sent a syn packet, not received any acks |\n-|_\b\t_\b\t_\bs_\by_\bn_\b__\bs_\be_\bn_\bt_\b,_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|relevance\u00a00|_\b._\b._\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b/_\ba_\bu_\bx_\b__\b/ |figure out which version of clang this is supported in |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bd_\be_\bp_\br_\be_\bc_\ba_\bt_\be_\bd_\b._\bh_\bp_\bp_\b:_\b4_\b7_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* f\bfi\big\bgu\bur\bre\be o\bou\but\bt w\bwh\bhi\bic\bch\bh v\bve\ber\brs\bsi\bio\bon\bn o\bof\bf c\bcl\bla\ban\bng\bg t\bth\bhi\bis\bs i\bis\bs s\bsu\bup\bpp\bpo\bor\brt\bte\bed\bd i\bin\bn *\b**\b**\b**\b**\b* |\n-|*\b**\b**\b* .\b..\b./\b/i\bin\bnc\bcl\blu\bud\bde\be/\b/l\bli\bib\bbt\bto\bor\brr\bre\ben\bnt\bt/\b/a\bau\bux\bx_\b_/\b/d\bde\bep\bpr\bre\bec\bca\bat\bte\bed\bd.\b.h\bhp\bpp\bp:\b:4\b47\b7 *\b**\b**\b* |\n-|CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |\n-|ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |\n-|POSSIBILITY OF SUCH DAMAGE. |\n-| |\n-|*/ |\n-| |\n-|#ifndef TORRENT_DEPRECATED_HPP_INCLUDED |\n-|#define TORRENT_DEPRECATED_HPP_INCLUDED |\n-| |\n-|#if !defined TORRENT_BUILDING_LIBRARY |\n-|# define TORRENT_DEPRECATED [[deprecated]] |\n-|#else |\n-|# define TORRENT_DEPRECATED |\n-|#endif |\n-| |\n-|#if defined __clang__ |\n-| |\n-|// ====== CLANG ======== |\n-| |\n-|# if !defined TORRENT_BUILDING_LIBRARY |\n-|# define TORRENT_DEPRECATED_ENUM __attribute__ ((deprecated)) |\n-|# endif |\n-| |\n-|#elif defined __GNUC__ |\n-| |\n-|// ======== GCC ======== |\n-| |\n-|// deprecation markup is only enabled when libtorrent |\n-|// headers are included by clients, not while building |\n-|// libtorrent itself |\n-|# if __GNUC__ >= 6 && !defined TORRENT_BUILDING_LIBRARY |\n-|# define TORRENT_DEPRECATED_ENUM __attribute__ ((deprecated)) |\n-|# endif |\n-| |\n-|#endif |\n-| |\n-|#ifndef TORRENT_DEPRECATED_ENUM |\n-|#define TORRENT_DEPRECATED_ENUM |\n-|#endif |\n-| |\n-|_\b#_\be_\bn_\bd_\bi_\bf_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n"}]}]}]}]}, {"source1": "python3-libtorrent_2.0.11-1_armhf.deb", "source2": "python3-libtorrent_2.0.11-1_armhf.deb", "unified_diff": null, "details": [{"source1": "file list", "source2": "file list", "unified_diff": "@@ -1,3 +1,3 @@\n -rw-r--r-- 0 0 0 4 2025-01-28 14:33:12.000000 debian-binary\n -rw-r--r-- 0 0 0 1016 2025-01-28 14:33:12.000000 control.tar.xz\n--rw-r--r-- 0 0 0 643188 2025-01-28 14:33:12.000000 data.tar.xz\n+-rw-r--r-- 0 0 0 643184 2025-01-28 14:33:12.000000 data.tar.xz\n"}, {"source1": "control.tar.xz", "source2": "control.tar.xz", "unified_diff": null, "details": [{"source1": "control.tar", "source2": "control.tar", "unified_diff": null, "details": [{"source1": "./md5sums", "source2": "./md5sums", "unified_diff": null, "details": [{"source1": "./md5sums", "source2": "./md5sums", "comments": ["Files differ"], "unified_diff": null}]}]}]}, {"source1": "data.tar.xz", "source2": "data.tar.xz", "unified_diff": null, "details": [{"source1": "data.tar", "source2": "data.tar", "unified_diff": null, "details": [{"source1": "file list", "source2": "file list", "unified_diff": "@@ -1,15 +1,15 @@\n drwxr-xr-x 0 root (0) root (0) 0 2025-01-28 14:33:12.000000 ./\n drwxr-xr-x 0 root (0) root (0) 0 2025-01-28 14:33:12.000000 ./usr/\n drwxr-xr-x 0 root (0) root (0) 0 2025-01-28 14:33:12.000000 ./usr/lib/\n drwxr-xr-x 0 root (0) root (0) 0 2025-01-28 14:33:12.000000 ./usr/lib/python3/\n drwxr-xr-x 0 root (0) root (0) 0 2025-01-28 14:33:12.000000 ./usr/lib/python3/dist-packages/\n -rw-r--r-- 0 root (0) root (0) 4188668 2025-01-28 14:33:12.000000 ./usr/lib/python3/dist-packages/libtorrent.cpython-313-arm-linux-gnueabihf.so\n drwxr-xr-x 0 root (0) root (0) 0 2025-01-28 14:33:12.000000 ./usr/lib/python3/dist-packages/libtorrent.egg-info/\n--rw-r--r-- 0 root (0) root (0) 274 2025-01-28 14:33:12.000000 ./usr/lib/python3/dist-packages/libtorrent.egg-info/PKG-INFO\n+-rw-r--r-- 0 root (0) root (0) 273 2025-01-28 14:33:12.000000 ./usr/lib/python3/dist-packages/libtorrent.egg-info/PKG-INFO\n -rw-r--r-- 0 root (0) root (0) 1 2025-01-28 14:33:12.000000 ./usr/lib/python3/dist-packages/libtorrent.egg-info/dependency_links.txt\n -rw-r--r-- 0 root (0) root (0) 17 2025-01-28 14:33:12.000000 ./usr/lib/python3/dist-packages/libtorrent.egg-info/top_level.txt\n drwxr-xr-x 0 root (0) root (0) 0 2025-01-28 14:33:12.000000 ./usr/share/\n drwxr-xr-x 0 root (0) root (0) 0 2025-01-28 14:33:12.000000 ./usr/share/doc/\n drwxr-xr-x 0 root (0) root (0) 0 2025-01-28 14:33:12.000000 ./usr/share/doc/python3-libtorrent/\n -rw-r--r-- 0 root (0) root (0) 2274 2025-01-28 14:33:12.000000 ./usr/share/doc/python3-libtorrent/changelog.Debian.gz\n -rw-r--r-- 0 root (0) root (0) 33511 2025-01-28 10:57:42.000000 ./usr/share/doc/python3-libtorrent/changelog.gz\n"}, {"source1": "./usr/lib/python3/dist-packages/libtorrent.egg-info/PKG-INFO", "source2": "./usr/lib/python3/dist-packages/libtorrent.egg-info/PKG-INFO", "unified_diff": "@@ -2,10 +2,10 @@\n Name: libtorrent\n Version: 2.0.11\n Summary: Python bindings for libtorrent-rasterbar\n Home-page: http://libtorrent.org\n Author: Arvid Norberg\n Author-email: arvid@libtorrent.org\n License: BSD\n-Platform: Linux-aarch64\n+Platform: Linux-armv7l\n \n Python bindings for libtorrent-rasterbar\n"}]}]}]}]}