{"diffoscope-json-version": 1, "source1": "/srv/reproducible-results/rbuild-debian/r-b-build.d6ai68Cv/b1/libtorrent-rasterbar_2.0.11-1_amd64.changes", "source2": "/srv/reproducible-results/rbuild-debian/r-b-build.d6ai68Cv/b2/libtorrent-rasterbar_2.0.11-1_amd64.changes", "unified_diff": null, "details": [{"source1": "Files", "source2": "Files", "unified_diff": "@@ -1,7 +1,7 @@\n \n 1e537d9298a8b265e97c6e12e4bbe431 366364 libdevel optional libtorrent-rasterbar-dev_2.0.11-1_amd64.deb\n- efaff4455dd9910bbbba012b22c5bc29 1671956 doc optional libtorrent-rasterbar-doc_2.0.11-1_all.deb\n+ 32197e3de3ac46707ba986bf70c59c5e 1669580 doc optional libtorrent-rasterbar-doc_2.0.11-1_all.deb\n eb060badd0fe91df76ba8d1a61170f8a 51344936 debug optional libtorrent-rasterbar2.0t64-dbgsym_2.0.11-1_amd64.deb\n 59d055cbeaf20048e371152f772719a8 1671968 libs optional libtorrent-rasterbar2.0t64_2.0.11-1_amd64.deb\n 5549fa91f34fc81a0da7bf1973c43a2b 13346400 debug optional python3-libtorrent-dbgsym_2.0.11-1_amd64.deb\n f0538e61618c44d7c60e7e17386381f3 710056 python optional python3-libtorrent_2.0.11-1_amd64.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 1668132 2025-01-28 14:33:12.000000 data.tar.xz\n+-rw-r--r-- 0 0 0 1665756 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": "./control", "source2": "./control", "unified_diff": "@@ -1,13 +1,13 @@\n Package: libtorrent-rasterbar-doc\n Source: libtorrent-rasterbar\n Version: 2.0.11-1\n Architecture: all\n Maintainer: Christian Marillat \n-Installed-Size: 5942\n+Installed-Size: 5773\n Section: doc\n Priority: optional\n Multi-Arch: foreign\n Homepage: https://libtorrent.org/\n Description: Documentation for libtorrent-rasterbar\n Bittorrent library by Rasterbar Software (Arvid Norberg).\n libtorrent-rasterbar is a C++ library that aims to be a good alternative to\n"}, {"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": "@@ -78,38 +78,38 @@\n -rw-r--r-- 0 root (0) root (0) 9631 2025-01-28 14:33:12.000000 ./usr/share/doc/libtorrent-rasterbar-doc/html/img/write_disk_buffers.png\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) 27435 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) 88949 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) 50915 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) 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) 102476 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) 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) 56856 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) 129808 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) 55640 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) 16462 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) 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) 1360915 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) 1274790 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-   operator void const* () const = delete;\n-   operator void* () const = delete;\n-   client_data_t& operator= (void const*) = delete;\n-   client_data_t& operator= (void*) = delete;\n-\n-   template <typename T, typename U  = typename std::enable_if<std::is_pointer<T>::value>::type>\n-};\n-
\n-[report issue]
\n-

client_data_t()

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

construct a nullptr client data

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

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

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

we don't allow type-unsafe operations

\n-[report issue]
\n-
\n-
\n+[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
  • ti - the immutable info-dict part of the torrent
  • \n@@ -399,14 +357,56 @@\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+   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+
\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+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+

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- 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- client_data_t& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (void*) = 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-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-client_data_t& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (void*) = delete;\n-we don't allow type-unsafe operations\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 [_\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+ 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+\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+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 _\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", "comments": ["Ordering differences only"], "unified_diff": "@@ -2835,27 +2835,27 @@\n

posted in response to a call to session::dht_live_nodes(). It contains the\n live nodes from the DHT routing table of one of the DHT nodes running\n locally.

\n
\n struct dht_live_nodes_alert final : alert\n {\n    std::string message () const override;\n-   int num_nodes () const;\n    std::vector<std::pair<sha1_hash, udp::endpoint>> nodes () const;\n+   int num_nodes () const;\n \n    static constexpr alert_category_t static_category  = alert_category::dht;\n    sha1_hash node_id;\n };\n 
\n \n [report issue]
\n

nodes() num_nodes()

\n
\n-int num_nodes () const;\n std::vector<std::pair<sha1_hash, udp::endpoint>> nodes () const;\n+int num_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@@ -2884,32 +2884,32 @@\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_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

num_samples() samples()

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

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

\n [report issue]
\n
\n

num_nodes()

\n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2199,24 +2199,24 @@\n *\b**\b**\b**\b**\b**\b* d\bdh\bht\bt_\b_l\bli\biv\bve\be_\b_n\bno\bod\bde\bes\bs_\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 posted in response to a call to session::dht_live_nodes(). It contains the live\n nodes from the DHT routing table of one of the DHT nodes running locally.\n struct dht_live_nodes_alert final : alert\n {\n std::string m\bme\bes\bss\bsa\bag\bge\be () const override;\n- int n\bnu\bum\bm_\b_n\bno\bod\bde\bes\bs () const;\n std::vector> n\bno\bod\bde\bes\bs () const;\n+ int n\bnu\bum\bm_\b_n\bno\bod\bde\bes\bs () 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::dht;\n sha1_hash node_id;\n };\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) 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 std::vector> n\bno\bod\bde\bes\bs () const;\n+int n\bnu\bum\bm_\b_n\bno\bod\bde\bes\bs () const;\n the number of nodes in the routing table and the actual nodes.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n node_id\n the local DHT node's node-ID this routing table belongs to\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_h\bhe\bea\bad\bde\ber\br_\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@@ -2237,30 +2237,30 @@\n *\b**\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_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 posted as a response to a call to session::dht_sample_infohashes() with the\n information from the DHT response message.\n struct dht_sample_infohashes_alert final : alert\n {\n std::string m\bme\bes\bss\bsa\bag\bge\be () const override;\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+ int n\bnu\bum\bm_\b_s\bsa\bam\bmp\bpl\ble\bes\bs () const;\n int n\bnu\bum\bm_\b_n\bno\bod\bde\bes\bs () const;\n std::vector> n\bno\bod\bde\bes\bs () 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 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* 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+int n\bnu\bum\bm_\b_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 The total number of nodes returned by nodes().\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\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": "@@ -30,23 +30,23 @@\n \n

home

\n \n [report issue]
\n

bdecode_node

\n

Declared in "libtorrent/bdecode.hpp"

\n

Sometimes it's important to get a non-owning reference to the root node (\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+

There are 5 different types of nodes, see type_t.

\n
\n struct bdecode_node\n {\n    bdecode_node () = default;\n-   bdecode_node (bdecode_node const&);\n    bdecode_node (bdecode_node&&) noexcept;\n    bdecode_node& operator= (bdecode_node const&) &;\n    bdecode_node& operator= (bdecode_node&&) & = default;\n+   bdecode_node (bdecode_node const&);\n    type_t type () const noexcept;\n    explicit operator bool () const noexcept;\n    bdecode_node non_owning () const;\n-   std::ptrdiff_t data_offset () const noexcept;\n    span<char const> data_section () const noexcept;\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-   int list_size () const;\n+   std::ptrdiff_t data_offset () const noexcept;\n    string_view list_string_value_at (int i\n       , string_view default_val = string_view()) 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-   string_view dict_find_string_value (string_view key\n-      , string_view default_value = string_view()) const;\n-   std::int64_t dict_find_int_value (string_view key\n+   bdecode_node list_at (int i) 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 dict_find (string_view key) const;\n+   bdecode_node dict_find_dict (string_view key) const;\n    std::pair<string_view, bdecode_node> dict_at (int i) const;\n+   int dict_size () const;\n    bdecode_node dict_find_string (string_view key) const;\n-   bdecode_node dict_find_dict (string_view key) const;\n+   std::pair<bdecode_node, bdecode_node> dict_at_node (int i) const;\n    bdecode_node dict_find_list (string_view key) const;\n+   std::int64_t dict_find_int_value (string_view key\n+      , std::int64_t default_val = 0) const;\n    bdecode_node dict_find_int (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+   string_view string_value () const;\n    char const* string_ptr () const;\n    std::ptrdiff_t string_offset () const;\n-   string_view string_value () 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@@ -116,33 +116,33 @@\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+[report issue]
\n+
\n+

operator=() bdecode_node()

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

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

\n [report issue]
\n
\n

type()

\n
\n type_t type () const noexcept;\n 
\n-

the type of this node. See type_t.

\n+

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@@ -150,71 +150,71 @@\n
\n

non_owning()

\n
\n bdecode_node non_owning () const;\n 
\n

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

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

data_offset() data_section()

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

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

\n
\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-int list_size () const;\n string_view list_string_value_at (int i\n       , string_view default_val = string_view()) const;\n+bdecode_node list_at (int i) const;\n+int list_size () const;\n+std::int64_t list_int_value_at (int i\n+      , std::int64_t default_val = 0) const;\n 
\n

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

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

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

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

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

\n
\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-string_view dict_find_string_value (string_view key\n-      , string_view default_value = string_view()) const;\n-std::int64_t dict_find_int_value (string_view key\n-      , std::int64_t default_val = 0) const;\n+bdecode_node dict_find_dict (string_view key) const;\n std::pair<string_view, bdecode_node> dict_at (int i) const;\n+int dict_size () const;\n bdecode_node dict_find_string (string_view key) const;\n-bdecode_node dict_find_dict (string_view key) const;\n+std::pair<bdecode_node, bdecode_node> dict_at_node (int i) const;\n bdecode_node dict_find_list (string_view key) const;\n+std::int64_t dict_find_int_value (string_view key\n+      , std::int64_t default_val = 0) const;\n bdecode_node dict_find_int (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@@ -229,25 +229,25 @@\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_offset() string_length() string_ptr()

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

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

\n
\n-int string_length () const;\n+string_view string_value () const;\n char const* string_ptr () const;\n std::ptrdiff_t string_offset () const;\n-string_view string_value () 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@@ -345,18 +345,18 @@\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-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 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", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,25 +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 * _\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 _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b=_\b(_\b)_\b _\bb_\bd_\be_\bc_\bo_\bd_\be_\b__\bn_\bo_\bd_\be_\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__\bo_\bf_\bf_\bs_\be_\bt_\b(_\b)_\b _\bd_\ba_\bt_\ba_\b__\bs_\be_\bc_\bt_\bi_\bo_\bn_\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__\bi_\bn_\bt_\b__\bv_\ba_\bl_\bu_\be_\b(_\b)_\b _\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__\bf_\bi_\bn_\bd_\b__\bi_\bn_\bt_\b(_\b)\n- _\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__\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__\bd_\bi_\bc_\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__\bs_\bi_\bz_\be_\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(_\b)_\b _\bd_\bi_\bc_\bt_\b__\bf_\bi_\bn_\bd_\b__\bd_\bi_\bc_\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+ _\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)_\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__\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__\bl_\bi_\bs_\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__\bv_\ba_\bl_\bu_\be_\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__\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__\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__\bo_\bf_\bf_\bs_\be_\bt_\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- 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 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 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- 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- int l\bli\bis\bst\bt_\b_s\bsi\biz\bze\be () const;\n+ std::ptrdiff_t d\bda\bat\bta\ba_\b_o\bof\bff\bfs\bse\bet\bt () const noexcept;\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 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- 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 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+ bdecode_node l\bli\bis\bst\bt_\b_a\bat\bt (int i) 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 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::pair d\bdi\bic\bct\bt_\b_a\bat\bt (int i) 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_\b_d\bdi\bic\bct\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 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::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 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 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+ 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 std::ptrdiff_t s\bst\btr\bri\bin\bng\bg_\b_o\bof\bff\bfs\bse\bet\bt () 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 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@@ -82,19 +82,19 @@\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-b\bbd\bde\bec\bco\bod\bde\be_\b_n\bno\bod\bde\be (bdecode_node const&);\n+*\b**\b**\b**\b**\b* o\bop\bpe\ber\bra\bat\bto\bor\br=\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 (bdecode_node&&) noexcept;\n bdecode_node& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (bdecode_node const&) &;\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 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@@ -103,50 +103,50 @@\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_o\bof\bff\bfs\bse\bet\bt(\b()\b) d\bda\bat\bta\ba_\b_s\bse\bec\bct\bti\bio\bon\bn(\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+*\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-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-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_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 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 l\bli\bis\bst\bt_\b_a\bat\bt (int i) 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 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_a\bat\bt(\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(\b()\b) d\bdi\bic\bct\bt_\b_a\bat\bt_\b_n\bno\bod\bde\be\n-(\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) 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_f\bfi\bin\bnd\bd_\b_l\bli\bis\bst\bt\n-(\b()\b) d\bdi\bic\bct\bt_\b_s\bsi\biz\bze\be(\b()\b) *\b**\b**\b**\b**\b*\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_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) 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)\n+d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd_\b_i\bin\bnt\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_a\bat\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)\n+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_l\bli\bis\bst\bt(\b()\b) *\b**\b**\b**\b**\b*\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-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 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+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::pair d\bdi\bic\bct\bt_\b_a\bat\bt (int i) 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_\b_d\bdi\bic\bct\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 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::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 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 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_v\bva\bal\blu\bue\be(\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) *\b**\b**\b**\b**\b*\n-int s\bst\btr\bri\bin\bng\bg_\b_l\ble\ben\bng\bgt\bth\bh () const;\n+*\b**\b**\b**\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_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) *\b**\b**\b**\b**\b*\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 std::ptrdiff_t s\bst\btr\bri\bin\bng\bg_\b_o\bof\bff\bfs\bse\bet\bt () 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 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,18 +214,18 @@\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-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 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"}]}, {"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,15 +34,15 @@\n

    \n
  • entry\n
  • \n@@ -69,41 +69,41 @@\n

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

    \n
    \n class entry\n {\n    data_type type () const;\n-   entry (preformatted_type);\n-   entry (integer_type);\n+   entry (span<char const>);\n    entry (list_type);\n    entry (dictionary_type);\n-   entry (span<char const>);\n+   entry (preformatted_type);\n+   entry (integer_type);\n    entry (U v);\n    entry (data_type t);\n    entry (bdecode_node const& n);\n+   entry& operator= (list_type) &;\n+   entry& operator= (entry const&) &;\n    entry& operator= (dictionary_type) &;\n-   entry& operator= (span<char const>) &;\n    entry& operator= (integer_type) &;\n-   entry& operator= (entry const&) &;\n-   entry& operator= (list_type) &;\n    entry& operator= (entry&&) & noexcept;\n-   entry& operator= (bdecode_node const&) &;\n    entry& operator= (preformatted_type) &;\n+   entry& operator= (bdecode_node const&) &;\n+   entry& operator= (span<char const>) &;\n    entry& operator= (U v) &;\n-   list_type& list ();\n    string_type& string ();\n+   dictionary_type const& dict () const;\n+   integer_type& integer ();\n    list_type const& list () const;\n-   preformatted_type const& preformatted () const;\n+   dictionary_type& dict ();\n    preformatted_type& preformatted ();\n-   integer_type& integer ();\n    string_type const& string () const;\n-   dictionary_type& dict ();\n-   dictionary_type const& dict () const;\n    integer_type const& integer () const;\n+   list_type& list ();\n+   preformatted_type const& preformatted () 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 \n@@ -124,19 +124,19 @@\n data_type type () const;\n 
    \n

    returns the concrete type of the entry

    \n [report issue]
\n
\n

entry()

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

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

\n [report issue]
\n
\n

entry()

\n@@ -152,43 +152,43 @@\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= (list_type) &;\n+entry& operator= (entry const&) &;\n entry& operator= (dictionary_type) &;\n-entry& operator= (span<char const>) &;\n entry& operator= (integer_type) &;\n-entry& operator= (entry const&) &;\n-entry& operator= (list_type) &;\n entry& operator= (entry&&) & noexcept;\n-entry& operator= (bdecode_node const&) &;\n entry& operator= (preformatted_type) &;\n+entry& operator= (bdecode_node const&) &;\n+entry& operator= (span<char const>) &;\n 
\n

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

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

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

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

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

\n
\n-list_type& list ();\n string_type& string ();\n+dictionary_type const& dict () const;\n+integer_type& integer ();\n list_type const& list () const;\n-preformatted_type const& preformatted () const;\n+dictionary_type& dict ();\n preformatted_type& preformatted ();\n-integer_type& integer ();\n string_type const& string () const;\n-dictionary_type& dict ();\n-dictionary_type const& dict () const;\n integer_type const& integer () const;\n+list_type& list ();\n+preformatted_type const& preformatted () 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 _\bs_\bt_\br_\bi_\bn_\bg_\b(_\b)_\b _\bi_\bn_\bt_\be_\bg_\be_\br_\b(_\b)_\b _\bd_\bi_\bc_\bt_\b(_\b)_\b _\bp_\br_\be_\bf_\bo_\br_\bm_\ba_\bt_\bt_\be_\bd_\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 _\bd_\bi_\bc_\bt_\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 * _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b<_\b<_\b(_\b)\n * _\bb_\be_\bn_\bc_\bo_\bd_\be_\b(_\b)\n@@ -35,41 +35,41 @@\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 data_type t\bty\byp\bpe\be () const;\n- e\ben\bnt\btr\bry\by (preformatted_type);\n- e\ben\bnt\btr\bry\by (integer_type);\n+ e\ben\bnt\btr\bry\by (span);\n e\ben\bnt\btr\bry\by (list_type);\n e\ben\bnt\btr\bry\by (dictionary_type);\n- e\ben\bnt\btr\bry\by (span);\n+ e\ben\bnt\btr\bry\by (preformatted_type);\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= (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= (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= (entry 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= (entry&&) & noexcept;\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= (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= (span) &;\n entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (U v) &;\n- list_type& l\bli\bis\bst\bt ();\n string_type& s\bst\btr\bri\bin\bng\bg ();\n+ dictionary_type const& d\bdi\bic\bct\bt () const;\n+ integer_type& i\bin\bnt\bte\beg\bge\ber\br ();\n list_type const& l\bli\bis\bst\bt () const;\n- preformatted_type const& p\bpr\bre\bef\bfo\bor\brm\bma\bat\btt\bte\bed\bd () const;\n+ dictionary_type& d\bdi\bic\bct\bt ();\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 string_type const& s\bst\btr\bri\bin\bng\bg () const;\n- dictionary_type& d\bdi\bic\bct\bt ();\n- dictionary_type const& d\bdi\bic\bct\bt () const;\n integer_type const& i\bin\bnt\bte\beg\bge\ber\br () const;\n+ list_type& l\bli\bis\bst\bt ();\n+ preformatted_type const& p\bpr\bre\bef\bfo\bor\brm\bma\bat\btt\bte\bed\bd () 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 \n@@ -85,52 +85,52 @@\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 [_\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 (preformatted_type);\n-e\ben\bnt\btr\bry\by (integer_type);\n+e\ben\bnt\btr\bry\by (span);\n e\ben\bnt\btr\bry\by (list_type);\n e\ben\bnt\btr\bry\by (dictionary_type);\n-e\ben\bnt\btr\bry\by (span);\n+e\ben\bnt\btr\bry\by (preformatted_type);\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 *\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= (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= (entry 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= (entry&&) & noexcept;\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= (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= (span) &;\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* s\bst\btr\bri\bin\bng\bg(\b()\b) i\bin\bnt\bte\beg\bge\ber\br(\b()\b) d\bdi\bic\bct\bt(\b()\b) p\bpr\bre\bef\bfo\bor\brm\bma\bat\btt\bte\bed\bd(\b()\b) l\bli\bis\bst\bt(\b()\b) *\b**\b**\b**\b**\b*\n-list_type& l\bli\bis\bst\bt ();\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) d\bdi\bic\bct\bt(\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 string_type& s\bst\btr\bri\bin\bng\bg ();\n+dictionary_type const& d\bdi\bic\bct\bt () const;\n+integer_type& i\bin\bnt\bte\beg\bge\ber\br ();\n list_type const& l\bli\bis\bst\bt () const;\n-preformatted_type const& p\bpr\bre\bef\bfo\bor\brm\bma\bat\btt\bte\bed\bd () const;\n+dictionary_type& d\bdi\bic\bct\bt ();\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 string_type const& s\bst\btr\bri\bin\bng\bg () const;\n-dictionary_type& d\bdi\bic\bct\bt ();\n-dictionary_type const& d\bdi\bic\bct\bt () const;\n integer_type const& i\bin\bnt\bte\beg\bge\ber\br () const;\n+list_type& l\bli\bis\bst\bt ();\n+preformatted_type const& p\bpr\bre\bef\bfo\bor\brm\bma\bat\btt\bte\bed\bd () 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,68 +28,122 @@\n 2.0.11\n \n \n

home

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

info_hash_t

\n

Declared in "libtorrent/info_hash.hpp"

\n

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

\n
\n

Note

\n

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

\n
\n
\n struct info_hash_t\n {\n-   explicit info_hash_t (sha256_hash h2) noexcept;\n    explicit info_hash_t (sha1_hash h1) noexcept;\n-   info_hash_t (sha1_hash h1, sha256_hash h2) noexcept;\n    info_hash_t () noexcept = default;\n+   explicit info_hash_t (sha256_hash h2) noexcept;\n+   info_hash_t (sha1_hash h1, sha256_hash h2) noexcept;\n    bool has_v2 () const;\n    bool has_v1 () 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@@ -100,18 +154,18 @@\n    sha1_hash v1;\n    sha256_hash v2;\n };\n 
\n [report issue]
\n

info_hash_t()

\n
\n-explicit info_hash_t (sha256_hash h2) noexcept;\n explicit info_hash_t (sha1_hash h1) noexcept;\n-info_hash_t (sha1_hash h1, sha256_hash h2) noexcept;\n info_hash_t () noexcept = default;\n+explicit info_hash_t (sha256_hash h2) 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@@ -148,68 +202,14 @@\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,56 +689,48 @@\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-\n-\n-[report issue]
\n+[report issue]
\n
\n-
\n-

load_torrent_parsed() load_torrent_buffer() load_torrent_file()

\n-

Declared in "libtorrent/load_torrent.hpp"

\n+
\n+

torrent_peer_equal()

\n+

Declared in "libtorrent/torrent_peer.hpp"

\n
\n-add_torrent_params load_torrent_parsed (\n-   bdecode_node const& torrent_file);\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-add_torrent_params load_torrent_buffer (\n-   span<char const> buffer, load_torrent_limits const& cfg);\n-add_torrent_params load_torrent_buffer (\n-   span<char const> buffer);\n-add_torrent_params load_torrent_parsed (\n-   bdecode_node const& torrent_file, load_torrent_limits const& cfg);\n+inline bool torrent_peer_equal (torrent_peer const* lhs, torrent_peer const* rhs);\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+

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+

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_info const& info);\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 (add_torrent_params const& atp);\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@@ -758,77 +750,109 @@\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+add_torrent_params parse_magnet_uri (string_view uri, error_code& ec);\n void parse_magnet_uri (string_view uri, add_torrent_params& p, error_code& ec);\n 
\n

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

torrent_peer_equal()

\n-

Declared in "libtorrent/torrent_peer.hpp"

\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-inline bool torrent_peer_equal (torrent_peer const* lhs, torrent_peer const* rhs);\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_parsed (\n+   bdecode_node const& torrent_file);\n+add_torrent_params load_torrent_file (\n+   std::string const& filename);\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, load_torrent_limits const& cfg);\n 
\n-[report issue]
\n-
\n-

enum connection_type

\n-

Declared in "libtorrent/peer_connection.hpp"

\n+

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

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

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
namevaluedescription
bittorrent
tcp0 
url_seed
socks51 
http_seed
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@@ -893,69 +917,14 @@\n \n \n \n \n \n \n
paused4 
\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 portmap_transport

\n

Declared in "libtorrent/portmap.hpp"

\n \n \n \n@@ -1006,14 +975,45 @@\n \n \n \n \n \n \n
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

int

\n

Declared in "libtorrent/version.hpp"

\n
\n
version_major
\n
the major, minor and tiny versions of libtorrent
\n@@ -1022,14 +1022,78 @@\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+

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@@ -1256,78 +1320,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-

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
\n \n
\n
\n
\n
\n
\n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,54 +1,96 @@\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_\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 * _\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_\b1_\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- * _\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+ * _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\be_\be_\br_\b__\be_\bq_\bu_\ba_\bl_\b(_\b)\n+ * _\bv_\be_\br_\bs_\bi_\bo_\bn_\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- * _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\be_\be_\br_\b__\be_\bq_\bu_\ba_\bl_\b(_\b)\n- * _\be_\bn_\bu_\bm_\b _\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b__\bt_\by_\bp_\be\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 _\bs_\bo_\bc_\bk_\be_\bt_\b__\bt_\by_\bp_\be_\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 * _\bi_\bn_\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 * _\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+ * _\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+[_\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* 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 (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 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+ 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\bv2\b2 () const;\n bool h\bha\bas\bs_\b_v\bv1\b1 () 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@@ -58,18 +100,18 @@\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 (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 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+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()\b) h\bha\bas\bs_\b_v\bv1\b1(\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\bv2\b2 () const;\n@@ -88,56 +130,14 @@\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,41 +506,37 @@\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* 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_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_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-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_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-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+*\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* 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\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_info const& info);\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 (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 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@@ -555,48 +551,58 @@\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+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 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* 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* 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+*\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_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_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_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, 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, 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 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* 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-|_\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+|_\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@@ -608,28 +614,14 @@\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 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\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@@ -637,23 +629,68 @@\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* 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* 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@@ -821,51 +858,14 @@\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* 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 _\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": "@@ -37,25 +37,25 @@\n
  • generate() generate_buf()
  • \n
  • files()
  • \n
  • set_comment()
  • \n
  • set_creator()
  • \n
  • set_creation_date()
  • \n
  • set_hash()
  • \n
  • set_hash2()
  • \n-
  • add_url_seed() add_http_seed()
  • \n+
  • add_http_seed() add_url_seed()
  • \n
  • add_node()
  • \n
  • add_tracker()
  • \n
  • set_root_cert()
  • \n-
  • set_priv() priv()
  • \n+
  • priv() set_priv()
  • \n
  • num_pieces()
  • \n
  • piece_range()
  • \n
  • file_range()
  • \n
  • file_piece_range()
  • \n
  • total_size()
  • \n-
  • piece_length() piece_size()
  • \n+
  • piece_size() piece_length()
  • \n
  • add_similar_torrent() add_collection()
  • \n \n \n
  • add_files()
  • \n
  • set_piece_hashes()
  • \n \n
    \n@@ -105,17 +105,17 @@\n

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

    \n
    \n struct create_torrent\n {\n+   explicit create_torrent (torrent_info const& ti);\n    explicit create_torrent (file_storage& fs, int piece_size = 0\n       , create_flags_t flags = {});\n-   explicit create_torrent (torrent_info const& ti);\n    std::vector<char> generate_buf () const;\n    entry generate () const;\n    file_storage const& files () const;\n    void set_comment (char const* str);\n    void set_creator (char const* str);\n    void set_creation_date (std::time_t timestamp);\n    void set_hash (piece_index_t index, sha1_hash const& h);\n@@ -123,16 +123,16 @@\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    void set_priv (bool p);\n    bool priv () const;\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@@ -149,17 +149,17 @@\n    static constexpr create_flags_t no_attributes  = 8_bit;\n    static constexpr create_flags_t canonical_files_no_tail_padding  = 9_bit;\n };\n 
    \n [report issue]
    \n

    create_torrent()

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

    The piece_size is the size of each piece in bytes. It must be a\n power of 2 and a minimum of 16 kiB. If a piece size of 0 is\n specified, a piece_size will be set automatically.\n 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@@ -272,18 +272,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_url_seed (string_view url);\n void add_http_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@@ -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-

    set_priv() priv()

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

    priv() set_priv()

    \n
    \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@@ -369,18 +369,18 @@\n [report issue]

    \n
    \n

    total_size()

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

    the total number of bytes of all files and pad files

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

    piece_length() piece_size()

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

    piece_size() piece_length()

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

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

    \n@@ -483,27 +483,27 @@\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+   , 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, error_code& ec);\n+inline void set_piece_hashes (create_torrent& t, std::string const& p);\n void set_piece_hashes (create_torrent& t, std::string const& p\n-   , 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+   , std::function<void(piece_index_t)> const& f);\n void set_piece_hashes (create_torrent& t, std::string const& p\n    , settings_interface const& settings, disk_io_constructor_type disk_io\n    , std::function<void(piece_index_t)> const& f, error_code& ec);\n-inline void set_piece_hashes (create_torrent& t, std::string const& p);\n-inline void set_piece_hashes (create_torrent& t, std::string const& p\n-   , 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, 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", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -8,25 +8,25 @@\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 _\bs_\be_\bt_\b__\bp_\br_\bi_\bv_\b(_\b)_\b _\bp_\br_\bi_\bv_\b(_\b)\n+          o _\bp_\br_\bi_\bv_\b(_\b)_\b _\bs_\be_\bt_\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__\bl_\be_\bn_\bg_\bt_\bh_\b(_\b)_\b _\bp_\bi_\be_\bc_\be_\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     * _\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 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@@ -66,17 +66,17 @@\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    std::vector g\bge\ben\bne\ber\bra\bat\bte\be_\b_b\bbu\buf\bf () const;\n    entry g\bge\ben\bne\ber\bra\bat\bte\be () 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@@ -85,16 +85,16 @@\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    void s\bse\bet\bt_\b_p\bpr\bri\biv\bv (bool p);\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+   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@@ -109,17 +109,17 @@\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@@ -198,15 +198,15 @@\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_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+*\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_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 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@@ -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* 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+*\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 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@@ -263,15 +263,15 @@\n for v2 and hybrid torrents only, the pieces in the specified file, specified as\n delta from the first piece in the file. i.e. the first index is 0.\n [_\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+*\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_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@@ -349,28 +349,28 @@\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+   , 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+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 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+   , 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-   , 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-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"}]}, {"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,364 +28,69 @@\n 2.0.11\n \n \n 

    home

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

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

    \n-

    Example use:

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

    disk_observer

    \n-

    Declared in "libtorrent/disk_observer.hpp"

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

    on_disk()

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

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

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

    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 void set_str (int name, std::string val) = 0;\n-   virtual bool has_val (int name) const = 0;\n-   virtual bool get_bool (int name) const = 0;\n-   virtual std::string const& get_str (int name) const = 0;\n-   virtual int get_int (int name) const = 0;\n-};\n-
    \n-[report issue]
    \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+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

    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@@ -400,18 +105,18 @@\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& operator= (disk_buffer_holder&&) & noexcept;\n    disk_buffer_holder (disk_buffer_holder&&) noexcept;\n-   disk_buffer_holder (disk_buffer_holder const&) = delete;\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@@ -476,14 +181,33 @@\n 
    \n

    bool()

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

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

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

    disk_observer

    \n+

    Declared in "libtorrent/disk_observer.hpp"

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

    on_disk()

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

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

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

    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@@ -529,21 +253,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@@ -595,26 +319,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@@ -871,20 +595,38 @@\n {\n storage_holder (storage_index_t idx, disk_interface& disk_io);\n storage_holder () = default;\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 const&) = delete;\n storage_holder (storage_holder&& rhs) noexcept;\n storage_holder& operator= (storage_holder&& rhs) noexcept;\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_str (int name, std::string val) = 0;\n+   virtual void set_int (int name, int val) = 0;\n+   virtual bool has_val (int name) const = 0;\n+   virtual int get_int (int name) const = 0;\n+   virtual std::string const& get_str (int name) const = 0;\n+   virtual bool get_bool (int name) const = 0;\n+};\n+
    \n [report issue]
    \n
    \n

    file_open_mode_t

    \n

    Declared in "libtorrent/disk_interface.hpp"

    \n
    \n
    read_only
    \n
    open the file for reading only
    \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,30 +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- * _\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 * _\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 o _\bd_\bi_\bs_\bk_\b__\bb_\bu_\bf_\bf_\be_\br_\b__\bh_\bo_\bl_\bd_\be_\br_\b(_\b)\n o _\bd_\bi_\bs_\bk_\b__\bb_\bu_\bf_\bf_\be_\br_\b__\bh_\bo_\bl_\bd_\be_\br_\b(_\b)\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+ * _\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 * _\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@@ -33,334 +32,28 @@\n o _\ba_\bs_\by_\bn_\bc_\b__\bc_\bl_\be_\ba_\br_\b__\bp_\bi_\be_\bc_\be_\b(_\b)\n o _\bu_\bp_\bd_\ba_\bt_\be_\b__\bs_\bt_\ba_\bt_\bs_\b__\bc_\bo_\bu_\bn_\bt_\be_\br_\bs_\b(_\b)\n o _\bg_\be_\bt_\b__\bs_\bt_\ba_\bt_\bu_\bs_\b(_\b)\n o _\ba_\bb_\bo_\br_\bt_\b(_\b)\n o _\bs_\bu_\bb_\bm_\bi_\bt_\b__\bj_\bo_\bb_\bs_\b(_\b)\n o _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bu_\bp_\bd_\ba_\bt_\be_\bd_\b(_\b)\n * _\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bh_\bo_\bl_\bd_\be_\br\n+ * _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be\n * _\bf_\bi_\bl_\be_\b__\bo_\bp_\be_\bn_\b__\bm_\bo_\bd_\be_\b__\bt\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-function to the _\bs_\be_\bs_\bs_\bi_\bo_\bn constructor (via _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs).\n-Example use:\n-struct temp_storage\n-{\n- explicit temp_storage(lt::file_storage const& fs) : m_files(fs) {}\n-\n- lt::span readv(lt::peer_request const r, lt::storage_error& ec)\n-const\n- {\n- auto const i = m_file_data.find(r.piece);\n- if (i == m_file_data.end())\n- {\n- ec.operation = lt::operation_t::file_read;\n- ec.ec = boost::asio::error::eof;\n- return {};\n- }\n- if (int(i->second.size()) <= r.start)\n- {\n- ec.operation = lt::operation_t::file_read;\n- ec.ec = boost::asio::error::eof;\n- return {};\n- }\n- return { i->second.data() + r.start, std::min(r.length, int(i->second.size\n-()) - r.start) };\n- }\n- void writev(lt::span const b, lt::piece_index_t const piece, int\n-const offset)\n- {\n- auto& data = m_file_data[piece];\n- if (data.empty())\n- {\n- // allocate the whole piece, otherwise we'll invalidate the pointers\n- // we have returned back to libtorrent\n- int const size = piece_size(piece);\n- data.resize(std::size_t(size));\n- }\n- TORRENT_ASSERT(offset + b.size() <= int(data.size()));\n- std::memcpy(data.data() + offset, b.data(), std::size_t(b.size()));\n- }\n- lt::sha1_hash hash(lt::piece_index_t const piece\n- , lt::span const block_hashes, lt::storage_error& ec)\n-const\n- {\n- auto const i = m_file_data.find(piece);\n- if (i == m_file_data.end())\n- {\n- ec.operation = lt::operation_t::file_read;\n- ec.ec = boost::asio::error::eof;\n- return {};\n- }\n- if (!block_hashes.empty())\n- {\n- int const piece_size2 = m_files.piece_size2(piece);\n- int const blocks_in_piece2 = m_files.blocks_in_piece2(piece);\n- char const* buf = i->second.data();\n- std::int64_t offset = 0;\n- for (int k = 0; k < blocks_in_piece2; ++k)\n- {\n- lt::hasher256 h2;\n- std::ptrdiff_t const len2 = std::min(lt::default_block_size, int\n-(piece_size2 - offset));\n- h2.update({ buf, len2 });\n- buf += len2;\n- offset += len2;\n- block_hashes[k] = h2.final();\n- }\n- }\n- return lt::hasher(i->second).final();\n- }\n- lt::sha256_hash hash2(lt::piece_index_t const piece, int const offset, lt::\n-storage_error& ec)\n- {\n- auto const i = m_file_data.find(piece);\n- if (i == m_file_data.end())\n- {\n- ec.operation = lt::operation_t::file_read;\n- ec.ec = boost::asio::error::eof;\n- return {};\n- }\n-\n- int const piece_size = m_files.piece_size2(piece);\n-\n- std::ptrdiff_t const len = std::min(lt::default_block_size, piece_size -\n-offset);\n-\n- lt::span b = {i->second.data() + offset, len};\n- return lt::hasher256(b).final();\n- }\n-\n-private:\n- int piece_size(lt::piece_index_t piece) const\n- {\n- int const num_pieces = static_cast((m_files.total_size() +\n-m_files.piece_length() - 1) / m_files.piece_length());\n- return static_cast(piece) < num_pieces - 1\n- ? m_files.piece_length() : static_cast(m_files.total_size() - std::\n-int64_t(num_pieces - 1) * m_files.piece_length());\n- }\n-\n- lt::file_storage const& m_files;\n- std::map> m_file_data;\n-};\n-\n-lt::storage_index_t pop(std::vector& q)\n-{\n- TORRENT_ASSERT(!q.empty());\n- lt::storage_index_t const ret = q.back();\n- q.pop_back();\n- return ret;\n-}\n-\n-struct temp_disk_io final : lt::disk_interface\n- , lt::buffer_allocator_interface\n-{\n- explicit temp_disk_io(lt::io_context& ioc): m_ioc(ioc) {}\n-\n- void settings_updated() override {}\n-\n- lt::storage_holder new_torrent(lt::storage_params const& params\n- , std::shared_ptr const&) override\n- {\n- lt::storage_index_t const idx = m_free_slots.empty()\n- ? m_torrents.end_index()\n- : pop(m_free_slots);\n- auto storage = std::make_unique(params.files);\n- if (idx == m_torrents.end_index()) m_torrents.emplace_back(std::move\n-(storage));\n- else m_torrents[idx] = std::move(storage);\n- return lt::storage_holder(idx, *this);\n- }\n-\n- void remove_torrent(lt::storage_index_t const idx) override\n- {\n- m_torrents[idx].reset();\n- m_free_slots.push_back(idx);\n- }\n-\n- void abort(bool) override {}\n-\n- void async_read(lt::storage_index_t storage, lt::peer_request const& r\n- , std::function handler\n- , lt::disk_job_flags_t) override\n- {\n- // this buffer is owned by the storage. It will remain valid for as\n- // long as the torrent remains in the session. We don't need any lifetime\n- // management of it.\n- lt::storage_error error;\n- lt::span b = m_torrents[storage]->readv(r, error);\n-\n- post(m_ioc, [handler, error, b, this]\n- { handler(lt::disk_buffer_holder(*this, const_cast(b.data()), int\n-(b.size())), error); });\n- }\n-\n- bool async_write(lt::storage_index_t storage, lt::peer_request const& r\n- , char const* buf, std::shared_ptr\n- , std::function handler\n- , lt::disk_job_flags_t) override\n- {\n- lt::span const b = { buf, r.length };\n-\n- m_torrents[storage]->writev(b, r.piece, r.start);\n-\n- post(m_ioc, [=]{ handler(lt::storage_error()); });\n- return false;\n- }\n-\n- void async_hash(lt::storage_index_t storage, lt::piece_index_t const piece\n- , lt::span block_hashes, lt::disk_job_flags_t\n- , std::function handler) override\n- {\n- lt::storage_error error;\n- lt::sha1_hash const hash = m_torrents[storage]->hash(piece, block_hashes,\n-error);\n- post(m_ioc, [=]{ handler(piece, hash, error); });\n- }\n-\n- void async_hash2(lt::storage_index_t storage, lt::piece_index_t const piece\n- , int const offset, lt::disk_job_flags_t\n- , std::function handler) override\n- {\n- lt::storage_error error;\n- lt::sha256_hash const hash = m_torrents[storage]->hash2(piece, offset,\n-error);\n- post(m_ioc, [=]{ handler(piece, hash, error); });\n- }\n-\n- void async_move_storage(lt::storage_index_t, std::string p, lt::move_flags_t\n- , std::function handler) override\n- {\n- post(m_ioc, [=]{\n- handler(lt::status_t::fatal_disk_error, p\n- , lt::storage_error(lt::error_code(boost::system::errc::\n-operation_not_supported, lt::system_category())));\n- });\n- }\n-\n- void async_release_files(lt::storage_index_t, std::function) override\n-{}\n-\n- void async_delete_files(lt::storage_index_t, lt::remove_flags_t\n- , std::function handler) override\n- {\n- post(m_ioc, [=]{ handler(lt::storage_error()); });\n- }\n-\n- void async_check_files(lt::storage_index_t\n- , lt::add_torrent_params const*\n- , lt::aux::vector\n- , std::function handler)\n-override\n- {\n- post(m_ioc, [=]{ handler(lt::status_t::no_error, lt::storage_error()); });\n- }\n-\n- void async_rename_file(lt::storage_index_t\n- , lt::file_index_t const idx\n- , std::string const name\n- , std::function handler) override\n- {\n- post(m_ioc, [=]{ handler(name, idx, lt::storage_error()); });\n- }\n-\n- void async_stop_torrent(lt::storage_index_t, std::function handler)\n-override\n- {\n- post(m_ioc, handler);\n- }\n-\n- void async_set_file_priority(lt::storage_index_t\n- , lt::aux::vector prio\n- , std::function)> handler)\n-override\n- {\n- post(m_ioc, [=]{\n- handler(lt::storage_error(lt::error_code(\n- boost::system::errc::operation_not_supported, lt::system_category())),\n-std::move(prio));\n- });\n- }\n-\n- void async_clear_piece(lt::storage_index_t, lt::piece_index_t index\n- , std::function handler) override\n- {\n- post(m_ioc, [=]{ handler(index); });\n- }\n-\n- // implements buffer_allocator_interface\n- void free_disk_buffer(char*) override\n- {\n- // never free any buffer. We only return buffers owned by the storage\n- // object\n- }\n-\n- void update_stats_counters(lt::counters&) const override {}\n-\n- std::vector get_status(lt::storage_index_t) const\n-override\n- { return {}; }\n-\n- void submit_jobs() override {}\n-\n-private:\n-\n- lt::aux::vector, lt::storage_index_t>\n-m_torrents;\n-\n- // slots that are unused in the m_torrents vector\n- std::vector m_free_slots;\n-\n- // callbacks are posted on this\n- lt::io_context& m_ioc;\n-};\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 void s\bse\bet\bt_\b_s\bst\btr\br (int name, std::string val) = 0;\n- virtual bool h\bha\bas\bs_\b_v\bva\bal\bl (int name) const = 0;\n- virtual bool g\bge\bet\bt_\b_b\bbo\boo\bol\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 int g\bge\bet\bt_\b_i\bin\bnt\bt (int name) const = 0;\n-};\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+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\n+the client with other peers.\n+Each configuration option is named with an enum value inside the _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk\n+class. These are the available settings:\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 implementing _\bd_\bi_\bs_\bk_\b__\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be, this must also be implemented in order to return\n disk buffers back to libtorrent\n struct buffer_allocator_interface\n@@ -372,18 +65,18 @@\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 disk buffer holder acts like a unique_ptr that frees a disk buffer when\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- disk_buffer_holder& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (disk_buffer_holder&&) & noexcept;\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- 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&&) & 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 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@@ -423,14 +116,26 @@\n bool i\bis\bs_\b_m\bmu\but\bta\bab\bbl\ble\be () const noexcept;\n if this returns true, the buffer may not be modified in place\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 implicitly convertible to true if the object is currently holding a buffer\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@@ -466,21 +171,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@@ -535,22 +240,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-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+*\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 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@@ -743,20 +448,35 @@\n {\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 ~\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 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* 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_s\bst\btr\br (int name, std::string 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 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+};\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_o\bop\bpe\ben\bn_\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/_\bd_\bi_\bs_\bk_\b__\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be_\b._\bh_\bp_\bp\"\n read_only\n open the file for reading only\n write_only\n open the file for writing only\n read_write\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": "@@ -33,44 +33,44 @@\n

    Table of contents

    \n \n
    \n [report issue]
    \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@@ -79,68 +79,38 @@\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
    \n [report issue]
    \n
    operation
    \n
    A code from operation_t enum, indicating what\n kind of operation failed.
    \n
    \n-[report issue]
    \n-
    \n-
    \n-

    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
    \n

    socks_category()

    \n

    Declared in "libtorrent/socks5_stream.hpp"

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

    returns the error_category for SOCKS5 errors

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

    upnp_category()

    \n-

    Declared in "libtorrent/upnp.hpp"

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

    the boost.system error category for UPnP errors

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

    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

    i2p_category()

    \n

    Declared in "libtorrent/i2p_stream.hpp"

    \n
    \n boost::system::error_category& i2p_category ();\n 
    \n@@ -158,144 +128,44 @@\n
    \n

    http_category()

    \n

    Declared in "libtorrent/error_code.hpp"

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

    returns the error_category for HTTP errors

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

    enum pcp_errors

    \n-

    Declared in "libtorrent/natpmp.hpp"

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-
    namevaluedescription
    pcp_success0 
    pcp_unsupp_version1 
    pcp_not_authorized2 
    pcp_malformed_request3 
    pcp_unsupp_opcode4 
    pcp_unsupp_option5 
    pcp_malformed_option6 
    pcp_network_failure7 
    pcp_no_resources8 
    pcp_unsupp_protocol9 
    pcp_user_ex_quota10 
    pcp_cannot_provide_external11 
    pcp_address_mismatch12 
    pcp_excessive_remote_peers13 
    \n-[report issue]
    \n-
    \n-

    enum error_code_enum

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

    bdecode_category()

    \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+
    \n+boost::system::error_category& bdecode_category ();\n+
    \n+[report issue]
    \n+
    \n+

    upnp_category()

    \n+

    Declared in "libtorrent/upnp.hpp"

    \n+
    \n+boost::system::error_category& upnp_category ();\n+
    \n+

    the boost.system error category for UPnP errors

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

    gzip_category()

    \n+

    Declared in "libtorrent/gzip.hpp"

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

    get the error_category for zip errors

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

    pcp_category()

    \n+

    Declared in "libtorrent/natpmp.hpp"

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

    enum socks_error_code

    \n

    Declared in "libtorrent/socks5_stream.hpp"

    \n \n \n \n@@ -351,171 +221,14 @@\n \n \n \n \n \n \n
    num_errors10 
    \n-[report issue]
    \n-
    \n-

    enum error_code_enum

    \n-

    Declared in "libtorrent/upnp.hpp"

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

    enum error_code_enum

    \n-

    Declared in "libtorrent/gzip.hpp"

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

    enum i2p_error_code

    \n

    Declared in "libtorrent/i2p_stream.hpp"

    \n \n \n \n@@ -568,15 +281,15 @@\n \n \n \n \n \n
    num_errors9 
    \n [report issue]
    \n-
    \n+
    \n

    enum error_code_enum

    \n

    Declared in "libtorrent/error_code.hpp"

    \n \n \n \n \n \n@@ -1400,14 +1113,301 @@\n \n \n \n \n \n \n
    service_unavailable503 
    \n+[report issue]
    \n+
    \n+

    enum error_code_enum

    \n+

    Declared in "libtorrent/bdecode.hpp"

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

    enum error_code_enum

    \n+

    Declared in "libtorrent/upnp.hpp"

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

    enum error_code_enum

    \n+

    Declared in "libtorrent/gzip.hpp"

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

    enum pcp_errors

    \n+

    Declared in "libtorrent/natpmp.hpp"

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    namevaluedescription
    pcp_success0 
    pcp_unsupp_version1 
    pcp_not_authorized2 
    pcp_malformed_request3 
    pcp_unsupp_opcode4 
    pcp_unsupp_option5 
    pcp_malformed_option6 
    pcp_network_failure7 
    pcp_no_resources8 
    pcp_unsupp_protocol9 
    pcp_user_ex_quota10 
    pcp_cannot_provide_external11 
    pcp_address_mismatch12 
    pcp_excessive_remote_peers13 
    \n
    \n \n
    \n
    \n
    \n
    \n
    \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,85 +2,67 @@\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_\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- * _\bb_\bd_\be_\bc_\bo_\bd_\be_\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- * _\bg_\bz_\bi_\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 * _\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+ * _\bb_\bd_\be_\bc_\bo_\bd_\be_\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+ * _\bg_\bz_\bi_\bp_\b__\bc_\ba_\bt_\be_\bg_\bo_\br_\by_\b(_\b)\n+ * _\bp_\bc_\bp_\b__\bc_\ba_\bt_\be_\bg_\bo_\br_\by_\b(_\b)\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 _\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 _\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+ * _\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 _\be_\br_\br_\bo_\br_\b__\bc_\bo_\bd_\be_\b__\be_\bn_\bu_\bm\n+ * _\be_\bn_\bu_\bm_\b _\bp_\bc_\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 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* 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* 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* 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* 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@@ -89,47 +71,31 @@\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 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& h\bht\btt\btp\bp_\b_c\bca\bat\bte\beg\bgo\bor\bry\by ();\n returns the error_category for HTTP errors\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\bpc\bcp\bp_\b_e\ber\brr\bro\bor\brs\bs *\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- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\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-|_\bp_\bc_\bp_\b__\bs_\bu_\bc_\bc_\be_\bs_\bs_\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-|_\bp_\bc_\bp_\b__\bu_\bn_\bs_\bu_\bp_\bp_\b__\bv_\be_\br_\bs_\bi_\bo_\bn_\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-|_\bp_\bc_\bp_\b__\bn_\bo_\bt_\b__\ba_\bu_\bt_\bh_\bo_\br_\bi_\bz_\be_\bd_\b _\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-|_\bp_\bc_\bp_\b__\bm_\ba_\bl_\bf_\bo_\br_\bm_\be_\bd_\b__\br_\be_\bq_\bu_\be_\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 |\n-|_\bp_\bc_\bp_\b__\bu_\bn_\bs_\bu_\bp_\bp_\b__\bo_\bp_\bc_\bo_\bd_\be_\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-|_\bp_\bc_\bp_\b__\bu_\bn_\bs_\bu_\bp_\bp_\b__\bo_\bp_\bt_\bi_\bo_\bn_\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-|_\bp_\bc_\bp_\b__\bm_\ba_\bl_\bf_\bo_\br_\bm_\be_\bd_\b__\bo_\bp_\bt_\bi_\bo_\bn_\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-|_\bp_\bc_\bp_\b__\bn_\be_\bt_\bw_\bo_\br_\bk_\b__\bf_\ba_\bi_\bl_\bu_\br_\be_\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-|_\bp_\bc_\bp_\b__\bn_\bo_\b__\br_\be_\bs_\bo_\bu_\br_\bc_\be_\bs_\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-|_\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+*\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- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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+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* 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* 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* 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* 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@@ -139,80 +105,14 @@\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-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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 _\bi_\bn_\bv_\ba_\bl_\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 |\n-|_\ba_\bc_\bt_\bi_\bo_\bn_\b__\bf_\ba_\bi_\bl_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b5_\b0_\b1_\b _\b _\b|_\bT_\bh_\be_\b _\br_\be_\bq_\bu_\be_\bs_\bt_\b _\bf_\ba_\bi_\bl_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|value_not_in_array |714 |The specified value does not exist |\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|_\bi_\bn_\b _\bt_\bh_\be_\b _\ba_\br_\br_\ba_\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-| | |The source IP address cannot be |\n-|source_ip_cannot_be_wildcarded |715 |wild-carded, but must be fully |\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|_\bs_\bp_\be_\bc_\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 |\n-|external_port_cannot_be_wildcarded|716 |The external port cannot be 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|_\bw_\bi_\bl_\bd_\bc_\ba_\br_\bd_\b,_\b _\bb_\bu_\bt_\b _\bm_\bu_\bs_\bt_\b _\bb_\be_\b _\bs_\bp_\be_\bc_\bi_\bf_\bi_\be_\bd_\b _\b _\b _\b _\b |\n-| | |The port mapping _\be_\bn_\bt_\br_\by specified |\n-|port_mapping_conflict |718 |conflicts with a mapping assigned |\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|_\bp_\br_\be_\bv_\bi_\bo_\bu_\bs_\bl_\by_\b _\bt_\bo_\b _\ba_\bn_\bo_\bt_\bh_\be_\br_\b _\bc_\bl_\bi_\be_\bn_\bt_\b _\b _\b _\b _\b _\b _\b _\b |\n-|internal_port_must_match_external |724 |Internal and external port value |\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|_\bm_\bu_\bs_\bt_\b _\bb_\be_\b _\bt_\bh_\be_\b _\bs_\ba_\bm_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-| | |The NAT implementation only supports|\n-|only_permanent_leases_supported |725 |permanent lease times on port |\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|_\bm_\ba_\bp_\bp_\bi_\bn_\bg_\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 |\n-| | |RemoteHost must be a wildcard and |\n-|remote_host_must_be_wildcard |726 |cannot be a specific IP address or |\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|_\bD_\bN_\bS_\b _\bn_\ba_\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 |\n-|external_port_must_be_wildcard |727 |ExternalPort must be a wildcard and |\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|_\bc_\ba_\bn_\bn_\bo_\bt_\b _\bb_\be_\b _\ba_\b _\bs_\bp_\be_\bc_\bi_\bf_\bi_\bc_\b _\bp_\bo_\br_\bt_\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-|inflated_data_too_large |2 |more bytes than the specified |\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|_\bm_\ba_\bx_\bi_\bm_\bu_\bm_\b _\bs_\bi_\bz_\be_\b,_\b _\ba_\bn_\bd_\b _\bw_\ba_\bs_\b _\br_\be_\bj_\be_\bc_\bt_\be_\bd_\b._\b _\b _\b _\b |\n-|data_did_not_terminate |3 |available inflate data did not |\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|_\bt_\be_\br_\bm_\bi_\bn_\ba_\bt_\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 |\n-|space_exhausted |4 |output space exhausted before |\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_\bm_\bp_\bl_\be_\bt_\bi_\bn_\bg_\b _\bi_\bn_\bf_\bl_\ba_\bt_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bi_\bn_\bv_\ba_\bl_\bi_\bd_\b__\bb_\bl_\bo_\bc_\bk_\b__\bt_\by_\bp_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b5_\b _\b _\b _\b _\b|_\bi_\bn_\bv_\ba_\bl_\bi_\bd_\b _\bb_\bl_\bo_\bc_\bk_\b _\bt_\by_\bp_\be_\b _\b(_\bt_\by_\bp_\be_\b _\b=_\b=_\b _\b3_\b)_\b _\b _\b _\b _\b |\n-|invalid_stored_block_length |6 |stored block length did not match |\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_\bn_\be_\b'_\bs_\b _\bc_\bo_\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 |\n-|too_many_length_or_distance_codes |7 |dynamic block code description: too|\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|_\bm_\ba_\bn_\by_\b _\bl_\be_\bn_\bg_\bt_\bh_\b _\bo_\br_\b _\bd_\bi_\bs_\bt_\ba_\bn_\bc_\be_\b _\bc_\bo_\bd_\be_\bs_\b _\b _\b _\b _\b _\b |\n-|code_lengths_codes_incomplete |8 |dynamic block code description: |\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 _\bl_\be_\bn_\bg_\bt_\bh_\bs_\b _\bc_\bo_\bd_\be_\bs_\b _\bi_\bn_\bc_\bo_\bm_\bp_\bl_\be_\bt_\be_\b _\b _\b _\b _\b _\b |\n-|repeat_lengths_with_no_first_length|9 |dynamic block code description: |\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|_\br_\be_\bp_\be_\ba_\bt_\b _\bl_\be_\bn_\bg_\bt_\bh_\bs_\b _\bw_\bi_\bt_\bh_\b _\bn_\bo_\b _\bf_\bi_\br_\bs_\bt_\b _\bl_\be_\bn_\bg_\bt_\bh|\n-|repeat_more_than_specified_lengths |10 |dynamic block code description: |\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|_\br_\be_\bp_\be_\ba_\bt_\b _\bm_\bo_\br_\be_\b _\bt_\bh_\ba_\bn_\b _\bs_\bp_\be_\bc_\bi_\bf_\bi_\be_\bd_\b _\bl_\be_\bn_\bg_\bt_\bh_\bs_\b |\n-|invalid_literal_length_code_lengths|11 |dynamic block code description: |\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 _\bl_\bi_\bt_\be_\br_\ba_\bl_\b/_\bl_\be_\bn_\bg_\bt_\bh_\b _\bc_\bo_\bd_\be_\b _\bl_\be_\bn_\bg_\bt_\bh_\bs|\n-|invalid_distance_code_lengths |12 |dynamic block code description: |\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 _\bd_\bi_\bs_\bt_\ba_\bn_\bc_\be_\b _\bc_\bo_\bd_\be_\b _\bl_\be_\bn_\bg_\bt_\bh_\bs_\b _\b _\b _\b _\b _\b |\n-|invalid_literal_code_in_block |13 |invalid literal/length or distance |\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 i\bi2\b2p\bp_\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/_\bi_\b2_\bp_\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 \n |_\bn\bn_\ba\ba_\bm\bm_\be\be_\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|_\b0_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |_\bp_\ba_\br_\bs_\be_\b__\bf_\ba_\bi_\bl_\be_\bd_\b _\b _\b _\b|_\b1_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |_\bc_\ba_\bn_\bt_\b__\br_\be_\ba_\bc_\bh_\b__\bp_\be_\be_\br_\b|_\b2_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n@@ -622,14 +522,114 @@\n |_\bu_\bn_\ba_\bu_\bt_\bh_\bo_\br_\bi_\bz_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b4_\b0_\b1_\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |_\bf_\bo_\br_\bb_\bi_\bd_\bd_\be_\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b4_\b0_\b3_\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |_\bn_\bo_\bt_\b__\bf_\bo_\bu_\bn_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b4_\b0_\b4_\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |_\bi_\bn_\bt_\be_\br_\bn_\ba_\bl_\b__\bs_\be_\br_\bv_\be_\br_\b__\be_\br_\br_\bo_\br_\b|_\b5_\b0_\b0_\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |_\bn_\bo_\bt_\b__\bi_\bm_\bp_\bl_\be_\bm_\be_\bn_\bt_\be_\bd_\b _\b _\b _\b _\b _\b _\b|_\b5_\b0_\b1_\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |_\bb_\ba_\bd_\b__\bg_\ba_\bt_\be_\bw_\ba_\by_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b5_\b0_\b2_\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n |_\bs_\be_\br_\bv_\bi_\bc_\be_\b__\bu_\bn_\ba_\bv_\ba_\bi_\bl_\ba_\bb_\bl_\be_\b _\b _\b|_\b5_\b0_\b3_\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/_\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+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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 _\bi_\bn_\bv_\ba_\bl_\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 |\n+|_\ba_\bc_\bt_\bi_\bo_\bn_\b__\bf_\ba_\bi_\bl_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b5_\b0_\b1_\b _\b _\b|_\bT_\bh_\be_\b _\br_\be_\bq_\bu_\be_\bs_\bt_\b _\bf_\ba_\bi_\bl_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|value_not_in_array |714 |The specified value does not exist |\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|_\bi_\bn_\b _\bt_\bh_\be_\b _\ba_\br_\br_\ba_\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+| | |The source IP address cannot be |\n+|source_ip_cannot_be_wildcarded |715 |wild-carded, but must be fully |\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|_\bs_\bp_\be_\bc_\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 |\n+|external_port_cannot_be_wildcarded|716 |The external port cannot be 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|_\bw_\bi_\bl_\bd_\bc_\ba_\br_\bd_\b,_\b _\bb_\bu_\bt_\b _\bm_\bu_\bs_\bt_\b _\bb_\be_\b _\bs_\bp_\be_\bc_\bi_\bf_\bi_\be_\bd_\b _\b _\b _\b _\b |\n+| | |The port mapping _\be_\bn_\bt_\br_\by specified |\n+|port_mapping_conflict |718 |conflicts with a mapping assigned |\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|_\bp_\br_\be_\bv_\bi_\bo_\bu_\bs_\bl_\by_\b _\bt_\bo_\b _\ba_\bn_\bo_\bt_\bh_\be_\br_\b _\bc_\bl_\bi_\be_\bn_\bt_\b _\b _\b _\b _\b _\b _\b _\b |\n+|internal_port_must_match_external |724 |Internal and external port value |\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|_\bm_\bu_\bs_\bt_\b _\bb_\be_\b _\bt_\bh_\be_\b _\bs_\ba_\bm_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+| | |The NAT implementation only supports|\n+|only_permanent_leases_supported |725 |permanent lease times on port |\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|_\bm_\ba_\bp_\bp_\bi_\bn_\bg_\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 |\n+| | |RemoteHost must be a wildcard and |\n+|remote_host_must_be_wildcard |726 |cannot be a specific IP address or |\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|_\bD_\bN_\bS_\b _\bn_\ba_\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 |\n+|external_port_must_be_wildcard |727 |ExternalPort must be a wildcard and |\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|_\bc_\ba_\bn_\bn_\bo_\bt_\b _\bb_\be_\b _\ba_\b _\bs_\bp_\be_\bc_\bi_\bf_\bi_\bc_\b _\bp_\bo_\br_\bt_\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+|inflated_data_too_large |2 |more bytes than the specified |\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|_\bm_\ba_\bx_\bi_\bm_\bu_\bm_\b _\bs_\bi_\bz_\be_\b,_\b _\ba_\bn_\bd_\b _\bw_\ba_\bs_\b _\br_\be_\bj_\be_\bc_\bt_\be_\bd_\b._\b _\b _\b _\b |\n+|data_did_not_terminate |3 |available inflate data did not |\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|_\bt_\be_\br_\bm_\bi_\bn_\ba_\bt_\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 |\n+|space_exhausted |4 |output space exhausted before |\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_\bm_\bp_\bl_\be_\bt_\bi_\bn_\bg_\b _\bi_\bn_\bf_\bl_\ba_\bt_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bi_\bn_\bv_\ba_\bl_\bi_\bd_\b__\bb_\bl_\bo_\bc_\bk_\b__\bt_\by_\bp_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b5_\b _\b _\b _\b _\b|_\bi_\bn_\bv_\ba_\bl_\bi_\bd_\b _\bb_\bl_\bo_\bc_\bk_\b _\bt_\by_\bp_\be_\b _\b(_\bt_\by_\bp_\be_\b _\b=_\b=_\b _\b3_\b)_\b _\b _\b _\b _\b |\n+|invalid_stored_block_length |6 |stored block length did not match |\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_\bn_\be_\b'_\bs_\b _\bc_\bo_\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 |\n+|too_many_length_or_distance_codes |7 |dynamic block code description: too|\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|_\bm_\ba_\bn_\by_\b _\bl_\be_\bn_\bg_\bt_\bh_\b _\bo_\br_\b _\bd_\bi_\bs_\bt_\ba_\bn_\bc_\be_\b _\bc_\bo_\bd_\be_\bs_\b _\b _\b _\b _\b _\b |\n+|code_lengths_codes_incomplete |8 |dynamic block code description: |\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 _\bl_\be_\bn_\bg_\bt_\bh_\bs_\b _\bc_\bo_\bd_\be_\bs_\b _\bi_\bn_\bc_\bo_\bm_\bp_\bl_\be_\bt_\be_\b _\b _\b _\b _\b _\b |\n+|repeat_lengths_with_no_first_length|9 |dynamic block code description: |\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|_\br_\be_\bp_\be_\ba_\bt_\b _\bl_\be_\bn_\bg_\bt_\bh_\bs_\b _\bw_\bi_\bt_\bh_\b _\bn_\bo_\b _\bf_\bi_\br_\bs_\bt_\b _\bl_\be_\bn_\bg_\bt_\bh|\n+|repeat_more_than_specified_lengths |10 |dynamic block code description: |\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|_\br_\be_\bp_\be_\ba_\bt_\b _\bm_\bo_\br_\be_\b _\bt_\bh_\ba_\bn_\b _\bs_\bp_\be_\bc_\bi_\bf_\bi_\be_\bd_\b _\bl_\be_\bn_\bg_\bt_\bh_\bs_\b |\n+|invalid_literal_length_code_lengths|11 |dynamic block code description: |\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 _\bl_\bi_\bt_\be_\br_\ba_\bl_\b/_\bl_\be_\bn_\bg_\bt_\bh_\b _\bc_\bo_\bd_\be_\b _\bl_\be_\bn_\bg_\bt_\bh_\bs|\n+|invalid_distance_code_lengths |12 |dynamic block code description: |\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 _\bd_\bi_\bs_\bt_\ba_\bn_\bc_\be_\b _\bc_\bo_\bd_\be_\b _\bl_\be_\bn_\bg_\bt_\bh_\bs_\b _\b _\b _\b _\b _\b |\n+|invalid_literal_code_in_block |13 |invalid literal/length or distance |\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 p\bpc\bcp\bp_\b_e\ber\brr\bro\bor\brs\bs *\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+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\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+|_\bp_\bc_\bp_\b__\bs_\bu_\bc_\bc_\be_\bs_\bs_\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+|_\bp_\bc_\bp_\b__\bu_\bn_\bs_\bu_\bp_\bp_\b__\bv_\be_\br_\bs_\bi_\bo_\bn_\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+|_\bp_\bc_\bp_\b__\bn_\bo_\bt_\b__\ba_\bu_\bt_\bh_\bo_\br_\bi_\bz_\be_\bd_\b _\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+|_\bp_\bc_\bp_\b__\bm_\ba_\bl_\bf_\bo_\br_\bm_\be_\bd_\b__\br_\be_\bq_\bu_\be_\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 |\n+|_\bp_\bc_\bp_\b__\bu_\bn_\bs_\bu_\bp_\bp_\b__\bo_\bp_\bc_\bo_\bd_\be_\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+|_\bp_\bc_\bp_\b__\bu_\bn_\bs_\bu_\bp_\bp_\b__\bo_\bp_\bt_\bi_\bo_\bn_\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+|_\bp_\bc_\bp_\b__\bm_\ba_\bl_\bf_\bo_\br_\bm_\be_\bd_\b__\bo_\bp_\bt_\bi_\bo_\bn_\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+|_\bp_\bc_\bp_\b__\bn_\be_\bt_\bw_\bo_\br_\bk_\b__\bf_\ba_\bi_\bl_\bu_\br_\be_\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+|_\bp_\bc_\bp_\b__\bn_\bo_\b__\br_\be_\bs_\bo_\bu_\br_\bc_\be_\bs_\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+|_\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 _\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-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 ();\n+   ip_filter (ip_filter const&);\n    ip_filter (ip_filter&&);\n-   ip_filter& operator= (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@@ -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& operator= (port_filter const&);\n    port_filter ();\n-   ~port_filter ();\n    port_filter (port_filter&&);\n-   port_filter& operator= (port_filter const&);\n-   port_filter (port_filter const&);\n    port_filter& operator= (port_filter&&);\n+   port_filter (port_filter const&);\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", "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-   ~\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 const&);\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&&);\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@@ -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+   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 ();\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&&);\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    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 const&);\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"}]}, {"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,82 +28,25 @@\n 2.0.11\n \n \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@@ -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-

    remove() add()

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

    add() remove()

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

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

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

    disallow() allow()

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

    allow() disallow()

    \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,64 +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- * _\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 _\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_\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-[_\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@@ -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* r\bre\bem\bmo\bov\bve\be(\b()\b) a\bad\bdd\bd(\b()\b) *\b**\b**\b**\b**\b*\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 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* 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+*\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@@ -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": "@@ -61,17 +61,17 @@\n
  • peer_plugin\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

    In short, the plugin interface makes it possible to:

    \n@@ -348,16 +348,16 @@\n
    \n struct torrent_plugin\n {\n    virtual std::shared_ptr<peer_plugin> new_connection (peer_connection_handle const&);\n    virtual void on_piece_pass (piece_index_t);\n    virtual void on_piece_failed (piece_index_t);\n    virtual void tick ();\n-   virtual bool on_pause ();\n    virtual bool on_resume ();\n+   virtual bool on_pause ();\n    virtual void on_files_checked ();\n    virtual void on_state (torrent_status::state_t);\n    virtual void on_add_peer (tcp::endpoint const&,\n       peer_source_flags_t, add_peer_flags_t);\n \n    static constexpr add_peer_flags_t first_time  = 1_bit;\n    static constexpr add_peer_flags_t filtered  = 2_bit;\n@@ -401,16 +401,16 @@\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-virtual bool on_pause ();\n virtual bool on_resume ();\n+virtual bool on_pause ();\n 
    \n

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

    \n@@ -475,43 +475,43 @@\n {\n virtual string_view type () const;\n virtual void add_handshake (entry&);\n virtual void on_disconnect (error_code const&);\n virtual void on_connected ();\n virtual bool on_handshake (span<char const>);\n virtual bool on_extension_handshake (bdecode_node const&);\n- virtual bool on_not_interested ();\n- virtual bool on_have_all ();\n+ virtual bool on_dont_have (piece_index_t);\n virtual bool on_have_none ();\n- virtual bool on_allowed_fast (piece_index_t);\n+ virtual bool on_have (piece_index_t);\n+ virtual bool on_choke ();\n+ virtual bool on_request (peer_request const&);\n+ virtual bool on_not_interested ();\n virtual bool on_unchoke ();\n virtual bool on_interested ();\n- virtual bool on_choke ();\n- virtual bool on_have (piece_index_t);\n- virtual bool on_dont_have (piece_index_t);\n+ virtual bool on_have_all ();\n virtual bool on_bitfield (bitfield const& /*bitfield*/);\n- virtual bool on_request (peer_request const&);\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_reject (peer_request const&);\n- virtual bool on_suggest (piece_index_t);\n virtual bool on_cancel (peer_request const&);\n- virtual void sent_reject_request (peer_request const&);\n+ virtual bool on_suggest (piece_index_t);\n virtual void sent_allow_fast (piece_index_t);\n- virtual void sent_choke ();\n- virtual void sent_have_none ();\n- virtual void sent_cancel (peer_request const&);\n+ virtual void sent_reject_request (peer_request const&);\n virtual void sent_suggest (piece_index_t);\n- virtual void sent_have_all ();\n+ virtual void sent_choke ();\n virtual void sent_request (peer_request const&);\n- virtual void sent_not_interested ();\n+ virtual void sent_have_all ();\n+ virtual void sent_cancel (peer_request const&);\n+ virtual void sent_have_none ();\n virtual void sent_interested ();\n- virtual void sent_have (piece_index_t);\n- virtual void sent_unchoke ();\n virtual void sent_piece (peer_request const&);\n+ virtual void sent_not_interested ();\n+ virtual void sent_unchoke ();\n+ virtual void sent_have (piece_index_t);\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@@ -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_interested() on_dont_have() on_bitfield() on_not_interested() on_choke() on_allowed_fast() on_have() on_have_all() on_have_none() on_unchoke() on_request()

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

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

    \n
    \n-virtual bool on_not_interested ();\n-virtual bool on_have_all ();\n+virtual bool on_dont_have (piece_index_t);\n virtual bool on_have_none ();\n-virtual bool on_allowed_fast (piece_index_t);\n+virtual bool on_have (piece_index_t);\n+virtual bool on_choke ();\n+virtual bool on_request (peer_request const&);\n+virtual bool on_not_interested ();\n virtual bool on_unchoke ();\n virtual bool on_interested ();\n-virtual bool on_choke ();\n-virtual bool on_have (piece_index_t);\n-virtual bool on_dont_have (piece_index_t);\n+virtual bool on_have_all ();\n virtual bool on_bitfield (bitfield const& /*bitfield*/);\n-virtual bool on_request (peer_request const&);\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@@ -613,27 +613,27 @@\n \n

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

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

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

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

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

    \n
    \n-virtual void sent_not_interested ();\n virtual void sent_interested ();\n-virtual void sent_have (piece_index_t);\n-virtual void sent_unchoke ();\n virtual void sent_piece (peer_request const&);\n+virtual void sent_not_interested ();\n+virtual void sent_unchoke ();\n+virtual void sent_have (piece_index_t);\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@@ -740,46 +740,46 @@\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 has_piece (piece_index_t i) const;\n    bool is_interesting () const;\n+   bool is_choked () const;\n    bool has_peer_choked () const;\n    bool is_peer_interested () const;\n    void maybe_unchoke_this_peer ();\n    void choke_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 is_disconnecting () const;\n+   bool is_connecting () const;\n+   bool is_outgoing () const;\n    bool on_local_network () const;\n    bool ignore_unchoke_slots () const;\n    bool failed () const;\n+   bool should_log (peer_log_alert::direction_t direction) const;\n    void peer_log (peer_log_alert::direction_t direction\n       , char const* event, char const* fmt = "", ...) const TORRENT_FORMAT(4,5);\n-   bool 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-   std::time_t last_seen_complete () const;\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+   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@@ -789,33 +789,19 @@\n
    \n struct bt_peer_connection_handle : peer_connection_handle\n {\n    explicit bt_peer_connection_handle (peer_connection_handle pc);\n    bool packet_finished () const;\n    bool support_extensions () const;\n    bool supports_encryption () const;\n-   void switch_recv_crypto (std::shared_ptr<crypto_plugin> crypto);\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_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@@ -836,14 +822,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
    \n \n
    \n
    \n
    \n
    \n
    \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -28,34 +28,34 @@\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__\bi_\bn_\bt_\be_\br_\be_\bs_\bt_\be_\bd_\b(_\b)_\b _\bo_\bn_\b__\bd_\bo_\bn_\bt_\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__\bn_\bo_\bt_\b__\bi_\bn_\bt_\be_\br_\be_\bs_\bt_\be_\bd_\b(_\b)\n- _\bo_\bn_\b__\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)_\b _\bo_\bn_\b__\bh_\ba_\bv_\be_\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__\bn_\bo_\bn_\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)\n+ o _\bo_\bn_\b__\bh_\ba_\bv_\be_\b(_\b)_\b _\bo_\bn_\b__\bd_\bo_\bn_\bt_\b__\bh_\ba_\bv_\be_\b(_\b)_\b _\bo_\bn_\b__\br_\be_\bq_\bu_\be_\bs_\bt_\b(_\b)_\b _\bo_\bn_\b__\ba_\bl_\bl_\bo_\bw_\be_\bd_\b__\bf_\ba_\bs_\bt_\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__\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)\n+ _\bo_\bn_\b__\bb_\bi_\bt_\bf_\bi_\be_\bl_\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 o _\bo_\bn_\b__\bp_\bi_\be_\bc_\be_\b(_\b)\n- o _\bs_\be_\bn_\bt_\b__\bp_\bi_\be_\bc_\be_\b(_\b)_\b _\bs_\be_\bn_\bt_\b__\bh_\ba_\bv_\be_\b(_\b)_\b _\bs_\be_\bn_\bt_\b__\bu_\bn_\bc_\bh_\bo_\bk_\be_\b(_\b)_\b _\bs_\be_\bn_\bt_\b__\bi_\bn_\bt_\be_\br_\be_\bs_\bt_\be_\bd_\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__\bh_\ba_\bv_\be_\b(_\b)_\b _\bs_\be_\bn_\bt_\b__\bu_\bn_\bc_\bh_\bo_\bk_\be_\b(_\b)_\b _\bs_\be_\bn_\bt_\b__\bp_\bi_\be_\bc_\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)\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__\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__\bs_\bm_\ba_\br_\bt_\b__\bb_\ba_\bn_\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 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@@ -259,16 +259,16 @@\n struct torrent_plugin\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_p\bpa\bau\bus\bse\be ();\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@@ -299,16 +299,16 @@\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_p\bpa\bau\bus\bse\be ();\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@@ -354,43 +354,43 @@\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_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_\b_a\bal\bll\bl ();\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_\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_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_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_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_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_h\bha\bav\bve\be_\b_a\bal\bll\bl ();\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_r\bre\beq\bqu\bue\bes\bst\bt (peer_request const&);\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_r\bre\bej\bje\bec\bct\bt (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_c\bca\ban\bnc\bce\bel\bl (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 bool o\bon\bn_\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_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_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_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_r\bre\beq\bqu\bue\bes\bst\bt (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_h\bha\bav\bve\be_\b_a\bal\bll\bl ();\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_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_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_h\bha\bav\bve\be (piece_index_t);\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@@ -426,48 +426,48 @@\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_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd(\b()\b) o\bon\bn_\b_d\bdo\bon\bnt\bt_\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_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\n-(\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) 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_n\bno\bon\bne\be(\b()\b) o\bon\bn_\b_u\bun\bnc\bch\bho\bok\bke\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_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_\b_a\bal\bll\bl ();\n+*\b**\b**\b**\b**\b* o\bon\bn_\b_h\bha\bav\bve\be(\b()\b) o\bon\bn_\b_d\bdo\bon\bnt\bt_\b_h\bha\bav\bve\be(\b()\b) o\bon\bn_\b_r\bre\beq\bqu\bue\bes\bst\bt(\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_n\bno\bon\bne\be(\b()\b)\n+o\bon\bn_\b_u\bun\bnc\bch\bho\bok\bke\be(\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_a\bal\bll\bl(\b()\b) o\bon\bn_\b_b\bbi\bit\btf\bfi\bie\bel\bld\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)\n+o\bon\bn_\b_c\bch\bho\bok\bke\be(\b()\b) *\b**\b**\b**\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_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_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_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_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_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_h\bha\bav\bve\be_\b_a\bal\bll\bl ();\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_r\bre\beq\bqu\bue\bes\bst\bt (peer_request const&);\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 [_\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\bpi\bie\bec\bce\be(\b()\b) s\bse\ben\bnt\bt_\b_h\bha\bav\bve\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_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd(\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_n\bno\bot\bt_\b_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd ();\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_u\bun\bnc\bch\bho\bok\bke\be(\b()\b) s\bse\ben\bnt\bt_\b_p\bpi\bie\bec\bce\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)\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_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_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_h\bha\bav\bve\be (piece_index_t);\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 [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n@@ -542,77 +542,66 @@\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 h\bha\bas\bs_\b_p\bpi\bie\bec\bce\be (piece_index_t i) 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_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 void c\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\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 bool o\bon\bn_\b_l\blo\boc\bca\bal\bl_\b_n\bne\bet\btw\bwo\bor\brk\bk () 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 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 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- 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+ 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==\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+ bool o\bop\bpe\ber\bra\bat\bto\bor\br<\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 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 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\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+ 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-*\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@@ -626,14 +615,25 @@\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 _\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-Resume_Data.html", "source2": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Resume_Data.html", "unified_diff": "@@ -28,40 +28,40 @@\n 2.0.11\n \n \n

    home

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

    write_resume_data() write_resume_data_buf()

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

    write_resume_data_buf() write_resume_data()

    \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 std::vector<char> write_torrent_file_buf (add_torrent_params const& atp\n    , write_torrent_flags_t flags);\n-entry write_torrent_file (add_torrent_params const& atp);\n-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@@ -70,18 +70,18 @@\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 (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 
    \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", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,46 +1,46 @@\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- * _\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+ * _\bw_\br_\bi_\bt_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b__\bb_\bu_\bf_\b(_\b)_\b _\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__\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+*\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\bbu\buf\bf(\b()\b) w\bwr\bri\bit\bte\be_\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/_\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+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) 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+*\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-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);\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 , 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+ , 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 (span buffer\n , error_code& ec, load_torrent_limits const& cfg = {});\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"}]}, {"source1": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Session.html", "source2": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Session.html", "unified_diff": "@@ -31,75 +31,75 @@\n

    home

    \n
    \n

    Table of contents

    \n
    \n [report issue]
    \n

    session_handle

    \n

    Declared in "libtorrent/session_handle.hpp"

    \n

    this class provides a non-owning handle to a session and a subset of the\n interface of the session class. If the underlying session is destructed\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,63 +111,63 @@\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-   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);\n+   void async_add_torrent (add_torrent_params const& params);\n+   torrent_handle add_torrent (add_torrent_params const& params, error_code& ec);\n    void async_add_torrent (add_torrent_params&& params);\n+   torrent_handle add_torrent (add_torrent_params const& params);\n    torrent_handle add_torrent (add_torrent_params&& params, error_code& ec);\n-   torrent_handle add_torrent (add_torrent_params const& params, error_code& ec);\n    bool is_paused () const;\n-   void resume ();\n    void pause ();\n+   void resume ();\n    bool is_dht_running () const;\n    void set_dht_storage (dht::dht_storage_constructor_type sc);\n    void add_dht_node (std::pair<std::string, int> const& node);\n    void dht_get_item (sha1_hash const& target);\n    void dht_get_item (std::array<char, 32> key\n       , std::string salt = std::string());\n    sha1_hash dht_put_item (entry data);\n    void dht_put_item (std::array<char, 32> key\n       , std::function<void(entry&, std::array<char, 64>&\n       , std::int64_t&, std::string const&)> cb\n       , std::string salt = std::string());\n-   void dht_announce (sha1_hash const& info_hash, int port = 0, dht::announce_flags_t flags = {});\n    void dht_get_peers (sha1_hash const& info_hash);\n+   void dht_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    unsigned short ssl_listen_port () const;\n+   unsigned short listen_port () const;\n    bool is_listening () 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-   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 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 const&);\n    settings_pack get_settings () const;\n    void apply_settings (settings_pack&&);\n-   void set_alert_notify (std::function<void()> const& fun);\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    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@@ -201,18 +201,18 @@\n 

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

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

    get_torrent_status() refresh_torrent_status()

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

    refresh_torrent_status() get_torrent_status()

    \n
    \n void refresh_torrent_status (std::vector<torrent_status>* ret\n       , status_flags_t flags = {}) const;\n std::vector<torrent_status> get_torrent_status (\n       std::function<bool(torrent_status const&)> const& pred\n       , status_flags_t flags = {}) const;\n 
    \n@@ -288,18 +288,18 @@\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-

    find_torrent() get_torrents()

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

    get_torrents() find_torrent()

    \n
    \n torrent_handle find_torrent (sha1_hash const& info_hash) const;\n std::vector<torrent_handle> get_torrents () 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@@ -309,20 +309,20 @@\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-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);\n+void async_add_torrent (add_torrent_params const& params);\n+torrent_handle add_torrent (add_torrent_params const& params, error_code& ec);\n void async_add_torrent (add_torrent_params&& params);\n+torrent_handle add_torrent (add_torrent_params const& params);\n torrent_handle add_torrent (add_torrent_params&& params, error_code& ec);\n-torrent_handle add_torrent (add_torrent_params const& params, error_code& ec);\n 
    \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@@ -354,16 +354,16 @@\n \n \n [report issue]

    \n
    \n

    resume() is_paused() pause()

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

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

    \n@@ -476,16 +476,16 @@\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_announce (sha1_hash const& info_hash, int port = 0, dht::announce_flags_t flags = {});\n void dht_get_peers (sha1_hash const& info_hash);\n+void dht_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@@ -568,18 +568,18 @@\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-

    set_ip_filter() get_ip_filter()

    \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@@ -599,16 +599,16 @@\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-unsigned short listen_port () const;\n unsigned short ssl_listen_port () const;\n+unsigned short 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@@ -643,18 +643,18 @@\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+[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@@ -696,21 +696,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-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 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@@ -750,35 +750,35 @@\n handle.save_resume_data();\n

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

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

    get_settings() apply_settings()

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

    apply_settings() get_settings()

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

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

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

    pop_alerts() wait_for_alert() set_alert_notify()

    \n+\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 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@@ -824,18 +824,18 @@\n message to an HWND or some other main message pump. The actual\n retrieval of alerts should not be done in the callback. In fact, the\n callback should not block. It should not perform any expensive work.\n It really should just notify the main application thread.

    \n

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

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

    delete_port_mapping() add_port_mapping()

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

    add_port_mapping() delete_port_mapping()

    \n
    \n 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@@ -904,14 +904,94 @@\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_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 [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@@ -919,32 +999,32 @@\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& operator= (session_proxy const&) &;\n-   session_proxy (session_proxy&&) noexcept;\n-   session_proxy ();\n-   ~session_proxy ();\n    session_proxy (session_proxy const&);\n    session_proxy& operator= (session_proxy&&) & noexcept;\n+   session_proxy (session_proxy&&) noexcept;\n+   ~session_proxy ();\n+   session_proxy ();\n };\n 
    \n \n \n [report issue]
    \n

    operator=() ~session_proxy() session_proxy()

    \n
    \n session_proxy& operator= (session_proxy const&) &;\n-session_proxy (session_proxy&&) noexcept;\n-session_proxy ();\n-~session_proxy ();\n session_proxy (session_proxy const&);\n session_proxy& operator= (session_proxy&&) & noexcept;\n+session_proxy (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@@ -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-   session ();\n+   explicit session (session_params const& params);\n    explicit session (session_params&& params);\n    session (session_params&& params, session_flags_t flags);\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, session_flags_t);\n+   session ();\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 (session_params const& params, io_context& ios);\n+   session (session_params const& params, io_context& ios, session_flags_t);\n    ~session ();\n    session_proxy abort ();\n };\n 
    \n [report issue]
    \n

    session()

    \n
    \n-session ();\n+explicit session (session_params const& params);\n explicit session (session_params&& params);\n session (session_params&& params, session_flags_t flags);\n session (session_params const& params, session_flags_t flags);\n-explicit session (session_params const& params);\n+session ();\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+session (session_params const& params, io_context& ios);\n+session (session_params const& params, io_context& ios, session_flags_t);\n 
    \n

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

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

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

    session_params

    \n-

    Declared in "libtorrent/session_params.hpp"

    \n-

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

    \n-
    \n-struct session_params\n-{\n-   session_params (settings_pack const& sp);\n-   session_params (settings_pack&& 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 const& sp);\n-session_params (settings_pack&& 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

    read_session_params() write_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+std::vector<char> write_session_params_buf (session_params const& sp\n+   , save_state_flags_t flags = save_state_flags_t::all());\n session_params read_session_params (bdecode_node const& e\n    , save_state_flags_t flags = save_state_flags_t::all());\n 
    \n

    These functions serialize and de-serialize a session_params object to and\n from bencoded form. The session_params object is used to initialize a new\n session using the state from a previous one (or by programmatically configure\n the session up-front).\n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -2,58 +2,58 @@\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__\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 _\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 _\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 _\br_\be_\bs_\bu_\bm_\be_\b(_\b)_\b _\bi_\bs_\b__\bp_\ba_\bu_\bs_\be_\bd_\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__\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 _\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 _\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 _\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 _\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 _\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 _\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 _\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 _\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 _\bp_\bo_\bp_\b__\ba_\bl_\be_\br_\bt_\bs_\b(_\b)_\b _\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)\n- o _\bd_\be_\bl_\be_\bt_\be_\b__\bp_\bo_\br_\bt_\b__\bm_\ba_\bp_\bp_\bi_\bn_\bg_\b(_\b)_\b _\ba_\bd_\bd_\b__\bp_\bo_\br_\bt_\b__\bm_\ba_\bp_\bp_\bi_\bn_\bg_\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_\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__\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- * _\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 * _\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)_\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_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@@ -72,67 +72,67 @@\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- 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);\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, 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 const& params, error_code&\n 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);\n+ torrent_handle a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt (add_torrent_params&& params, error_code& ec);\n bool i\bis\bs_\b_p\bpa\bau\bus\bse\bed\bd () const;\n- void r\bre\bes\bsu\bum\bme\be ();\n void p\bpa\bau\bus\bse\be ();\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_g\bge\bet\bt_\b_p\bpe\bee\ber\brs\bs (sha1_hash const& info_hash);\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 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 bool i\bis\bs_\b_l\bli\bis\bst\bte\ben\bni\bin\bng\bg () 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- 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 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 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&&);\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 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@@ -161,15 +161,15 @@\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* g\bge\bet\bt_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_s\bst\bta\bat\btu\bus\bs(\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) *\b**\b**\b**\b**\b*\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@@ -225,31 +225,31 @@\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* 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+*\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 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 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-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);\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 const& 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);\n torrent_handle a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt (add_torrent_params&& 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, error_code& ec);\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@@ -272,16 +272,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* r\bre\bes\bsu\bum\bme\be(\b()\b) i\bis\bs_\b_p\bpa\bau\bus\bse\bed\bd(\b()\b) p\bpa\bau\bus\bse\be(\b()\b) *\b**\b**\b**\b**\b*\n bool i\bis\bs_\b_p\bpa\bau\bus\bse\bed\bd () const;\n-void r\bre\bes\bsu\bum\bme\be ();\n void p\bpa\bau\bus\bse\be ();\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@@ -358,17 +358,17 @@\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-void d\bdh\bht\bt_\b_g\bge\bet\bt_\b_p\bpe\bee\ber\brs\bs (sha1_hash const& info_hash);\n dht_get_peers() will issue a DHT get_peer request to the DHT for the specified\n info-hash. The response (the peers) will be posted back in a\n _\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@@ -425,15 +425,15 @@\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* 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+*\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@@ -444,16 +444,16 @@\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 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+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 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@@ -480,15 +480,15 @@\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+*\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@@ -518,17 +518,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-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+*\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 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@@ -558,26 +558,26 @@\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+*\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 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&&);\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) 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) *\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+*\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@@ -616,15 +616,15 @@\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* d\bde\bel\ble\bet\bte\be_\b_p\bpo\bor\brt\bt_\b_m\bma\bap\bpp\bpi\bin\bng\bg(\b()\b) a\bad\bdd\bd_\b_p\bpo\bor\brt\bt_\b_m\bma\bap\bpp\bpi\bin\bng\bg(\b()\b) *\b**\b**\b**\b**\b*\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@@ -673,39 +673,103 @@\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\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* 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 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- 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 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&&) & noexcept;\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+ 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* 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 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-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 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&&) & noexcept;\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+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- s\bse\bes\bss\bsi\bio\bon\bn ();\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&& params, session_flags_t flags);\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, session_flags_t);\n+ s\bse\bes\bss\bsi\bio\bon\bn ();\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+ 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 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 ();\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&& params, session_flags_t flags);\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 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+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 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@@ -781,87 +845,23 @@\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 const& sp);\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 ();\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 const& sp);\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 ();\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* 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) 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+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 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 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"}]}, {"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@@ -4598,23 +4598,23 @@\n

    \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_bool (int name, bool 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-   bool get_bool (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@@ -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_int() set_bool()

    \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_bool (int name, bool 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,16 +4727,16 @@\n

    clear a specific setting from the pack

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

    get_str() get_bool() get_int()

    \n
    \n-bool get_bool (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@@ -5096,45 +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 [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 +5173,43 @@\n
    \n

    default_settings()

    \n

    Declared in "libtorrent/settings_pack.hpp"

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

    returns a settings_pack with every setting set to its default value

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

    high_performance_seed() min_memory_usage()

    \n+

    Declared in "libtorrent/session.hpp"

    \n+
    \n+settings_pack 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 \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__\bi_\bn_\bt_\b(_\b)_\b _\bs_\be_\bt_\b__\bb_\bo_\bo_\bl_\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 * _\bs_\be_\bt_\bt_\bi_\bn_\bg_\b__\bb_\by_\b__\bn_\ba_\bm_\be_\b(_\b)_\b _\bn_\ba_\bm_\be_\b__\bf_\bo_\br_\b__\bs_\be_\bt_\bt_\bi_\bn_\bg_\b(_\b)\n * _\bd_\be_\bf_\ba_\bu_\bl_\bt_\b__\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\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 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@@ -1435,23 +1435,23 @@\n connect to the external NAT-PMP port (configured using announce_port) instead\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_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 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- bool g\bge\bet\bt_\b_b\bbo\boo\bol\bl (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@@ -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-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+*\b**\b**\b**\b**\b* s\bse\bet\bt_\b_s\bst\btr\br(\b()\b) s\bse\bet\bt_\b_i\bin\bnt\bt(\b()\b) s\bse\bet\bt_\b_b\bbo\boo\bol\bl(\b()\b) *\b**\b**\b**\b**\b*\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_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 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,16 +1546,16 @@\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-bool g\bge\bet\bt_\b_b\bbo\boo\bol\bl (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@@ -1683,38 +1683,14 @@\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-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-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-that each connection only has at most one block in use at any one time. It\n-lowers the outstanding blocks send to the disk I/O thread so that connections\n-only have one block waiting to be flushed to disk at any given time. It lowers\n-the max number of peers in the peer list for torrents. It performs multiple\n-smaller reads when it hashes pieces, instead of reading it all into memory\n-before hashing.\n-This configuration is intended to be the starting point for embedded devices.\n-It will significantly reduce memory usage.\n-high_performance_seed returns settings optimized for a seed box, serving many\n-peers and that doesn't do any downloading. It has a 128 MB disk cache and has a\n-limit of 400 files in its file pool. It support fast upload rates by allowing\n-large send buffers.\n-[_\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@@ -1743,14 +1719,38 @@\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* 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+for the basis, and should be tweaked to fit your needs better.\n+min_memory_usage returns settings that will use the minimal amount of RAM, at\n+the potential expense of upload and download performance. It adjusts the socket\n+buffer sizes, disables the disk cache, lowers the send buffer watermarks so\n+that each connection only has at most one block in use at any one time. It\n+lowers the outstanding blocks send to the disk I/O thread so that connections\n+only have one block waiting to be flushed to disk at any given time. It lowers\n+the max number of peers in the peer list for torrents. It performs multiple\n+smaller reads when it hashes pieces, instead of reading it all into memory\n+before hashing.\n+This configuration is intended to be the starting point for embedded devices.\n+It will significantly reduce memory usage.\n+high_performance_seed returns settings optimized for a seed box, serving many\n+peers and that doesn't do any downloading. It has a 128 MB disk cache and has a\n+limit of 400 files in its file pool. It support fast upload rates by allowing\n+large send buffers.\n _\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,25 +28,50 @@\n 2.0.11\n \n \n

    home

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

    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@@ -62,40 +87,15 @@\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-

    inc_stats_counter() operator[]()

    \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,19 +1,37 @@\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_\bt_\ba_\bt_\bs_\b__\bm_\be_\bt_\br_\bi_\bc\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 * _\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@@ -25,32 +43,14 @@\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* 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 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": "@@ -33,52 +33,52 @@\n

    Table of contents

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

    storage_params

    \n@@ -139,76 +139,76 @@\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+   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_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+   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+   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-   void set_num_pieces (int n);\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+   void set_piece_length (int l);\n    int piece_size (piece_index_t index) const;\n    int piece_size2 (piece_index_t index) const;\n    int blocks_in_piece2 (piece_index_t index) const;\n    int blocks_per_piece () const;\n-   std::string const& name () 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 file_path (file_index_t index, std::string const& save_path = "") const;\n-   std::int64_t file_offset (file_index_t index) const;\n-   sha256_hash root (file_index_t index) const;\n    std::string symlink (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::time_t mtime (file_index_t index) const;\n    bool pad_file_at (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+   std::int64_t file_offset (file_index_t index) const;\n    std::int64_t file_size (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+   sha1_hash hash (file_index_t index) const;\n+   sha256_hash root (file_index_t index) const;\n+   std::time_t mtime (file_index_t index) const;\n+   std::string file_path (file_index_t index, std::string const& save_path = "") const;\n    index_range<piece_index_t::diff_type> file_piece_range (file_index_t) const;\n-   int file_first_block_node (file_index_t index) const;\n+   int file_num_blocks (file_index_t index) const;\n+   int file_num_pieces (file_index_t index) const;\n    int file_first_piece_node (file_index_t index) const;\n+   int file_first_block_node (file_index_t index) const;\n    std::uint32_t file_path_hash (file_index_t index, std::string const& save_path) const;\n    void all_path_hashes (std::unordered_set<std::uint32_t>& table) const;\n    file_flags_t file_flags (file_index_t index) const;\n    bool file_absolute_path (file_index_t index) const;\n-   file_index_t file_index_at_piece (piece_index_t piece) const;\n    file_index_t file_index_at_offset (std::int64_t offset) const;\n+   file_index_t file_index_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@@ -230,36 +230,36 @@\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+[report issue]
    \n+
    \n+

    add_file_borrow() add_file()

    \n
    \n-void add_file (std::string const& path, std::int64_t file_size\n-      , file_flags_t file_flags = {}\n-      , std::time_t mtime = 0, string_view symlink_path = string_view()\n+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_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+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+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@@ -310,29 +310,29 @@\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+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+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@@ -358,21 +358,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-void set_num_pieces (int 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@@ -397,26 +397,26 @@\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+void set_piece_length (int l);\n 
    \n

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

    \n [report issue]
    \n
    \n

    piece_size()

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

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

    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@@ -440,16 +440,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-std::string const& name () const;\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@@ -461,36 +461,36 @@\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-[report issue]
    \n-\n+\n-
    \n-

    file_piece_range() file_num_blocks() file_num_pieces()

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

    file_num_blocks() file_num_pieces() file_piece_range()

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

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

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

    file_first_block_node() file_first_piece_node()

    \n
    \n-int file_first_block_node (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 
    \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@@ -574,16 +574,16 @@\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-file_index_t file_index_at_piece (piece_index_t piece) const;\n file_index_t file_index_at_offset (std::int64_t offset) const;\n+file_index_t file_index_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@@ -629,57 +629,57 @@\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+[report issue]
    \n
    \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

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

    mmap_disk_io_constructor()

    \n+

    Declared in "libtorrent/mmap_disk_io.hpp"

    \n
    \n-std::unique_ptr<disk_interface> posix_disk_io_constructor (\n+std::unique_ptr<disk_interface> mmap_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+

    constructs a memory mapped file disk I/O object.

    \n [report issue]
    \n
    \n

    default_disk_io_constructor()

    \n

    Declared in "libtorrent/session.hpp"

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

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

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

    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": "@@ -4,51 +4,51 @@\n _\bh_\bo_\bm_\be\n Table of contents\n * _\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bp_\ba_\br_\ba_\bm_\bs\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 _\ba_\bd_\bd_\b__\bf_\bi_\bl_\be_\b__\bb_\bo_\br_\br_\bo_\bw_\b(_\b)_\b _\ba_\bd_\bd_\b__\bf_\bi_\bl_\be_\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 _\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 _\bm_\bt_\bi_\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 _\bp_\ba_\bd_\b__\bf_\bi_\bl_\be_\b__\ba_\bt_\b(_\b)_\b _\bf_\bi_\bl_\be_\b__\bp_\ba_\bt_\bh_\b(_\b)_\b _\bf_\bi_\bl_\be_\b__\bn_\ba_\bm_\be_\b(_\b)\n- _\br_\bo_\bo_\bt_\b__\bp_\bt_\br_\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__\bp_\bi_\be_\bc_\be_\b__\br_\ba_\bn_\bg_\be_\b(_\b)_\b _\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)\n+ o _\bm_\bt_\bi_\bm_\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)_\b _\bf_\bi_\bl_\be_\b__\bp_\ba_\bt_\bh_\b(_\b)_\b _\bs_\by_\bm_\bl_\bi_\bn_\bk_\b(_\b)_\b _\br_\bo_\bo_\bt_\b(_\b)\n+ _\bp_\ba_\bd_\b__\bf_\bi_\bl_\be_\b__\ba_\bt_\b(_\b)_\b _\bf_\bi_\bl_\be_\b__\bs_\bi_\bz_\be_\b(_\b)_\b _\bf_\bi_\bl_\be_\b__\bo_\bf_\bf_\bs_\be_\bt_\b(_\b)_\b _\bh_\ba_\bs_\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 _\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__\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__\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- * _\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- * _\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 * _\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_\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 * _\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* 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@@ -96,80 +96,80 @@\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+ 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_\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 (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 (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 (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+ 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+ 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_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+ 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 f\bfi\bil\ble\be_\b_p\bpa\bat\bth\bh (file_index_t index, std::string const& save_path =\n-\"\") const;\n- std::int64_t f\bfi\bil\ble\be_\b_o\bof\bff\bfs\bse\bet\bt (file_index_t index) const;\n- sha256_hash r\bro\boo\bot\bt (file_index_t index) const;\n std::string s\bsy\bym\bml\bli\bin\bnk\bk (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::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- 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+ std::int64_t f\bfi\bil\ble\be_\b_o\bof\bff\bfs\bse\bet\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- 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+ sha1_hash h\bha\bas\bsh\bh (file_index_t index) const;\n+ sha256_hash r\bro\boo\bot\bt (file_index_t index) const;\n+ std::time_t m\bmt\bti\bim\bme\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 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_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_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_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_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_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+ 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@@ -185,32 +185,32 @@\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+*\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_\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_\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+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+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@@ -280,17 +280,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-void s\bse\bet\bt_\b_n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\bs (int n);\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 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* 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@@ -302,16 +302,16 @@\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* 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+void s\bse\bet\bt_\b_p\bpi\bie\bec\bce\be_\b_l\ble\ben\bng\bgt\bth\bh (int l);\n set and get the size of each piece in this torrent. It must be a power of two\n and at least 16 kiB.\n [_\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@@ -329,40 +329,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-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+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* m\bmt\bti\bim\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) p\bpa\bad\bd_\b_f\bfi\bil\ble\be_\b_a\bat\bt(\b()\b) f\bfi\bil\ble\be_\b_p\bpa\bat\bth\bh(\b()\b) f\bfi\bil\ble\be_\b_n\bna\bam\bme\be(\b()\b)\n-r\bro\boo\bot\bt_\b_p\bpt\btr\br(\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-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::int64_t f\bfi\bil\ble\be_\b_o\bof\bff\bfs\bse\bet\bt (file_index_t index) const;\n-sha256_hash r\bro\boo\bot\bt (file_index_t index) const;\n+*\b**\b**\b**\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_n\bna\bam\bme\be(\b()\b) f\bfi\bil\ble\be_\b_p\bpa\bat\bth\bh(\b()\b) s\bsy\bym\bml\bli\bin\bnk\bk(\b()\b) r\bro\boo\bot\bt(\b()\b) p\bpa\bad\bd_\b_f\bfi\bil\ble\be_\b_a\bat\bt(\b()\b)\n+f\bfi\bil\ble\be_\b_s\bsi\biz\bze\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) *\b**\b**\b**\b**\b*\n std::string s\bsy\bym\bml\bli\bin\bnk\bk (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::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-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+std::int64_t f\bfi\bil\ble\be_\b_o\bof\bff\bfs\bse\bet\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+sha1_hash h\bha\bas\bsh\bh (file_index_t index) const;\n+sha256_hash r\bro\boo\bot\bt (file_index_t index) const;\n+std::time_t m\bmt\bti\bim\bme\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 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@@ -375,26 +375,26 @@\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_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_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) *\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+*\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 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_n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\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_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+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@@ -412,16 +412,16 @@\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-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+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@@ -450,43 +450,43 @@\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* 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* 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* 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+*\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-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+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\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* 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,51 +39,51 @@\n \n
  • partial_piece_info
  • \n
  • torrent_handle\n
  • \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

    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@@ -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, 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 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-   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-   void get_download_queue (std::vector<partial_piece_info>& queue) const;\n-   void post_download_queue () 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 clear_piece_deadlines () const;\n+   void post_download_queue () const;\n+   void get_download_queue (std::vector<partial_piece_info>& queue) const;\n    void set_piece_deadline (piece_index_t index, int deadline, deadline_flags_t flags = {}) const;\n    void reset_piece_deadline (piece_index_t index) const;\n+   void clear_piece_deadlines () const;\n    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+   void post_file_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    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+   void replace_trackers (std::vector<announce_entry> const&) const;\n    void add_url_seed (std::string const& url) const;\n-   void remove_url_seed (std::string const& url) const;\n    std::set<std::string> url_seeds () const;\n-   void remove_http_seed (std::string const& url) const;\n-   std::set<std::string> http_seeds () const;\n+   void remove_url_seed (std::string const& url) const;\n    void add_http_seed (std::string const& url) const;\n+   std::set<std::string> http_seeds () const;\n+   void remove_http_seed (std::string const& url) const;\n    void add_extension (\n       std::function<std::shared_ptr<torrent_plugin>(torrent_handle const&, client_data_t)> const& ext\n       , client_data_t userdata = client_data_t{});\n    bool set_metadata (span<char const> metadata) const;\n    bool is_valid () const;\n-   void resume () const;\n    void pause (pause_flags_t flags = {}) const;\n-   void set_flags (torrent_flags_t flags) const;\n+   void resume () 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-   torrent_flags_t flags () const;\n+   void set_flags (torrent_flags_t flags) const;\n    void flush_cache () const;\n    void force_recheck () const;\n    void save_resume_data (resume_data_flags_t flags = {}) const;\n    bool need_save_resume_data (resume_data_flags_t flags) const;\n    bool need_save_resume_data () const;\n-   void queue_position_down () const;\n-   void queue_position_bottom () const;\n+   void queue_position_up () const;\n    queue_position_t queue_position () 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_set (queue_position_t p) const;\n+   void set_ssl_certificate_buffer (std::string const& certificate\n+      , std::string const& private_key\n+      , std::string const& dh_params);\n    void set_ssl_certificate (std::string const& certificate\n       , std::string const& private_key\n       , std::string const& dh_params\n       , std::string const& passphrase = "");\n-   void set_ssl_certificate_buffer (std::string const& certificate\n-      , std::string const& private_key\n-      , std::string const& dh_params);\n-   std::shared_ptr<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    std::vector<download_priority_t> get_piece_priorities () const;\n-   void piece_priority (piece_index_t index, download_priority_t priority) const;\n-   download_priority_t piece_priority (piece_index_t index) 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    void prioritize_pieces (std::vector<download_priority_t> const& pieces) const;\n-   void prioritize_files (std::vector<download_priority_t> const& files) const;\n+   void piece_priority (piece_index_t index, download_priority_t priority) 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    std::vector<download_priority_t> get_file_priorities () const;\n-   void force_lsd_announce () const;\n+   download_priority_t file_priority (file_index_t index) const;\n+   void prioritize_files (std::vector<download_priority_t> const& files) const;\n    void force_reannounce (int seconds = 0, int idx = -1, reannounce_flags_t = {}) const;\n+   void force_lsd_announce () const;\n    void force_dht_announce () const;\n    void scrape_tracker (int idx = -1) const;\n    void set_download_limit (int limit) const;\n-   int upload_limit () const;\n    int download_limit () const;\n    void set_upload_limit (int limit) const;\n+   int upload_limit () const;\n    void connect_peer (tcp::endpoint const& adr, peer_source_flags_t source = {}\n       , pex_flags_t flags = pex_encryption | pex_utp | pex_holepunch) const;\n    void clear_peers ();\n    int max_uploads () const;\n    void set_max_uploads (int max_uploads) const;\n-   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-   sha1_hash info_hash () const;\n    info_hash_t info_hashes () const;\n-   bool operator!= (const torrent_handle& h) 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 \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, 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 
    \n@@ -444,39 +444,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-

    status() post_status()

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

    post_status() status()

    \n
    \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+torrent_status 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-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+void post_download_queue () const;\n+void get_download_queue (std::vector<partial_piece_info>& 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-\n-[report issue]
    \n-
    \n-

    clear_piece_deadlines() reset_piece_deadline() set_piece_deadline()

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

    set_piece_deadline() clear_piece_deadlines() reset_piece_deadline()

    \n
    \n-void clear_piece_deadlines () const;\n void set_piece_deadline (piece_index_t index, int deadline, deadline_flags_t flags = {}) const;\n void reset_piece_deadline (piece_index_t index) const;\n+void clear_piece_deadlines () const;\n 
    \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@@ -528,22 +528,22 @@\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 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+void post_file_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@@ -572,25 +572,25 @@\n

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

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

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

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

    \n
    \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+void replace_trackers (std::vector<announce_entry> const&) 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 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@@ -602,42 +602,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-\n-[report issue]
    \n-
    \n-

    url_seeds() add_url_seed() remove_url_seed()

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

    remove_url_seed() url_seeds() add_url_seed()

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

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

    \n

    See http seeding for more information.

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

    add_http_seed() remove_http_seed() http_seeds()

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

    http_seeds() add_http_seed() remove_http_seed()

    \n
    \n-void remove_http_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+std::set<std::string> http_seeds () const;\n+void remove_http_seed (std::string const& url) 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@@ -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

    resume() pause()

    \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@@ -710,18 +710,18 @@\n
    \n \n \n [report issue]
    \n
    \n

    flags() set_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-torrent_flags_t flags () const;\n+void set_flags (torrent_flags_t flags) const;\n 
    \n

    sets and gets the torrent state flags. See torrent_flags_t.\n The set_flags overload that take a mask will affect all\n flags part of the mask, and set their values to what the\n flags argument is set to. This allows clearing and\n setting flags in a single function call.\n The set_flags overload that just takes flags, sets all\n@@ -877,27 +877,27 @@\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_up() queue_position_down() queue_position() queue_position_bottom() queue_position_top()

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

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

    \n
    \n-void queue_position_down () const;\n-void queue_position_bottom () const;\n+void queue_position_up () const;\n queue_position_t queue_position () 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 
    \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 greater queue positions have their positions decreased to fill in the\n@@ -921,21 +921,21 @@\n of all other torrents remain intact but their numerical queue position\n shifts to make space for this torrent's new position

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

    set_ssl_certificate_buffer() set_ssl_certificate()

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

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

    \n

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

    \n

    cert is a path to the (signed) certificate in .pem format\n@@ -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() torrent_file_with_hashes()

    \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@@ -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-

    piece_priority() prioritize_pieces() get_piece_priorities()

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

    piece_priority() get_piece_priorities() prioritize_pieces()

    \n
    \n std::vector<download_priority_t> get_piece_priorities () const;\n-void piece_priority (piece_index_t index, download_priority_t priority) const;\n-download_priority_t piece_priority (piece_index_t index) 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 void prioritize_pieces (std::vector<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,24 +1054,24 @@\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-

    get_file_priorities() file_priority() prioritize_files()

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

    prioritize_files() get_file_priorities() file_priority()

    \n
    \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-download_priority_t file_priority (file_index_t index) const;\n std::vector<download_priority_t> get_file_priorities () const;\n+download_priority_t file_priority (file_index_t index) 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 torrent based on the vector.

    \n@@ -1094,22 +1094,22 @@\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_reannounce() force_lsd_announce()

    \n
    \n-void force_lsd_announce () const;\n void force_reannounce (int seconds = 0, int idx = -1, reannounce_flags_t = {}) const;\n+void force_lsd_announce () const;\n void force_dht_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@@ -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-[report issue]
    \n-
    \n-

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

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

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

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

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

    set_max_connections() max_connections()

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

    max_connections() set_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-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

    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 _\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 _\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)_\b _\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 _\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 _\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 _\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 _\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 _\bu_\br_\bl_\b__\bs_\be_\be_\bd_\bs_\b(_\b)_\b _\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)\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 _\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)_\b _\br_\be_\bp_\bl_\ba_\bc_\be_\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 _\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)_\b _\ba_\bd_\bd_\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 _\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 _\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__\bd_\bo_\bw_\bn_\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__\bt_\bo_\bp_\b(_\b)\n+          o _\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__\bb_\bo_\bt_\bt_\bo_\bm_\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__\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(_\b)_\b _\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)\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 _\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 _\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__\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 _\bg_\be_\bt_\b__\bp_\bi_\be_\bc_\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__\bp_\bi_\be_\bc_\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 _\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)\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__\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)\n           o _\bs_\bc_\br_\ba_\bp_\be_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\b(_\b)\n-          o _\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)_\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 _\bs_\be_\bt_\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)_\b _\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\b__\bl_\bi_\bm_\bi_\bt_\b(_\b)\n+            _\bu_\bp_\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_\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_\b(_\b)_\b _\bi_\bn_\bf_\bo_\b__\bh_\ba_\bs_\bh_\be_\bs_\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 [_\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* 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-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@@ -183,112 +183,112 @@\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 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-   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-   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+   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 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_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 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 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 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    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+   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_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    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+   void r\bre\bep\bpl\bla\bac\bce\be_\b_t\btr\bra\bac\bck\bke\ber\brs\bs (std::vector const&) 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_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 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 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_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 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_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) const;\n+   void r\bre\bes\bsu\bum\bme\be () 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-   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 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_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+   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_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_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-   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    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-   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\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\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_f\bfi\bil\ble\bes\bs (std::vector const& files) 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 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    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\bfo\bor\brc\bce\be_\b_l\bls\bsd\bd_\b_a\ban\bnn\bno\bou\bun\bnc\bce\be () 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 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_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 f\bfo\bor\brc\bce\be_\b_d\bdh\bht\bt_\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    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    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_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    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-   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-   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-   bool o\bop\bpe\ber\bra\bat\bto\bor\br!\b!=\b= (const torrent_handle& h) 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 \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+*\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* 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+*\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 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-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+*\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 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 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 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* 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) 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 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+*\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 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 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 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 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@@ -415,20 +415,20 @@\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+*\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+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 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* 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) r\bre\bep\bpl\bla\bac\bce\be_\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 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+void r\bre\bep\bpl\bla\bac\bce\be_\b_t\btr\bra\bac\bck\bke\ber\brs\bs (std::vector const&) 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@@ -470,30 +470,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* u\bur\brl\bl_\b_s\bse\bee\bed\bds\bs(\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) *\b**\b**\b**\b**\b*\n+*\b**\b**\b**\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) 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_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_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 r\bre\bem\bmo\bov\bve\be_\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) 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 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+*\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 void a\bad\bdd\bd_\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 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 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@@ -525,16 +525,16 @@\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-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@@ -542,18 +542,18 @@\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-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-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 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@@ -677,21 +677,21 @@\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_d\bdo\bow\bwn\bn(\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_t\bto\bop\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_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+*\b**\b**\b**\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\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()\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_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 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 queue_position() returns the torrent's position in the download queue. The\n@@ -706,21 +706,21 @@\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+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-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 For SSL torrents, use this to specify a path to a .pem file to use as this\n client's certificate. The certificate must be signed by the certificate in the\n .torrent file to be valid.\n The _\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) overload takes the actual certificate, private\n key and DH params as strings, rather than paths to files.\n cert is a path to the (signed) certificate in .pem format corresponding to this\n torrent.\n@@ -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()\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) *\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@@ -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* 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+*\b**\b**\b**\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) 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-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\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\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,19 +816,19 @@\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-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+*\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) 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) *\b**\b**\b**\b**\b*\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 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+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 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 The priority values are the same as for _\bp_\bi_\be_\bc_\be_\b__\bp_\br_\bi_\bo_\br_\bi_\bt_\by_\b(_\b). See\n@@ -847,18 +847,18 @@\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_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) *\b**\b**\b**\b**\b*\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 f\bfo\bor\brc\bce\be_\b_d\bdh\bht\bt_\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@@ -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* 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) 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) 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) u\bup\bpl\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_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 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_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 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 void s\bse\bet\bt_\b_m\bma\bax\bx_\b_u\bup\bpl\blo\boa\bad\bds\bs (int max_uploads) const;\n set_max_uploads() sets the maximum number of peers that's unchoked at the same\n time on this torrent. If you set this to -1, there will be no limit. This\n defaults to infinite. The primary setting controlling this is the global\n unchoke slots limit, set by unchoke_slots_limit in _\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-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* 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 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-sha1_hash i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh () const;\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-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": "@@ -41,23 +41,23 @@\n 
  • load_torrent_limits
  • \n
  • torrent_info
  • \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@@ -197,69 +197,69 @@\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 (torrent_info const& t);\n-   torrent_info (char const* buffer, int size, error_code& ec);\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-   explicit torrent_info (info_hash_t const& info_hash);\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    explicit torrent_info (std::string const& filename);\n-   torrent_info (span<char const> buffer, error_code& ec, from_span_t);\n+   torrent_info (torrent_info const& t);\n+   torrent_info (char const* buffer, int size);\n+   explicit torrent_info (info_hash_t const& info_hash);\n    explicit torrent_info (bdecode_node const& torrent_file);\n+   torrent_info (std::string const& filename, load_torrent_limits const& cfg);\n    torrent_info (bdecode_node const& torrent_file, error_code& ec);\n+   torrent_info (span<char const> buffer, error_code& ec, from_span_t);\n    torrent_info (std::string const& filename, error_code& ec);\n-   torrent_info (bdecode_node const& torrent_file, load_torrent_limits const& cfg);\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 ();\n-   file_storage const& orig_files () const;\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+   void add_tracker (std::string const& url, int tier = 0);\n+   std::vector<announce_entry> const& trackers () const;\n    void clear_trackers ();\n    void add_tracker (std::string const& url, int tier\n       , announce_entry::tracker_source source);\n-   void add_tracker (std::string const& url, int tier = 0);\n-   std::vector<announce_entry> const& trackers () const;\n-   std::vector<sha1_hash> similar_torrents () const;\n    std::vector<std::string> collections () const;\n-   std::vector<web_seed_entry> const& web_seeds () const;\n-   void set_web_seeds (std::vector<web_seed_entry> seeds);\n-   void add_url_seed (std::string const& url\n-      , std::string const& ext_auth = std::string()\n-      , web_seed_entry::headers_t const& ext_headers = web_seed_entry::headers_t());\n+   std::vector<sha1_hash> similar_torrents () 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    std::int64_t total_size () const;\n-   int piece_length () const;\n    int num_pieces () const;\n+   int piece_length () 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-   info_hash_t const& info_hashes () const;\n+   piece_index_t last_piece () const;\n    sha1_hash info_hash () const noexcept;\n-   bool v2 () const;\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+   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@@ -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 (char const* buffer, int size);\n-torrent_info (torrent_info const& t);\n-torrent_info (char const* buffer, int size, error_code& ec);\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-explicit torrent_info (info_hash_t const& info_hash);\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 explicit torrent_info (std::string const& filename);\n-torrent_info (span<char const> buffer, error_code& ec, from_span_t);\n+torrent_info (torrent_info const& t);\n+torrent_info (char const* buffer, int size);\n+explicit torrent_info (info_hash_t const& info_hash);\n explicit torrent_info (bdecode_node const& torrent_file);\n+torrent_info (std::string const& filename, load_torrent_limits const& cfg);\n torrent_info (bdecode_node const& torrent_file, error_code& ec);\n+torrent_info (span<char const> buffer, error_code& ec, from_span_t);\n torrent_info (std::string const& filename, error_code& ec);\n-torrent_info (bdecode_node const& torrent_file, load_torrent_limits const& cfg);\n-torrent_info (std::string const& filename, 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@@ -323,16 +323,16 @@\n \n

    frees all storage associated with this torrent_info object

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

    files() orig_files()

    \n
    \n-file_storage const& orig_files () const;\n file_storage const& files () const;\n+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@@ -348,15 +348,15 @@\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+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@@ -376,25 +376,25 @@\n
    \n

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

    \n

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

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

    add_tracker() trackers() clear_trackers()

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

    trackers() clear_trackers() add_tracker()

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

    add_tracker() adds a tracker to the announce-list. The tier\n determines the order in which the trackers are to be tried.\n The trackers() function will return a sorted vector of\n announce_entry. Each announce entry contains a string, which is\n the tracker url, and a tier index. The tier index is the high-level\n priority. No matter which trackers that works or not, the ones with\n@@ -403,37 +403,37 @@\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+std::vector<sha1_hash> similar_torrents () const;\n 
    \n

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

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

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

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

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

    \n
    \n-std::vector<web_seed_entry> const& web_seeds () const;\n-void set_web_seeds (std::vector<web_seed_entry> seeds);\n-void add_url_seed (std::string const& url\n-      , std::string const& ext_auth = std::string()\n-      , web_seed_entry::headers_t const& ext_headers = web_seed_entry::headers_t());\n void add_http_seed (std::string const& url\n       , std::string const& extern_auth = std::string()\n       , web_seed_entry::headers_t const& extra_headers = web_seed_entry::headers_t());\n+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 
    \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 piece_length () const;\n int num_pieces () const;\n+int piece_length () 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,48 +476,48 @@\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-\n-[report issue]
    \n-
    \n-

    piece_range() last_piece() end_piece()

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

    end_piece() piece_range() last_piece()

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

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

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

    info_hash() info_hashes()

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

    info_hashes() info_hash()

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

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

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

    v1() v2()

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

    v2() v1()

    \n
    \n-bool v2 () const;\n bool v1 () const;\n+bool v2 () 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@@ -588,23 +588,23 @@\n to peers over anything other than the i2p network.

    \n [report issue]
    \n
    \n

    piece_size()

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

    returns the piece size of file with index. This will be the same as piece_length(),\n+

    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-sha1_hash hash_for_piece (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 
    \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", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -10,23 +10,23 @@\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 _\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 _\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 _\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)_\b _\ba_\bd_\bd_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\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 _\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)_\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 _\bv_\b1_\b(_\b)_\b _\bv_\b2_\b(_\b)\n+ o _\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)_\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_\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@@ -120,74 +120,74 @@\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 (char const* buffer, int size);\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, 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- explicit t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (span buffer, from_span_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 (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- 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+ 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 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 (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 (std::string const& filename, 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- 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 ~\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+ 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+ void a\bad\bdd\bd_\b_t\btr\bra\bac\bck\bke\ber\br (std::string const& url, int tier = 0);\n+ std::vector const& t\btr\bra\bac\bck\bke\ber\brs\bs () const;\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\n , announce_entry::tracker_source source);\n- void a\bad\bdd\bd_\b_t\btr\bra\bac\bck\bke\ber\br (std::string const& url, int tier = 0);\n- std::vector const& t\btr\bra\bac\bck\bke\ber\brs\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 c\bco\bol\bll\ble\bec\bct\bti\bio\bon\bns\bs () const;\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_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 s\bsi\bim\bmi\bil\bla\bar\br_\b_t\bto\bor\brr\bre\ben\bnt\bts\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 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_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 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 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- info_hash_t const& i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bhe\bes\bs () const;\n+ piece_index_t l\bla\bas\bst\bt_\b_p\bpi\bie\bec\bce\be () const;\n sha1_hash i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bh () const noexcept;\n- bool v\bv2\b2 () const;\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+ 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@@ -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 (char const* buffer, int size);\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, 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-explicit t\bto\bor\brr\bre\ben\bnt\bt_\b_i\bin\bnf\bfo\bo (span buffer, from_span_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 (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-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+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 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 (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 (std::string const& filename, 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-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 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@@ -242,16 +242,16 @@\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& 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+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@@ -284,49 +284,49 @@\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) 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+*\b**\b**\b**\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) 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 (std::string const& url, int tier = 0);\n+std::vector const& t\btr\bra\bac\bck\bke\ber\brs\bs () const;\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\n , announce_entry::tracker_source source);\n-void a\bad\bdd\bd_\b_t\btr\bra\bac\bck\bke\ber\br (std::string const& url, int tier = 0);\n-std::vector const& t\btr\bra\bac\bck\bke\ber\brs\bs () const;\n add_tracker() adds a tracker to the announce-list. The tier determines the\n order in which the trackers are to be tried. The trackers() function will\n return a sorted vector of _\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+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* 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-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_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+*\b**\b**\b**\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) 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 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,46 +340,46 @@\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 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 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) 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* 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) l\bla\bas\bst\bt_\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+piece_index_t l\bla\bas\bst\bt_\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\bh(\b()\b) i\bin\bnf\bfo\bo_\b_h\bha\bas\bsh\bhe\bes\bs(\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+*\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\bv1\b1(\b()\b) v\bv2\b2(\b()\b) *\b**\b**\b**\b**\b*\n-bool v\bv2\b2 () const;\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@@ -428,16 +428,16 @@\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+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 *\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"}]}, {"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,18 +131,18 @@\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-   announce_entry& operator= (announce_entry const&) &;\n+   announce_entry ();\n    explicit announce_entry (string_view u);\n \n    enum tracker_source\n    {\n       source_torrent,\n       source_client,\n       source_magnet_link,\n@@ -155,22 +155,22 @@\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+[report issue]
    \n+

    operator=() announce_entry() ~announce_entry()

    \n
    \n+announce_entry& operator= (announce_entry const&) &;\n announce_entry (announce_entry const&);\n-announce_entry ();\n ~announce_entry ();\n-announce_entry& operator= (announce_entry const&) &;\n+announce_entry ();\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@@ -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 _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b=_\b(_\b)_\b _\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)\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,18 +78,18 @@\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- 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 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@@ -101,19 +101,19 @@\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+*\b**\b**\b**\b**\b* o\bop\bpe\ber\bra\bat\bto\bor\br=\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) *\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-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-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 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"}]}, {"source1": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Utility.html", "source2": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference-Utility.html", "unified_diff": "@@ -31,15 +31,15 @@\n

    home

    \n \n@@ -70,49 +70,49 @@\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 (int bits, bool val);\n-   bitfield (bitfield const& rhs);\n    explicit bitfield (int bits);\n    bitfield () noexcept = default;\n+   bitfield (bitfield const& rhs);\n+   bitfield (bitfield&& rhs) noexcept = default;\n    bitfield (char const* b, int bits);\n+   bitfield (int bits, bool val);\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+   bool get_bit (int index) const noexcept;\n    void clear_bit (int index) noexcept;\n    void set_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 (int bits, bool val);\n-bitfield (bitfield const& rhs);\n explicit bitfield (int bits);\n bitfield () noexcept = default;\n+bitfield (bitfield const& rhs);\n+bitfield (bitfield&& rhs) noexcept = default;\n bitfield (char const* b, int bits);\n+bitfield (int bits, bool val);\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@@ -121,21 +121,21 @@\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+[report issue]
    \n+
    \n+

    get_bit() operator[]()

    \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

    clear_bit() set_bit()

    \n
    \n@@ -187,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@@ -242,32 +242,32 @@\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 (hasher const&);\n-   hasher (char const* data, int len);\n    explicit hasher (span<char const> data);\n    hasher& operator= (hasher const&) &;\n+   hasher (hasher const&);\n+   hasher (char const* data, int len);\n    hasher& update (span<char const> data);\n    hasher& update (char const* data, int len);\n    sha1_hash final ();\n    void reset ();\n };\n 
    \n \n [report issue]
    \n

    hasher() operator=()

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

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

    \n [report issue]
    \n
    \n

    update()

    \n
    \n@@ -296,33 +296,33 @@\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+   explicit hasher256 (span<char const> data);\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+[report issue]
    \n+

    operator=() hasher256()

    \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+explicit hasher256 (span<char const> data);\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", "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     * _\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 _\bg_\be_\bt_\b__\bb_\bi_\bt_\b(_\b)_\b _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b[_\b]_\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@@ -21,73 +21,73 @@\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 _\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 _\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 [_\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 (int bits, bool val);\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 (bitfield const& rhs);\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 (int bits, bool val);\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+   bool g\bge\bet\bt_\b_b\bbi\bit\bt (int index) const noexcept;\n    void c\bcl\ble\bea\bar\br_\b_b\bbi\bit\bt (int index) noexcept;\n    void s\bse\bet\bt_\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 (int bits, bool val);\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 (bitfield const& rhs);\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 (int bits, bool val);\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+*\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 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* 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 c\bcl\ble\bea\bar\br_\b_b\bbi\bit\bt (int index) noexcept;\n void s\bse\bet\bt_\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@@ -113,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@@ -151,29 +151,29 @@\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-   h\bha\bas\bsh\bhe\ber\br (hasher const&);\n-   h\bha\bas\bsh\bhe\ber\br (char const* data, int len);\n    explicit h\bha\bas\bsh\bhe\ber\br (span data);\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+   h\bha\bas\bsh\bhe\ber\br (char const* data, int len);\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-h\bha\bas\bsh\bhe\ber\br (hasher const&);\n-h\bha\bas\bsh\bhe\ber\br (char const* data, int len);\n explicit h\bha\bas\bsh\bhe\ber\br (span data);\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+h\bha\bas\bsh\bhe\ber\br (char const* data, int len);\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@@ -189,30 +189,30 @@\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+   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    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+*\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 h\bha\bas\bsh\bhe\ber\br2\b25\b56\b6 (hasher256 const&);\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 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"}]}, {"source1": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference.html", "source2": "./usr/share/doc/libtorrent-rasterbar-doc/html/reference.html", "comments": ["Ordering differences only"], "unified_diff": "@@ -19,214 +19,214 @@\n     \"libtorrent\n     \n     
    \n

    reference documentation

    \n \n

    single-page version

    \n
    \n-

    Torrent Handle

    \n+

    Torrent Info

    \n \n+

    Torrent Status

    \n+\n

    Core

    \n \n+

    Add Torrent

    \n+\n+

    Torrent Handle

    \n+\n

    Session

    \n \n-

    Torrent Status

    \n+

    Trackers

    \n \n

    Stats

    \n \n-

    Trackers

    \n-\n-

    Add Torrent

    \n-\n

    Settings

    \n \n-

    Torrent Info

    \n-\n

    DHT

    \n \n

    Resume Data

    \n \n
    \n
    \n-

    Bencoding

    \n-\n-

    Bdecoding

    \n-\n-

    Create Torrents

    \n-\n

    Filter

    \n \n

    Error Codes

    \n \n+

    Bencoding

    \n+\n-\n+
    \n

    Utility

    \n \n

    Storage

    \n \n

    Custom Storage

    \n \n+

    PeerClass

    \n+\n+

    Plugins

    \n+\n

    ed25519

    \n
    \n \n \n \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,165 +1,165 @@\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-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+Torrent Status\n+_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bs_\bt_\ba_\bt_\bu_\bs\n Core\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+_\bi_\bn_\bf_\bo_\b__\bh_\ba_\bs_\bh_\b__\bt\n _\bp_\be_\be_\br_\b__\bi_\bn_\bf_\bo\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+_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\be_\be_\br_\b__\be_\bq_\bu_\ba_\bl_\b(_\b)\n+_\bv_\be_\br_\bs_\bi_\bo_\bn_\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-_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\be_\be_\br_\b__\be_\bq_\bu_\ba_\bl_\b(_\b)\n-_\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b__\bt_\by_\bp_\be\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+_\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-_\bs_\bo_\bc_\bk_\be_\bt_\b__\bt_\by_\bp_\be_\b__\bt\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 _\bi_\bn_\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 _\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+_\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+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 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 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_\ba_\br_\ba_\bm_\bs\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 _\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)\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-Torrent Status\n-_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bs_\bt_\ba_\bt_\bu_\bs\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 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_\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-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-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 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-_\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 _\bs_\be_\bt_\bt_\bi_\bn_\bg_\b__\bb_\by_\b__\bn_\ba_\bm_\be_\b(_\b)\n _\bn_\ba_\bm_\be_\b__\bf_\bo_\br_\b__\bs_\be_\bt_\bt_\bi_\bn_\bg_\b(_\b)\n _\bd_\be_\bf_\ba_\bu_\bl_\bt_\b__\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\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+_\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 DHT\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__\bs_\bt_\ba_\bt_\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 _\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\bf_\bl_\ba_\bg_\bs_\b__\bt\n Resume Data\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(_\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__\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-Bencoding\n-_\bo_\bv_\be_\br_\bv_\bi_\be_\bw\n-_\be_\bn_\bt_\br_\by\n-_\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b<_\b<_\b(_\b)\n-_\bb_\be_\bn_\bc_\bo_\bd_\be_\b(_\b)\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 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-_\bb_\bd_\be_\bc_\bo_\bd_\be_\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-_\bg_\bz_\bi_\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 _\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+_\bb_\bd_\be_\bc_\bo_\bd_\be_\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+_\bg_\bz_\bi_\bp_\b__\bc_\ba_\bt_\be_\bg_\bo_\br_\by_\b(_\b)\n+_\bp_\bc_\bp_\b__\bc_\ba_\bt_\be_\bg_\bo_\br_\by_\b(_\b)\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-_\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 _\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-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-Plugins\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+_\be_\br_\br_\bo_\br_\b__\bc_\bo_\bd_\be_\b__\be_\bn_\bu_\bm\n+_\bp_\bc_\bp_\b__\be_\br_\br_\bo_\br_\bs\n+Bencoding\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__\bs_\bm_\ba_\br_\bt_\b__\bb_\ba_\bn_\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+_\be_\bn_\bt_\br_\by\n+_\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b<_\b<_\b(_\b)\n+_\bb_\be_\bn_\bc_\bo_\bd_\be_\b(_\b)\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 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 Storage\n _\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bp_\ba_\br_\ba_\bm_\bs\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-_\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-_\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 _\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_\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 _\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 Custom Storage\n _\bo_\bv_\be_\br_\bv_\bi_\be_\bw\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 _\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+_\bd_\bi_\bs_\bk_\b__\bo_\bb_\bs_\be_\br_\bv_\be_\br\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+_\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be\n _\bf_\bi_\bl_\be_\b__\bo_\bp_\be_\bn_\b__\bm_\bo_\bd_\be_\b__\bt\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+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__\bs_\bm_\ba_\br_\bt_\b__\bb_\ba_\bn_\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 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"}]}, {"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,728 +28,728 @@\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

    Table of contents

    \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+   explicit bitfield (int bits);\n+   bitfield (bitfield&& rhs) noexcept = default;\n+   bitfield (bitfield const& rhs);\n+   bitfield (char const* b, int bits);\n+   bitfield (int bits, bool val);\n+   bitfield () noexcept = default;\n+   void assign (char const* b, int const bits);\n+   bool get_bit (int index) const noexcept;\n+   bool operator[] (int index) const noexcept;\n+   void clear_bit (int index) noexcept;\n+   void set_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+explicit bitfield (int bits);\n+bitfield (bitfield&& rhs) noexcept = default;\n+bitfield (bitfield const& rhs);\n+bitfield (char const* b, int bits);\n+bitfield (int bits, bool val);\n+bitfield () noexcept = default;\n+
    \n+

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

    \n+

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

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

    assign()

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

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

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

    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+

    set_bit() clear_bit()

    \n+
    \n+void clear_bit (int index) noexcept;\n+void set_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+[report issue]
    \n+
    \n+
    \n+

    hasher

    \n+

    Declared in "libtorrent/hasher.hpp"

    \n+

    this is a SHA-1 hash class.

    \n+

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

    \n+

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

    \n+

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

    \n+

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

    \n+
    \n+class hasher\n+{\n+   hasher ();\n+   hasher (char const* data, int len);\n+   hasher& operator= (hasher const&) &;\n+   explicit hasher (span<char const> data);\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+

    operator=() hasher()

    \n+
    \n+hasher (char const* data, int len);\n+hasher& operator= (hasher const&) &;\n+explicit hasher (span<char const> data);\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+   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 (char const* data, int len);\n+   hasher256& update (span<char const> data);\n+   sha256_hash final ();\n+   void reset ();\n+   ~hasher256 ();\n+};\n+
    \n+\n+[report issue]
    \n+

    hasher256() operator=()

    \n+
    \n+explicit hasher256 (span<char const> data);\n+hasher256 (hasher256 const&);\n+hasher256 (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 (char const* data, int len);\n+hasher256& update (span<char const> data);\n+
    \n+

    append the following bytes to what is being hashed

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

    final()

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

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

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

    reset()

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

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

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

    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 (ip_filter&&);\n+   ip_filter& operator= (ip_filter const&);\n+   ip_filter ();\n+   ~ip_filter ();\n+   ip_filter (ip_filter const&);\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+      blocked,\n+   };\n+};\n+
    \n+[report issue]
    \n+

    empty()

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

    returns true if the filter does not contain any rules

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

    add_rule()

    \n+
    \n+void add_rule (address const& first, address const& last, std::uint32_t flags);\n+
    \n+

    Adds a rule to the filter. first and last defines a range of\n+ip addresses that will be marked with the given flags. The flags\n+can currently be 0, which means allowed, or ip_filter::blocked, which\n+means disallowed.

    \n+

    precondition:\n+first.is_v4() == last.is_v4() && first.is_v6() == last.is_v6()

    \n+

    postcondition:\n+access(x) == flags for every x in the range [first, last]

    \n+

    This means that in a case of overlapping ranges, the last one applied takes\n+precedence.

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

    access()

    \n+
    \n+std::uint32_t access (address const& addr) const;\n+
    \n+

    Returns the access permissions for the given address (addr). The permission\n+can currently be 0 or ip_filter::blocked. The complexity of this operation\n+is O(log n), where n is the minimum number of non-overlapping ranges to describe\n+the current filter.

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

    export_filter()

    \n+
    \n+filter_tuple_t export_filter () const;\n+
    \n+

    This function will return the current state of the filter in the minimum number of\n+ranges possible. They are sorted from ranges in low addresses to high addresses. Each\n+entry in the returned vector is a range with the access control specified in its\n+flags field.

    \n+

    The return value is a tuple containing two range-lists. One for IPv4 addresses\n+and one for IPv6 addresses.

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

    enum access_flags

    \n+

    Declared in "libtorrent/ip_filter.hpp"

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    namevaluedescription
    blocked1indicates that IPs in this range should not be connected\n+to nor accepted as incoming connections
    \n+[report issue]
    \n+
    \n+
    \n+

    port_filter

    \n+

    Declared in "libtorrent/ip_filter.hpp"

    \n+

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

    \n+
    \n+class port_filter\n+{\n+   port_filter (port_filter const&);\n+   port_filter (port_filter&&);\n+   port_filter& operator= (port_filter&&);\n+   port_filter& operator= (port_filter const&);\n+   ~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+[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+

    web_seed_entry

    \n+

    Declared in "libtorrent/torrent_info.hpp"

    \n+

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

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

    operator==()

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

    URL and type comparison

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

    operator<()

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

    URL and type less-than comparison

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

    enum type_t

    \n+

    Declared in "libtorrent/torrent_info.hpp"

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

    load_torrent_limits

    \n+

    Declared in "libtorrent/torrent_info.hpp"

    \n+

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

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

    torrent_info

    \n+

    Declared in "libtorrent/torrent_info.hpp"

    \n+

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

    \n+
    \n+class torrent_info\n+{\n+   explicit torrent_info (span<char const> buffer, from_span_t);\n+   torrent_info (char const* buffer, int size, error_code& ec);\n+   explicit torrent_info (std::string const& filename);\n+   explicit torrent_info (bdecode_node const& torrent_file);\n+   torrent_info (bdecode_node const& torrent_file, load_torrent_limits const& cfg);\n+   torrent_info (std::string const& filename, error_code& ec);\n+   explicit torrent_info (info_hash_t const& info_hash);\n+   torrent_info (torrent_info const& t);\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 (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+   torrent_info (char const* buffer, int size);\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+   std::vector<announce_entry> const& trackers () const;\n+   void clear_trackers ();\n+   void add_tracker (std::string const& url, int tier\n+      , announce_entry::tracker_source source);\n+   void add_tracker (std::string const& url, int tier = 0);\n+   std::vector<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+   std::vector<web_seed_entry> const& web_seeds () const;\n+   void set_web_seeds (std::vector<web_seed_entry> seeds);\n+   void add_url_seed (std::string const& url\n+      , std::string const& ext_auth = std::string()\n+      , web_seed_entry::headers_t const& ext_headers = web_seed_entry::headers_t());\n+   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 v2 () const;\n+   bool v1 () const;\n+   int num_files () const;\n+   std::vector<file_slice> map_block (piece_index_t const piece\n+      , std::int64_t offset, int size) const;\n+   peer_request map_file (file_index_t const file, std::int64_t offset, int size) const;\n+   string_view ssl_cert () const;\n+   bool is_valid () const;\n+   bool priv () const;\n+   bool is_i2p () const;\n+   int piece_size (piece_index_t index) const;\n+   sha1_hash hash_for_piece (piece_index_t index) const;\n+   char const* hash_for_piece_ptr (piece_index_t const index) const;\n+   bool is_loaded () const;\n+   const std::string& name () const;\n+   std::time_t creation_date () const;\n+   const std::string& creator () const;\n+   const std::string& comment () const;\n+   std::vector<std::pair<std::string, int>> const& nodes () const;\n+   void add_node (std::pair<std::string, int> const& node);\n+   bool parse_info_section (bdecode_node const& info, error_code& ec, int max_pieces);\n+   bdecode_node info (char const* key) const;\n+   span<char const> info_section () const;\n+   span<char const> piece_layer (file_index_t) const;\n+   void free_piece_layers ();\n+};\n+
    \n+[report issue]
    \n+

    torrent_info()

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

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

    \n+

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

    \n+

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

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

    rename_file()

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

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

    \n+

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

    \n+

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

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

    remap_files()

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

    Warning

    \n+

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

    \n+
    \n+

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

    \n+

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

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

    add_tracker() clear_trackers() trackers()

    \n+
    \n+std::vector<announce_entry> const& trackers () const;\n+void clear_trackers ();\n+void add_tracker (std::string const& url, int tier\n+      , announce_entry::tracker_source source);\n+void add_tracker (std::string const& url, int tier = 0);\n+
    \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_http_seed() set_web_seeds() add_url_seed() 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+std::vector<web_seed_entry> const& web_seeds () const;\n+void set_web_seeds (std::vector<web_seed_entry> seeds);\n+void add_url_seed (std::string const& url\n+      , std::string const& ext_auth = std::string()\n+      , web_seed_entry::headers_t const& ext_headers = web_seed_entry::headers_t());\n+
    \n+

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

    \n+

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

    \n+

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

    \n+

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

    \n+

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

    \n+

    See http seeding for more information.

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

    total_size()

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

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

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

    piece_length() num_pieces()

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

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

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

    end_piece() last_piece() piece_range()

    \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+
    \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+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+

    v1() v2()

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

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

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

    num_files()

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

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

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

    map_block()

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

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

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

    map_file()

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

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

    \n+

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

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

    ssl_cert()

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

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

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

    is_valid()

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

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

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

    priv()

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

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

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

    is_i2p()

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

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

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

    piece_size()

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

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

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

    hash_for_piece_ptr() hash_for_piece()

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

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

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

    name()

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

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

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

    creation_date()

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

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

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

    creator()

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

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

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

    comment()

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

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

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

    nodes()

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

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

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

    add_node()

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

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

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

    parse_info_section()

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

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

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

    info()

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

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

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

    info_section()

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

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

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

    piece_layer()

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

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

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

    free_piece_layers()

    \n+
    \n+void free_piece_layers ();\n+
    \n+

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

    \n

    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@@ -795,15 +1880,17 @@\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+
    \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@@ -984,27 +2071,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

    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@@ -1727,26 +2814,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-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@@ -3384,27 +4471,27 @@\n

    posted in response to a call to session::dht_live_nodes(). It contains the\n live nodes from the DHT routing table of one of the DHT nodes running\n locally.

    \n
    \n struct dht_live_nodes_alert final : alert\n {\n    std::string message () const override;\n-   int num_nodes () const;\n    std::vector<std::pair<sha1_hash, udp::endpoint>> nodes () const;\n+   int num_nodes () const;\n \n    static constexpr alert_category_t static_category  = alert_category::dht;\n    sha1_hash node_id;\n };\n 
    \n-\n-[report issue]
    \n-

    nodes() num_nodes()

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

    num_nodes() nodes()

    \n
    \n-int num_nodes () const;\n std::vector<std::pair<sha1_hash, udp::endpoint>> nodes () const;\n+int num_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@@ -3433,45 +4520,45 @@\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-   std::vector<sha1_hash> samples () const;\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-

    num_samples() samples()

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

    samples() num_samples()

    \n
    \n-std::vector<sha1_hash> samples () const;\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+
    \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@@ -4226,1971 +5313,2287 @@\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-

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

    storage_params

    \n+

    Declared in "libtorrent/storage_defs.hpp"

    \n+

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

    \n
    \n-struct block_info\n+struct storage_params\n {\n-   void set_peer (tcp::endpoint const& ep);\n-   tcp::endpoint peer () const;\n-\n-   enum block_state_t\n-   {\n-      none,\n-      requested,\n-      writing,\n-      finished,\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-   unsigned bytes_progress:15;\n-   unsigned block_size:15;\n-   unsigned state:2;\n-   unsigned num_peers:14;\n+   file_storage const& files;\n+   file_storage const* mapped_files  = nullptr;\n+   std::string const& path;\n+   storage_mode_t mode {storage_mode_sparse};\n+   aux::vector<download_priority_t, file_index_t> const& priorities;\n+   sha1_hash info_hash;\n };\n 
    \n-\n-[report issue]
    \n-

    peer() set_peer()

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

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

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

    enum block_state_t

    \n-

    Declared in "libtorrent/torrent_handle.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
    none0This block has not been downloaded or requested form any peer.
    requested1The block has been requested, but not completely downloaded yet.
    writing2The block has been downloaded and is currently queued for being\n-written to disk.
    finished3The block has been written to disk.
    \n-[report issue]
    \n-
    bytes_progress
    \n-
    the number of bytes that have been received for this block
    \n-
    \n-[report issue]
    \n-
    block_size
    \n-
    the total number of bytes in this block.
    \n-
    \n-[report issue]
    \n-
    state
    \n-
    the state this block is in (see block_state_t)
    \n-
    \n-[report issue]
    \n-
    num_peers
    \n-
    the number of peers that is currently requesting this block. Typically\n-this is 0 or 1, but at the end of the torrent blocks may be requested\n-by more peers in parallel to speed things up.
    \n-
    \n-[report issue]
    \n-
    \n-
    \n-

    partial_piece_info

    \n-

    Declared in "libtorrent/torrent_handle.hpp"

    \n-

    This class holds information about pieces that have outstanding requests\n-or outstanding writes

    \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 partial_piece_info\n+struct file_slice\n {\n-   piece_index_t piece_index;\n-   int blocks_in_piece;\n-   int finished;\n-   int writing;\n-   int requested;\n-   block_info const* blocks;\n+   file_index_t file_index;\n+   std::int64_t offset;\n+   std::int64_t size;\n };\n 
    \n-[report issue]
    \n-
    piece_index
    \n-
    the index of the piece in question. blocks_in_piece is the number\n-of blocks in this particular piece. This number will be the same for\n-most pieces, but\n-the last piece may have fewer blocks than the standard pieces.
    \n-
    \n-[report issue]
    \n-
    blocks_in_piece
    \n-
    the number of blocks in this piece
    \n-
    \n-[report issue]
    \n-
    finished
    \n-
    the number of blocks that are in the finished state
    \n-
    \n-[report issue]
    \n-
    writing
    \n-
    the number of blocks that are in the writing state
    \n+[report issue]
    \n+
    file_index
    \n+
    the index of the file
    \n
    \n-[report issue]
    \n-
    requested
    \n-
    the number of blocks that are in the requested state
    \n+[report issue]
    \n+
    offset
    \n+
    the offset from the start of the file, in bytes
    \n
    \n-[report issue]
    \n-
    blocks
    \n-

    this is an array of blocks_in_piece number of\n-items. One for each block in the piece.

    \n-
    \n-

    Warning

    \n-

    This is a pointer that points to an array\n-that's owned by the session object. The next time\n-get_download_queue() is called, it will be invalidated.\n-In the case of piece_info_alert, these pointers point into the alert\n-object itself, and will be invalidated when the alert destruct.

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

    torrent_handle

    \n-

    Declared in "libtorrent/torrent_handle.hpp"

    \n-

    You will usually have to store your torrent handles somewhere, since it's\n-the object through which you retrieve information about the torrent and\n-aborts the torrent.

    \n-
    \n-

    Warning

    \n-

    Any member function that returns a value or fills in a value has to be\n-made synchronously. This means it has to wait for the main thread to\n-complete the query before it can return. This might potentially be\n-expensive if done from within a GUI thread that needs to stay\n-responsive. Try to avoid querying for information you don't need, and\n-try to do it in as few calls as possible. You can get most of the\n-interesting information about a torrent from the\n-torrent_handle::status() call.

    \n-
    \n-

    The default constructor will initialize the handle to an invalid state.\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-are processed by a background thread, there is no guarantee that a\n-handle will remain valid between two calls.

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

    file_storage

    \n+

    Declared in "libtorrent/file_storage.hpp"

    \n+

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

    \n
    \n-struct torrent_handle\n+class file_storage\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 read_piece (piece_index_t piece) const;\n-   bool have_piece (piece_index_t piece) const;\n-   void get_peer_info (std::vector<peer_info>& v) const;\n-   void post_peer_info () 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-   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 clear_piece_deadlines () const;\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-   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 add_tracker (announce_entry const&) const;\n-   void replace_trackers (std::vector<announce_entry> const&) const;\n-   void post_trackers () const;\n-   std::set<std::string> url_seeds () const;\n-   void add_url_seed (std::string const& url) const;\n-   void remove_url_seed (std::string const& url) const;\n-   void add_http_seed (std::string const& url) const;\n-   std::set<std::string> http_seeds () const;\n-   void remove_http_seed (std::string const& url) 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 pause (pause_flags_t flags = {}) const;\n-   void resume () const;\n-   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-   void queue_position_bottom () const;\n-   void queue_position_down () const;\n-   void queue_position_top () const;\n-   queue_position_t queue_position () 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<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 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-   void prioritize_pieces (std::vector<download_priority_t> const& pieces) const;\n-   std::vector<download_priority_t> get_piece_priorities () const;\n-   download_priority_t piece_priority (piece_index_t index) const;\n-   std::vector<download_priority_t> get_file_priorities () 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_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 download_limit () const;\n-   int upload_limit () const;\n-   void set_upload_limit (int limit) const;\n-   void set_download_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-   void set_max_uploads (int max_uploads) const;\n-   int max_uploads () 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-   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+   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+      , 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 (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 (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+   char const* root_ptr (file_index_t const index) const;\n+   sha256_hash root (file_index_t index) const;\n+   std::string file_path (file_index_t index, std::string const& save_path = "") const;\n+   string_view file_name (file_index_t index) const;\n+   bool pad_file_at (file_index_t index) const;\n+   std::int64_t file_offset (file_index_t index) const;\n+   std::int64_t file_size (file_index_t index) const;\n+   sha1_hash hash (file_index_t index) const;\n+   std::time_t mtime (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_num_pieces (file_index_t index) const;\n+   int file_first_piece_node (file_index_t index) const;\n+   int file_first_block_node (file_index_t index) const;\n+   std::uint32_t file_path_hash (file_index_t index, std::string const& save_path) const;\n+   void all_path_hashes (std::unordered_set<std::uint32_t>& table) const;\n+   file_flags_t file_flags (file_index_t index) const;\n+   bool file_absolute_path (file_index_t index) const;\n+   file_index_t file_index_at_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 add_piece_flags_t overwrite_existing  = 0_bit;\n-   static constexpr status_flags_t query_distributed_copies  = 0_bit;\n-   static constexpr status_flags_t query_accurate_download_counters  = 1_bit;\n-   static constexpr status_flags_t query_last_seen_complete  = 2_bit;\n-   static constexpr status_flags_t query_pieces  = 3_bit;\n-   static constexpr status_flags_t query_verified_pieces  = 4_bit;\n-   static constexpr status_flags_t query_torrent_file  = 5_bit;\n-   static constexpr status_flags_t query_name  = 6_bit;\n-   static constexpr status_flags_t query_save_path  = 7_bit;\n-   static constexpr deadline_flags_t alert_when_available  = 0_bit;\n-   static constexpr file_progress_flags_t piece_granularity  = 0_bit;\n-   static constexpr pause_flags_t graceful_pause  = 0_bit;\n-   static constexpr resume_data_flags_t flush_disk_cache  = 0_bit;\n-   static constexpr resume_data_flags_t save_info_dict  = 1_bit;\n-   static constexpr resume_data_flags_t only_if_modified  = 2_bit;\n-   static constexpr resume_data_flags_t if_counters_changed  = 3_bit;\n-   static constexpr resume_data_flags_t if_download_progress  = 4_bit;\n-   static constexpr resume_data_flags_t if_config_changed  = 5_bit;\n-   static constexpr resume_data_flags_t if_state_changed  = 6_bit;\n-   static constexpr resume_data_flags_t if_metadata_changed  = 7_bit;\n-   static constexpr reannounce_flags_t ignore_min_interval  = 0_bit;\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-

    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-[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-
    \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-downloaded with this data.

    \n-

    Since the data is written asynchronously, you may know that is passed\n-or failed the hash check by waiting for piece_finished_alert or\n-hash_failed_alert.

    \n-

    Adding pieces while the torrent is being checked (i.e. in\n-torrent_status::checking_files state) is not supported.

    \n-

    The overload taking a raw pointer to the data is a blocking call. It\n-won't return until the libtorrent thread has copied the data into its\n-disk write buffer. data is expected to point to a buffer of as\n-many bytes as the size of the specified piece. See\n-file_storage::piece_size().

    \n-

    The data in the buffer is copied and passed on to the disk IO thread\n-to be written at a later point.

    \n-

    The overload taking a std::vector<char> is not blocking, it will\n-send the buffer to the main thread and return immediately.

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

    read_piece()

    \n-
    \n-void read_piece (piece_index_t piece) const;\n-
    \n-

    This function starts an asynchronous read operation of the specified\n-piece from this torrent. You must have completed the download of the\n-specified piece before calling this function.

    \n-

    When the read operation is completed, it is passed back through an\n-alert, read_piece_alert. Since this alert is a response to an explicit\n-call, it will always be posted, regardless of the alert mask.

    \n-

    Note that if you read multiple pieces, the read operations are not\n-guaranteed to finish in the same order as you initiated them.

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

    post_peer_info() get_peer_info()

    \n-
    \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-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-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-filter them out.

    \n-

    The status() function will block until the internal libtorrent\n-thread responds with the torrent_status object. To avoid blocking,\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-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-
    \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-void clear_piece_deadlines () const;\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-
    \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-function again.

    \n-

    If the piece is already downloaded when this call is made, nothing\n-happens, unless the alert_when_available flag is set, in which case it\n-will have the same effect as calling read_piece() for index.

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

    file_progress() post_file_progress()

    \n-
    \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-downloading pieces and j is the number of blocks in a piece.

    \n-

    The flags parameter can be used to specify the granularity of the\n-file progress. If left at the default value of 0, the progress will be\n-as accurate as possible, but also more expensive to calculate. If\n-torrent_handle::piece_granularity is specified, the progress will\n-be specified in piece granularity. i.e. only pieces that have been\n-fully downloaded and passed the hash check count. When specifying\n-piece granularity, the operation is a lot cheaper, since libtorrent\n-already keeps track of this internally and no calculation is required.

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

    file_status()

    \n-
    \n-std::vector<open_file_state> file_status () const;\n-
    \n-

    This function returns a vector with status about files\n-that are open for this torrent. Any file that is not open\n-will not be reported in the vector, i.e. it's possible that\n-the vector is empty when returning, if none of the files in the\n-torrent are currently open.

    \n-

    See open_file_state

    \n-[report issue]
    \n-
    \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() trackers() post_trackers() replace_trackers()

    \n-
    \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-void post_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-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-will trigger a tracker_list_alert to be posted.

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

    is_valid()

    \n
    \n-std::set<std::string> url_seeds () const;\n-void add_url_seed (std::string const& url) const;\n-void remove_url_seed (std::string const& url) const;\n+bool is_valid () 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() remove_http_seed() add_http_seed()

    \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 add_http_seed (std::string const& url) const;\n-std::set<std::string> http_seeds () const;\n-void remove_http_seed (std::string const& url) const;\n+void reserve (int num_files);\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+

    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_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+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 (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_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-

    add the specified extension to this torrent. The ext argument is\n-a function that will be called from within libtorrent's context\n-passing in the internal torrent object and the specified userdata\n-pointer. The function is expected to return a shared pointer to\n-a torrent_plugin instance.

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

    set_metadata()

    \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-bool set_metadata (span<char const> metadata) const;\n+void rename_file (file_index_t index, std::string const& new_filename);\n 
    \n-

    set_metadata expects the info section of metadata. i.e. The\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-

    is_valid()

    \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-bool is_valid () const;\n+std::vector<file_slice> map_block (piece_index_t piece, std::int64_t offset\n+      , std::int64_t size) 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-session::find_torrent() was successful.

    \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+

    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-void pause (pause_flags_t flags = {}) const;\n-void resume () const;\n+peer_request map_file (file_index_t file, std::int64_t offset, int size) 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-

    For possible values of the flags parameter, see pause_flags_t.

    \n-

    To know if a torrent is paused or not, call\n-torrent_handle::flags() and check for the\n-torrent_status::paused flag.

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

    set_flags() flags() unset_flags()

    \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-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+int num_files () const noexcept;\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-the specified flags and leave any other flags unchanged.\n-unset_flags clears the specified flags, while leaving\n-any other flags unchanged.

    \n-

    The seed_mode flag is special, it can only be cleared once the\n-torrent has been added, and it can only be set as part of the\n-add_torrent_params flags, when adding the torrent.

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

    flush_cache()

    \n+

    returns the number of files in the file_storage

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

    end_file()

    \n
    \n-void flush_cache () const;\n+file_index_t end_file () const noexcept;\n 
    \n-

    Instructs libtorrent to flush all the disk caches for this torrent and\n-close all file handles. This is done asynchronously and you will be\n-notified that it's complete through cache_flushed_alert.

    \n-

    Note that by the time you get the alert, libtorrent may have cached\n-more data for the torrent, but you are guaranteed that whatever cached\n-data libtorrent had by the time you called\n-torrent_handle::flush_cache() has been written to disk.

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

    force_recheck()

    \n+

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

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

    file_range()

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

    force_recheck puts the torrent back in a state where it assumes to\n-have no resume data. All peers will be disconnected and the torrent\n-will stop announcing to the tracker. The torrent will be added to the\n-checking queue, and will be checked (all the files will be read and\n-compared to the piece hashes). Once the check is complete, the torrent\n-will start connecting to peers again, as normal.\n-The torrent will be placed last in queue, i.e. its queue position\n-will be the highest of all torrents in the session.

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

    save_resume_data()

    \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-void save_resume_data (resume_data_flags_t flags = {}) const;\n-
    \n-

    save_resume_data() asks libtorrent to generate fast-resume data for\n-this torrent. The fast resume data (stored in an add_torrent_params\n-object) can be used to resume a torrent in the next session without\n-having to check all files for which pieces have been downloaded. It\n-can also be used to save a .torrent file for a torrent_handle.

    \n-

    This operation is asynchronous, save_resume_data will return\n-immediately. The resume data is delivered when it's done through a\n-save_resume_data_alert.

    \n-

    The operation will fail, and post a save_resume_data_failed_alert\n-instead, in the following cases:

    \n-
    \n-
      \n-
    1. The torrent is in the process of being removed.
    2. \n-
    3. No torrent state has changed since the last saving of resume\n-data, and the only_if_modified flag is set.\n-metadata (see libtorrent's metadata from peers extension)
    4. \n-
    \n-
    \n-

    Note that some counters may be outdated by the time you receive the fast resume data

    \n-

    When saving resume data because of shutting down, make sure not to\n-remove_torrent() before you receive the save_resume_data_alert.\n-There's no need to pause the session or torrent when saving resume\n-data.

    \n-

    The paused state of a torrent is saved in the resume data, so pausing\n-all torrents before saving resume data will all torrents be restored\n-in a paused state.

    \n-
    \n-

    Note

    \n-

    It is typically a good idea to save resume data whenever a torrent\n-is completed or paused. If you save resume data for torrents when they are\n-paused, you can accelerate the shutdown process by not saving resume\n-data again for those torrents. Completed torrents should have their\n-resume data saved when they complete and on exit, since their\n-statistics might be updated.

    \n-
    \n-

    Example code to pause and save resume data for all torrents and wait\n-for the alerts:

    \n-
    \n-extern int outstanding_resume_data; // global counter of outstanding resume data\n-std::vector<torrent_handle> handles = ses.get_torrents();\n-for (torrent_handle const& h : handles) try\n-{\n-        h.save_resume_data(torrent_handle::only_if_modified);\n-        ++outstanding_resume_data;\n-}\n-catch (lt::system_error const& e)\n-{\n-        // the handle was invalid, ignore this one and move to the next\n-}\n-\n-while (outstanding_resume_data > 0)\n-{\n-        alert const* a = ses.wait_for_alert(seconds(30));\n-\n-        // if we don't get an alert within 30 seconds, abort\n-        if (a == nullptr) break;\n-\n-        std::vector<alert*> alerts;\n-        ses.pop_alerts(&alerts);\n-\n-        for (alert* i : alerts)\n-        {\n-                if (alert_cast<save_resume_data_failed_alert>(i))\n-                {\n-                        process_alert(i);\n-                        --outstanding_resume_data;\n-                        continue;\n-                }\n-\n-                save_resume_data_alert const* rd = alert_cast<save_resume_data_alert>(i);\n-                if (rd == nullptr)\n-                {\n-                        process_alert(i);\n-                        continue;\n-                }\n-\n-                std::ofstream out((rd->params.save_path\n-                        + "/" + rd->params.name + ".fastresume").c_str()\n-                        , std::ios_base::binary);\n-                std::vector<char> buf = write_resume_data_buf(rd->params);\n-                out.write(buf.data(), buf.size());\n-                --outstanding_resume_data;\n-        }\n-}\n+std::int64_t total_size () const;\n 
    \n-
    \n-

    Note

    \n-

    Note how outstanding_resume_data is a global counter in this\n-example. This is deliberate, otherwise there is a race condition for\n-torrents that was just asked to save their resume data, they posted\n-the alert, but it has not been received yet. Those torrents would\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+

    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-bool need_save_resume_data (resume_data_flags_t flags) const;\n-bool need_save_resume_data () const;\n+void set_num_pieces (int n);\n+int num_pieces () 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-libtorrent's main thread. A way to avoid blocking is to instead\n-call save_resume_data() directly, specifying the conditions under\n-which resume data should be saved.

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

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

    \n+

    set and get the number of pieces in the torrent

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

    end_piece()

    \n
    \n-void queue_position_up () const;\n-void queue_position_bottom () const;\n-void queue_position_down () const;\n-void queue_position_top () const;\n-queue_position_t queue_position () const;\n+piece_index_t end_piece () 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-greater queue positions have their positions decreased to fill in the\n-space in the sequence.

    \n-

    queue_position() returns the torrent's position in the download\n-queue. The torrents with the smallest numbers are the ones that are\n-being downloaded. The smaller number, the closer the torrent is to the\n-front of the line to be started.

    \n-

    The queue position is also available in the torrent_status.

    \n-

    The queue_position_*() functions adjust the torrents position in\n-the queue. Up means closer to the front and down means closer to the\n-back of the queue. Top and bottom refers to the front and the back of\n-the queue respectively.

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

    queue_position_set()

    \n+

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

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

    last_piece()

    \n
    \n-void queue_position_set (queue_position_t p) const;\n+piece_index_t last_piece () 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+

    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-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+index_range<piece_index_t> piece_range () const noexcept;\n 
    \n-

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

    \n-

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

    \n-

    cert is a path to the (signed) certificate in .pem format\n-corresponding to this torrent.

    \n-

    private_key is a path to the private key for the specified\n-certificate. This must be in .pem format.

    \n-

    dh_params is a path to the Diffie-Hellman parameter file, which\n-needs to be in .pem format. You can generate this file using the\n-openssl command like this: openssl dhparam -outform PEM -out\n-dhparams.pem 512.

    \n-

    passphrase may be specified if the private key is encrypted and\n-requires a passphrase to be decrypted.

    \n-

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

    \n-

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

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

    torrent_file_with_hashes() torrent_file()

    \n+

    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-std::shared_ptr<torrent_info> torrent_file_with_hashes () const;\n-std::shared_ptr<const torrent_info> torrent_file () const;\n+void set_piece_length (int l);\n+int piece_length () 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-

    Note that the torrent_info object returned here may be a different\n-instance than the one added to the session, with different attributes\n-like piece layers, dht nodes and trackers. A torrent_info object does\n-not round-trip cleanly when added to a session.

    \n-

    If you want to save a .torrent file from the torrent_handle, instead\n-call save_resume_data() and write_torrent_file() the\n-add_torrent_params object passed back in the alert.

    \n-

    torrent_file_with_hashes() returns a copy of the internal\n-torrent_info and piece layer hashes (if it's a v2 torrent). The piece\n-layers will only be included if they are available. If this torrent\n-was added from a .torrent file with piece layers or if it's seeding,\n-the piece layers are available. This function is more expensive than\n-torrent_file() since it needs to make copies of this information.

    \n-

    The torrent_file_with_hashes() is here for backwards compatibility\n-when constructing a create_torrent object from a torrent_info that's\n-in a session. Prefer save_resume_data() + write_torrent_file().

    \n-

    Note that a torrent added from a magnet link may not have the full\n-merkle trees for all files, and hence not have the complete piece\n-layers. In that state, you cannot create a .torrent file even from\n-the torrent_info returned from torrent_file_with_hashes(). Once the\n-torrent completes downloading all files, becoming a seed, you can\n-make a .torrent file from it.

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

    piece_layers()

    \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-std::vector<std::vector<sha256_hash>> piece_layers () const;\n+int piece_size (piece_index_t index) 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+

    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-void piece_availability (std::vector<int>& avail) const;\n-void post_piece_availability () const;\n+int piece_size2 (piece_index_t index) 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-

    piece_priority() prioritize_pieces() get_piece_priorities()

    \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-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-void prioritize_pieces (std::vector<download_priority_t> const& pieces) const;\n-std::vector<download_priority_t> get_piece_priorities () const;\n-download_priority_t piece_priority (piece_index_t index) const;\n+int blocks_in_piece2 (piece_index_t index) const;\n 
    \n-

    These functions are used to set and get the priority of individual\n-pieces. By default all pieces have priority 4. That means that the\n-random rarest first algorithm is effectively active for all pieces.\n-You may however change the priority of individual pieces. There are 8\n-priority levels. 0 means not to download the piece at all. Otherwise,\n-lower priority values means less likely to be picked. Piece priority\n-takes precedence over piece availability. Every piece with priority 7\n-will be attempted to be picked before a priority 6 piece and so on.

    \n-

    The default priority of pieces is 4.

    \n-

    Piece priorities can not be changed for torrents that have not\n-downloaded the metadata yet. Magnet links won't have metadata\n-immediately. see the metadata_received_alert.

    \n-

    piece_priority sets or gets the priority for an individual piece,\n-specified by index.

    \n-

    prioritize_pieces takes a vector of integers, one integer per\n-piece in the torrent. All the piece priorities will be updated with\n-the priorities in the vector.\n-The second overload of prioritize_pieces that takes a vector of pairs\n-will update the priorities of only select pieces, and leave all other\n-unaffected. Each pair is (piece, priority). That is, the first item is\n-the piece index and the second item is the priority of that piece.\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-

    file_priority() get_file_priorities() prioritize_files()

    \n+

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

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

    blocks_per_piece()

    \n
    \n-std::vector<download_priority_t> get_file_priorities () 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+int blocks_per_piece () 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-torrent based on the vector.

    \n-

    get_file_priorities() returns a vector with the priorities of all\n-files.

    \n-

    The priority values are the same as for piece_priority(). See\n-download_priority_t.

    \n-

    Whenever a file priority is changed, all other piece priorities are\n-reset to match the file priorities. In order to maintain special\n-priorities for particular pieces, piece_priority() has to be called\n-again for those pieces.

    \n-

    You cannot set the file priorities on a torrent that does not yet have\n-metadata or a torrent that is a seed. file_priority(int, int) and\n-prioritize_files() are both no-ops for such torrents.

    \n-

    Since changing file priorities may involve disk operations (of moving\n-files in- and out of the part file), the internal accounting of file\n-priorities happen asynchronously. i.e. setting file priorities and then\n-immediately querying them may not yield the same priorities just set.\n-To synchronize with the priorities taking effect, wait for the\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_lsd_announce() force_dht_announce() force_reannounce()

    \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 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 set_name (std::string const& n);\n+std::string const& name () 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-re-announce interval settings.

    \n-

    The tracker_index argument specifies which tracker to re-announce.\n-If set to -1 (which is the default), all trackers are re-announce.

    \n-

    The flags argument can be used to affect the re-announce. See\n-ignore_min_interval.

    \n-

    force_dht_announce will announce the torrent to the DHT\n-immediately.

    \n-

    force_lsd_announce will announce the torrent on LSD\n-immediately.

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

    scrape_tracker()

    \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 scrape_tracker (int idx = -1) const;\n+void swap (file_storage& ti) noexcept;\n 
    \n-

    scrape_tracker() will send a scrape request to a tracker. By\n-default (idx = -1) it will scrape the last working tracker. If\n-idx is >= 0, the tracker with the specified index will scraped.

    \n-

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

    \n-

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

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

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

    \n+

    swap all content of this with ti.

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

    canonicalize()

    \n
    \n-int download_limit () const;\n-int upload_limit () const;\n-void set_upload_limit (int limit) const;\n-void set_download_limit (int limit) const;\n+void canonicalize ();\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-(settings_pack::upload_rate_limit) will not override the global\n-rate limit. The torrent can never upload more than the global rate\n-limit.

    \n-

    upload_limit and download_limit will return the current limit\n-setting, for upload and download, respectively.

    \n-

    Local peers are not rate limited by default. see peer classes.

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

    connect_peer()

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

    clear_peers()

    \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_blocks() file_num_pieces()

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

    This will disconnect all peers and clear the peer list for this\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-

    max_uploads() set_max_uploads()

    \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-void set_max_uploads (int max_uploads) const;\n-int max_uploads () const;\n+int file_first_piece_node (file_index_t index) const;\n+int file_first_block_node (file_index_t index) 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-

    max_connections() set_max_connections()

    \n+

    index of first piece node in the merkle tree

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

    file_path_hash()

    \n
    \n-void set_max_connections (int max_connections) const;\n-int max_connections () const;\n+std::uint32_t file_path_hash (file_index_t index, std::string const& save_path) 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-connections_limit in settings_pack.

    \n-

    max_connections() returns the current settings.

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

    move_storage()

    \n+

    returns the crc32 hash of file_path(index)

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

    all_path_hashes()

    \n
    \n-void move_storage (std::string const& save_path\n-      , move_flags_t flags = move_flags_t::always_replace_files\n-      ) const;\n+void all_path_hashes (std::unordered_set<std::uint32_t>& table) const;\n 
    \n-

    Moves the file(s) that this torrent are currently seeding from or\n-downloading to. If the given save_path is not located on the same\n-drive as the original save path, the files will be copied to the new\n-drive and removed from their original location. This will block all\n-other disk IO, and other torrents download and upload rates may drop\n-while copying the file.

    \n-

    Since disk IO is performed in a separate thread, this operation is\n-also asynchronous. Once the operation completes, the\n-storage_moved_alert is generated, with the new path as the\n-message. If the move fails for some reason,\n-storage_moved_failed_alert is generated instead, containing the\n-error message.

    \n-

    The flags argument determines the behavior of the copying/moving\n-of the files in the torrent. see move_flags_t.

    \n-

    always_replace_files is the default and replaces any file that\n-exist in both the source directory and the target directory.

    \n-

    fail_if_exist first check to see that none of the copy operations\n-would cause an overwrite. If it would, it will fail. Otherwise it will\n-proceed as if it was in always_replace_files mode. Note that there\n-is an inherent race condition here. If the files in the target\n-directory appear after the check but before the copy or move\n-completes, they will be overwritten. When failing because of files\n-already existing in the target path, the error of\n-move_storage_failed_alert is set to\n-boost::system::errc::file_exists.

    \n-

    The intention is that a client may use this as a probe, and if it\n-fails, ask the user which mode to use. The client may then re-issue\n-the move_storage call with one of the other modes.

    \n-

    dont_replace always keeps the existing file in the target\n-directory, if there is one. The source files will still be removed in\n-that case. Note that it won't automatically re-check files. If an\n-incomplete torrent is moved into a directory with the complete files,\n-pause, move, force-recheck and resume. Without the re-checking, the\n-torrent will keep downloading and files in the new download directory\n-will be overwritten.

    \n-

    Files that have been renamed to have absolute paths are not moved by\n-this function. Keep in mind that files that don't belong to the\n-torrent but are stored in the torrent's directory may be moved as\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-

    rename_file()

    \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-void rename_file (file_index_t index, std::string const& new_name) const;\n+file_flags_t file_flags (file_index_t index) const;\n 
    \n-

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

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

    info_hashes() info_hash()

    \n+

    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-info_hash_t info_hashes () const;\n-sha1_hash info_hash () const;\n+bool file_absolute_path (file_index_t index) 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-

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

    \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-bool operator!= (const torrent_handle& h) const;\n-bool operator< (const torrent_handle& h) const;\n-bool operator== (const torrent_handle& h) 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 
    \n-

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

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

    id()

    \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-std::uint32_t id () const;\n+file_index_t file_index_for_root (sha256_hash const& root_hash) const;\n 
    \n-

    returns a unique identifier for this torrent. It's not a dense index.\n-It's not preserved across sessions.

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

    native_handle()

    \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-std::shared_ptr<torrent> native_handle () const;\n+piece_index_t piece_index_at_file (file_index_t f) const;\n 
    \n-

    This function is intended only for use by plugins and the alert\n-dispatch function. This type does not have a stable ABI and should\n-be relied on as little as possible. Accessing the handle returned by\n-this function is not thread safe outside of libtorrent's internal\n-thread (which is used to invoke plugin callbacks).\n-The torrent class is not only eligible for changing ABI across\n-minor versions of libtorrent, its layout is also dependent on build\n-configuration. This adds additional requirements on a client to be\n-built with the exact same build configuration as libtorrent itself.\n-i.e. the TORRENT_ macros must match between libtorrent and the\n-client builds.

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

    userdata()

    \n+

    returns the piece index the given file starts at

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

    sanitize_symlinks()

    \n
    \n-client_data_t userdata () const;\n+void sanitize_symlinks ();\n 
    \n-

    returns the userdata pointer as set in add_torrent_params

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

    in_session()

    \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 in_session () const;\n+bool v2 () const;\n 
    \n-

    Returns true if the torrent is in the session. It returns true before\n-session::remove_torrent() is called, and false afterward.

    \n-

    Note that this is a blocking function, unlike torrent_handle::is_valid()\n-which returns immediately.

    \n-[report issue]
    \n-
    overwrite_existing
    \n-
    instruct libtorrent to overwrite any data that may already have been\n-downloaded with the data of the new piece being added. Using this\n-flag when adding a piece that is actively being downloaded from other\n-peers may have some unexpected consequences, as blocks currently\n-being downloaded from peers may not be replaced.
    \n-
    \n-[report issue]
    \n-
    query_distributed_copies
    \n-
    calculates distributed_copies, distributed_full_copies and\n-distributed_fraction.
    \n-
    \n-[report issue]
    \n-
    query_accurate_download_counters
    \n-
    includes partial downloaded blocks in total_done and\n-total_wanted_done.
    \n-
    \n-[report issue]
    \n-
    query_last_seen_complete
    \n-
    includes last_seen_complete.
    \n-
    \n-[report issue]
    \n-
    query_pieces
    \n-
    populate the pieces field in torrent_status.
    \n-
    \n-[report issue]
    \n-
    query_verified_pieces
    \n-
    includes verified_pieces (only applies to torrents in seed\n-mode).
    \n-
    \n-[report issue]
    \n-
    query_torrent_file
    \n-
    includes torrent_file, which is all the static information from\n-the .torrent file.
    \n-
    \n-[report issue]
    \n-
    query_name
    \n-
    includes name, the name of the torrent. This is either derived\n-from the .torrent file, or from the &dn= magnet link argument\n-or possibly some other source. If the name of the torrent is not\n-known, this is an empty string.
    \n-
    \n-[report issue]
    \n-
    query_save_path
    \n-
    includes save_path, the path to the directory the files of the\n-torrent are saved to.
    \n-
    \n-[report issue]
    \n-
    alert_when_available
    \n-
    used to ask libtorrent to send an alert once the piece has been\n-downloaded, by passing alert_when_available. When set, the\n-read_piece_alert alert will be delivered, with the piece data, when\n-it's downloaded.
    \n-
    \n-[report issue]
    \n-
    piece_granularity
    \n-
    only calculate file progress at piece granularity. This makes\n-the file_progress() call cheaper and also only takes bytes that\n-have passed the hash check into account, so progress cannot\n-regress in this mode.
    \n-
    \n-[report issue]
    \n-
    graceful_pause
    \n-
    will delay the disconnect of peers that we're still downloading\n-outstanding requests from. The torrent will not accept any more\n-requests and will disconnect all idle peers. As soon as a peer is done\n-transferring the blocks that were requested from it, it is\n-disconnected. This is a graceful shut down of the torrent in the sense\n-that no downloaded bytes are wasted.
    \n-
    \n-[report issue]
    \n-
    flush_disk_cache
    \n-
    the disk cache will be flushed before creating the resume data.\n-This avoids a problem with file timestamps in the resume data in\n-case the cache hasn't been flushed yet.
    \n-
    \n-[report issue]
    \n-
    save_info_dict
    \n-
    the resume data will contain the metadata from the torrent file as\n-well. This is useful for clients that don't keep .torrent files\n-around separately, or for torrents that were added via a magnet link.
    \n-
    \n-[report issue]
    \n-
    only_if_modified
    \n-
    this flag has the same behavior as the combination of:\n-if_counters_changed | if_download_progress | if_config_changed |\n-if_state_changed | if_metadata_changed
    \n-
    \n-[report issue]
    \n-
    if_counters_changed
    \n-
    save resume data if any counters has changed since the last time\n-resume data was saved. This includes upload/download counters, active\n-time counters and scrape data. A torrent that is not paused will have\n-its active time counters incremented continuously.
    \n-
    \n-[report issue]
    \n-
    if_download_progress
    \n-
    save the resume data if any blocks have been downloaded since the\n-last time resume data was saved. This includes:\n-* checking existing files on disk\n-* downloading a block from a peer
    \n-
    \n-[report issue]
    \n-
    if_config_changed
    \n-
    save the resume data if configuration options changed since last time\n-the resume data was saved. This includes:\n-* file- or piece priorities\n-* upload- and download rate limits\n-* change max-uploads (unchoke slots)\n-* change max connection limit\n-* enable/disable peer-exchange, local service discovery or DHT\n-* enable/disable apply IP-filter\n-* enable/disable auto-managed\n-* enable/disable share-mode\n-* enable/disable sequential-mode\n-* files renamed\n-* storage moved (save_path changed)
    \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-
    if_state_changed
    \n-
    save the resume data if torrent state has changed since last time the\n-resume data was saved. This includes:\n-* upload mode\n-* paused state\n-* super-seeding\n-* seed-mode
    \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-
    if_metadata_changed
    \n-
    save the resume data if any metadata changed since the last time\n-resume data was saved. This includes:\n-* add/remove web seeds\n-* add/remove trackers\n-* receiving metadata for a magnet link
    \n+[report issue]
    \n+
    flag_executable
    \n+
    this file has the executable attribute set.
    \n
    \n-[report issue]
    \n-
    ignore_min_interval
    \n-
    by default, force-reannounce will still honor the min-interval\n-published by the tracker. If this flag is set, it will be ignored\n-and the tracker is announced immediately.
    \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+[report issue]
    \n
    \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-

    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+

    posix_disk_io_constructor()

    \n+

    Declared in "libtorrent/posix_disk_io.hpp"

    \n
    \n-struct peer_class_type_filter\n-{\n-   void remove (socket_type_t const st, peer_class_t const peer_class);\n-   void add (socket_type_t const st, peer_class_t const peer_class);\n-   void 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+std::unique_ptr<disk_interface> posix_disk_io_constructor (\n+   io_context& ios, settings_interface const&, counters& cnt);\n 
    \n-\n-[report issue]
    \n-

    remove() add()

    \n+

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

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

    disabled_disk_io_constructor()

    \n+

    Declared in "libtorrent/disabled_disk_io.hpp"

    \n
    \n-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+std::unique_ptr<disk_interface> disabled_disk_io_constructor (\n+   io_context& ios, settings_interface const&, counters& cnt);\n 
    \n-

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

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

    allow() disallow()

    \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+

    mmap_disk_io_constructor()

    \n+

    Declared in "libtorrent/mmap_disk_io.hpp"

    \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+std::unique_ptr<disk_interface> mmap_disk_io_constructor (\n+   io_context& ios, settings_interface const&, counters& cnt);\n 
    \n-

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

    \n-

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

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

    apply()

    \n+

    constructs a memory mapped file disk I/O object.

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

    default_disk_io_constructor()

    \n+

    Declared in "libtorrent/session.hpp"

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

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

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

    enum socket_type_t

    \n-

    Declared in "libtorrent/peer_class_type_filter.hpp"

    \n+

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

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

    enum storage_mode_t

    \n+

    Declared in "libtorrent/storage_defs.hpp"

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

    enum status_t

    \n+

    Declared in "libtorrent/storage_defs.hpp"

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

    enum move_flags_t

    \n+

    Declared in "libtorrent/storage_defs.hpp"

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\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-

    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+

    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+

    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 info_hash_t\n+struct buffer_allocator_interface\n {\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-   explicit info_hash_t (sha1_hash h1) 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+   virtual void free_disk_buffer (char* b) = 0;\n };\n 
    \n-[report issue]
    \n-

    info_hash_t()

    \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-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-explicit info_hash_t (sha1_hash h1) noexcept;\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-

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

    disk_buffer_holder()

    \n
    \n-bool has (protocol_version v) const;\n-bool has_v2 () const;\n-bool has_v1 () const;\n+disk_buffer_holder (buffer_allocator_interface& alloc\n+      , char* buf, int sz) noexcept;\n 
    \n-

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

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

    get()

    \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-sha1_hash get (protocol_version v) const;\n+disk_buffer_holder () noexcept = default;\n 
    \n-

    returns the has for the specified protocol version

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

    get_best()

    \n+

    default construct a holder that does not own any buffer

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

    ~disk_buffer_holder()

    \n
    \n-sha1_hash get_best () const;\n+~disk_buffer_holder ();\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+

    frees disk buffer held by this object

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

    data()

    \n
    \n-template <typename F> void for_each (F f) const;\n+char* data () const noexcept;\n 
    \n-

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

    \n+

    return a pointer to the held buffer, if any. Otherwise returns nullptr.

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

    reset()

    \n
    \n-void(sha1_hash const&, protocol_version);\n+void reset ();\n 
    \n-[report issue]
    \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-

    piece_block

    \n-

    Declared in "libtorrent/piece_block.hpp"

    \n+
    \n+

    disk_observer

    \n+

    Declared in "libtorrent/disk_observer.hpp"

    \n
    \n-struct piece_block\n+struct disk_observer\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+   virtual void on_disk () = 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+[report issue]
    \n+

    on_disk()

    \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+virtual void on_disk () = 0;\n 
    \n-[report issue]
    \n-

    operator==()

    \n+

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

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

    open_file_state

    \n+

    Declared in "libtorrent/disk_interface.hpp"

    \n+

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

    \n
    \n-bool operator== (peer_request const& r) const;\n+struct open_file_state\n+{\n+   file_index_t file_index;\n+   file_open_mode_t open_mode;\n+   time_point last_use;\n+};\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+[report issue]
    \n+
    file_index
    \n+
    the index of the file this entry refers to into the file_storage\n+file list of this torrent. This starts indexing at 0.
    \n
    \n-[report issue]
    \n-
    start
    \n-
    The byte offset within that piece where the range starts.
    \n+[report issue]
    \n+
    open_mode
    \n+

    open_mode is a bitmask of the file flags this file is currently\n+opened with. For possible flags, see file_open_mode_t.

    \n+

    Note that the read/write mode is not a bitmask. The two least significant bits are used\n+to represent the read/write mode. Those bits can be masked out using the rw_mask constant.

    \n+
    \n
    \n-[report issue]
    \n-
    length
    \n-
    The size of the range, in bytes.
    \n+[report issue]
    \n+
    last_use
    \n+
    a (high precision) timestamp of when the file was last used.
    \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+[report issue]
    \n+
    \n+

    disk_interface

    \n+

    Declared in "libtorrent/disk_interface.hpp"

    \n+

    The disk_interface is the customization point for disk I/O in libtorrent.\n+implement this interface and provide a factory function to the session constructor\n+use custom disk I/O. All functions on the disk subsystem (implementing\n+disk_interface) are called from within libtorrent's network thread. For\n+disk I/O to be performed in a separate thread, the disk subsystem has to\n+manage that itself.

    \n+

    Although the functions are called async_*, they do not technically\n+have to be asynchronous, but they support being asynchronous, by\n+expecting the result passed back into a callback. The callbacks must be\n+posted back onto the network thread via the io_context object passed into\n+the constructor. The callbacks will be run in the network thread.

    \n
    \n-struct peer_info\n+struct disk_interface\n {\n-   sha256_hash i2p_destination () const;\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 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+   virtual void async_release_files (storage_index_t storage\n+      , std::function<void()> handler = std::function<void()>()) = 0;\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+   virtual void async_stop_torrent (storage_index_t storage\n+      , std::function<void()> handler = std::function<void()>()) = 0;\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+   virtual void async_delete_files (storage_index_t storage, remove_flags_t options\n+      , std::function<void(storage_error const&)> handler) = 0;\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+   virtual void async_clear_piece (storage_index_t storage, piece_index_t index\n+      , std::function<void(piece_index_t)> handler) = 0;\n+   virtual void update_stats_counters (counters& c) const = 0;\n+   virtual std::vector<open_file_state> get_status (storage_index_t) const = 0;\n+   virtual void abort (bool wait) = 0;\n+   virtual void submit_jobs () = 0;\n+   virtual void settings_updated () = 0;\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+   static constexpr disk_job_flags_t force_copy  = 0_bit;\n+   static constexpr disk_job_flags_t sequential_access  = 3_bit;\n+   static constexpr disk_job_flags_t volatile_read  = 4_bit;\n+   static constexpr disk_job_flags_t v1_hash  = 5_bit;\n+   static constexpr disk_job_flags_t flush_piece  = 7_bit;\n };\n 
    \n-[report issue]
    \n-

    i2p_destination()

    \n+[report issue]
    \n+

    new_torrent()

    \n
    \n-sha256_hash i2p_destination () const;\n+virtual storage_holder new_torrent (storage_params const& p\n+      , std::shared_ptr<void> const& torrent) = 0;\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+

    this is called when a new torrent is added. The shared_ptr can be\n+used to hold the internal torrent object alive as long as there are\n+outstanding disk operations on the storage.\n+The returned storage_holder is an owning reference to the underlying\n+storage that was just created. It is fundamentally a storage_index_t

    \n+[report issue]
    \n+
    \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+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+
    \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-\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+[report issue]
    \n+
    sequential_access
    \n+
    hint that there may be more disk operations with sequential access to\n+the file
    \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+[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-
    download_queue_time
    \n-
    the time until all blocks in the request queue will be downloaded
    \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-
    interesting
    \n-
    we are interested in pieces from this peer.
    \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-
    choked
    \n-
    we have choked this peer.
    \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 () = 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& operator= (storage_holder const&) = delete;\n+   storage_holder (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+

    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_bool (int name, bool 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+

    file_open_mode_t

    \n+

    Declared in "libtorrent/disk_interface.hpp"

    \n+
    \n+
    read_only
    \n+
    open the file for reading only
    \n
    \n-[report issue]
    \n-
    remote_interested
    \n-
    the peer is interested in us
    \n+
    \n+
    write_only
    \n+
    open the file for writing only
    \n
    \n-[report issue]
    \n-
    remote_choked
    \n-
    the peer has choked us.
    \n+
    \n+
    read_write
    \n+
    open the file for reading and writing
    \n
    \n-[report issue]
    \n-
    supports_extensions
    \n-
    means that this peer supports the\n-extension protocol.
    \n+
    \n+
    rw_mask
    \n+
    the mask for the bits determining read or write mode
    \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+
    sparse
    \n+
    open the file in sparse mode (if supported by the\n+filesystem).
    \n
    \n-[report issue]
    \n-
    local_connection
    \n-
    deprecated synonym for outgoing_connection
    \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-[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+
    random_access
    \n+
    When this is not set, the kernel is hinted that access to this file will\n+be made sequentially.
    \n
    \n-[report issue]
    \n-
    connecting
    \n-
    The connection is in a half-open state (i.e. it is\n-being connected).
    \n+
    \n+
    mmapped
    \n+
    the file is memory mapped
    \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+[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 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-
    seed
    \n-
    This peer is a seed (it has all the pieces).
    \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-
    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+[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-
    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+[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-
    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+[report issue]
    \n+
    error_file_ssl_ctx
    \n+
    the error occurred setting up the SSL context
    \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+[report issue]
    \n+
    error_file_metadata
    \n+
    the error occurred while loading the metadata for the torrent
    \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+[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-
    i2p_socket
    \n-
    indicates that this socket is running on top of the\n-I2P transport.
    \n+[report issue]
    \n+
    error_file_partfile
    \n+
    the error occurred with the partfile
    \n
    \n-[report issue]
    \n-
    utp_socket
    \n-
    indicates that this socket is a uTP socket
    \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-
    ssl_socket
    \n-
    indicates that this socket is running on top of an SSL\n-(TLS) channel
    \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-
    rc4_encrypted
    \n-
    this connection is obfuscated with RC4
    \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-
    plaintext_encrypted
    \n-
    the handshake of this connection was obfuscated\n-with a Diffie-Hellman exchange
    \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+

    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+

    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_v2 () const;\n+   bool has (protocol_version v) const;\n+   sha1_hash get (protocol_version v) const;\n+   sha1_hash get_best () const;\n+   friend bool operator!= (info_hash_t const& lhs, info_hash_t const& rhs);\n+   friend bool operator== (info_hash_t const& lhs, info_hash_t const& rhs) noexcept;\n+   template <typename F> void for_each (F f) const;\n+   bool operator< (info_hash_t const& o) const;\n+   friend std::ostream& operator<< (std::ostream& os, info_hash_t const& ih);\n+\n+   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() has_v1()

    \n+
    \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+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@@ -6421,56 +7824,48 @@\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-\n-\n-[report issue]
    \n+[report issue]
    \n
    \n-
    \n-

    load_torrent_parsed() load_torrent_buffer() load_torrent_file()

    \n-

    Declared in "libtorrent/load_torrent.hpp"

    \n+
    \n+

    torrent_peer_equal()

    \n+

    Declared in "libtorrent/torrent_peer.hpp"

    \n
    \n-add_torrent_params load_torrent_parsed (\n-   bdecode_node const& torrent_file);\n-add_torrent_params load_torrent_buffer (\n-   span<char const> buffer, load_torrent_limits const& cfg);\n-add_torrent_params load_torrent_buffer (\n-   span<char const> buffer);\n-add_torrent_params load_torrent_file (\n-   std::string const& filename);\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+inline bool torrent_peer_equal (torrent_peer const* lhs, torrent_peer const* rhs);\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+

    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+

    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 (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@@ -6490,77 +7885,109 @@\n an empty string is returned.

    \n

    For more information about magnet links, see magnet links.

    \n [report issue]
    \n
    \n

    parse_magnet_uri()

    \n

    Declared in "libtorrent/magnet_uri.hpp"

    \n
    \n-void parse_magnet_uri (string_view uri, add_torrent_params& p, error_code& ec);\n-add_torrent_params parse_magnet_uri (string_view uri);\n add_torrent_params parse_magnet_uri (string_view uri, error_code& ec);\n+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-[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-[report issue]
    \n-
    \n-

    torrent_peer_equal()

    \n-

    Declared in "libtorrent/torrent_peer.hpp"

    \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-inline bool torrent_peer_equal (torrent_peer const* lhs, torrent_peer const* rhs);\n+add_torrent_params load_torrent_file (\n+   std::string const& filename, load_torrent_limits const& cfg);\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_parsed (\n+   bdecode_node const& torrent_file);\n+add_torrent_params load_torrent_file (\n+   std::string const& filename);\n+add_torrent_params load_torrent_buffer (\n+   span<char const> buffer, load_torrent_limits const& cfg);\n 
    \n-[report issue]
    \n-
    \n-

    enum connection_type

    \n-

    Declared in "libtorrent/peer_connection.hpp"

    \n+

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

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

    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
    namevaluedescription
    bittorrent
    tcp0 
    url_seed
    socks51 
    http_seed
    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@@ -6625,69 +8052,14 @@\n \n \n \n \n \n \n
    paused4 
    \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 portmap_transport

    \n

    Declared in "libtorrent/portmap.hpp"

    \n \n \n \n@@ -6738,14 +8110,45 @@\n \n \n \n \n \n \n
    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

    int

    \n

    Declared in "libtorrent/version.hpp"

    \n
    \n
    version_major
    \n
    the major, minor and tiny versions of libtorrent
    \n@@ -6754,14 +8157,78 @@\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+

    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@@ -6988,1143 +8455,1889 @@\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+[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-
    \n-
    default_priority
    \n-
    The default priority for files and pieces.
    \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-
    \n-
    low_priority
    \n-
    The lowest priority for files and pieces.
    \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-
    \n-
    top_priority
    \n-
    The highest priority for files and pieces.
    \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-
    \n-

    pex_flags_t

    \n-

    Declared in "libtorrent/pex_flags.hpp"

    \n-
    \n-
    pex_encryption
    \n-
    the peer supports protocol encryption
    \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-
    \n-
    pex_seed
    \n-
    the peer is a seed
    \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-
    \n-
    pex_utp
    \n-
    the peer supports the uTP, transport protocol over UDP.
    \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-
    \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+[report issue]
    \n+
    storage_mode
    \n+
    One of the values from storage_mode_t. For more information, see\n+storage allocation.
    \n
    \n-
    \n-
    pex_lt_v2
    \n-
    protocol v2\n-this is not a standard flag, it is only used internally
    \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-
    \n-

    char const*

    \n-

    Declared in "libtorrent/version.hpp"

    \n-
    \n-
    version_str
    \n-
    the libtorrent version in string form
    \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-
    \n-

    std::uint64_t

    \n-

    Declared in "libtorrent/version.hpp"

    \n-
    \n-
    version_revision
    \n-
    the git commit of this libtorrent version
    \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-
    \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-   std::vector<torrent_status> get_torrent_status (\n-      std::function<bool(torrent_status const&)> const& pred\n-      , status_flags_t flags = {}) const;\n-   void refresh_torrent_status (std::vector<torrent_status>* ret\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-   torrent_handle find_torrent (sha1_hash const& info_hash) const;\n-   std::vector<torrent_handle> get_torrents () const;\n-   void async_add_torrent (add_torrent_params&& 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 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-   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_announce (sha1_hash const& info_hash, int port = 0, dht::announce_flags_t flags = {});\n-   void dht_get_peers (sha1_hash const& info_hash);\n-   void dht_live_nodes (sha1_hash const& nid);\n-   void dht_sample_infohashes (udp::endpoint const& ep, sha1_hash const& target);\n-   void dht_direct_request (udp::endpoint const& ep, entry const& e, client_data_t userdata = {});\n-   void add_extension (std::shared_ptr<plugin> ext);\n-   void add_extension (std::function<std::shared_ptr<torrent_plugin>(\n-      torrent_handle const&, client_data_t)> ext);\n-   void set_ip_filter (ip_filter f);\n-   ip_filter get_ip_filter () const;\n-   void set_port_filter (port_filter const& f);\n-   bool is_listening () const;\n-   unsigned short ssl_listen_port () const;\n-   unsigned short listen_port () const;\n-   ip_filter get_peer_class_filter () const;\n-   void set_peer_class_filter (ip_filter const& f);\n-   peer_class_type_filter get_peer_class_type_filter () const;\n-   void set_peer_class_type_filter (peer_class_type_filter const& f);\n-   peer_class_t create_peer_class (char const* name);\n-   void delete_peer_class (peer_class_t cid);\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 pop_alerts (std::vector<alert*>* alerts);\n-   alert* wait_for_alert (time_duration max_wait);\n-   void set_alert_notify (std::function<void()> const& fun);\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 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-std::vector<torrent_status> get_torrent_status (\n-      std::function<bool(torrent_status const&)> const& pred\n-      , status_flags_t flags = {}) const;\n-void refresh_torrent_status (std::vector<torrent_status>* ret\n-      , status_flags_t flags = {}) const;\n-
    \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-

    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+

    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-

    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-

    find_torrent() get_torrents()

    \n-
    \n-torrent_handle find_torrent (sha1_hash const& info_hash) const;\n-std::vector<torrent_handle> get_torrents () 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-void async_add_torrent (add_torrent_params&& 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 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-
    \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-

    resume() is_paused() pause()

    \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
    \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_announce (sha1_hash const& info_hash, int port = 0, dht::announce_flags_t flags = {});\n-void dht_get_peers (sha1_hash const& info_hash);\n-
    \n-

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

    \n-

    dht_announce() will issue a DHT announce request to the DHT to the\n-specified info-hash, advertising the specified port. If the port is\n-left at its default, 0, the port will be implied by the DHT message's\n-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::shared_ptr<plugin> ext);\n-void add_extension (std::function<std::shared_ptr<torrent_plugin>(\n-      torrent_handle const&, client_data_t)> 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+[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-#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+[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-#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+[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-#include <libtorrent/extensions/smart_ban.hpp>\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-
    \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-bool is_listening () const;\n-unsigned short ssl_listen_port () const;\n-unsigned short 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-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-peer_class_type_filter get_peer_class_type_filter () const;\n-void set_peer_class_type_filter (peer_class_type_filter const& f);\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+[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-void delete_peer_class (peer_class_t cid);\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+   operator void const* () const = delete;\n+   client_data_t& operator= (void*) = delete;\n+   client_data_t& operator= (void 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-

    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-

    get_peer_class() set_peer_class()

    \n+[report issue]
    \n+

    client_data_t()

    \n
    \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+client_data_t () = default;\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+

    construct a nullptr client data

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

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

    \n
    \n-void remove_torrent (const torrent_handle&, remove_flags_t = {});\n+operator void const* () const = delete;\n+client_data_t& operator= (void*) = delete;\n+client_data_t& operator= (void const*) = delete;\n+operator void* () const = delete;\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+

    we don't allow type-unsafe operations

    \n+[report issue]
    \n+
    \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-void apply_settings (settings_pack&&);\n-void apply_settings (settings_pack const&);\n-settings_pack get_settings () const;\n+struct peer_class_type_filter\n+{\n+   void remove (socket_type_t const st, peer_class_t const peer_class);\n+   void add (socket_type_t const st, peer_class_t const peer_class);\n+   void 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-

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

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

    pop_alerts() wait_for_alert() set_alert_notify()

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

    add() remove()

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

    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+

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

    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+

    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-void reopen_network_sockets (reopen_network_flags_t options = reopen_map_ports);\n+std::uint32_t apply (socket_type_t const st, std::uint32_t peer_class_mask);\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+

    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_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-std::shared_ptr<aux::session_impl> native_handle () const;\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-

    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+[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-
    delete_partfile
    \n-
    delete just the part-file associated with this torrent
    \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-
    paused
    \n-
    when set, the session will start paused. Call\n-session_handle::resume() to start
    \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-
    udp tcp
    \n-
    protocols used by add_port_mapping()
    \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-[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+
    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-
    \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+[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 session_proxy\n+struct storage_error\n {\n-   session_proxy& operator= (session_proxy const&) &;\n-   session_proxy ();\n-   ~session_proxy ();\n-   session_proxy& operator= (session_proxy&&) & noexcept;\n-   session_proxy (session_proxy const&);\n-   session_proxy (session_proxy&&) noexcept;\n+   explicit operator bool () 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-\n-\n-[report issue]
    \n-

    operator=() ~session_proxy() session_proxy()

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

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

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

    session

    \n-

    Declared in "libtorrent/session.hpp"

    \n-

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

    \n-

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

    \n-

    see apply_settings().

    \n+[report issue]
    \n+

    bool()

    \n
    \n-struct session : session_handle\n-{\n-   explicit session (session_params const& params);\n-   session (session_params&& params, session_flags_t flags);\n-   session (session_params const& params, session_flags_t flags);\n-   explicit session (session_params&& params);\n-   session ();\n-   session (session_params const& params, io_context& ios, session_flags_t);\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 ();\n-   session_proxy abort ();\n-};\n+explicit operator bool () const;\n 
    \n-[report issue]
    \n-

    session()

    \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-explicit session (session_params const& params);\n-session (session_params&& params, session_flags_t flags);\n-session (session_params const& params, session_flags_t flags);\n-explicit session (session_params&& params);\n-session ();\n+void file (file_index_t f);\n+file_index_t file () const;\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+

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

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

    socks_category()

    \n+

    Declared in "libtorrent/socks5_stream.hpp"

    \n
    \n-session (session_params const& params, io_context& ios, session_flags_t);\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+boost::system::error_category& socks_category ();\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+

    returns the error_category for SOCKS5 errors

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

    i2p_category()

    \n+

    Declared in "libtorrent/i2p_stream.hpp"

    \n
    \n-~session ();\n+boost::system::error_category& i2p_category ();\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+

    returns the error category for I2P errors

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

    libtorrent_category()

    \n+

    Declared in "libtorrent/error_code.hpp"

    \n
    \n-session_proxy abort ();\n+boost::system::error_category& libtorrent_category ();\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+

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

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

    http_category()

    \n+

    Declared in "libtorrent/error_code.hpp"

    \n
    \n-struct session_proxy {};\n+boost::system::error_category& http_category ();\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+

    returns the error_category for HTTP errors

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

    bdecode_category()

    \n+

    Declared in "libtorrent/bdecode.hpp"

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

    session_params()

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

    upnp_category()

    \n+

    Declared in "libtorrent/upnp.hpp"

    \n
    \n-session_params ();\n-session_params (settings_pack const& sp);\n-session_params (settings_pack&& sp);\n+boost::system::error_category& upnp_category ();\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+

    the boost.system error category for UPnP errors

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

    gzip_category()

    \n+

    Declared in "libtorrent/gzip.hpp"

    \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+boost::system::error_category& gzip_category ();\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-

    read_session_params() write_session_params_buf() write_session_params()

    \n-

    Declared in "libtorrent/session_params.hpp"

    \n+

    get the error_category for zip errors

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

    pcp_category()

    \n+

    Declared in "libtorrent/natpmp.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+boost::system::error_category& pcp_category ();\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+

    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 i2p_error_code

    \n+

    Declared in "libtorrent/i2p_stream.hpp"

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

    enum error_code_enum

    \n+

    Declared in "libtorrent/error_code.hpp"

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

    enum http_errors

    \n+

    Declared in "libtorrent/error_code.hpp"

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    namevaluedescription
    cont100 
    ok200 
    created201 
    accepted202 
    no_content204 
    multiple_choices300 
    moved_permanently301 
    moved_temporarily302 
    not_modified304 
    bad_request400 
    unauthorized401 
    forbidden403 
    not_found404 
    internal_server_error500 
    not_implemented501 
    bad_gateway502 
    service_unavailable503 
    \n+[report issue]
    \n+
    \n+

    enum error_code_enum

    \n+

    Declared in "libtorrent/bdecode.hpp"

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

    enum error_code_enum

    \n+

    Declared in "libtorrent/upnp.hpp"

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

    enum error_code_enum

    \n+

    Declared in "libtorrent/gzip.hpp"

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

    enum pcp_errors

    \n+

    Declared in "libtorrent/natpmp.hpp"

    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    namevaluedescription
    pcp_success0 
    pcp_unsupp_version1 
    pcp_not_authorized2 
    pcp_malformed_request3 
    pcp_unsupp_opcode4 
    pcp_unsupp_option5 
    pcp_malformed_option6 
    pcp_network_failure7 
    pcp_no_resources8 
    pcp_unsupp_protocol9 
    pcp_user_ex_quota10 
    pcp_cannot_provide_external11 
    pcp_address_mismatch12 
    pcp_excessive_remote_peers13 
    \n

    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@@ -8141,46 +10354,46 @@\n

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

    \n
    \n class entry\n {\n    data_type type () const;\n-   entry (list_type);\n-   entry (dictionary_type);\n    entry (integer_type);\n+   entry (list_type);\n    entry (preformatted_type);\n+   entry (dictionary_type);\n    entry (span<char const>);\n    entry (U v);\n    entry (data_type t);\n    entry (bdecode_node const& n);\n-   entry& operator= (integer_type) &;\n-   entry& operator= (dictionary_type) &;\n    entry& operator= (bdecode_node const&) &;\n-   entry& operator= (entry&&) & noexcept;\n    entry& operator= (entry const&) &;\n-   entry& operator= (span<char const>) &;\n-   entry& operator= (list_type) &;\n    entry& operator= (preformatted_type) &;\n+   entry& operator= (dictionary_type) &;\n+   entry& operator= (entry&&) & noexcept;\n+   entry& operator= (list_type) &;\n+   entry& operator= (integer_type) &;\n+   entry& operator= (span<char const>) &;\n    entry& operator= (U v) &;\n+   string_type& string ();\n+   list_type& list ();\n+   integer_type& integer ();\n+   dictionary_type& dict ();\n+   preformatted_type& preformatted ();\n+   integer_type const& integer () const;\n    preformatted_type const& preformatted () const;\n-   list_type const& list () const;\n    dictionary_type const& dict () const;\n-   preformatted_type& preformatted ();\n    string_type const& string () const;\n-   integer_type const& integer () const;\n-   integer_type& integer ();\n-   dictionary_type& dict ();\n-   string_type& string ();\n-   list_type& list ();\n+   list_type const& list () 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+   entry const* find_key (string_view key) const;\n    std::string to_string (bool single_line = false) const;\n \n    enum data_type\n    {\n       int_t,\n       string_t,\n       list_t,\n@@ -8196,18 +10409,18 @@\n data_type type () const;\n 
    \n

    returns the concrete type of the entry

    \n [report issue]
    \n
    \n

    entry()

    \n
    \n-entry (list_type);\n-entry (dictionary_type);\n entry (integer_type);\n+entry (list_type);\n entry (preformatted_type);\n+entry (dictionary_type);\n entry (span<char const>);\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@@ -8221,46 +10434,46 @@\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+
    \n

    operator=()

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

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

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

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

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

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

    \n
    \n+string_type& string ();\n+list_type& list ();\n+integer_type& integer ();\n+dictionary_type& dict ();\n+preformatted_type& preformatted ();\n+integer_type const& integer () const;\n preformatted_type const& preformatted () const;\n-list_type const& list () const;\n dictionary_type const& dict () const;\n-preformatted_type& preformatted ();\n string_type const& string () const;\n-integer_type const& integer () const;\n-integer_type& integer ();\n-dictionary_type& dict ();\n-string_type& string ();\n-list_type& list ();\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@@ -8294,22 +10507,22 @@\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+
    \n

    swap()

    \n
    \n void swap (entry& e);\n 
    \n

    swaps the content of this with e.

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

    operator[]()

    \n
    \n entry const& operator[] (string_view key) const;\n entry& operator[] (string_view key);\n 
    \n

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

    \n@@ -8320,16 +10533,16 @@\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 const* find_key (string_view key) const;\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@@ -8381,15 +10594,15 @@\n 5\n  \n \n \n \n [report issue]
    \n
    \n-
    \n+
    \n

    operator<<()

    \n

    Declared in "libtorrent/entry.hpp"

    \n
    \n inline std::ostream& operator<< (std::ostream& os, const entry& e);\n 
    \n

    prints the bencoded structure to the ostream as a JSON-style structure.

    \n [report issue]
    \n@@ -8408,339 +10621,14 @@\n instantiated as ostream_iterator or back_insert_iterator. This\n function assumes the value_type of the iterator is a char.\n In order to encode entry e into a buffer, do:

    \n
    \n std::vector<char> buf;\n bencode(std::back_inserter(buf), e);\n 
    \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-   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-   bdecode_node list_at (int i) const;\n-   std::int64_t list_int_value_at (int i\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 dict_find_int_value (string_view key\n-      , std::int64_t default_val = 0) const;\n-   int dict_size () const;\n-   string_view dict_find_string_value (string_view key\n-      , string_view default_value = string_view()) const;\n-   bdecode_node dict_find_list (string_view key) const;\n-   bdecode_node dict_find_dict (string_view key) const;\n-   bdecode_node dict_find (string_view key) const;\n-   bdecode_node dict_find_int (string_view key) const;\n-   std::pair<string_view, bdecode_node> dict_at (int i) const;\n-   bdecode_node dict_find_string (string_view key) 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-   string_view string_value () 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-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_int_value_at() list_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-bdecode_node list_at (int i) const;\n-std::int64_t list_int_value_at (int i\n-      , std::int64_t default_val = 0) const;\n-
    \n-

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

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

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

    \n-
    \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-int dict_size () const;\n-string_view dict_find_string_value (string_view key\n-      , string_view default_value = string_view()) const;\n-bdecode_node dict_find_list (string_view key) const;\n-bdecode_node dict_find_dict (string_view key) const;\n-bdecode_node dict_find (string_view key) const;\n-bdecode_node dict_find_int (string_view key) const;\n-std::pair<string_view, bdecode_node> dict_at (int i) const;\n-bdecode_node dict_find_string (string_view key) const;\n-
    \n-

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

    \n-

    Functions with the _value suffix return the value of the node\n-directly, rather than the nodes. In case the node is not found, or it has\n-a different type, a default value is returned (which can be specified).

    \n-

    dict_at() returns the (key, value)-pair at the specified index in a\n-dictionary. Keys are only allowed to be strings. dict_at_node() also\n-returns the (key, value)-pair, but the key is returned as a\n-bdecode_node (and it will always be a string).

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

    int_value()

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

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

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

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

    \n-
    \n-int string_length () const;\n-char const* string_ptr () const;\n-std::ptrdiff_t string_offset () const;\n-string_view string_value () 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

    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@@ -8872,15 +10760,15 @@\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+
    \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@@ -8995,16 +10883,16 @@\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 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@@ -9026,21 +10914,21 @@\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+[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+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@@ -9125,56 +11013,56 @@\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_choke ();\n+ virtual bool on_have_none ();\n virtual bool on_allowed_fast (piece_index_t);\n virtual bool on_interested ();\n- virtual bool on_dont_have (piece_index_t);\n+ virtual bool on_have_all ();\n+ virtual bool on_bitfield (bitfield const& /*bitfield*/);\n virtual bool on_unchoke ();\n+ virtual bool on_dont_have (piece_index_t);\n virtual bool on_not_interested ();\n+ virtual bool on_request (peer_request const&);\n virtual bool on_have (piece_index_t);\n- virtual bool on_have_all ();\n- virtual bool on_have_none ();\n- virtual bool on_bitfield (bitfield const& /*bitfield*/);\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_have_all ();\n+ virtual void sent_reject_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_request (peer_request const&);\n- virtual void sent_reject_request (peer_request const&);\n- virtual void sent_choke ();\n- virtual void sent_suggest (piece_index_t);\n virtual void sent_have_none ();\n- virtual void sent_interested ();\n+ virtual void sent_choke ();\n virtual void sent_not_interested ();\n virtual void sent_piece (peer_request const&);\n+ virtual void sent_interested ();\n virtual void sent_unchoke ();\n virtual void sent_have (piece_index_t);\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 on_piece_failed (piece_index_t);\n virtual void tick ();\n virtual bool write_request (peer_request const&);\n };\n \n-[report issue]
    \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@@ -9219,39 +11107,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+\n+\n \n-\n-[report issue]
    \n-
    \n-

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

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

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

    \n
    \n-virtual bool on_request (peer_request const&);\n virtual bool on_choke ();\n+virtual bool on_have_none ();\n virtual bool on_allowed_fast (piece_index_t);\n virtual bool on_interested ();\n-virtual bool on_dont_have (piece_index_t);\n+virtual bool on_have_all ();\n+virtual bool on_bitfield (bitfield const& /*bitfield*/);\n virtual bool on_unchoke ();\n+virtual bool on_dont_have (piece_index_t);\n virtual bool on_not_interested ();\n+virtual bool on_request (peer_request const&);\n virtual bool on_have (piece_index_t);\n-virtual bool on_have_all ();\n-virtual bool on_have_none ();\n-virtual bool on_bitfield (bitfield const& /*bitfield*/);\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@@ -9263,25 +11151,25 @@\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_not_interested() sent_have() sent_unchoke() sent_piece() sent_interested()

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

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

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

    called after a choke message has been sent to the peer

    \n [report issue]
    \n
    \n

    sent_payload()

    \n@@ -9319,21 +11207,21 @@\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+[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+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@@ -9392,44 +11280,44 @@\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_choked () const;\n    bool is_peer_interested () const;\n    bool has_peer_choked () const;\n-   void maybe_unchoke_this_peer ();\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_connecting () const;\n+   tcp::endpoint local_endpoint () 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 is_connecting () const;\n    bool on_local_network () const;\n+   bool ignore_unchoke_slots () const;\n    bool failed () const;\n    bool should_log (peer_log_alert::direction_t direction) const;\n    void peer_log (peer_log_alert::direction_t direction\n       , char const* event, char const* fmt = "", ...) const TORRENT_FORMAT(4,5);\n    bool can_disconnect (error_code const& ec) const;\n    bool has_metadata () const;\n    bool in_handshake () const;\n    void send_buffer (char const* begin, int size);\n-   time_point time_of_last_unchoke () const;\n    std::time_t last_seen_complete () const;\n+   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@@ -9444,28 +11332,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_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@@ -9486,2314 +11360,2827 @@\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-

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

    create_ut_pex_plugin()

    \n+

    Declared in "libtorrent/extensions/ut_pex.hpp"

    \n
    \n-struct torrent_status\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+

    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-   bool operator== (torrent_status const& st) const;\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+   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+   int list_size () 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+   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+   int dict_size () const;\n+   bdecode_node dict_find (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+   bdecode_node dict_find_dict (string_view key) const;\n+   bdecode_node dict_find_int (string_view key) const;\n+   std::int64_t int_value () const;\n+   char const* string_ptr () const;\n+   string_view string_value () const;\n+   std::ptrdiff_t string_offset () 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 state_t\n+   enum type_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+      none_t,\n+      dict_t,\n+      list_t,\n+      string_t,\n+      int_t,\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+[report issue]
    \n+

    bdecode_node()

    \n
    \n-bool operator== (torrent_status const& st) const;\n+bdecode_node () = default;\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+

    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+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+int list_size () 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_find_int_value() dict_find_string() dict_find() dict_size() dict_at_node() dict_find_dict() dict_find_list() dict_at() dict_find_int()

    \n+
    \n+string_view dict_find_string_value (string_view key\n+      , string_view default_value = string_view()) 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+int dict_size () const;\n+bdecode_node dict_find (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+bdecode_node dict_find_dict (string_view key) const;\n+bdecode_node dict_find_int (string_view key) const;\n+
    \n+

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

    \n+

    Functions with the _value suffix return the value of the node\n+directly, rather than the nodes. In case the node is not found, or it has\n+a different type, a default value is returned (which can be specified).

    \n+

    dict_at() returns the (key, value)-pair at the specified index in a\n+dictionary. Keys are only allowed to be strings. dict_at_node() also\n+returns the (key, value)-pair, but the key is returned as a\n+bdecode_node (and it will always be a string).

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

    int_value()

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

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

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

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

    \n+
    \n+char const* string_ptr () const;\n+string_view string_value () const;\n+std::ptrdiff_t string_offset () 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 \n-\n+\n \n-\n+\n \n-\n+\n \n-\n-\n-\n+\n+
    namevaluedescription
    checking_files
    none_t0uninitialized or default constructed. This is also used\n+to indicate that a node was not found in some cases.
    dict_t1The torrent has not started its download yet, and is\n-currently checking existing files.a dictionary node. The dict_find_ functions are valid.
    downloading_metadata
    list_t2The torrent is trying to download metadata from peers.\n-This implies the ut_metadata extension is in use.a list node. The list_ functions are valid.
    downloading
    string_t3The 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.a string node, the string_ functions are valid.
    finished
    int_t4In 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.an integer node. The int_ functions are valid.
    seeding5In this state the torrent has finished downloading and\n-is a pure seeder.
    \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+

    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+\n+   enum block_state_t\n+   {\n+      none,\n+      requested,\n+      writing,\n+      finished,\n+   };\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+void set_peer (tcp::endpoint const& ep);\n+tcp::endpoint peer () const;\n+
    \n+

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

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

    enum block_state_t

    \n+

    Declared in "libtorrent/torrent_handle.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
    namevaluedescription
    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.
    none0This block has not been downloaded or requested form any peer.
    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.
    requested1The block has been requested, but not completely downloaded yet.
    writing2The block has been downloaded and is currently queued for being\n+written to disk.
    finished3The block has been written to disk.
    \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+[report issue]
    \n+
    bytes_progress
    \n+
    the number of bytes that have been received for this block
    \n
    \n-[report issue]
    \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+
    the total number of bytes in this block.
    \n
    \n-[report issue]
    \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+
    the state this block is in (see block_state_t)
    \n
    \n-[report issue]
    \n-
    has_incoming
    \n-
    true if there has ever been an incoming connection attempt to this\n-torrent.
    \n+[report issue]
    \n+
    num_peers
    \n+
    the number of peers that is currently requesting this block. Typically\n+this is 0 or 1, but at the end of the torrent blocks may be requested\n+by more peers in parallel to speed things up.
    \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+[report issue]
    \n+
    \n+
    \n+

    partial_piece_info

    \n+

    Declared in "libtorrent/torrent_handle.hpp"

    \n+

    This class holds information about pieces that have outstanding requests\n+or outstanding writes

    \n+
    \n+struct partial_piece_info\n+{\n+   piece_index_t piece_index;\n+   int blocks_in_piece;\n+   int finished;\n+   int writing;\n+   int requested;\n+   block_info const* blocks;\n+};\n+
    \n+[report issue]
    \n+
    piece_index
    \n+
    the index of the piece in question. blocks_in_piece is the number\n+of blocks in this particular piece. This number will be the same for\n+most pieces, but\n+the last piece may have fewer blocks than the standard pieces.
    \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+[report issue]
    \n+
    blocks_in_piece
    \n+
    the number of blocks in this piece
    \n
    \n-[report issue]
    \n-
    info_hashes
    \n-
    the info-hash for this torrent
    \n+[report issue]
    \n+
    finished
    \n+
    the number of blocks that are in the finished state
    \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+[report issue]
    \n+
    writing
    \n+
    the number of blocks that are in the writing state
    \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+[report issue]
    \n+
    requested
    \n+
    the number of blocks that are in the requested state
    \n
    \n-[report issue]
    \n-
    flags
    \n-
    reflects several of the torrent's flags. For more\n-information, see torrent_handle::flags().
    \n+[report issue]
    \n+
    blocks
    \n+

    this is an array of blocks_in_piece number of\n+items. One for each block in the piece.

    \n+
    \n+

    Warning

    \n+

    This is a pointer that points to an array\n+that's owned by the session object. The next time\n+get_download_queue() is called, it will be invalidated.\n+In the case of piece_info_alert, these pointers point into the alert\n+object itself, and will be invalidated when the alert destruct.

    \n+
    \n+
    \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-DHT nodes etc.
    4. \n-
    5. Read through all the files in the torrent, SHA-1 all the data\n-and set the piece hashes.
    6. \n-
    7. The torrent is bencoded into a file or buffer.
    8. \n-
    \n-

    If there are a lot of files and or deep directory hierarchies to\n-traverse, step one can be time consuming.

    \n-

    Typically step 3 is by far the most time consuming step, since it\n-requires to read all the bytes from all the files in the torrent.

    \n-

    All of these classes and functions are declared by including\n-libtorrent/create_torrent.hpp.

    \n-

    example:

    \n-
    \n-file_storage fs;\n-\n-// recursively adds files in directories\n-add_files(fs, "./my_torrent");\n-\n-create_torrent t(fs);\n-t.add_tracker("http://my.tracker.com/announce");\n-t.set_creator("libtorrent example");\n-\n-// reads the files and calculates the hashes\n-set_piece_hashes(t, ".");\n-\n-ofstream out("my_torrent.torrent", std::ios_base::binary);\n-std::vector<char> buf = t.generate_buf();\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+[report issue]
    \n+
    \n+

    torrent_handle

    \n+

    Declared in "libtorrent/torrent_handle.hpp"

    \n+

    You will usually have to store your torrent handles somewhere, since it's\n+the object through which you retrieve information about the torrent and\n+aborts the torrent.

    \n+
    \n+

    Warning

    \n+

    Any member function that returns a value or fills in a value has to be\n+made synchronously. This means it has to wait for the main thread to\n+complete the query before it can return. This might potentially be\n+expensive if done from within a GUI thread that needs to stay\n+responsive. Try to avoid querying for information you don't need, and\n+try to do it in as few calls as possible. You can get most of the\n+interesting information about a torrent from the\n+torrent_handle::status() call.

    \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 (file_storage& fs, int piece_size = 0\n-      , create_flags_t flags = {});\n-   explicit create_torrent (torrent_info const& ti);\n-   std::vector<char> generate_buf () const;\n-   entry generate () const;\n-   file_storage const& files () const;\n-   void set_comment (char const* str);\n-   void set_creator (char const* str);\n-   void set_creation_date (std::time_t timestamp);\n-   void set_hash (piece_index_t index, sha1_hash const& h);\n-   void set_hash2 (file_index_t file, piece_index_t::diff_type piece, sha256_hash const& h);\n-   void add_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-   void set_priv (bool p);\n-   bool priv () 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_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-   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 (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-be any combination of the flags defined by create_flags_t.

    \n-

    The file_storage (fs) parameter defines the files, sizes and\n-their properties for the torrent to be created. Set this up first,\n-before passing it to the create_torrent constructor.

    \n-

    The overload that takes a torrent_info object will make a verbatim\n-copy of its info dictionary (to preserve the info-hash). The copy of\n-the info dictionary will be used by create_torrent::generate(). This means\n-that none of the member functions of create_torrent that affects\n-the content of the info dictionary (such as set_hash()), will\n-have any affect. Instead of using this overload, consider using\n-write_torrent_file() instead.

    \n+

    The default constructor will initialize the handle to an invalid state.\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-

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

    \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+are processed by a background thread, there is no guarantee that a\n+handle will remain valid between two calls.

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

    generate_buf() generate()

    \n
    \n-std::vector<char> generate_buf () const;\n-entry generate () const;\n+struct torrent_handle\n+{\n+   friend std::size_t hash_value (torrent_handle const& th);\n+   torrent_handle () noexcept = default;\n+   void add_piece (piece_index_t piece, std::vector<char> data, add_piece_flags_t flags = {}) const;\n+   void add_piece (piece_index_t piece, char const* data, add_piece_flags_t flags = {}) const;\n+   void read_piece (piece_index_t piece) const;\n+   bool have_piece (piece_index_t piece) const;\n+   void get_peer_info (std::vector<peer_info>& v) const;\n+   void post_peer_info () 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+   void post_download_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 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+   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<std::int64_t> file_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 replace_trackers (std::vector<announce_entry> const&) const;\n+   void post_trackers () const;\n+   void add_tracker (announce_entry const&) const;\n+   std::set<std::string> url_seeds () const;\n+   void remove_url_seed (std::string const& url) const;\n+   void add_url_seed (std::string const& url) const;\n+   void add_http_seed (std::string const& url) const;\n+   std::set<std::string> http_seeds () const;\n+   void remove_http_seed (std::string const& url) const;\n+   void add_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 pause (pause_flags_t flags = {}) const;\n+   void resume () const;\n+   void unset_flags (torrent_flags_t flags) const;\n+   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 () const;\n+   bool need_save_resume_data (resume_data_flags_t flags) const;\n+   void queue_position_top () const;\n+   void queue_position_bottom () const;\n+   void queue_position_up () const;\n+   void queue_position_down () 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::vector<std::vector<sha256_hash>> piece_layers () const;\n+   void piece_availability (std::vector<int>& avail) const;\n+   void post_piece_availability () const;\n+   download_priority_t piece_priority (piece_index_t index) const;\n+   void prioritize_pieces (std::vector<download_priority_t> const& pieces) const;\n+   void piece_priority (piece_index_t index, download_priority_t priority) const;\n+   std::vector<download_priority_t> get_piece_priorities () 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+   download_priority_t file_priority (file_index_t index) 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 force_reannounce (int seconds = 0, int idx = -1, reannounce_flags_t = {}) const;\n+   void force_dht_announce () const;\n+   void force_lsd_announce () const;\n+   void scrape_tracker (int idx = -1) const;\n+   int upload_limit () const;\n+   void set_download_limit (int limit) const;\n+   int download_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+   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+   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+   static constexpr status_flags_t query_accurate_download_counters  = 1_bit;\n+   static constexpr status_flags_t query_last_seen_complete  = 2_bit;\n+   static constexpr status_flags_t query_pieces  = 3_bit;\n+   static constexpr status_flags_t query_verified_pieces  = 4_bit;\n+   static constexpr status_flags_t query_torrent_file  = 5_bit;\n+   static constexpr status_flags_t query_name  = 6_bit;\n+   static constexpr status_flags_t query_save_path  = 7_bit;\n+   static constexpr deadline_flags_t alert_when_available  = 0_bit;\n+   static constexpr file_progress_flags_t piece_granularity  = 0_bit;\n+   static constexpr pause_flags_t graceful_pause  = 0_bit;\n+   static constexpr resume_data_flags_t flush_disk_cache  = 0_bit;\n+   static constexpr resume_data_flags_t save_info_dict  = 1_bit;\n+   static constexpr resume_data_flags_t only_if_modified  = 2_bit;\n+   static constexpr resume_data_flags_t if_counters_changed  = 3_bit;\n+   static constexpr resume_data_flags_t if_download_progress  = 4_bit;\n+   static constexpr resume_data_flags_t if_config_changed  = 5_bit;\n+   static constexpr resume_data_flags_t if_state_changed  = 6_bit;\n+   static constexpr resume_data_flags_t if_metadata_changed  = 7_bit;\n+   static constexpr reannounce_flags_t ignore_min_interval  = 0_bit;\n+};\n 
    \n-

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

    \n-

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

    \n-

    Whether the resulting torrent object is v1, v2 or hybrid depends on\n-whether any of the v1_only or v2_only flags were set on the\n-constructor. If neither were set, the resulting torrent depends on\n-which hashes were set. If both v1 and v2 hashes were set, a hybrid\n-torrent is created.

    \n-

    Any failure will cause this function to throw system_error, with an\n-appropriate error message. These are the reasons this call may throw:

    \n-
      \n-
    • the file storage has 0 files
    • \n-
    • the total size of the file storage is 0 bytes (i.e. it only has\n-empty files)
    • \n-
    • not all v1 hashes (set_hash()) and not all v2 hashes (set_hash2())\n-were set
    • \n-
    • for v2 torrents, you may not have a directory with the same name as\n-a file. If that's encountered in the file storage, generate()\n-fails.
    • \n-
    \n-[report issue]
    \n-
    \n-

    files()

    \n+[report issue]
    \n+

    torrent_handle()

    \n
    \n-file_storage const& files () const;\n+torrent_handle () noexcept = default;\n 
    \n-

    returns an immutable reference to the file_storage used to create\n-the torrent from.

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

    set_comment()

    \n+

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

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

    add_piece()

    \n
    \n-void set_comment (char const* str);\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-

    Sets the comment for the torrent. The string str should be utf-8 encoded.\n-The comment in a torrent file is optional.

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

    set_creator()

    \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+downloaded with this data.

    \n+

    Since the data is written asynchronously, you may know that is passed\n+or failed the hash check by waiting for piece_finished_alert or\n+hash_failed_alert.

    \n+

    Adding pieces while the torrent is being checked (i.e. in\n+torrent_status::checking_files state) is not supported.

    \n+

    The overload taking a raw pointer to the data is a blocking call. It\n+won't return until the libtorrent thread has copied the data into its\n+disk write buffer. data is expected to point to a buffer of as\n+many bytes as the size of the specified piece. See\n+file_storage::piece_size().

    \n+

    The data in the buffer is copied and passed on to the disk IO thread\n+to be written at a later point.

    \n+

    The overload taking a std::vector<char> is not blocking, it will\n+send the buffer to the main thread and return immediately.

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

    read_piece()

    \n
    \n-void set_creator (char const* str);\n+void read_piece (piece_index_t piece) const;\n 
    \n-

    Sets the creator of the torrent. The string str should be utf-8 encoded.\n-This is optional.

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

    set_creation_date()

    \n+

    This function starts an asynchronous read operation of the specified\n+piece from this torrent. You must have completed the download of the\n+specified piece before calling this function.

    \n+

    When the read operation is completed, it is passed back through an\n+alert, read_piece_alert. Since this alert is a response to an explicit\n+call, it will always be posted, regardless of the alert mask.

    \n+

    Note that if you read multiple pieces, the read operations are not\n+guaranteed to finish in the same order as you initiated them.

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

    have_piece()

    \n
    \n-void set_creation_date (std::time_t timestamp);\n+bool have_piece (piece_index_t piece) const;\n 
    \n-

    sets the "creation time" field. Defaults to the system clock at the\n-time of construction of the create_torrent object. The timestamp is\n-specified in seconds, posix time. If the creation date is set to 0,\n-the "creation date" field will be omitted from the generated torrent.

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

    set_hash()

    \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-void set_hash (piece_index_t index, sha1_hash const& h);\n+void get_peer_info (std::vector<peer_info>& v) const;\n+void post_peer_info () const;\n 
    \n-

    This sets the SHA-1 hash for the specified piece (index). You are required\n-to 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 set_piece_hashes().\n-A SHA-1 hash of all zeros is internally used to indicate a hash that\n-has not been set. Setting such hash will not be considered set when\n-calling generate().\n-This function will throw std::system_error if it is called on an\n-object constructed with the v2_only flag.

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

    set_hash2()

    \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+

    status() post_status()

    \n
    \n-void set_hash2 (file_index_t file, piece_index_t::diff_type piece, sha256_hash const& h);\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-

    sets the bittorrent v2 hash for file file of the piece piece.\n-piece is relative to the first piece of the file, starting at 0. The\n-first piece in the file can be computed with\n-file_storage::file_index_at_piece().\n-The hash, h, is the root of the merkle tree formed by the piece's\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+

    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+filter them out.

    \n+

    The status() function will block until the internal libtorrent\n+thread responds with the torrent_status object. To avoid blocking,\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-void add_http_seed (string_view url);\n-void add_url_seed (string_view url);\n+void post_download_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 
    \n-

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

    \n-

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

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

    add_node()

    \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-void add_node (std::pair<std::string, int> node);\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 adds a DHT node to the torrent. This especially useful if you're creating a\n-tracker less torrent. It can be used by clients to bootstrap their DHT node from.\n-The node is a hostname and a port number where there is a DHT node running.\n-You can have any number of DHT nodes in a torrent.

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

    add_tracker()

    \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+function again.

    \n+

    If the piece is already downloaded when this call is made, nothing\n+happens, unless the alert_when_available flag is set, in which case it\n+will have the same effect as calling read_piece() for index.

    \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+

    file_progress() post_file_progress()

    \n
    \n-void add_tracker (string_view url, int tier = 0);\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<std::int64_t> file_progress (file_progress_flags_t flags = {}) const;\n 
    \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 http:// or udp://\n-url to a machine running a bittorrent tracker that accepts announces for this torrent's\n-info-hash. The tier is the fallback priority of the tracker. All trackers with tier 0 are\n-tried first (in any order). If all fail, trackers with tier 1 are tried. If all of those\n-fail, trackers with tier 2 are tried, and so on.

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

    set_root_cert()

    \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+downloading pieces and j is the number of blocks in a piece.

    \n+

    The flags parameter can be used to specify the granularity of the\n+file progress. If left at the default value of 0, the progress will be\n+as accurate as possible, but also more expensive to calculate. If\n+torrent_handle::piece_granularity is specified, the progress will\n+be specified in piece granularity. i.e. only pieces that have been\n+fully downloaded and passed the hash check count. When specifying\n+piece granularity, the operation is a lot cheaper, since libtorrent\n+already keeps track of this internally and no calculation is required.

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

    file_status()

    \n
    \n-void set_root_cert (string_view cert);\n+std::vector<open_file_state> file_status () const;\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-

    set_priv() priv()

    \n+

    This function returns a vector with status about files\n+that are open for this torrent. Any file that is not open\n+will not be reported in the vector, i.e. it's possible that\n+the vector is empty when returning, if none of the files in the\n+torrent are currently open.

    \n+

    See open_file_state

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

    clear_error()

    \n
    \n-void set_priv (bool p);\n-bool priv () const;\n+void clear_error () 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+

    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() replace_trackers() add_tracker() trackers()

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

    returns the number of pieces in the associated file_storage object.

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

    piece_range()

    \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+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+will trigger a tracker_list_alert to be posted.

    \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+

    url_seeds() add_url_seed() remove_url_seed()

    \n
    \n-index_range<piece_index_t> piece_range () const noexcept;\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-

    all piece indices in the torrent to be created

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

    file_range()

    \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() remove_http_seed() http_seeds()

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

    all file indices in the torrent to be created

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

    file_piece_range()

    \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
    \n-index_range<piece_index_t::diff_type> file_piece_range (file_index_t f);\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 
    \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-

    total_size()

    \n+

    add the specified extension to this torrent. The ext argument is\n+a function that will be called from within libtorrent's context\n+passing in the internal torrent object and the specified userdata\n+pointer. The function is expected to return a shared pointer to\n+a torrent_plugin instance.

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

    set_metadata()

    \n
    \n-std::int64_t total_size () const;\n+bool set_metadata (span<char const> metadata) const;\n 
    \n-

    the total number of bytes of all files and pad files

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

    piece_length() piece_size()

    \n+

    set_metadata expects the info section of metadata. i.e. The\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+

    is_valid()

    \n
    \n-int piece_size (piece_index_t i) const;\n-int piece_length () const;\n+bool is_valid () 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+

    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+session::find_torrent() was successful.

    \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-void add_collection (string_view c);\n-void add_similar_torrent (sha1_hash ih);\n+void pause (pause_flags_t flags = {}) const;\n+void resume () const;\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-[report issue]
    \n-
    modification_time
    \n-
    This will include the file modification time as part of the torrent.\n-This is not enabled by default, as it might cause problems when you\n-create a torrent from separate files with the same content, hoping to\n-yield the same info-hash. If the files have different modification times,\n-with this option enabled, you would get different info-hashes for the\n-files.
    \n-
    \n-[report issue]
    \n-
    symlinks
    \n-
    If this flag is set, files that are symlinks get a symlink attribute\n-set on them and their data will not be included in the torrent. This\n-is useful if you need to reconstruct a file hierarchy which contains\n-symlinks.
    \n-
    \n-[report issue]
    \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-set_hash2() before calling generate(). Setting v1 hashes (with\n-set_hash()) is an error with this flag set.
    \n-
    \n-[report issue]
    \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 set_hash(), before calling\n-generate(). Setting v2 hashes (with set_hash2()) is an error with\n-this flag set.
    \n-
    \n-[report issue]
    \n-
    canonical_files
    \n-
    This flag only affects v1-only torrents, and is only relevant\n-together with the v1_only_flag. This flag will force the\n-same file order and padding as a v2 (or hybrid) torrent would have.\n-It has the effect of ordering files and inserting pad files to align\n-them with piece boundaries.
    \n-
    \n-[report issue]
    \n-
    no_attributes
    \n-
    passing this flag to add_files() will ignore file attributes (such as\n-executable or hidden) when adding the files to the file storage.\n-Since not all filesystems and operating systems support all file\n-attributes the resulting torrent may differ depending on where it's\n-created. If it's important for torrents to be created consistently\n-across systems, this flag should be set.
    \n-
    \n-[report issue]
    \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)\n-with the one exception that tail padding is not added to the last\n-file.\n-This behavior deviates from the specification but was the way\n-libtorrent created torrents in version up to and including 2.0.7.\n-This flag is here for backwards compatibility.
    \n-
    \n-[report issue]
    \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+

    For possible values of the flags parameter, see pause_flags_t.

    \n+

    To know if a torrent is paused or not, call\n+torrent_handle::flags() and check for the\n+torrent_status::paused flag.

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

    add_files()

    \n-

    Declared in "libtorrent/create_torrent.hpp"

    \n-
    \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-bool Pred(std::string const& p);\n-
    \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 directories\n-are traversed.

    \n-

    The ".." directory is never traversed.

    \n-

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

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

    set_piece_hashes()

    \n-

    Declared in "libtorrent/create_torrent.hpp"

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

    flags() unset_flags() set_flags()

    \n
    \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-void set_piece_hashes (create_torrent& t, std::string const& p\n-   , std::function<void(piece_index_t)> const& f, error_code& ec);\n-inline void set_piece_hashes (create_torrent& t, std::string const& p\n-   , std::function<void(piece_index_t)> const& f);\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, 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+void unset_flags (torrent_flags_t flags) const;\n+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-

    The overloads taking a settings_pack may be used to configure the\n-underlying disk access. Such as settings_pack::aio_threads.

    \n-

    The overloads that don't take an error_code& may throw an exception in case of a\n-file error, the other overloads sets the error code to reflect the error, if any.

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

    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+

    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+the specified flags and leave any other flags unchanged.\n+unset_flags clears the specified flags, while leaving\n+any other flags unchanged.

    \n+

    The seed_mode flag is special, it can only be cleared once the\n+torrent has been added, and it can only be set as part of the\n+add_torrent_params flags, when adding the torrent.

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

    flush_cache()

    \n
    \n-struct bitfield\n-{\n-   bitfield () noexcept = default;\n-   explicit bitfield (int bits);\n-   bitfield (int bits, bool val);\n-   bitfield (bitfield&& rhs) noexcept = default;\n-   bitfield (char const* b, int bits);\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 clear_bit (int index) noexcept;\n-   void set_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+void flush_cache () const;\n 
    \n-[report issue]
    \n-

    bitfield()

    \n+

    Instructs libtorrent to flush all the disk caches for this torrent and\n+close all file handles. This is done asynchronously and you will be\n+notified that it's complete through cache_flushed_alert.

    \n+

    Note that by the time you get the alert, libtorrent may have cached\n+more data for the torrent, but you are guaranteed that whatever cached\n+data libtorrent had by the time you called\n+torrent_handle::flush_cache() has been written to disk.

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

    force_recheck()

    \n
    \n-bitfield () noexcept = default;\n-explicit bitfield (int bits);\n-bitfield (int bits, bool val);\n-bitfield (bitfield&& rhs) noexcept = default;\n-bitfield (char const* b, int bits);\n-bitfield (bitfield const& rhs);\n+void force_recheck () const;\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+

    force_recheck puts the torrent back in a state where it assumes to\n+have no resume data. All peers will be disconnected and the torrent\n+will stop announcing to the tracker. The torrent will be added to the\n+checking queue, and will be checked (all the files will be read and\n+compared to the piece hashes). Once the check is complete, the torrent\n+will start connecting to peers again, as normal.\n+The torrent will be placed last in queue, i.e. its queue position\n+will be the highest of all torrents in the session.

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

    save_resume_data()

    \n
    \n-void assign (char const* b, int const bits);\n+void save_resume_data (resume_data_flags_t flags = {}) const;\n 
    \n-

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

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

    get_bit() operator[]()

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

    save_resume_data() asks libtorrent to generate fast-resume data for\n+this torrent. The fast resume data (stored in an add_torrent_params\n+object) can be used to resume a torrent in the next session without\n+having to check all files for which pieces have been downloaded. It\n+can also be used to save a .torrent file for a torrent_handle.

    \n+

    This operation is asynchronous, save_resume_data will return\n+immediately. The resume data is delivered when it's done through a\n+save_resume_data_alert.

    \n+

    The operation will fail, and post a save_resume_data_failed_alert\n+instead, in the following cases:

    \n+
    \n+
      \n+
    1. The torrent is in the process of being removed.
    2. \n+
    3. No torrent state has changed since the last saving of resume\n+data, and the only_if_modified flag is set.\n+metadata (see libtorrent's metadata from peers extension)
    4. \n+
    \n+
    \n+

    Note that some counters may be outdated by the time you receive the fast resume data

    \n+

    When saving resume data because of shutting down, make sure not to\n+remove_torrent() before you receive the save_resume_data_alert.\n+There's no need to pause the session or torrent when saving resume\n+data.

    \n+

    The paused state of a torrent is saved in the resume data, so pausing\n+all torrents before saving resume data will all torrents be restored\n+in a paused state.

    \n+
    \n+

    Note

    \n+

    It is typically a good idea to save resume data whenever a torrent\n+is completed or paused. If you save resume data for torrents when they are\n+paused, you can accelerate the shutdown process by not saving resume\n+data again for those torrents. Completed torrents should have their\n+resume data saved when they complete and on exit, since their\n+statistics might be updated.

    \n+
    \n+

    Example code to pause and save resume data for all torrents and wait\n+for the alerts:

    \n+
    \n+extern int outstanding_resume_data; // global counter of outstanding resume data\n+std::vector<torrent_handle> handles = ses.get_torrents();\n+for (torrent_handle const& h : handles) try\n+{\n+        h.save_resume_data(torrent_handle::only_if_modified);\n+        ++outstanding_resume_data;\n+}\n+catch (lt::system_error const& e)\n+{\n+        // the handle was invalid, ignore this one and move to the next\n+}\n+\n+while (outstanding_resume_data > 0)\n+{\n+        alert const* a = ses.wait_for_alert(seconds(30));\n+\n+        // if we don't get an alert within 30 seconds, abort\n+        if (a == nullptr) break;\n+\n+        std::vector<alert*> alerts;\n+        ses.pop_alerts(&alerts);\n+\n+        for (alert* i : alerts)\n+        {\n+                if (alert_cast<save_resume_data_failed_alert>(i))\n+                {\n+                        process_alert(i);\n+                        --outstanding_resume_data;\n+                        continue;\n+                }\n+\n+                save_resume_data_alert const* rd = alert_cast<save_resume_data_alert>(i);\n+                if (rd == nullptr)\n+                {\n+                        process_alert(i);\n+                        continue;\n+                }\n+\n+                std::ofstream out((rd->params.save_path\n+                        + "/" + rd->params.name + ".fastresume").c_str()\n+                        , std::ios_base::binary);\n+                std::vector<char> buf = write_resume_data_buf(rd->params);\n+                out.write(buf.data(), buf.size());\n+                --outstanding_resume_data;\n+        }\n+}\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+

    Note

    \n+

    Note how outstanding_resume_data is a global counter in this\n+example. This is deliberate, otherwise there is a race condition for\n+torrents that was just asked to save their resume data, they posted\n+the alert, but it has not been received yet. Those torrents would\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-void clear_bit (int index) noexcept;\n-void set_bit (int index) noexcept;\n+bool need_save_resume_data () const;\n+bool need_save_resume_data (resume_data_flags_t flags) const;\n 
    \n-

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

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

    all_set()

    \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+libtorrent's main thread. A way to avoid blocking is to instead\n+call save_resume_data() directly, specifying the conditions under\n+which resume data should be saved.

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

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

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

    returns true if all bits in the bitfield are set

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

    none_set()

    \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+greater queue positions have their positions decreased to fill in the\n+space in the sequence.

    \n+

    queue_position() returns the torrent's position in the download\n+queue. The torrents with the smallest numbers are the ones that are\n+being downloaded. The smaller number, the closer the torrent is to the\n+front of the line to be started.

    \n+

    The queue position is also available in the torrent_status.

    \n+

    The queue_position_*() functions adjust the torrents position in\n+the queue. Up means closer to the front and down means closer to the\n+back of the queue. Top and bottom refers to the front and the back of\n+the queue respectively.

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

    queue_position_set()

    \n
    \n-bool none_set () const noexcept;\n+void queue_position_set (queue_position_t p) const;\n 
    \n-

    returns true if no bit in the bitfield is set

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

    size()

    \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-int size () const noexcept;\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 
    \n-

    returns the size of the bitfield in bits.

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

    num_words()

    \n+

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

    \n+

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

    \n+

    cert is a path to the (signed) certificate in .pem format\n+corresponding to this torrent.

    \n+

    private_key is a path to the private key for the specified\n+certificate. This must be in .pem format.

    \n+

    dh_params is a path to the Diffie-Hellman parameter file, which\n+needs to be in .pem format. You can generate this file using the\n+openssl command like this: openssl dhparam -outform PEM -out\n+dhparams.pem 512.

    \n+

    passphrase may be specified if the private key is encrypted and\n+requires a passphrase to be decrypted.

    \n+

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

    \n+

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

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

    torrent_file() torrent_file_with_hashes()

    \n
    \n-int num_words () const noexcept;\n+std::shared_ptr<torrent_info> torrent_file_with_hashes () const;\n+std::shared_ptr<const torrent_info> torrent_file () const;\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+

    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+

    Note that the torrent_info object returned here may be a different\n+instance than the one added to the session, with different attributes\n+like piece layers, dht nodes and trackers. A torrent_info object does\n+not round-trip cleanly when added to a session.

    \n+

    If you want to save a .torrent file from the torrent_handle, instead\n+call save_resume_data() and write_torrent_file() the\n+add_torrent_params object passed back in the alert.

    \n+

    torrent_file_with_hashes() returns a copy of the internal\n+torrent_info and piece layer hashes (if it's a v2 torrent). The piece\n+layers will only be included if they are available. If this torrent\n+was added from a .torrent file with piece layers or if it's seeding,\n+the piece layers are available. This function is more expensive than\n+torrent_file() since it needs to make copies of this information.

    \n+

    The torrent_file_with_hashes() is here for backwards compatibility\n+when constructing a create_torrent object from a torrent_info that's\n+in a session. Prefer save_resume_data() + write_torrent_file().

    \n+

    Note that a torrent added from a magnet link may not have the full\n+merkle trees for all files, and hence not have the complete piece\n+layers. In that state, you cannot create a .torrent file even from\n+the torrent_info returned from torrent_file_with_hashes(). Once the\n+torrent completes downloading all files, becoming a seed, you can\n+make a .torrent file from it.

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

    piece_layers()

    \n
    \n-int num_bytes () const noexcept;\n+std::vector<std::vector<sha256_hash>> piece_layers () const;\n 
    \n-

    returns the number of bytes needed to represent all bits in this\n-bitfield

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

    empty()

    \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+

    post_piece_availability() piece_availability()

    \n
    \n-bool empty () const noexcept;\n+void piece_availability (std::vector<int>& avail) const;\n+void post_piece_availability () const;\n 
    \n-

    returns true if the bitfield has zero size.

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

    data()

    \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+

    prioritize_pieces() piece_priority() get_piece_priorities()

    \n
    \n-char const* data () const noexcept;\n-char* data () noexcept;\n+download_priority_t piece_priority (piece_index_t index) const;\n+void prioritize_pieces (std::vector<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_piece_priorities () const;\n+void prioritize_pieces (std::vector<std::pair<piece_index_t, download_priority_t>> const& pieces) const;\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+

    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+takes precedence over piece availability. Every piece with priority 7\n+will be attempted to be picked before a priority 6 piece and so on.

    \n+

    The default priority of pieces is 4.

    \n+

    Piece priorities can not be changed for torrents that have not\n+downloaded the metadata yet. Magnet links won't have metadata\n+immediately. see the metadata_received_alert.

    \n+

    piece_priority sets or gets the priority for an individual piece,\n+specified by index.

    \n+

    prioritize_pieces takes a vector of integers, one integer per\n+piece in the torrent. All the piece priorities will be updated with\n+the priorities in the vector.\n+The second overload of prioritize_pieces that takes a vector of pairs\n+will update the priorities of only select pieces, and leave all other\n+unaffected. Each pair is (piece, priority). That is, the first item is\n+the piece index and the second item is the priority of that piece.\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+

    prioritize_files() file_priority() get_file_priorities()

    \n
    \n-void swap (bitfield& rhs) noexcept;\n+std::vector<download_priority_t> get_file_priorities () const;\n+download_priority_t file_priority (file_index_t index) 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 
    \n-

    swaps the bit-fields two variables refer to

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

    count()

    \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+torrent based on the vector.

    \n+

    get_file_priorities() returns a vector with the priorities of all\n+files.

    \n+

    The priority values are the same as for piece_priority(). See\n+download_priority_t.

    \n+

    Whenever a file priority is changed, all other piece priorities are\n+reset to match the file priorities. In order to maintain special\n+priorities for particular pieces, piece_priority() has to be called\n+again for those pieces.

    \n+

    You cannot set the file priorities on a torrent that does not yet have\n+metadata or a torrent that is a seed. file_priority(int, int) and\n+prioritize_files() are both no-ops for such torrents.

    \n+

    Since changing file priorities may involve disk operations (of moving\n+files in- and out of the part file), the internal accounting of file\n+priorities happen asynchronously. i.e. setting file priorities and then\n+immediately querying them may not yield the same priorities just set.\n+To synchronize with the priorities taking effect, wait for the\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-int count () const noexcept;\n+void force_reannounce (int seconds = 0, int idx = -1, reannounce_flags_t = {}) const;\n+void force_dht_announce () const;\n+void force_lsd_announce () const;\n 
    \n-

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

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

    find_first_set()

    \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+re-announce interval settings.

    \n+

    The tracker_index argument specifies which tracker to re-announce.\n+If set to -1 (which is the default), all trackers are re-announce.

    \n+

    The flags argument can be used to affect the re-announce. See\n+ignore_min_interval.

    \n+

    force_dht_announce will announce the torrent to the DHT\n+immediately.

    \n+

    force_lsd_announce will announce the torrent on LSD\n+immediately.

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

    scrape_tracker()

    \n
    \n-int find_first_set () const noexcept;\n+void scrape_tracker (int idx = -1) const;\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+

    scrape_tracker() will send a scrape request to a tracker. By\n+default (idx = -1) it will scrape the last working tracker. If\n+idx is >= 0, the tracker with the specified index will scraped.

    \n+

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

    \n+

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

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

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

    \n
    \n-int find_last_clear () const noexcept;\n+int upload_limit () const;\n+void set_download_limit (int limit) const;\n+int download_limit () const;\n+void set_upload_limit (int limit) const;\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+

    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+(settings_pack::upload_rate_limit) will not override the global\n+rate limit. The torrent can never upload more than the global rate\n+limit.

    \n+

    upload_limit and download_limit will return the current limit\n+setting, for upload and download, respectively.

    \n+

    Local peers are not rate limited by default. see peer classes.

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

    connect_peer()

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

    operator=() hasher()

    \n+

    connect_peer() is a way to manually connect to peers that one\n+believe is a part of the torrent. If the peer does not respond, or is\n+not a member of this torrent, it will simply be disconnected. No harm\n+can be done by using this other than an unnecessary connection attempt\n+is made. If the torrent is uninitialized or in queued or checking\n+mode, this will throw system_error. The second (optional)\n+argument will be bitwise ORed into the source mask of this peer.\n+Typically this is one of the source flags in peer_info. i.e.\n+tracker, pex, dht etc.

    \n+

    For possible values of flags, see pex_flags_t.

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

    clear_peers()

    \n
    \n-explicit hasher (span<char const> data);\n-hasher (hasher const&);\n-hasher& operator= (hasher const&) &;\n-hasher (char const* data, int len);\n+void clear_peers ();\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+

    This will disconnect all peers and clear the peer list for this\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-hasher& update (span<char const> data);\n-hasher& update (char const* data, int len);\n+int max_uploads () const;\n+void set_max_uploads (int max_uploads) const;\n 
    \n-

    append the following bytes to what is being hashed

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

    final()

    \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-sha1_hash final ();\n+int max_connections () const;\n+void set_max_connections (int max_connections) const;\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+

    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+connections_limit in settings_pack.

    \n+

    max_connections() returns the current settings.

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

    move_storage()

    \n
    \n-void reset ();\n+void move_storage (std::string const& save_path\n+      , move_flags_t flags = move_flags_t::always_replace_files\n+      ) const;\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+

    Moves the file(s) that this torrent are currently seeding from or\n+downloading to. If the given save_path is not located on the same\n+drive as the original save path, the files will be copied to the new\n+drive and removed from their original location. This will block all\n+other disk IO, and other torrents download and upload rates may drop\n+while copying the file.

    \n+

    Since disk IO is performed in a separate thread, this operation is\n+also asynchronous. Once the operation completes, the\n+storage_moved_alert is generated, with the new path as the\n+message. If the move fails for some reason,\n+storage_moved_failed_alert is generated instead, containing the\n+error message.

    \n+

    The flags argument determines the behavior of the copying/moving\n+of the files in the torrent. see move_flags_t.

    \n+

    always_replace_files is the default and replaces any file that\n+exist in both the source directory and the target directory.

    \n+

    fail_if_exist first check to see that none of the copy operations\n+would cause an overwrite. If it would, it will fail. Otherwise it will\n+proceed as if it was in always_replace_files mode. Note that there\n+is an inherent race condition here. If the files in the target\n+directory appear after the check but before the copy or move\n+completes, they will be overwritten. When failing because of files\n+already existing in the target path, the error of\n+move_storage_failed_alert is set to\n+boost::system::errc::file_exists.

    \n+

    The intention is that a client may use this as a probe, and if it\n+fails, ask the user which mode to use. The client may then re-issue\n+the move_storage call with one of the other modes.

    \n+

    dont_replace always keeps the existing file in the target\n+directory, if there is one. The source files will still be removed in\n+that case. Note that it won't automatically re-check files. If an\n+incomplete torrent is moved into a directory with the complete files,\n+pause, move, force-recheck and resume. Without the re-checking, the\n+torrent will keep downloading and files in the new download directory\n+will be overwritten.

    \n+

    Files that have been renamed to have absolute paths are not moved by\n+this function. Keep in mind that files that don't belong to the\n+torrent but are stored in the torrent's directory may be moved as\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+

    rename_file()

    \n
    \n-class hasher256\n-{\n-   hasher256 ();\n-   hasher256 (hasher256 const&);\n-   explicit hasher256 (span<char const> data);\n-   hasher256& operator= (hasher256 const&) &;\n-   hasher256 (char const* data, int len);\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+void rename_file (file_index_t index, std::string const& new_name) const;\n 
    \n-\n-[report issue]
    \n-

    hasher256() operator=()

    \n+

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

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

    info_hashes() info_hash()

    \n
    \n-hasher256 (hasher256 const&);\n-explicit hasher256 (span<char const> data);\n-hasher256& operator= (hasher256 const&) &;\n-hasher256 (char const* data, int len);\n+sha1_hash info_hash () const;\n+info_hash_t info_hashes () 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+

    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+

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

    \n
    \n-hasher256& update (span<char const> data);\n-hasher256& update (char const* data, int len);\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-

    append the following bytes to what is being hashed

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

    final()

    \n+

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

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

    id()

    \n
    \n-sha256_hash final ();\n+std::uint32_t id () const;\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+

    returns a unique identifier for this torrent. It's not a dense index.\n+It's not preserved across sessions.

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

    native_handle()

    \n
    \n-void reset ();\n+std::shared_ptr<torrent> native_handle () const;\n 
    \n-

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

    \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+

    This function is intended only for use by plugins and the alert\n+dispatch function. This type does not have a stable ABI and should\n+be relied on as little as possible. Accessing the handle returned by\n+this function is not thread safe outside of libtorrent's internal\n+thread (which is used to invoke plugin callbacks).\n+The torrent class is not only eligible for changing ABI across\n+minor versions of libtorrent, its layout is also dependent on build\n+configuration. This adds additional requirements on a client to be\n+built with the exact same build configuration as libtorrent itself.\n+i.e. the TORRENT_ macros must match between libtorrent and the\n+client builds.

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

    userdata()

    \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+client_data_t userdata () const;\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+

    returns the userdata pointer as set in add_torrent_params

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

    in_session()

    \n
    \n-struct file_slice\n-{\n-   file_index_t file_index;\n-   std::int64_t offset;\n-   std::int64_t size;\n-};\n+bool in_session () const;\n 
    \n-[report issue]
    \n-
    file_index
    \n-
    the index of the file
    \n+

    Returns true if the torrent is in the session. It returns true before\n+session::remove_torrent() is called, and false afterward.

    \n+

    Note that this is a blocking function, unlike torrent_handle::is_valid()\n+which returns immediately.

    \n+[report issue]
    \n+
    overwrite_existing
    \n+
    instruct libtorrent to overwrite any data that may already have been\n+downloaded with the data of the new piece being added. Using this\n+flag when adding a piece that is actively being downloaded from other\n+peers may have some unexpected consequences, as blocks currently\n+being downloaded from peers may not be replaced.
    \n
    \n-[report issue]
    \n-
    offset
    \n-
    the offset from the start of the file, in bytes
    \n+[report issue]
    \n+
    query_distributed_copies
    \n+
    calculates distributed_copies, distributed_full_copies and\n+distributed_fraction.
    \n
    \n-[report issue]
    \n-
    size
    \n-
    the size of the window, in bytes
    \n+[report issue]
    \n+
    query_accurate_download_counters
    \n+
    includes partial downloaded blocks in total_done and\n+total_wanted_done.
    \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+[report issue]
    \n+
    query_last_seen_complete
    \n+
    includes last_seen_complete.
    \n+
    \n+[report issue]
    \n+
    query_pieces
    \n+
    populate the pieces field in torrent_status.
    \n+
    \n+[report issue]
    \n+
    query_verified_pieces
    \n+
    includes verified_pieces (only applies to torrents in seed\n+mode).
    \n+
    \n+[report issue]
    \n+
    query_torrent_file
    \n+
    includes torrent_file, which is all the static information from\n+the .torrent file.
    \n+
    \n+[report issue]
    \n+
    query_name
    \n+
    includes name, the name of the torrent. This is either derived\n+from the .torrent file, or from the &dn= magnet link argument\n+or possibly some other source. If the name of the torrent is not\n+known, this is an empty string.
    \n+
    \n+[report issue]
    \n+
    query_save_path
    \n+
    includes save_path, the path to the directory the files of the\n+torrent are saved to.
    \n+
    \n+[report issue]
    \n+
    alert_when_available
    \n+
    used to ask libtorrent to send an alert once the piece has been\n+downloaded, by passing alert_when_available. When set, the\n+read_piece_alert alert will be delivered, with the piece data, when\n+it's downloaded.
    \n+
    \n+[report issue]
    \n+
    piece_granularity
    \n+
    only calculate file progress at piece granularity. This makes\n+the file_progress() call cheaper and also only takes bytes that\n+have passed the hash check into account, so progress cannot\n+regress in this mode.
    \n+
    \n+[report issue]
    \n+
    graceful_pause
    \n+
    will delay the disconnect of peers that we're still downloading\n+outstanding requests from. The torrent will not accept any more\n+requests and will disconnect all idle peers. As soon as a peer is done\n+transferring the blocks that were requested from it, it is\n+disconnected. This is a graceful shut down of the torrent in the sense\n+that no downloaded bytes are wasted.
    \n+
    \n+[report issue]
    \n+
    flush_disk_cache
    \n+
    the disk cache will be flushed before creating the resume data.\n+This avoids a problem with file timestamps in the resume data in\n+case the cache hasn't been flushed yet.
    \n+
    \n+[report issue]
    \n+
    save_info_dict
    \n+
    the resume data will contain the metadata from the torrent file as\n+well. This is useful for clients that don't keep .torrent files\n+around separately, or for torrents that were added via a magnet link.
    \n+
    \n+[report issue]
    \n+
    only_if_modified
    \n+
    this flag has the same behavior as the combination of:\n+if_counters_changed | if_download_progress | if_config_changed |\n+if_state_changed | if_metadata_changed
    \n+
    \n+[report issue]
    \n+
    if_counters_changed
    \n+
    save resume data if any counters has changed since the last time\n+resume data was saved. This includes upload/download counters, active\n+time counters and scrape data. A torrent that is not paused will have\n+its active time counters incremented continuously.
    \n+
    \n+[report issue]
    \n+
    if_download_progress
    \n+
    save the resume data if any blocks have been downloaded since the\n+last time resume data was saved. This includes:\n+* checking existing files on disk\n+* downloading a block from a peer
    \n+
    \n+[report issue]
    \n+
    if_config_changed
    \n+
    save the resume data if configuration options changed since last time\n+the resume data was saved. This includes:\n+* file- or piece priorities\n+* upload- and download rate limits\n+* change max-uploads (unchoke slots)\n+* change max connection limit\n+* enable/disable peer-exchange, local service discovery or DHT\n+* enable/disable apply IP-filter\n+* enable/disable auto-managed\n+* enable/disable share-mode\n+* enable/disable sequential-mode\n+* files renamed\n+* storage moved (save_path changed)
    \n+
    \n+[report issue]
    \n+
    if_state_changed
    \n+
    save the resume data if torrent state has changed since last time the\n+resume data was saved. This includes:\n+* upload mode\n+* paused state\n+* super-seeding\n+* seed-mode
    \n+
    \n+[report issue]
    \n+
    if_metadata_changed
    \n+
    save the resume data if any metadata changed since the last time\n+resume data was saved. This includes:\n+* add/remove web seeds\n+* add/remove trackers\n+* receiving metadata for a magnet link
    \n+
    \n+[report issue]
    \n+
    ignore_min_interval
    \n+
    by default, force-reannounce will still honor the min-interval\n+published by the tracker. If this flag is set, it will be ignored\n+and the tracker is announced immediately.
    \n+
    \n+[report issue]
    \n+
    \n+
    \n+

    hash_value()

    \n+

    Declared in "libtorrent/torrent_handle.hpp"

    \n
    \n-class file_storage\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+

    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-   void reserve (int num_files);\n-   void add_file (std::string const& path, std::int64_t file_size\n-      , file_flags_t file_flags = {}\n-      , std::time_t mtime = 0, string_view symlink_path = string_view()\n-      , char const* root_hash = nullptr);\n-   void add_file (error_code& ec, std::string const& path, std::int64_t file_size\n-      , file_flags_t file_flags = {}\n-      , std::time_t mtime = 0, string_view symlink_path = string_view()\n-      , char const* root_hash = nullptr);\n-   void add_file_borrow (error_code& ec, string_view filename\n-      , std::string const& path, std::int64_t file_size\n-      , file_flags_t file_flags = {}, char const* filehash = nullptr\n-      , std::int64_t mtime = 0, string_view symlink_path = string_view()\n-      , char const* root_hash = nullptr);\n-   void add_file_borrow (string_view filename\n-      , std::string const& path, std::int64_t file_size\n-      , file_flags_t file_flags = {}, char const* filehash = nullptr\n-      , std::int64_t mtime = 0, string_view symlink_path = string_view()\n-      , char const* root_hash = nullptr);\n-   void rename_file (file_index_t index, std::string const& new_filename);\n-   std::vector<file_slice> map_block (piece_index_t piece, std::int64_t offset\n-      , std::int64_t size) const;\n-   peer_request map_file (file_index_t file, std::int64_t offset, int size) const;\n-   int num_files () const noexcept;\n-   file_index_t end_file () const noexcept;\n-   index_range<file_index_t> file_range () const noexcept;\n-   std::int64_t total_size () const;\n-   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-   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_size (file_index_t index) const;\n-   std::string symlink (file_index_t index) const;\n-   bool pad_file_at (file_index_t index) const;\n-   sha256_hash root (file_index_t index) const;\n-   string_view file_name (file_index_t index) const;\n-   std::time_t mtime (file_index_t index) const;\n-   sha1_hash hash (file_index_t index) const;\n-   std::string file_path (file_index_t index, std::string const& save_path = "") const;\n-   std::int64_t file_offset (file_index_t index) const;\n-   char const* root_ptr (file_index_t const 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_pieces (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_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+   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+   void async_add_torrent (add_torrent_params&& params);\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 const& params, error_code& ec);\n+   torrent_handle add_torrent (add_torrent_params&& params);\n+   torrent_handle add_torrent (add_torrent_params&& params, error_code& ec);\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+   bool is_listening () const;\n+   unsigned short ssl_listen_port () const;\n+   unsigned short listen_port () const;\n+   ip_filter get_peer_class_filter () const;\n+   void set_peer_class_filter (ip_filter const& f);\n+   peer_class_type_filter get_peer_class_type_filter () const;\n+   void set_peer_class_type_filter (peer_class_type_filter const& f);\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 set_alert_notify (std::function<void()> const& fun);\n+   alert* wait_for_alert (time_duration max_wait);\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 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+   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+[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+

    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-void reserve (int num_files);\n+session_params session_state (save_state_flags_t flags = save_state_flags_t::all()) const;\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+

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

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

    get_torrent_status() refresh_torrent_status()

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

    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+

    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 rename_file (file_index_t index, std::string const& new_filename);\n+void post_torrent_updates (status_flags_t flags = status_flags_t::all());\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+

    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-std::vector<file_slice> map_block (piece_index_t piece, std::int64_t offset\n-      , std::int64_t size) const;\n+void post_session_stats ();\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+

    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-peer_request map_file (file_index_t file, std::int64_t offset, int size) const;\n+void post_dht_stats ();\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+

    This will cause a dht_stats_alert to be posted.

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

    set_dht_state()

    \n
    \n-int num_files () const noexcept;\n+void set_dht_state (dht::dht_state&& st);\n+void set_dht_state (dht::dht_state const& st);\n 
    \n-

    returns the number of files in the file_storage

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

    end_file()

    \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-file_index_t end_file () const noexcept;\n+std::vector<torrent_handle> get_torrents () const;\n+torrent_handle find_torrent (sha1_hash const& info_hash) const;\n 
    \n-

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

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

    file_range()

    \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-index_range<file_index_t> file_range () const noexcept;\n+void async_add_torrent (add_torrent_params&& params);\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 const& params, error_code& ec);\n+torrent_handle add_torrent (add_torrent_params&& params);\n+torrent_handle add_torrent (add_torrent_params&& params, error_code& ec);\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+

    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-std::int64_t total_size () const;\n+void pause ();\n+void resume ();\n+bool is_paused () const;\n 
    \n-

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

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

    num_pieces() set_num_pieces()

    \n+

    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-void set_num_pieces (int n);\n-int num_pieces () const;\n+bool is_dht_running () const;\n 
    \n-

    set and get the number of pieces in the torrent

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

    end_piece()

    \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-piece_index_t end_piece () const;\n+void set_dht_storage (dht::dht_storage_constructor_type sc);\n 
    \n-

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

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

    last_piece()

    \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-piece_index_t last_piece () const;\n+void add_dht_node (std::pair<std::string, int> const& node);\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+

    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-index_range<piece_index_t> piece_range () const noexcept;\n+void dht_get_item (sha1_hash const& target);\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+

    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 set_piece_length (int l);\n-int piece_length () const;\n+void dht_get_item (std::array<char, 32> key\n+      , std::string salt = std::string());\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+

    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-int piece_size (piece_index_t index) const;\n+sha1_hash dht_put_item (entry data);\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+

    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-int piece_size2 (piece_index_t index) const;\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-

    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+

    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-int blocks_in_piece2 (piece_index_t index) const;\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-

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

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

    blocks_per_piece()

    \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-int blocks_per_piece () const;\n+void dht_live_nodes (sha1_hash const& nid);\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+

    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-std::string const& name () const;\n-void set_name (std::string const& n);\n+void dht_sample_infohashes (udp::endpoint const& ep, sha1_hash const& target);\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+

    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 swap (file_storage& ti) noexcept;\n+void dht_direct_request (udp::endpoint const& ep, entry const& e, client_data_t userdata = {});\n 
    \n-

    swap all content of this with ti.

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

    canonicalize()

    \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 canonicalize ();\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-

    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-

    root() file_size() mtime() root_ptr() pad_file_at() file_offset() file_path() hash() file_name() symlink()

    \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-std::int64_t file_size (file_index_t index) const;\n-std::string symlink (file_index_t index) const;\n-bool pad_file_at (file_index_t index) const;\n-sha256_hash root (file_index_t index) const;\n-string_view file_name (file_index_t index) const;\n-std::time_t mtime (file_index_t index) const;\n-sha1_hash hash (file_index_t index) const;\n-std::string file_path (file_index_t index, std::string const& save_path = "") const;\n-std::int64_t file_offset (file_index_t index) const;\n-char const* root_ptr (file_index_t const index) const;\n+ip_filter get_ip_filter () const;\n+void set_ip_filter (ip_filter f);\n 
    \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+

    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-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_pieces (file_index_t index) const;\n+void set_port_filter (port_filter const& f);\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+

    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-int file_first_block_node (file_index_t index) const;\n-int file_first_piece_node (file_index_t index) const;\n+bool is_listening () const;\n+unsigned short ssl_listen_port () const;\n+unsigned short listen_port () const;\n 
    \n-

    index of first piece node in the merkle tree

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

    file_path_hash()

    \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-std::uint32_t file_path_hash (file_index_t index, std::string const& save_path) const;\n+ip_filter get_peer_class_filter () const;\n+void set_peer_class_filter (ip_filter const& f);\n 
    \n-

    returns the crc32 hash of file_path(index)

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

    all_path_hashes()

    \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 all_path_hashes (std::unordered_set<std::uint32_t>& table) const;\n+peer_class_type_filter get_peer_class_type_filter () const;\n+void set_peer_class_type_filter (peer_class_type_filter const& f);\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+

    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-file_flags_t file_flags (file_index_t index) const;\n+peer_class_t create_peer_class (char const* name);\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+

    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-bool file_absolute_path (file_index_t index) const;\n+void delete_peer_class (peer_class_t cid);\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+

    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+

    get_peer_class() set_peer_class()

    \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+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-

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

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

    file_index_for_root()

    \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-file_index_t file_index_for_root (sha256_hash const& root_hash) const;\n+void remove_torrent (const torrent_handle&, remove_flags_t = {});\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+

    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+

    set_alert_notify() wait_for_alert() pop_alerts()

    \n+
    \n+void set_alert_notify (std::function<void()> const& fun);\n+alert* wait_for_alert (time_duration max_wait);\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+

    delete_port_mapping() add_port_mapping()

    \n
    \n-piece_index_t piece_index_at_file (file_index_t f) const;\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-

    returns the piece index the given file starts at

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

    sanitize_symlinks()

    \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 sanitize_symlinks ();\n+void reopen_network_sockets (reopen_network_flags_t options = reopen_map_ports);\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+

    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-bool v2 () const;\n+std::shared_ptr<aux::session_impl> native_handle () 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+

    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-
    flag_hidden
    \n-
    this file has the hidden attribute set. This is primarily\n-a windows attribute
    \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-
    flag_executable
    \n-
    this file has the executable attribute set.
    \n+[report issue]
    \n+
    save_extension_state
    \n+
    load or save state from plugins
    \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+[report issue]
    \n+
    save_ip_filter
    \n+
    load or save the IP filter set on the session
    \n
    \n-[report issue]
    \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-

    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-

    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-

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

    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+

    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 ip_filter\n+struct session_params\n {\n-   ip_filter& operator= (ip_filter&&);\n-   ip_filter (ip_filter const&);\n-   ip_filter ();\n-   ~ip_filter ();\n-   ip_filter (ip_filter&&);\n-   ip_filter& operator= (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+   session_params (settings_pack const& sp);\n+   session_params (settings_pack&& 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-   enum access_flags\n-   {\n-      blocked,\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-

    empty()

    \n+[report issue]
    \n+

    session_params()

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

    returns true if the filter does not contain any rules

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

    add_rule()

    \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-void add_rule (address const& first, address const& last, std::uint32_t flags);\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-

    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+

    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_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-std::uint32_t access (address const& addr) const;\n+struct session_proxy\n+{\n+   session_proxy& operator= (session_proxy const&) &;\n+   session_proxy (session_proxy&&) noexcept;\n+   session_proxy ();\n+   session_proxy (session_proxy const&);\n+   ~session_proxy ();\n+   session_proxy& operator= (session_proxy&&) & noexcept;\n+};\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+\n+[report issue]
    \n+

    operator=() ~session_proxy() session_proxy()

    \n
    \n-filter_tuple_t export_filter () const;\n+session_proxy& operator= (session_proxy const&) &;\n+session_proxy (session_proxy&&) noexcept;\n+session_proxy ();\n+session_proxy (session_proxy const&);\n+~session_proxy ();\n+session_proxy& operator= (session_proxy&&) & noexcept;\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+

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

    \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+

    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-class port_filter\n+struct session : session_handle\n {\n-   port_filter ();\n-   port_filter (port_filter const&);\n-   ~port_filter ();\n-   port_filter& operator= (port_filter const&);\n-   port_filter (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+   session (session_params const& params, session_flags_t flags);\n+   session ();\n+   explicit session (session_params const& params);\n+   explicit session (session_params&& params);\n+   session (session_params&& params, session_flags_t flags);\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);\n+   session (session_params const& params, io_context& ios, session_flags_t);\n+   ~session ();\n+   session_proxy abort ();\n };\n 
    \n-[report issue]
    \n-

    add_rule()

    \n+[report issue]
    \n+

    session()

    \n
    \n-void add_rule (std::uint16_t first, std::uint16_t last, std::uint32_t flags);\n+session (session_params const& params, session_flags_t flags);\n+session ();\n+explicit session (session_params const& params);\n+explicit session (session_params&& params);\n+session (session_params&& params, session_flags_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+

    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-std::uint32_t access (std::uint16_t port) const;\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);\n+session (session_params const& params, io_context& ios, session_flags_t);\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+

    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-
    \n-

    stats_metric

    \n-

    Declared in "libtorrent/session_stats.hpp"

    \n-

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

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

    ~session()

    \n
    \n-struct stats_metric\n-{\n-   char const* name;\n-   int value_index;\n-   metric_type_t type;\n-};\n+~session ();\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+

    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-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+session_proxy abort ();\n 
    \n-\n-[report issue]
    \n-

    inc_stats_counter() operator[]()

    \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-std::int64_t operator[] (int i) const ;\n-std::int64_t inc_stats_counter (int c, std::int64_t value = 1) ;\n+struct session_proxy {};\n 
    \n-

    returns the new value

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

    write_session_params_buf() write_session_params() read_session_params()

    \n+

    Declared in "libtorrent/session_params.hpp"

    \n
    \n-int find_metric_idx (string_view name);\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-

    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+

    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

    announce_infohash

    \n

    Declared in "libtorrent/announce_entry.hpp"

    \n
    \n struct announce_infohash\n {\n@@ -11881,19 +14268,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 ();\n    explicit announce_entry (string_view u);\n    announce_entry& operator= (announce_entry const&) &;\n-   ~announce_entry ();\n-   announce_entry ();\n    announce_entry (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@@ -11904,24 +14291,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() operator=() ~announce_entry()

    \n
    \n+announce_entry ();\n explicit announce_entry (string_view u);\n announce_entry& operator= (announce_entry const&) &;\n-~announce_entry ();\n-announce_entry ();\n announce_entry (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@@ -11939,15 +14326,15 @@\n \n \n \n \n \n \n \n-\n+\n \n \n \n \n \n \n \n@@ -11984,2576 +14371,569 @@\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-

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

    \n-

    Example use:

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

    disk_observer

    \n-

    Declared in "libtorrent/disk_observer.hpp"

    \n+
    \n+

    counters

    \n+

    Declared in "libtorrent/performance_counters.hpp"

    \n
    \n-struct disk_observer\n+struct counters\n {\n-   virtual void on_disk () = 0;\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 set_value (int c, std::int64_t value) ;\n+   void blend_stats_counter (int c, std::int64_t value, int ratio) ;\n };\n 
    \n-[report issue]
    \n-

    on_disk()

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

    operator[]() inc_stats_counter()

    \n
    \n-virtual void on_disk () = 0;\n+std::int64_t inc_stats_counter (int c, std::int64_t value = 1) ;\n+std::int64_t operator[] (int i) const ;\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+

    returns the new value

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

    settings_interface

    \n-

    Declared in "libtorrent/settings_pack.hpp"

    \n-

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

    \n-
    \n-struct settings_interface\n-{\n-   virtual bool has_val (int name) const = 0;\n-   virtual void set_bool (int name, bool val) = 0;\n-   virtual void set_int (int name, int val) = 0;\n-   virtual void set_str (int name, std::string val) = 0;\n-   virtual bool get_bool (int name) const = 0;\n-   virtual std::string const& get_str (int name) const = 0;\n-   virtual int get_int (int name) const = 0;\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+

    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 disk_buffer_holder\n+struct stats_metric\n {\n-   disk_buffer_holder& operator= (disk_buffer_holder&&) & noexcept;\n-   disk_buffer_holder (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+   char const* name;\n+   int value_index;\n+   metric_type_t type;\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+[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-bool is_mutable () const noexcept;\n+std::vector<stats_metric> session_stats_metrics ();\n 
    \n-

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

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

    bool()

    \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-explicit operator bool () const noexcept;\n+int find_metric_idx (string_view name);\n 
    \n-

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

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

    open_file_state

    \n-

    Declared in "libtorrent/disk_interface.hpp"

    \n-

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

    \n-
    \n-struct open_file_state\n-{\n-   file_index_t file_index;\n-   file_open_mode_t open_mode;\n-   time_point last_use;\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+
    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_tex8
    \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+

    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+DHT nodes etc.
    4. \n+
    5. Read through all the files in the torrent, SHA-1 all the data\n+and set the piece hashes.
    6. \n+
    7. The torrent is bencoded into a file or buffer.
    8. \n+
    \n+

    If there are a lot of files and or deep directory hierarchies to\n+traverse, step one can be time consuming.

    \n+

    Typically step 3 is by far the most time consuming step, since it\n+requires to read all the bytes from all the files in the torrent.

    \n+

    All of these classes and functions are declared by including\n+libtorrent/create_torrent.hpp.

    \n+

    example:

    \n+
    \n+file_storage fs;\n+\n+// recursively adds files in directories\n+add_files(fs, "./my_torrent");\n+\n+create_torrent t(fs);\n+t.add_tracker("http://my.tracker.com/announce");\n+t.set_creator("libtorrent example");\n+\n+// reads the files and calculates the hashes\n+set_piece_hashes(t, ".");\n+\n+ofstream out("my_torrent.torrent", std::ios_base::binary);\n+std::vector<char> buf = t.generate_buf();\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-
    file_index
    \n-
    the index of the file this entry refers to into the file_storage\n-file list of this torrent. This starts indexing at 0.
    \n-
    \n-[report issue]
    \n-
    open_mode
    \n-

    open_mode is a bitmask of the file flags this file is currently\n-opened with. For possible flags, see file_open_mode_t.

    \n-

    Note that the read/write mode is not a bitmask. The two least significant bits are used\n-to represent the read/write mode. Those bits can be masked out using the rw_mask constant.

    \n-
    \n-
    \n-[report issue]
    \n-
    last_use
    \n-
    a (high precision) timestamp of when the file was last used.
    \n-
    \n-[report issue]
    \n-
    \n-

    disk_interface

    \n-

    Declared in "libtorrent/disk_interface.hpp"

    \n-

    The disk_interface is the customization point for disk I/O in libtorrent.\n-implement this interface and provide a factory function to the session constructor\n-use custom disk I/O. All functions on the disk subsystem (implementing\n-disk_interface) are called from within libtorrent's network thread. For\n-disk I/O to be performed in a separate thread, the disk subsystem has to\n-manage that itself.

    \n-

    Although the functions are called async_*, they do not technically\n-have to be asynchronous, but they support being asynchronous, by\n-expecting the result passed back into a callback. The callbacks must be\n-posted back onto the network thread via the io_context object passed into\n-the constructor. The callbacks will be run in the network thread.

    \n+[report issue]
    \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 disk_interface\n+struct create_torrent\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 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-   virtual void async_release_files (storage_index_t storage\n-      , std::function<void()> handler = std::function<void()>()) = 0;\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-   virtual void async_stop_torrent (storage_index_t storage\n-      , std::function<void()> handler = std::function<void()>()) = 0;\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-   virtual void async_delete_files (storage_index_t storage, remove_flags_t options\n-      , std::function<void(storage_error const&)> handler) = 0;\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-   virtual void async_clear_piece (storage_index_t storage, piece_index_t index\n-      , std::function<void(piece_index_t)> handler) = 0;\n-   virtual void update_stats_counters (counters& c) const = 0;\n-   virtual std::vector<open_file_state> get_status (storage_index_t) const = 0;\n-   virtual void abort (bool wait) = 0;\n-   virtual void submit_jobs () = 0;\n-   virtual void settings_updated () = 0;\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+   void set_priv (bool p);\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_length () const;\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 disk_job_flags_t force_copy  = 0_bit;\n-   static constexpr disk_job_flags_t sequential_access  = 3_bit;\n-   static constexpr disk_job_flags_t volatile_read  = 4_bit;\n-   static constexpr disk_job_flags_t v1_hash  = 5_bit;\n-   static constexpr disk_job_flags_t flush_piece  = 7_bit;\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-

    new_torrent()

    \n-
    \n-virtual storage_holder new_torrent (storage_params const& p\n-      , std::shared_ptr<void> const& torrent) = 0;\n-
    \n-

    this is called when a new torrent is added. The shared_ptr can be\n-used to hold the internal torrent object alive as long as there are\n-outstanding disk operations on the storage.\n-The returned storage_holder is an owning reference to the underlying\n-storage that was just created. It is fundamentally a storage_index_t

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

    create_torrent()

    \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+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-

    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+

    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+be any combination of the flags defined by create_flags_t.

    \n+

    The file_storage (fs) parameter defines the files, sizes and\n+their properties for the torrent to be created. Set this up first,\n+before passing it to the create_torrent constructor.

    \n+

    The overload that takes a torrent_info object will make a verbatim\n+copy of its info dictionary (to preserve the info-hash). The copy of\n+the info dictionary will be used by create_torrent::generate(). This means\n+that none of the member functions of create_torrent that affects\n+the content of the info dictionary (such as set_hash()), will\n+have any affect. Instead of using this overload, consider using\n+write_torrent_file() instead.

    \n+
    \n+

    Warning

    \n+

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

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

    generate() generate_buf()

    \n
    \n-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+entry generate () const;\n+std::vector<char> generate_buf () 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+

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

    \n+

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

    \n+

    Whether the resulting torrent object is v1, v2 or hybrid depends on\n+whether any of the v1_only or v2_only flags were set on the\n+constructor. If neither were set, the resulting torrent depends on\n+which hashes were set. If both v1 and v2 hashes were set, a hybrid\n+torrent is created.

    \n+

    Any failure will cause this function to throw system_error, with an\n+appropriate error message. These are the reasons this call may throw:

    \n+
      \n+
    • the file storage has 0 files
    • \n+
    • the total size of the file storage is 0 bytes (i.e. it only has\n+empty files)
    • \n+
    • not all v1 hashes (set_hash()) and not all v2 hashes (set_hash2())\n+were set
    • \n+
    • for v2 torrents, you may not have a directory with the same name as\n+a file. If that's encountered in the file storage, generate()\n+fails.
    • \n+
    \n+[report issue]
    \n+
    \n+

    files()

    \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+file_storage const& files () 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 an immutable reference to the file_storage used to create\n+the torrent from.

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

    set_comment()

    \n
    \n-virtual void async_release_files (storage_index_t storage\n-      , std::function<void()> handler = std::function<void()>()) = 0;\n+void set_comment (char const* str);\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+

    Sets the comment for the torrent. The string str should be utf-8 encoded.\n+The comment in a torrent file is optional.

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

    set_creator()

    \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+void set_creator (char const* str);\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+

    Sets the creator of the torrent. The string str should be utf-8 encoded.\n+This is optional.

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

    set_creation_date()

    \n
    \n-virtual void async_stop_torrent (storage_index_t storage\n-      , std::function<void()> handler = std::function<void()>()) = 0;\n+void set_creation_date (std::time_t timestamp);\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+

    sets the "creation time" field. Defaults to the system clock at the\n+time of construction of the create_torrent object. The timestamp is\n+specified in seconds, posix time. If the creation date is set to 0,\n+the "creation date" field will be omitted from the generated torrent.

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

    set_hash()

    \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+void set_hash (piece_index_t index, sha1_hash const& h);\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+

    This sets the SHA-1 hash for the specified piece (index). You are required\n+to 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 set_piece_hashes().\n+A SHA-1 hash of all zeros is internally used to indicate a hash that\n+has not been set. Setting such hash will not be considered set when\n+calling generate().\n+This function will throw std::system_error if it is called on an\n+object constructed with the v2_only flag.

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

    set_hash2()

    \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+void set_hash2 (file_index_t file, piece_index_t::diff_type piece, sha256_hash const& h);\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+

    sets the bittorrent v2 hash for file file of the piece piece.\n+piece is relative to the first piece of the file, starting at 0. The\n+first piece in the file can be computed with\n+file_storage::file_index_at_piece().\n+The hash, h, is the root of the merkle tree formed by the piece's\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_http_seed() add_url_seed()

    \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+void add_http_seed (string_view url);\n+void add_url_seed (string_view url);\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 adds a url seed to the torrent. You can have any number of url seeds. For a\n+single file torrent, this should be an HTTP url, pointing to a file with identical\n+content as the file of the torrent. For a multi-file torrent, it should point to\n+a directory containing a directory with the same name as this torrent, and all the\n+files of the torrent in it.

    \n+

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

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

    add_node()

    \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+void add_node (std::pair<std::string, int> node);\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+

    This adds a DHT node to the torrent. This especially useful if you're creating a\n+tracker less torrent. It can be used by clients to bootstrap their DHT node from.\n+The node is a hostname and a port number where there is a DHT node running.\n+You can have any number of DHT nodes in a torrent.

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

    add_tracker()

    \n
    \n-virtual void update_stats_counters (counters& c) const = 0;\n+void add_tracker (string_view url, int tier = 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+

    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 http:// or udp://\n+url to a machine running a bittorrent tracker that accepts announces for this torrent's\n+info-hash. The tier is the fallback priority of the tracker. All trackers with tier 0 are\n+tried first (in any order). If all fail, trackers with tier 1 are tried. If all of those\n+fail, trackers with tier 2 are tried, and so on.

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

    set_root_cert()

    \n
    \n-virtual std::vector<open_file_state> get_status (storage_index_t) const = 0;\n+void set_root_cert (string_view cert);\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+

    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+

    set_priv() priv()

    \n
    \n-virtual void abort (bool wait) = 0;\n+void set_priv (bool p);\n+bool priv () 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+

    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-virtual void submit_jobs () = 0;\n+int num_pieces () 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 number of pieces in the associated file_storage object.

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

    piece_range()

    \n
    \n-virtual void settings_updated () = 0;\n+index_range<piece_index_t> piece_range () const noexcept;\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+

    all piece indices in the torrent to be created

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

    file_range()

    \n
    \n-struct storage_holder\n-{\n-   storage_holder (storage_index_t idx, disk_interface& disk_io);\n-   storage_holder () = default;\n-   ~storage_holder ();\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 (storage_holder&& rhs) noexcept;\n-   storage_holder& operator= (storage_holder&& rhs) noexcept;\n-};\n+index_range<file_index_t> file_range () const noexcept;\n 
    \n-[report issue]
    \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-

    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+

    all file indices in the torrent to be created

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

    file_piece_range()

    \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-   operator void const* () const = delete;\n-   client_data_t& operator= (void*) = 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+index_range<piece_index_t::diff_type> file_piece_range (file_index_t f);\n 
    \n-[report issue]
    \n-

    client_data_t()

    \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+

    total_size()

    \n
    \n-client_data_t () = default;\n+std::int64_t total_size () const;\n 
    \n-

    construct a nullptr client data

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

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

    \n+

    the total number of bytes of all files and pad files

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

    piece_size() piece_length()

    \n
    \n-operator void const* () const = delete;\n-client_data_t& operator= (void*) = delete;\n-operator void* () const = delete;\n-client_data_t& operator= (void const*) = delete;\n+int piece_length () const;\n+int piece_size (piece_index_t i) const;\n 
    \n-

    we don't allow type-unsafe operations

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

    add_torrent_params

    \n-

    Declared in "libtorrent/add_torrent_params.hpp"

    \n-

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

    \n-
      \n-
    • ti - the immutable info-dict part of the torrent
    • \n-
    • info_hash - when you don't have the metadata (.torrent file). This\n-uniquely identifies the torrent and can validate the info-dict when\n-received from the swarm.
    • \n-
    \n-

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

    \n-

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

    \n-

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

    \n-

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

    \n+

    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-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+void add_collection (string_view c);\n+void add_similar_torrent (sha1_hash ih);\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+

    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+[report issue]
    \n+
    modification_time
    \n+
    This will include the file modification time as part of the torrent.\n+This is not enabled by default, as it might cause problems when you\n+create a torrent from separate files with the same content, hoping to\n+yield the same info-hash. If the files have different modification times,\n+with this option enabled, you would get different info-hashes for the\n+files.
    \n
    \n-[report issue]
    \n-
    merkle_tree_mask
    \n-
    if set, indicates which hashes are included in the corresponding\n-vector of merkle_trees. These bitmasks always cover the full\n-tree, a cleared bit means the hash is all zeros (i.e. not set) and\n-set bit means the next hash in the corresponding vector in\n-merkle_trees is the hash for that node. This is an optimization\n-to avoid storing a lot of zeros.
    \n+[report issue]
    \n+
    symlinks
    \n+
    If this flag is set, files that are symlinks get a symlink attribute\n+set on them and their data will not be included in the torrent. This\n+is useful if you need to reconstruct a file hierarchy which contains\n+symlinks.
    \n
    \n-[report issue]
    \n-
    verified_leaf_hashes
    \n-
    bit-fields indicating which v2 leaf hashes have been verified\n-against the root hash. If this vector is empty and merkle_trees is\n-non-empty it implies that all hashes in merkle_trees are verified.
    \n+[report issue]
    \n+
    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+set_hash2() before calling generate(). Setting v1 hashes (with\n+set_hash()) is an error with this flag set.
    \n
    \n-[report issue]
    \n-
    renamed_files
    \n-
    this is a map of file indices in the torrent and new filenames to be\n-applied before the torrent is added.
    \n+[report issue]
    \n+
    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 set_hash(), before calling\n+generate(). Setting v2 hashes (with set_hash2()) is an error with\n+this flag set.
    \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+[report issue]
    \n+
    canonical_files
    \n+
    This flag only affects v1-only torrents, and is only relevant\n+together with the v1_only_flag. This flag will force the\n+same file order and padding as a v2 (or hybrid) torrent would have.\n+It has the effect of ordering files and inserting pad files to align\n+them with piece boundaries.
    \n
    \n-[report issue]
    \n-
    \n-

    storage_error

    \n-

    Declared in "libtorrent/error_code.hpp"

    \n-

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

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

    bool()

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

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

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

    file()

    \n-
    \n-file_index_t file () const;\n-void file (file_index_t f);\n-
    \n-

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

    \n-[report issue]
    \n-
    ec
    \n-
    the error that occurred
    \n+[report issue]
    \n+
    no_attributes
    \n+
    passing this flag to add_files() will ignore file attributes (such as\n+executable or hidden) when adding the files to the file storage.\n+Since not all filesystems and operating systems support all file\n+attributes the resulting torrent may differ depending on where it's\n+created. If it's important for torrents to be created consistently\n+across systems, this flag should be set.
    \n
    \n-[report issue]
    \n-
    operation
    \n-
    A code from operation_t enum, indicating what\n-kind of operation failed.
    \n+[report issue]
    \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)\n+with the one exception that tail padding is not added to the last\n+file.\n+This behavior deviates from the specification but was the way\n+libtorrent created torrents in version up to and including 2.0.7.\n+This flag is here for backwards compatibility.
    \n
    \n-[report issue]
    \n+[report issue]
    \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-

    socks_category()

    \n-

    Declared in "libtorrent/socks5_stream.hpp"

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

    returns the error_category for SOCKS5 errors

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

    upnp_category()

    \n-

    Declared in "libtorrent/upnp.hpp"

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

    the boost.system error category for UPnP errors

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

    gzip_category()

    \n-

    Declared in "libtorrent/gzip.hpp"

    \n+
    \n+

    add_files()

    \n+

    Declared in "libtorrent/create_torrent.hpp"

    \n
    \n-boost::system::error_category& gzip_category ();\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-

    get the error_category for zip errors

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

    i2p_category()

    \n-

    Declared in "libtorrent/i2p_stream.hpp"

    \n-
    \n-boost::system::error_category& i2p_category ();\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+bool Pred(std::string const& p);\n 
    \n-

    returns the error category for I2P errors

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

    libtorrent_category()

    \n-

    Declared in "libtorrent/error_code.hpp"

    \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 directories\n+are traversed.

    \n+

    The ".." directory is never traversed.

    \n+

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

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

    set_piece_hashes()

    \n+

    Declared in "libtorrent/create_torrent.hpp"

    \n
    \n-boost::system::error_category& libtorrent_category ();\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+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+   , std::function<void(piece_index_t)> const& f);\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, error_code& ec);\n+void set_piece_hashes (create_torrent& t, std::string const& p\n+   , std::function<void(piece_index_t)> const& f, error_code& ec);\n 
    \n-

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

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

    http_category()

    \n-

    Declared in "libtorrent/error_code.hpp"

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

    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-

    returns the error_category for HTTP errors

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

    enum pcp_errors

    \n-

    Declared in "libtorrent/natpmp.hpp"

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-
    namevaluedescription
    pcp_success0 
    pcp_unsupp_version1 
    pcp_not_authorized2 
    pcp_malformed_request3 
    pcp_unsupp_opcode4 
    pcp_unsupp_option5 
    pcp_malformed_option6 
    pcp_network_failure7 
    pcp_no_resources8 
    pcp_unsupp_protocol9 
    pcp_user_ex_quota10 
    pcp_cannot_provide_external11 
    pcp_address_mismatch12 
    pcp_excessive_remote_peers13 
    \n-[report issue]
    \n-
    \n-

    enum 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 socks_error_code

    \n-

    Declared in "libtorrent/socks5_stream.hpp"

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

    enum error_code_enum

    \n-

    Declared in "libtorrent/upnp.hpp"

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

    enum error_code_enum

    \n-

    Declared in "libtorrent/gzip.hpp"

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

    enum i2p_error_code

    \n-

    Declared in "libtorrent/i2p_stream.hpp"

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

    enum error_code_enum

    \n-

    Declared in "libtorrent/error_code.hpp"

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

    enum http_errors

    \n-

    Declared in "libtorrent/error_code.hpp"

    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-
    namevaluedescription
    cont100 
    ok200 
    created201 
    accepted202 
    no_content204 
    multiple_choices300 
    moved_permanently301 
    moved_temporarily302 
    not_modified304 
    bad_request400 
    unauthorized401 
    forbidden403 
    not_found404 
    internal_server_error500 
    not_implemented501 
    bad_gateway502 
    service_unavailable503 
    \n+

    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

    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@@ -19093,24 +19473,24 @@\n

    \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_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+   void set_str (int name, std::string val) override;\n    void set_int (int name, flags::bitfield_flag<Type, Tag> const val);\n+   void set_bool (int name, bool val) override;\n    bool has_val (int name) const override;\n    void clear ();\n    void clear (int name);\n+   bool get_bool (int name) const override;\n    int get_int (int name) const override;\n    std::string const& get_str (int name) const override;\n-   bool get_bool (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@@ -19180,23 +19560,23 @@\n       socks5,\n       socks5_pw,\n       http,\n       http_pw,\n    };\n };\n 
    \n-\n \n-[report issue]
    \n-

    set_int() set_str() set_bool()

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

    set_str() set_int() set_bool()

    \n
    \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+void set_str (int name, std::string val) override;\n void set_int (int name, flags::bitfield_flag<Type, Tag> const val);\n+void set_bool (int name, bool val) override;\n 
    \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@@ -19217,22 +19597,22 @@\n
    \n

    clear()

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

    clear a specific setting from the pack

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

    get_int() get_str() get_bool()

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

    get_int() get_bool() get_str()

    \n
    \n+bool get_bool (int name) const override;\n int get_int (int name) const override;\n std::string const& get_str (int name) const override;\n-bool get_bool (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@@ -19591,45 +19971,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 min_memory_usage ();\n-settings_pack high_performance_seed ();\n-
    \n-

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

    \n-

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

    \n-

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

    \n-

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

    \n [report issue]
    \n+
    \n
    \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@@ -19697,653 +20048,44 @@\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-

    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, 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);\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, load_torrent_limits const& cfg, from_span_t);\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 (info_hash_t const& info_hash);\n-   torrent_info (torrent_info const& t);\n-   explicit torrent_info (span<char const> buffer, from_span_t);\n-   explicit torrent_info (std::string const& filename);\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-   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<announce_entry> const& trackers () const;\n-   std::vector<std::string> collections () const;\n-   std::vector<sha1_hash> similar_torrents () 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-   std::vector<web_seed_entry> const& web_seeds () const;\n-   void set_web_seeds (std::vector<web_seed_entry> seeds);\n-   void add_url_seed (std::string const& url\n-      , std::string const& ext_auth = std::string()\n-      , web_seed_entry::headers_t const& ext_headers = web_seed_entry::headers_t());\n-   std::int64_t total_size () 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-   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-   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, 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);\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, load_torrent_limits const& cfg, from_span_t);\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 (info_hash_t const& info_hash);\n-torrent_info (torrent_info const& t);\n-explicit torrent_info (span<char const> buffer, from_span_t);\n-explicit torrent_info (std::string const& filename);\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-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-

    add_tracker() trackers() clear_trackers()

    \n-
    \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<announce_entry> const& trackers () const;\n-
    \n-

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

    \n-

    trackers() returns all entries from announce-list.

    \n-

    clear_trackers() removes all trackers from announce-list.

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

    similar_torrents() collections()

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

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

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

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

    \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-std::vector<web_seed_entry> const& web_seeds () const;\n-void set_web_seeds (std::vector<web_seed_entry> seeds);\n-void add_url_seed (std::string const& url\n-      , std::string const& ext_auth = std::string()\n-      , web_seed_entry::headers_t const& ext_headers = web_seed_entry::headers_t());\n-
    \n-

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

    \n-

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

    \n-

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

    \n-

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

    \n-

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

    \n-

    See http seeding for more information.

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

    total_size()

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

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

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

    num_pieces() piece_length()

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

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

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

    piece_range() last_piece() 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_hashes() info_hash()

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

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

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

    v1() v2()

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

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

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

    num_files()

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

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

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

    map_block()

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

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

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

    map_file()

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

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

    \n-

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

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

    ssl_cert()

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

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

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

    is_valid()

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

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

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

    priv()

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

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

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

    is_i2p()

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

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

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

    piece_size()

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

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

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

    hash_for_piece() hash_for_piece_ptr()

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

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

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

    name()

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

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

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

    creation_date()

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

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

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

    creator()

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

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

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

    comment()

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

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

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

    nodes()

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

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

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

    add_node()

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

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

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

    parse_info_section()

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

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

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

    info()

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

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

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

    info_section()

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

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

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

    piece_layer()

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

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

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

    free_piece_layers()

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

    min_memory_usage() high_performance_seed()

    \n+

    Declared in "libtorrent/session.hpp"

    \n
    \n-void free_piece_layers ();\n+settings_pack min_memory_usage ();\n+settings_pack high_performance_seed ();\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+

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

    \n+

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

    \n+

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

    \n+

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

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

    dht_storage_counters

    \n

    Declared in "libtorrent/kademlia/dht_storage.hpp"

    \n

    This structure hold the relevant counters for the storage

    \n
    \n struct dht_storage_counters\n {\n@@ -20646,29 +20388,29 @@\n \n \n [report issue]
    \n
    \n

    write_resume_data_buf() write_resume_data()

    \n

    Declared in "libtorrent/write_resume_data.hpp"

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

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

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

    write_torrent_file() write_torrent_file_buf()

    \n

    Declared in "libtorrent/write_resume_data.hpp"

    \n
    \n std::vector<char> write_torrent_file_buf (add_torrent_params const& atp\n    , write_torrent_flags_t flags);\n-entry write_torrent_file (add_torrent_params const& atp);\n 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 
    \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@@ -20677,22 +20419,22 @@\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+   , load_torrent_limits const& cfg = {});\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", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -1,12 +1,88 @@\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+ * _\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 _\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 _\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+ * _\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+ * _\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 _\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 _\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__\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 _\ba_\bd_\bd_\b__\bu_\br_\bl_\b__\bs_\be_\be_\bd_\b(_\b)_\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 _\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 _\be_\bn_\bd_\b__\bp_\bi_\be_\bc_\be_\b(_\b)_\b _\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)\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 _\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 _\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+ 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 * _\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@@ -114,18 +190,18 @@\n o _\bp_\bk_\bt_\b__\bb_\bu_\bf_\b(_\b)\n o _\be_\bn_\bu_\bm_\b _\bd_\bi_\br_\be_\bc_\bt_\bi_\bo_\bn_\b__\bt\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 * _\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+ o _\bn_\bu_\bm_\b__\bn_\bo_\bd_\be_\bs_\b(_\b)_\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 _\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 _\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__\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@@ -142,186 +218,169 @@\n o _\bm_\be_\bs_\bs_\ba_\bg_\be_\b(_\b)\n o _\bc_\ba_\bt_\be_\bg_\bo_\br_\by_\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- * _\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 _\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 _\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 _\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 _\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)\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 _\br_\be_\bm_\bo_\bv_\be_\b__\bh_\bt_\bt_\bp_\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__\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+ * _\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bp_\ba_\br_\ba_\bm_\bs\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_\bu_\bm_\be_\b(_\b)_\b _\bp_\ba_\bu_\bs_\be_\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__\bb_\bo_\bt_\bt_\bo_\bm_\b(_\b)_\b _\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__\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__\bt_\bo_\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_\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 _\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 _\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__\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 _\bm_\ba_\bx_\b__\bu_\bp_\bl_\bo_\ba_\bd_\bs_\b(_\b)_\b _\bs_\be_\bt_\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_\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 _\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- * _\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 _\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+ 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 _\bc_\ba_\bn_\bo_\bn_\bi_\bc_\ba_\bl_\bi_\bz_\be_\b(_\b)\n+ o _\bf_\bi_\bl_\be_\b__\bs_\bi_\bz_\be_\b(_\b)_\b _\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 _\br_\bo_\bo_\bt_\b(_\b)_\b _\bh_\ba_\bs_\bh_\b(_\b)_\b _\bm_\bt_\bi_\bm_\be_\b(_\b)\n+ _\bf_\bi_\bl_\be_\b__\bn_\ba_\bm_\be_\b(_\b)_\b _\br_\bo_\bo_\bt_\b__\bp_\bt_\br_\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__\bp_\bi_\be_\bc_\be_\b__\br_\ba_\bn_\bg_\be_\b(_\b)_\b _\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)\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+ * _\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+ * _\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+ * _\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_\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+ * _\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+ * _\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+ o _\bd_\bi_\bs_\bk_\b__\bb_\bu_\bf_\bf_\be_\br_\b__\bh_\bo_\bl_\bd_\be_\br_\b(_\b)\n+ o _\bd_\bi_\bs_\bk_\b__\bb_\bu_\bf_\bf_\be_\br_\b__\bh_\bo_\bl_\bd_\be_\br_\b(_\b)\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+ * _\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+ * _\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__\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+ o _\ba_\bs_\by_\bn_\bc_\b__\bd_\be_\bl_\be_\bt_\be_\b__\bf_\bi_\bl_\be_\bs_\b(_\b)\n+ o _\ba_\bs_\by_\bn_\bc_\b__\bs_\be_\bt_\b__\bf_\bi_\bl_\be_\b__\bp_\br_\bi_\bo_\br_\bi_\bt_\by_\b(_\b)\n+ o _\ba_\bs_\by_\bn_\bc_\b__\bc_\bl_\be_\ba_\br_\b__\bp_\bi_\be_\bc_\be_\b(_\b)\n+ o _\bu_\bp_\bd_\ba_\bt_\be_\b__\bs_\bt_\ba_\bt_\bs_\b__\bc_\bo_\bu_\bn_\bt_\be_\br_\bs_\b(_\b)\n+ o _\bg_\be_\bt_\b__\bs_\bt_\ba_\bt_\bu_\bs_\b(_\b)\n+ o _\ba_\bb_\bo_\br_\bt_\b(_\b)\n+ o _\bs_\bu_\bb_\bm_\bi_\bt_\b__\bj_\bo_\bb_\bs_\b(_\b)\n+ o _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bu_\bp_\bd_\ba_\bt_\be_\bd_\b(_\b)\n+ * _\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bh_\bo_\bl_\bd_\be_\br\n+ * _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be\n+ * _\bf_\bi_\bl_\be_\b__\bo_\bp_\be_\bn_\b__\bm_\bo_\bd_\be_\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+ * _\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 * _\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 _\bh_\ba_\bs_\b__\bv_\b2_\b(_\b)_\b _\bh_\ba_\bs_\b(_\b)_\b _\bh_\ba_\bs_\b__\bv_\b1_\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- * _\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+ * _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\be_\be_\br_\b__\be_\bq_\bu_\ba_\bl_\b(_\b)\n+ * _\bv_\be_\br_\bs_\bi_\bo_\bn_\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- * _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\be_\be_\br_\b__\be_\bq_\bu_\ba_\bl_\b(_\b)\n- * _\be_\bn_\bu_\bm_\b _\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b__\bt_\by_\bp_\be\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 _\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 _\bs_\bo_\bc_\bk_\be_\bt_\b__\bt_\by_\bp_\be_\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 * _\bi_\bn_\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 * _\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- * _\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_\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 _\br_\be_\bs_\bu_\bm_\be_\b(_\b)_\b _\bi_\bs_\b__\bp_\ba_\bu_\bs_\be_\bd_\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__\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 _\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 _\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 _\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 _\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 _\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 _\bp_\bo_\bp_\b__\ba_\bl_\be_\br_\bt_\bs_\b(_\b)_\b _\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)\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- * _\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- * _\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+ * _\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+ * _\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+ * _\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+ * _\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+ * _\bs_\bo_\bc_\bk_\bs_\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+ * _\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+ * _\bb_\bd_\be_\bc_\bo_\bd_\be_\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+ * _\bg_\bz_\bi_\bp_\b__\bc_\ba_\bt_\be_\bg_\bo_\br_\by_\b(_\b)\n+ * _\bp_\bc_\bp_\b__\bc_\ba_\bt_\be_\bg_\bo_\br_\by_\b(_\b)\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 _\bi_\b2_\bp_\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+ * _\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 _\be_\br_\br_\bo_\br_\b__\bc_\bo_\bd_\be_\b__\be_\bn_\bu_\bm\n+ * _\be_\bn_\bu_\bm_\b _\bp_\bc_\bp_\b__\be_\br_\br_\bo_\br_\bs\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 _\bp_\br_\be_\bf_\bo_\br_\bm_\ba_\bt_\bt_\be_\bd_\b(_\b)_\b _\bl_\bi_\bs_\bt_\b(_\b)_\b _\bi_\bn_\bt_\be_\bg_\be_\br_\b(_\b)\n+ o _\bp_\br_\be_\bf_\bo_\br_\bm_\ba_\bt_\bt_\be_\bd_\b(_\b)_\b _\bs_\bt_\br_\bi_\bn_\bg_\b(_\b)_\b _\bd_\bi_\bc_\bt_\b(_\b)_\b _\bi_\bn_\bt_\be_\bg_\be_\br_\b(_\b)_\b _\bl_\bi_\bs_\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 * _\bo_\bp_\be_\br_\ba_\bt_\bo_\br_\b<_\b<_\b(_\b)\n * _\bb_\be_\bn_\bc_\bo_\bd_\be_\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__\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_\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__\ba_\bt_\b__\bn_\bo_\bd_\be_\b(_\b)_\b _\bd_\bi_\bc_\bt_\b__\bf_\bi_\bn_\bd_\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__\bl_\bi_\bs_\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__\bv_\ba_\bl_\bu_\be_\b(_\b)_\b _\bd_\bi_\bc_\bt_\b__\bf_\bi_\bn_\bd_\b__\bs_\bt_\br_\bi_\bn_\bg\n- _\b(_\b)_\b _\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__\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 * _\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@@ -330,283 +389,224 @@\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__\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__\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__\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__\bn_\bo_\bn_\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__\bd_\bo_\bn_\bt_\b__\bh_\ba_\bv_\be_\b(_\b)_\b _\bo_\bn_\b__\bc_\bh_\bo_\bk_\be_\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\n- _\b(_\b)_\b _\bo_\bn_\b__\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd_\b(_\b)_\b _\bo_\bn_\b__\bh_\ba_\bv_\be_\b__\ba_\bl_\bl_\b(_\b)\n+ o _\bo_\bn_\b__\bh_\ba_\bv_\be_\b__\bn_\bo_\bn_\be_\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__\bu_\bn_\bc_\bh_\bo_\bk_\be_\b(_\b)_\b _\bo_\bn_\b__\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd_\b(_\b)\n+ _\bo_\bn_\b__\bh_\ba_\bv_\be_\b__\ba_\bl_\bl_\b(_\b)_\b _\bo_\bn_\b__\bd_\bo_\bn_\bt_\b__\bh_\ba_\bv_\be_\b(_\b)_\b _\bo_\bn_\b__\bc_\bh_\bo_\bk_\be_\b(_\b)_\b _\bo_\bn_\b__\br_\be_\bq_\bu_\be_\bs_\bt_\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__\bi_\bn_\bt_\be_\br_\be_\bs_\bt_\be_\bd_\b(_\b)\n o _\bo_\bn_\b__\bp_\bi_\be_\bc_\be_\b(_\b)\n- o _\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__\bu_\bn_\bc_\bh_\bo_\bk_\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__\bu_\bn_\bc_\bh_\bo_\bk_\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__\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__\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__\bs_\bm_\ba_\br_\bt_\b__\bb_\ba_\bn_\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- * _\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__\bu_\bt_\b__\bp_\be_\bx_\b__\bp_\bl_\bu_\bg_\bi_\bn_\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__\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__\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(_\b)\n+ _\bd_\bi_\bc_\bt_\b__\bf_\bi_\bn_\bd_\b(_\b)_\b _\bd_\bi_\bc_\bt_\b__\bs_\bi_\bz_\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)\n+ _\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(_\b)_\b _\bd_\bi_\bc_\bt_\b__\bf_\bi_\bn_\bd_\b__\bi_\bn_\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__\bp_\bt_\br_\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__\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+ * _\bb_\bd_\be_\bc_\bo_\bd_\be_\b(_\b)\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 _\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 _\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 _\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 _\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 _\bu_\br_\bl_\b__\bs_\be_\be_\bd_\bs_\b(_\b)_\b _\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)\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 _\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(_\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__\bu_\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+ 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(_\b)_\b _\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)\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 _\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__\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 _\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 _\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\b__\bl_\bi_\bm_\bi_\bt_\b(_\b)\n+ _\bs_\be_\bt_\b__\bu_\bp_\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 _\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+ * _\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 _\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 _\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 _\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 _\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 _\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)_\b _\bp_\bo_\bp_\b__\ba_\bl_\be_\br_\bt_\bs_\b(_\b)\n+ o _\bd_\be_\bl_\be_\bt_\be_\b__\bp_\bo_\br_\bt_\b__\bm_\ba_\bp_\bp_\bi_\bn_\bg_\b(_\b)_\b _\ba_\bd_\bd_\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_\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__\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+ * _\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)_\b _\br_\be_\ba_\bd_\b__\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs_\b(_\b)\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 _\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)_\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+ * _\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 * _\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__\bb_\bu_\bf_\b(_\b)_\b _\bg_\be_\bn_\be_\br_\ba_\bt_\be_\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 _\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__\bl_\be_\bn_\bg_\bt_\bh_\b(_\b)_\b _\bp_\bi_\be_\bc_\be_\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 * _\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- * _\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 _\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- * _\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- * _\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bp_\ba_\br_\ba_\bm_\bs\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 _\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 _\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 _\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 _\br_\bo_\bo_\bt_\b(_\b)_\b _\bf_\bi_\bl_\be_\b__\bs_\bi_\bz_\be_\b(_\b)_\b _\bm_\bt_\bi_\bm_\be_\b(_\b)_\b _\br_\bo_\bo_\bt_\b__\bp_\bt_\br_\b(_\b)_\b _\bp_\ba_\bd_\b__\bf_\bi_\bl_\be_\b__\ba_\bt_\b(_\b)_\b _\bf_\bi_\bl_\be_\b__\bo_\bf_\bf_\bs_\be_\bt_\b(_\b)\n- _\bf_\bi_\bl_\be_\b__\bp_\ba_\bt_\bh_\b(_\b)_\b _\bh_\ba_\bs_\bh_\b(_\b)_\b _\bf_\bi_\bl_\be_\b__\bn_\ba_\bm_\be_\b(_\b)_\b _\bs_\by_\bm_\bl_\bi_\bn_\bk_\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__\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- * _\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- * _\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- * _\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- * _\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- * _\bs_\bt_\ba_\bt_\bs_\b__\bm_\be_\bt_\br_\bi_\bc\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_\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- * _\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- * _\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- * _\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- o _\bd_\bi_\bs_\bk_\b__\bb_\bu_\bf_\bf_\be_\br_\b__\bh_\bo_\bl_\bd_\be_\br_\b(_\b)\n- o _\bd_\bi_\bs_\bk_\b__\bb_\bu_\bf_\bf_\be_\br_\b__\bh_\bo_\bl_\bd_\be_\br_\b(_\b)\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- * _\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__\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- o _\ba_\bs_\by_\bn_\bc_\b__\bd_\be_\bl_\be_\bt_\be_\b__\bf_\bi_\bl_\be_\bs_\b(_\b)\n- o _\ba_\bs_\by_\bn_\bc_\b__\bs_\be_\bt_\b__\bf_\bi_\bl_\be_\b__\bp_\br_\bi_\bo_\br_\bi_\bt_\by_\b(_\b)\n- o _\ba_\bs_\by_\bn_\bc_\b__\bc_\bl_\be_\ba_\br_\b__\bp_\bi_\be_\bc_\be_\b(_\b)\n- o _\bu_\bp_\bd_\ba_\bt_\be_\b__\bs_\bt_\ba_\bt_\bs_\b__\bc_\bo_\bu_\bn_\bt_\be_\br_\bs_\b(_\b)\n- o _\bg_\be_\bt_\b__\bs_\bt_\ba_\bt_\bu_\bs_\b(_\b)\n- o _\ba_\bb_\bo_\br_\bt_\b(_\b)\n- o _\bs_\bu_\bb_\bm_\bi_\bt_\b__\bj_\bo_\bb_\bs_\b(_\b)\n- o _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bu_\bp_\bd_\ba_\bt_\be_\bd_\b(_\b)\n- * _\bs_\bt_\bo_\br_\ba_\bg_\be_\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- * _\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 _\bv_\bo_\bi_\bd_\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- * _\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- * _\bb_\bd_\be_\bc_\bo_\bd_\be_\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- * _\bg_\bz_\bi_\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- * _\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 _\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 _\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 _\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 * _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk\n- o _\bs_\be_\bt_\b__\bi_\bn_\bt_\b(_\b)_\b _\bs_\be_\bt_\b__\bs_\bt_\br_\b(_\b)_\b _\bs_\be_\bt_\b__\bb_\bo_\bo_\bl_\b(_\b)\n+ o _\bs_\be_\bt_\b__\bs_\bt_\br_\b(_\b)_\b _\bs_\be_\bt_\b__\bi_\bn_\bt_\b(_\b)_\b _\bs_\be_\bt_\b__\bb_\bo_\bo_\bl_\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 _\bg_\be_\bt_\b__\bi_\bn_\bt_\b(_\b)_\b _\bg_\be_\bt_\b__\bb_\bo_\bo_\bl_\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- * _\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 * _\bs_\be_\bt_\bt_\bi_\bn_\bg_\b__\bb_\by_\b__\bn_\ba_\bm_\be_\b(_\b)_\b _\bn_\ba_\bm_\be_\b__\bf_\bo_\br_\b__\bs_\be_\bt_\bt_\bi_\bn_\bg_\b(_\b)\n * _\bd_\be_\bf_\ba_\bu_\bl_\bt_\b__\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\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 _\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 _\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 _\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__\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 _\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_\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 _\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(_\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- 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+ * _\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 * _\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 o _\bg_\be_\bt_\b__\bp_\be_\be_\br_\bs_\b(_\b)\n o _\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b__\bp_\be_\be_\br_\b(_\b)\n o _\bg_\be_\bt_\b__\bi_\bm_\bm_\bu_\bt_\ba_\bb_\bl_\be_\b__\bi_\bt_\be_\bm_\b(_\b)\n@@ -627,14 +627,779 @@\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* 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+ explicit b\bbi\bit\btf\bfi\bie\bel\bld\bd (int bits);\n+ b\bbi\bit\btf\bfi\bie\bel\bld\bd (bitfield&& rhs) noexcept = default;\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 (int bits, bool val);\n+ b\bbi\bit\btf\bfi\bie\bel\bld\bd () 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+ void s\bse\bet\bt_\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+explicit b\bbi\bit\btf\bfi\bie\bel\bld\bd (int bits);\n+b\bbi\bit\btf\bfi\bie\bel\bld\bd (bitfield&& rhs) noexcept = default;\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 (int bits, bool val);\n+b\bbi\bit\btf\bfi\bie\bel\bld\bd () 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* 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* 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+void s\bse\bet\bt_\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+[_\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+ 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+ explicit h\bha\bas\bsh\bhe\ber\br (span data);\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* 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+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+explicit h\bha\bas\bsh\bhe\ber\br (span data);\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+ 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 (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* 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 (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* 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* 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 ();\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 const&);\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+ {\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+ 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+ port_filter& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (port_filter const&);\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+ 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* 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+ 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 (char const* buffer, int size, error_code& ec);\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, load_torrent_limits const&\n+cfg);\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 (info_hash_t const& info_hash);\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 (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 (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+ 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& 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+ std::vector const& t\btr\bra\bac\bck\bke\ber\brs\bs () const;\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\n+ , announce_entry::tracker_source source);\n+ void a\bad\bdd\bd_\b_t\btr\bra\bac\bck\bke\ber\br (std::string const& url, int tier = 0);\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+ 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_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::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\bv2\b2 () const;\n+ bool v\bv1\b1 () 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+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 (char const* buffer, int size, error_code& ec);\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, load_torrent_limits const&\n+cfg);\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 (info_hash_t const& info_hash);\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 (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 (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+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& 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* 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+std::vector const& t\btr\bra\bac\bck\bke\ber\brs\bs () const;\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\n+ , announce_entry::tracker_source source);\n+void a\bad\bdd\bd_\b_t\btr\bra\bac\bck\bke\ber\br (std::string const& url, int tier = 0);\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_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) a\bad\bdd\bd_\b_u\bur\brl\bl_\b_s\bse\bee\bed\bd(\b()\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+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_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+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* 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) 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\bv2\b2 () const;\n+bool v\bv1\b1 () 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 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@@ -796,25 +1561,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* 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* 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 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@@ -1431,24 +2196,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 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@@ -2684,24 +3449,24 @@\n *\b**\b**\b**\b**\b**\b* d\bdh\bht\bt_\b_l\bli\biv\bve\be_\b_n\bno\bod\bde\bes\bs_\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 posted in response to a call to session::dht_live_nodes(). It contains the live\n nodes from the DHT routing table of one of the DHT nodes running locally.\n struct dht_live_nodes_alert final : alert\n {\n std::string m\bme\bes\bss\bsa\bag\bge\be () const override;\n- int n\bnu\bum\bm_\b_n\bno\bod\bde\bes\bs () const;\n std::vector> n\bno\bod\bde\bes\bs () const;\n+ int n\bnu\bum\bm_\b_n\bno\bod\bde\bes\bs () 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::dht;\n sha1_hash node_id;\n };\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) 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+*\b**\b**\b**\b**\b* n\bnu\bum\bm_\b_n\bno\bod\bde\bes\bs(\b()\b) n\bno\bod\bde\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n std::vector> n\bno\bod\bde\bes\bs () const;\n+int n\bnu\bum\bm_\b_n\bno\bod\bde\bes\bs () const;\n the number of nodes in the routing table and the actual nodes.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n node_id\n the local DHT node's node-ID this routing table belongs to\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_h\bhe\bea\bad\bde\ber\br_\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@@ -2722,30 +3487,30 @@\n *\b**\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_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 posted as a response to a call to session::dht_sample_infohashes() with the\n information from the DHT response message.\n struct dht_sample_infohashes_alert final : alert\n {\n std::string m\bme\bes\bss\bsa\bag\bge\be () const override;\n- std::vector s\bsa\bam\bmp\bpl\ble\bes\bs () const;\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 int n\bnu\bum\bm_\b_n\bno\bod\bde\bes\bs () const;\n std::vector> n\bno\bod\bde\bes\bs () 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 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* 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-std::vector s\bsa\bam\bmp\bpl\ble\bes\bs () const;\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 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 The total number of nodes returned by nodes().\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n@@ -3219,1241 +3984,1518 @@\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* 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+*\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- 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+ 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 block_state_t\n- {\n- none,\n- requested,\n- writing,\n- finished,\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* 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 (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 (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_\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+ char const* r\bro\boo\bot\bt_\b_p\bpt\btr\br (file_index_t const index) const;\n+ sha256_hash r\bro\boo\bot\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+ string_view f\bfi\bil\ble\be_\b_n\bna\bam\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::int64_t f\bfi\bil\ble\be_\b_o\bof\bff\bfs\bse\bet\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+ sha1_hash h\bha\bas\bsh\bh (file_index_t index) const;\n+ std::time_t m\bmt\bti\bim\bme\be (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_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_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- unsigned bytes_progress:15;\n- unsigned block_size:15;\n- unsigned state:2;\n- unsigned num_peers:14;\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* 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-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-The peer is the ip address of the peer this block was downloaded from.\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* 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-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bp_\be_\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 |\n-|requested|1 |The block has been requested, but not completely downloaded|\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\by_\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 |\n-|writing |2 |The block has been downloaded and is currently queued for |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bb_\be_\bi_\bn_\bg_\b _\bw_\br_\bi_\bt_\bt_\be_\bn_\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 |\n-|_\bf_\bi_\bn_\bi_\bs_\bh_\be_\bd_\b _\b|_\b3_\b _\b _\b _\b _\b|_\bT_\bh_\be_\b _\bb_\bl_\bo_\bc_\bk_\b _\bh_\ba_\bs_\b _\bb_\be_\be_\bn_\b _\bw_\br_\bi_\bt_\bt_\be_\bn_\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 |\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- bytes_progress\n- the number of bytes that have been received for this block\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 (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 (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_\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- block_size\n- the total number of bytes in this block.\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- state\n- the state this block is in (see _\bb_\bl_\bo_\bc_\bk_\b__\bs_\bt_\ba_\bt_\be_\b__\bt)\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- num_peers\n- the number of peers that is currently requesting this block. Typically\n- this is 0 or 1, but at the end of the torrent blocks may be requested by\n- more peers in parallel to speed things up.\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**\b* p\bpa\bar\brt\bti\bia\bal\bl_\b_p\bpi\bie\bec\bce\be_\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-This class holds information about pieces that have outstanding requests or\n-outstanding writes\n-struct partial_piece_info\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* 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* 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* 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+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_s\bsi\biz\bze\be(\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) r\bro\boo\bot\bt(\b()\b) h\bha\bas\bsh\bh(\b()\b) m\bmt\bti\bim\bme\be(\b()\b) f\bfi\bil\ble\be_\b_n\bna\bam\bme\be(\b()\b)\n+r\bro\boo\bot\bt_\b_p\bpt\btr\br(\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::string s\bsy\bym\bml\bli\bin\bnk\bk (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+sha256_hash r\bro\boo\bot\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+string_view f\bfi\bil\ble\be_\b_n\bna\bam\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::int64_t f\bfi\bil\ble\be_\b_o\bof\bff\bfs\bse\bet\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+sha1_hash h\bha\bas\bsh\bh (file_index_t index) const;\n+std::time_t m\bmt\bti\bim\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* 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_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) *\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) 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_n\bnu\bum\bm_\b_p\bpi\bie\bec\bce\bes\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* 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* 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* 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\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* 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+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+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\n+the client with other peers.\n+Each configuration option is named with an enum value inside the _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk\n+class. These are the available settings:\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+implementing _\bd_\bi_\bs_\bk_\b__\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be, this must also be implemented in order to return\n+disk buffers back to libtorrent\n+struct buffer_allocator_interface\n {\n- piece_index_t piece_index;\n- int blocks_in_piece;\n- int finished;\n- int writing;\n- int requested;\n- block_info const* blocks;\n+ virtual void f\bfr\bre\bee\be_\b_d\bdi\bis\bsk\bk_\b_b\bbu\buf\bff\bfe\ber\br (char* b) = 0;\n };\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- piece_index\n- the index of the piece in question. blocks_in_piece is the number of\n- blocks in this particular piece. This number will be the same for most\n- pieces, but the last piece may have fewer blocks than the standard\n- pieces.\n+*\b**\b**\b**\b**\b**\b* d\bdi\bis\bsk\bk_\b_b\bbu\buf\bff\bfe\ber\br_\b_h\bho\bol\bld\bde\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__\bb_\bu_\bf_\bf_\be_\br_\b__\bh_\bo_\bl_\bd_\be_\br_\b._\bh_\bp_\bp\"\n+The disk buffer holder acts like a unique_ptr that frees a disk buffer when\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+ 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+ bool i\bis\bs_\b_m\bmu\but\bta\bab\bbl\ble\be () const noexcept;\n+ explicit operator b\bbo\boo\bol\bl () const noexcept;\n+ std::ptrdiff_t s\bsi\biz\bze\be () const;\n+};\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- blocks_in_piece\n- the number of blocks in this piece\n+*\b**\b**\b**\b**\b* d\bdi\bis\bsk\bk_\b_b\bbu\buf\bff\bfe\ber\br_\b_h\bho\bol\bld\bde\ber\br(\b()\b) *\b**\b**\b**\b**\b*\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+construct a buffer holder that will free the held buffer using a disk buffer\n+pool directly (there's only one disk_buffer_pool per _\bs_\be_\bs_\bs_\bi_\bo_\bn)\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- finished\n- the number of blocks that are in the finished state\n+*\b**\b**\b**\b**\b* d\bdi\bis\bsk\bk_\b_b\bbu\buf\bff\bfe\ber\br_\b_h\bho\bol\bld\bde\ber\br(\b()\b) *\b**\b**\b**\b**\b*\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+default construct a holder that does not own any buffer\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- writing\n- the number of blocks that are in the writing state\n+*\b**\b**\b**\b**\b* ~\b~d\bdi\bis\bsk\bk_\b_b\bbu\buf\bff\bfe\ber\br_\b_h\bho\bol\bld\bde\ber\br(\b()\b) *\b**\b**\b**\b**\b*\n+~\b~d\bdi\bis\bsk\bk_\b_b\bbu\buf\bff\bfe\ber\br_\b_h\bho\bol\bld\bde\ber\br ();\n+frees disk buffer held by this object\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- requested\n- the number of blocks that are in the requested state\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 () const noexcept;\n+return a pointer to the held buffer, if any. Otherwise returns nullptr.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- blocks\n- this is an array of blocks_in_piece number of items. One for each block\n- in the piece.\n- Warning\n- This is a pointer that points to an array that's owned by the _\bs_\be_\bs_\bs_\bi_\bo_\bn\n- object. The next time _\bg_\be_\bt_\b__\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\b__\bq_\bu_\be_\bu_\be_\b(_\b) is called, it will be\n- invalidated. In the case of _\bp_\bi_\be_\bc_\be_\b__\bi_\bn_\bf_\bo_\b__\ba_\bl_\be_\br_\bt, these pointers point into\n- the _\ba_\bl_\be_\br_\bt object itself, and will be invalidated when the _\ba_\bl_\be_\br_\bt destruct.\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+free the held disk buffer, if any, and clear the holder. This sets the holder\n+object to a default-constructed state\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_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/_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be_\b._\bh_\bp_\bp\"\n-You will usually have to store your torrent handles somewhere, since it's the\n-object through which you retrieve information about the torrent and aborts the\n-torrent.\n-Warning\n-Any member function that returns a value or fills in a value has to be made\n-synchronously. This means it has to wait for the main thread to complete the\n-query before it can return. This might potentially be expensive if done from\n-within a GUI thread that needs to stay responsive. Try to avoid querying for\n-information you don't need, and try to do it in as few calls as possible. You\n-can get most of the interesting information about a torrent from the\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) call.\n-The default constructor will initialize the handle to an invalid state. Which\n-means you cannot perform any operation on it, unless you first assign it a\n-valid handle. If you try to perform any operation on an uninitialized handle,\n-it will throw invalid_handle.\n-Warning\n-All operations on a _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be may throw system_error exception, in case\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+*\b**\b**\b**\b**\b* s\bsw\bwa\bap\bp(\b()\b) *\b**\b**\b**\b**\b*\n+void s\bsw\bwa\bap\bp (disk_buffer_holder& h) noexcept;\n+swap pointers of two disk buffer holders.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+*\b**\b**\b**\b**\b* i\bis\bs_\b_m\bmu\but\bta\bab\bbl\ble\be(\b()\b) *\b**\b**\b**\b**\b*\n+bool i\bis\bs_\b_m\bmu\but\bta\bab\bbl\ble\be () const noexcept;\n+if this returns true, the buffer may not be modified in place\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+implicitly convertible to true if the object is currently holding a buffer\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- 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 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 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- 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- 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 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 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- 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- 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 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- void p\bpo\bos\bst\bt_\b_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 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_u\bur\brl\bl_\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- std::set h\bht\btt\btp\bp_\b_s\bse\bee\bed\bds\bs () 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_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 p\bpa\bau\bus\bse\be (pause_flags_t flags = {}) const;\n- void r\bre\bes\bsu\bum\bme\be () 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) 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- 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_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_t\bto\bop\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 (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_\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\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- 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- 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- 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_f\bfi\bil\ble\be_\b_p\bpr\bri\bio\bor\bri\bit\bti\bie\bes\bs () 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_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 d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_l\bli\bim\bmi\bit\bt () 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- 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 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- 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< (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+ 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+ file_open_mode_t open_mode;\n+ time_point last_use;\n+};\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ file_index\n+ the index of the file this _\be_\bn_\bt_\br_\by refers to into the file_storage file\n+ list of this torrent. This starts indexing at 0.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ open_mode\n+ open_mode is a bitmask of the file flags this file is currently opened\n+ with. For possible flags, see _\bf_\bi_\bl_\be_\b__\bo_\bp_\be_\bn_\b__\bm_\bo_\bd_\be_\b__\bt.\n+ Note that the read/write mode is not a bitmask. The two least significant\n+ bits are used to represent the read/write mode. Those bits can be masked\n+ out using the rw_mask constant.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ last_use\n+ a (high precision) timestamp of when the file was last used.\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_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__\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be_\b._\bh_\bp_\bp\"\n+The _\bd_\bi_\bs_\bk_\b__\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be is the customization point for disk I/O in libtorrent.\n+implement this interface and provide a factory function to the _\bs_\be_\bs_\bs_\bi_\bo_\bn\n+constructor use custom disk I/O. All functions on the disk subsystem\n+(implementing _\bd_\bi_\bs_\bk_\b__\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be) are called from within libtorrent's network\n+thread. For disk I/O to be performed in a separate thread, the disk subsystem\n+has to manage that itself.\n+Although the functions are called async_*, they do not technically h\bha\bav\bve\be to be\n+asynchronous, but they support being asynchronous, by expecting the result\n+passed back into a callback. The callbacks must be posted back onto the network\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 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+ , std::function handler) = 0;\n+ virtual void a\bas\bsy\byn\bnc\bc_\b_m\bmo\bov\bve\be_\b_s\bst\bto\bor\bra\bag\bge\be (storage_index_t storage, std::string p,\n+move_flags_t flags\n+ , std::function\n+handler) = 0;\n+ virtual void a\bas\bsy\byn\bnc\bc_\b_r\bre\bel\ble\bea\bas\bse\be_\b_f\bfi\bil\ble\bes\bs (storage_index_t storage\n+ , std::function handler = std::function()) = 0;\n+ virtual void a\bas\bsy\byn\bnc\bc_\b_c\bch\bhe\bec\bck\bk_\b_f\bfi\bil\ble\bes\bs (storage_index_t storage\n+ , add_torrent_params const* resume_data\n+ , aux::vector links\n+ , std::function handler) = 0;\n+ virtual void a\bas\bsy\byn\bnc\bc_\b_s\bst\bto\bop\bp_\b_t\bto\bor\brr\bre\ben\bnt\bt (storage_index_t storage\n+ , std::function handler = std::function()) = 0;\n+ virtual void a\bas\bsy\byn\bnc\bc_\b_r\bre\ben\bna\bam\bme\be_\b_f\bfi\bil\ble\be (storage_index_t storage\n+ , file_index_t index, std::string name\n+ , std::function handler) = 0;\n+ virtual void a\bas\bsy\byn\bnc\bc_\b_d\bde\bel\ble\bet\bte\be_\b_f\bfi\bil\ble\bes\bs (storage_index_t storage, remove_flags_t\n+options\n+ , std::function handler) = 0;\n+ virtual void a\bas\bsy\byn\bnc\bc_\b_s\bse\bet\bt_\b_f\bfi\bil\ble\be_\b_p\bpr\bri\bio\bor\bri\bit\bty\by (storage_index_t storage\n+ , aux::vector prio\n+ , std::function)> handler) = 0;\n+ virtual void a\bas\bsy\byn\bnc\bc_\b_c\bcl\ble\bea\bar\br_\b_p\bpi\bie\bec\bce\be (storage_index_t storage, piece_index_t index\n+ , std::function handler) = 0;\n+ virtual void u\bup\bpd\bda\bat\bte\be_\b_s\bst\bta\bat\bts\bs_\b_c\bco\bou\bun\bnt\bte\ber\brs\bs (counters& c) const = 0;\n+ virtual std::vector g\bge\bet\bt_\b_s\bst\bta\bat\btu\bus\bs (storage_index_t) const = 0;\n+ virtual void a\bab\bbo\bor\brt\bt (bool wait) = 0;\n+ virtual void s\bsu\bub\bbm\bmi\bit\bt_\b_j\bjo\bob\bbs\bs () = 0;\n+ virtual void s\bse\bet\btt\bti\bin\bng\bgs\bs_\b_u\bup\bpd\bda\bat\bte\bed\bd () = 0;\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- static constexpr status_flags_t q\bqu\bue\ber\bry\by_\b_a\bac\bcc\bcu\bur\bra\bat\bte\be_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_c\bco\bou\bun\bnt\bte\ber\brs\bs = 1_bit;\n- static constexpr status_flags_t q\bqu\bue\ber\bry\by_\b_l\bla\bas\bst\bt_\b_s\bse\bee\ben\bn_\b_c\bco\bom\bmp\bpl\ble\bet\bte\be = 2_bit;\n- static constexpr status_flags_t q\bqu\bue\ber\bry\by_\b_p\bpi\bie\bec\bce\bes\bs = 3_bit;\n- static constexpr status_flags_t q\bqu\bue\ber\bry\by_\b_v\bve\ber\bri\bif\bfi\bie\bed\bd_\b_p\bpi\bie\bec\bce\bes\bs = 4_bit;\n- static constexpr status_flags_t q\bqu\bue\ber\bry\by_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be = 5_bit;\n- static constexpr status_flags_t q\bqu\bue\ber\bry\by_\b_n\bna\bam\bme\be = 6_bit;\n- static constexpr status_flags_t q\bqu\bue\ber\bry\by_\b_s\bsa\bav\bve\be_\b_p\bpa\bat\bth\bh = 7_bit;\n- static constexpr deadline_flags_t a\bal\ble\ber\brt\bt_\b_w\bwh\bhe\ben\bn_\b_a\bav\bva\bai\bil\bla\bab\bbl\ble\be = 0_bit;\n- static constexpr file_progress_flags_t p\bpi\bie\bec\bce\be_\b_g\bgr\bra\ban\bnu\bul\bla\bar\bri\bit\bty\by = 0_bit;\n- static constexpr pause_flags_t g\bgr\bra\bac\bce\bef\bfu\bul\bl_\b_p\bpa\bau\bus\bse\be = 0_bit;\n- static constexpr resume_data_flags_t f\bfl\blu\bus\bsh\bh_\b_d\bdi\bis\bsk\bk_\b_c\bca\bac\bch\bhe\be = 0_bit;\n- static constexpr resume_data_flags_t s\bsa\bav\bve\be_\b_i\bin\bnf\bfo\bo_\b_d\bdi\bic\bct\bt = 1_bit;\n- static constexpr resume_data_flags_t o\bon\bnl\bly\by_\b_i\bif\bf_\b_m\bmo\bod\bdi\bif\bfi\bie\bed\bd = 2_bit;\n- static constexpr resume_data_flags_t i\bif\bf_\b_c\bco\bou\bun\bnt\bte\ber\brs\bs_\b_c\bch\bha\ban\bng\bge\bed\bd = 3_bit;\n- static constexpr resume_data_flags_t i\bif\bf_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_p\bpr\bro\bog\bgr\bre\bes\bss\bs = 4_bit;\n- static constexpr resume_data_flags_t i\bif\bf_\b_c\bco\bon\bnf\bfi\big\bg_\b_c\bch\bha\ban\bng\bge\bed\bd = 5_bit;\n- static constexpr resume_data_flags_t i\bif\bf_\b_s\bst\bta\bat\bte\be_\b_c\bch\bha\ban\bng\bge\bed\bd = 6_bit;\n- static constexpr resume_data_flags_t i\bif\bf_\b_m\bme\bet\bta\bad\bda\bat\bta\ba_\b_c\bch\bha\ban\bng\bge\bed\bd = 7_bit;\n- static constexpr reannounce_flags_t i\big\bgn\bno\bor\bre\be_\b_m\bmi\bin\bn_\b_i\bin\bnt\bte\ber\brv\bva\bal\bl = 0_bit;\n+ static constexpr disk_job_flags_t f\bfo\bor\brc\bce\be_\b_c\bco\bop\bpy\by = 0_bit;\n+ static constexpr disk_job_flags_t s\bse\beq\bqu\bue\ben\bnt\bti\bia\bal\bl_\b_a\bac\bcc\bce\bes\bss\bs = 3_bit;\n+ static constexpr disk_job_flags_t v\bvo\bol\bla\bat\bti\bil\ble\be_\b_r\bre\bea\bad\bd = 4_bit;\n+ static constexpr disk_job_flags_t v\bv1\b1_\b_h\bha\bas\bsh\bh = 5_bit;\n+ static constexpr disk_job_flags_t f\bfl\blu\bus\bsh\bh_\b_p\bpi\bie\bec\bce\be = 7_bit;\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_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+*\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 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+this is called when a new torrent is added. The shared_ptr can be used to hold\n+the internal torrent object alive as long as there are outstanding disk\n+operations on the storage. The returned _\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bh_\bo_\bl_\bd_\be_\br is an owning reference\n+to the underlying storage that was just created. It is fundamentally a\n+storage_index_t\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-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-the hash check by waiting for _\bp_\bi_\be_\bc_\be_\b__\bf_\bi_\bn_\bi_\bs_\bh_\be_\bd_\b__\ba_\bl_\be_\br_\bt or _\bh_\ba_\bs_\bh_\b__\bf_\ba_\bi_\bl_\be_\bd_\b__\ba_\bl_\be_\br_\bt.\n-Adding pieces while the torrent is being checked (i.e. in _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bs_\bt_\ba_\bt_\bu_\bs_\b:_\b:\n-_\bc_\bh_\be_\bc_\bk_\bi_\bn_\bg_\b__\bf_\bi_\bl_\be_\bs state) is not supported.\n-The overload taking a raw pointer to the data is a blocking call. It won't\n-return until the libtorrent thread has copied the data into its disk write\n-buffer. data is expected to point to a buffer of as many bytes as the size of\n-the specified piece. See _\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b:_\b:_\bp_\bi_\be_\bc_\be_\b__\bs_\bi_\bz_\be_\b(_\b).\n-The data in the buffer is copied and passed on to the disk IO thread to be\n-written at a later point.\n-The overload taking a std::vector is not blocking, it will send the\n-buffer to the main thread and return immediately.\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* r\bre\bea\bad\bd_\b_p\bpi\bie\bec\bce\be(\b()\b) *\b**\b**\b**\b**\b*\n-void r\bre\bea\bad\bd_\b_p\bpi\bie\bec\bce\be (piece_index_t piece) const;\n-This function starts an asynchronous read operation of the specified piece from\n-this torrent. You must have completed the download of the specified piece\n-before calling this function.\n-When the read operation is completed, it is passed back through an _\ba_\bl_\be_\br_\bt,\n-_\br_\be_\ba_\bd_\b__\bp_\bi_\be_\bc_\be_\b__\ba_\bl_\be_\br_\bt. Since this _\ba_\bl_\be_\br_\bt is a response to an explicit call, it will\n-always be posted, regardless of the _\ba_\bl_\be_\br_\bt mask.\n-Note that if you read multiple pieces, the read operations are not guaranteed\n-to finish in the same order as you initiated them.\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 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+will stop further writes and wait for the passed-in disk_observer to be\n+notified before resuming.\n+Note that for async_read, the _\bp_\be_\be_\br_\b__\br_\be_\bq_\bu_\be_\bs_\bt (r) is not necessarily aligned to\n+blocks (but it is most of the time). However, all writes (passed to\n+async_write) are guaranteed to be block aligned.\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+*\b**\b**\b**\b**\b* a\bas\bsy\byn\bnc\bc_\b_h\bha\bas\bsh\bh(\b()\b) *\b**\b**\b**\b**\b*\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+Compute hash(es) for the specified piece. Unless the v1_hash flag is set (in\n+flags), the SHA-1 hash of the whole piece does not need to be computed.\n+Thev2span is optional and can be empty, which means v2 hashes should not be\n+computed. If v2 is non-empty it must be at least large enough to hold all v2\n+blocks in the piece, and this function will fill in the span with the SHA-256\n+block hashes of the piece.\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\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+*\b**\b**\b**\b**\b* a\bas\bsy\byn\bnc\bc_\b_h\bha\bas\bsh\bh2\b2(\b()\b) *\b**\b**\b**\b**\b*\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+ , std::function handler) = 0;\n+computes the v2 hash (SHA-256) of a single block. The block at offset in piece\n+piece.\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-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-with the _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bs_\bt_\ba_\bt_\bu_\bs object. To avoid blocking, instead call post_status().\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+*\b**\b**\b**\b**\b* a\bas\bsy\byn\bnc\bc_\b_m\bmo\bov\bve\be_\b_s\bst\bto\bor\bra\bag\bge\be(\b()\b) *\b**\b**\b**\b**\b*\n+virtual void a\bas\bsy\byn\bnc\bc_\b_m\bmo\bov\bve\be_\b_s\bst\bto\bor\bra\bag\bge\be (storage_index_t storage, std::string p,\n+move_flags_t flags\n+ , std::function\n+handler) = 0;\n+called to request the files for the specified storage/torrent be moved to a new\n+location. It is the disk I/O object's responsibility to synchronize this with\n+any currently outstanding disk operations to the storage. Whether files are\n+replaced at the destination path or not is controlled by flags (see\n+_\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* 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-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 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-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+*\b**\b**\b**\b**\b* a\bas\bsy\byn\bnc\bc_\b_r\bre\bel\ble\bea\bas\bse\be_\b_f\bfi\bil\ble\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n+virtual void a\bas\bsy\byn\bnc\bc_\b_r\bre\bel\ble\bea\bas\bse\be_\b_f\bfi\bil\ble\bes\bs (storage_index_t storage\n+ , std::function handler = std::function()) = 0;\n+This is called on disk I/O objects to request they close all open files for the\n+specified storage/torrent. If file handles are not pooled/cached, it can be a\n+no-op. For truly asynchronous disk I/O, this should provide at least one point\n+in time when all files are closed. It is possible that later asynchronous\n+operations will re-open some of the files, by the time this completion handler\n+is called, that's fine.\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 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-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-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-unless the alert_when_available flag is set, in which case it will have the\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+*\b**\b**\b**\b**\b* a\bas\bsy\byn\bnc\bc_\b_c\bch\bhe\bec\bck\bk_\b_f\bfi\bil\ble\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n+virtual void a\bas\bsy\byn\bnc\bc_\b_c\bch\bhe\bec\bck\bk_\b_f\bfi\bil\ble\bes\bs (storage_index_t storage\n+ , add_torrent_params const* resume_data\n+ , aux::vector links\n+ , std::function handler) = 0;\n+this is called when torrents are added to validate their resume data against\n+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 torrent. The\n+string being a path to an existing identical file. The default behavior is to\n+create hard links of those files into the storage of the new torrent (specified\n+by storage). An empty string indicates that there is no known identical file.\n+This is part 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 files/pieces\n+are expected to be on disk already. This should be verified. Not just the\n+existence of the file, but also that it has the correct size.\n+Any file with a piece set in the resume_data->have_pieces bitmask should exist\n+on disk, this should be verified. Pad files and files with zero priority may be\n+skipped.\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\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-number of blocks in a piece.\n-The flags parameter can be used to specify the granularity of the file\n-progress. If left at the default value of 0, the progress will be as accurate\n-as possible, but also more expensive to calculate. If torrent_handle::\n-piece_granularity is specified, the progress will be specified in piece\n-granularity. i.e. only pieces that have been fully downloaded and passed the\n-hash check count. When specifying piece granularity, the operation is a lot\n-cheaper, since libtorrent already keeps track of this internally and no\n-calculation is required.\n+*\b**\b**\b**\b**\b* a\bas\bsy\byn\bnc\bc_\b_s\bst\bto\bop\bp_\b_t\bto\bor\brr\bre\ben\bnt\bt(\b()\b) *\b**\b**\b**\b**\b*\n+virtual void a\bas\bsy\byn\bnc\bc_\b_s\bst\bto\bop\bp_\b_t\bto\bor\brr\bre\ben\bnt\bt (storage_index_t storage\n+ , std::function handler = std::function()) = 0;\n+This is called when a torrent is stopped. It gives the disk I/O object an\n+opportunity to flush any data to disk that's currently kept cached. This\n+function should at least do the same thing as _\ba_\bs_\by_\bn_\bc_\b__\br_\be_\bl_\be_\ba_\bs_\be_\b__\bf_\bi_\bl_\be_\bs_\b(_\b).\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_s\bst\bta\bat\btu\bus\bs(\b()\b) *\b**\b**\b**\b**\b*\n-std::vector f\bfi\bil\ble\be_\b_s\bst\bta\bat\btu\bus\bs () const;\n-This function returns a vector with status about files that are open for this\n-torrent. Any file that is not open will not be reported in the vector, i.e.\n-it's possible that the vector is empty when returning, if none of the files in\n-the torrent are currently open.\n-See _\bo_\bp_\be_\bn_\b__\bf_\bi_\bl_\be_\b__\bs_\bt_\ba_\bt_\be\n+*\b**\b**\b**\b**\b* a\bas\bsy\byn\bnc\bc_\b_r\bre\ben\bna\bam\bme\be_\b_f\bfi\bil\ble\be(\b()\b) *\b**\b**\b**\b**\b*\n+virtual void a\bas\bsy\byn\bnc\bc_\b_r\bre\ben\bna\bam\bme\be_\b_f\bfi\bil\ble\be (storage_index_t storage\n+ , file_index_t index, std::string name\n+ , std::function handler) = 0;\n+This function is called when the name of a file in the specified storage has\n+been requested to be renamed. The disk I/O object is responsible for renaming\n+the file without racing with other potentially outstanding operations against\n+the file (such as read, write, move, etc.).\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+*\b**\b**\b**\b**\b* a\bas\bsy\byn\bnc\bc_\b_d\bde\bel\ble\bet\bte\be_\b_f\bfi\bil\ble\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n+virtual void a\bas\bsy\byn\bnc\bc_\b_d\bde\bel\ble\bet\bte\be_\b_f\bfi\bil\ble\bes\bs (storage_index_t storage, remove_flags_t\n+options\n+ , std::function handler) = 0;\n+This function is called when some file(s) on disk have been requested to be\n+removed by the client. storage indicates which torrent is referred to. See\n+_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bh_\ba_\bn_\bd_\bl_\be for remove_flags_t flags indicating which files are to be\n+removed. e.g. _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bh_\ba_\bn_\bd_\bl_\be_\b:_\b:_\bd_\be_\bl_\be_\bt_\be_\b__\bf_\bi_\bl_\be_\bs - delete all files _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bh_\ba_\bn_\bd_\bl_\be_\b:_\b:\n+_\bd_\be_\bl_\be_\bt_\be_\b__\bp_\ba_\br_\bt_\bf_\bi_\bl_\be - only delete part file.\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) 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) r\bre\bep\bpl\bla\bac\bce\be_\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 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-void p\bpo\bos\bst\bt_\b_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-post_trackers() is the asynchronous version of trackers(). It will trigger a\n-_\bt_\br_\ba_\bc_\bk_\be_\br_\b__\bl_\bi_\bs_\bt_\b__\ba_\bl_\be_\br_\bt to be posted.\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+*\b**\b**\b**\b**\b* a\bas\bsy\byn\bnc\bc_\b_s\bse\bet\bt_\b_f\bfi\bil\ble\be_\b_p\bpr\bri\bio\bor\bri\bit\bty\by(\b()\b) *\b**\b**\b**\b**\b*\n+virtual void a\bas\bsy\byn\bnc\bc_\b_s\bse\bet\bt_\b_f\bfi\bil\ble\be_\b_p\bpr\bri\bio\bor\bri\bit\bty\by (storage_index_t storage\n+ , aux::vector prio\n+ , std::function)> handler) = 0;\n+This is called to set the priority of some or all files. Changing the priority\n+from or to 0 may involve moving data to and from the partfile. The disk I/\n+O object is responsible for correctly synchronizing this work to not race with\n+any potentially outstanding asynchronous operations affecting these files.\n+prio is a vector of the file priority for all files. If it's shorter than the\n+total number of files in the torrent, they are assumed to be set to the default\n+priority.\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-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_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+*\b**\b**\b**\b**\b* a\bas\bsy\byn\bnc\bc_\b_c\bcl\ble\bea\bar\br_\b_p\bpi\bie\bec\bce\be(\b()\b) *\b**\b**\b**\b**\b*\n+virtual void a\bas\bsy\byn\bnc\bc_\b_c\bcl\ble\bea\bar\br_\b_p\bpi\bie\bec\bce\be (storage_index_t storage, piece_index_t index\n+ , std::function handler) = 0;\n+This is called when a piece fails the hash check, to ensure there are no\n+outstanding disk operations to the piece before blocks are re-requested from\n+peers to overwrite the existing blocks. The disk I/O object does not need to\n+perform any action other than synchronize with all outstanding disk operations\n+to the specified piece before posting the result back.\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) r\bre\bem\bmo\bov\bve\be_\b_h\bht\btt\btp\bp_\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 (std::string const& url) const;\n-std::set h\bht\btt\btp\bp_\b_s\bse\bee\bed\bds\bs () 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-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+*\b**\b**\b**\b**\b* u\bup\bpd\bda\bat\bte\be_\b_s\bst\bta\bat\bts\bs_\b_c\bco\bou\bun\bnt\bte\ber\brs\bs(\b()\b) *\b**\b**\b**\b**\b*\n+virtual void u\bup\bpd\bda\bat\bte\be_\b_s\bst\bta\bat\bts\bs_\b_c\bco\bou\bun\bnt\bte\ber\brs\bs (counters& c) const = 0;\n+_\bu_\bp_\bd_\ba_\bt_\be_\b__\bs_\bt_\ba_\bt_\bs_\b__\bc_\bo_\bu_\bn_\bt_\be_\br_\bs_\b(_\b) is called to give the disk storage an opportunity to\n+update gauges in the c stats _\bc_\bo_\bu_\bn_\bt_\be_\br_\bs, that aren't updated continuously as\n+operations are performed. This is called before a snapshot of the _\bc_\bo_\bu_\bn_\bt_\be_\br_\bs are\n+passed to the client.\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-client_data_t)> const& ext\n- , client_data_t userdata = client_data_t{});\n-add the specified extension to this torrent. The ext argument is a function\n-that will be called from within libtorrent's context passing in the internal\n-torrent object and the specified userdata pointer. The function is expected to\n-return a shared pointer to a _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\bl_\bu_\bg_\bi_\bn instance.\n+*\b**\b**\b**\b**\b* g\bge\bet\bt_\b_s\bst\bta\bat\btu\bus\bs(\b()\b) *\b**\b**\b**\b**\b*\n+virtual std::vector g\bge\bet\bt_\b_s\bst\bta\bat\btu\bus\bs (storage_index_t) const = 0;\n+Return a list of all the files that are currently open for the specified\n+storage/torrent. This is is just used for the client to query the currently\n+open files, and which modes those files are open in.\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\bme\bet\bta\bad\bda\bat\bta\ba(\b()\b) *\b**\b**\b**\b**\b*\n-bool s\bse\bet\bt_\b_m\bme\bet\bta\bad\bda\bat\bta\ba (span metadata) const;\n-set_metadata expects the i\bin\bnf\bfo\bo section of metadata. i.e. The buffer passed in\n-will be hashed and verified against the info-hash. If it fails, a\n-metadata_failed_alert will be generated. If it passes, a\n-metadata_received_alert is generated. The function returns true if the metadata\n-is successfully set on the torrent, and false otherwise. If the torrent already\n-has metadata, this function will not affect the torrent, and false will be\n-returned.\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 (bool wait) = 0;\n+this is called when the _\bs_\be_\bs_\bs_\bi_\bo_\bn is starting to shut down. The disk I/O object\n+is expected to flush any outstanding write jobs, cancel hash jobs and initiate\n+tearing down of any internal threads. If wait is true, this should be\n+asynchronous. i.e. this call should not return until all threads have stopped\n+and all jobs have either been aborted or completed and the disk I/O object is\n+ready to be destructed.\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 torrent and false if it hasn't\n-been initialized or if the torrent it refers to has been removed from the\n-_\bs_\be_\bs_\bs_\bi_\bo_\bn AND destructed.\n-To tell if the _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be is in the _\bs_\be_\bs_\bs_\bi_\bo_\bn, use _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be_\b:_\b:_\bi_\bn_\b__\bs_\be_\bs_\bs_\bi_\bo_\bn\n-_\b(_\b). This will return true before _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bh_\ba_\bn_\bd_\bl_\be_\b:_\b:_\br_\be_\bm_\bo_\bv_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b) is called,\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+*\b**\b**\b**\b**\b* s\bsu\bub\bbm\bmi\bit\bt_\b_j\bjo\bob\bbs\bs(\b()\b) *\b**\b**\b**\b**\b*\n+virtual void s\bsu\bub\bbm\bmi\bit\bt_\b_j\bjo\bob\bbs\bs () = 0;\n+This will be called after a batch of disk jobs has been issues (via the async_*\n+). It gives the disk I/O object an opportunity to notify any potential\n+condition variables to wake up the disk thread(s). The async_* calls can of\n+course also notify condition variables, but doing it in this call allows for\n+batching jobs, by issuing the notification once for a collection of jobs.\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-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+*\b**\b**\b**\b**\b* s\bse\bet\btt\bti\bin\bng\bgs\bs_\b_u\bup\bpd\bda\bat\bte\bed\bd(\b()\b) *\b**\b**\b**\b**\b*\n+virtual void s\bse\bet\btt\bti\bin\bng\bgs\bs_\b_u\bup\bpd\bda\bat\bte\bed\bd () = 0;\n+This is called to notify the disk I/O object that the settings have been\n+updated. In the disk io constructor, a _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be reference is passed\n+in. Whenever these settings are updated, this function is called to allow the\n+disk I/O object to react to any changed settings relevant to its operations.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\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-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) 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-added, and it can only be set as part of the _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs flags, when\n-adding the torrent.\n+ force_copy\n+ force making a copy of the cached block, rather than getting a reference\n+ to a block already in the cache. This is used the block is expected to be\n+ overwritten very soon, by async_write()`, and we need access to the\n+ previous content.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* f\bfl\blu\bus\bsh\bh_\b_c\bca\bac\bch\bhe\be(\b()\b) *\b**\b**\b**\b**\b*\n-void f\bfl\blu\bus\bsh\bh_\b_c\bca\bac\bch\bhe\be () const;\n-Instructs libtorrent to flush all the disk caches for this torrent and close\n-all file handles. This is done asynchronously and you will be notified that\n-it's complete through _\bc_\ba_\bc_\bh_\be_\b__\bf_\bl_\bu_\bs_\bh_\be_\bd_\b__\ba_\bl_\be_\br_\bt.\n-Note that by the time you get the _\ba_\bl_\be_\br_\bt, libtorrent may have cached more data\n-for the torrent, but you are guaranteed that whatever cached data libtorrent\n-had by the time you called torrent_handle::flush_cache() has been written to\n-disk.\n+ sequential_access\n+ hint that there may be more disk operations with sequential access to the\n+ file\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\bec\bch\bhe\bec\bck\bk(\b()\b) *\b**\b**\b**\b**\b*\n-void f\bfo\bor\brc\bce\be_\b_r\bre\bec\bch\bhe\bec\bck\bk () const;\n-force_recheck puts the torrent back in a state where it assumes to have no\n-resume data. All peers will be disconnected and the torrent will stop\n-announcing to the tracker. The torrent will be added to the checking queue, and\n-will be checked (all the files will be read and compared to the piece hashes).\n-Once the check is complete, the torrent will start connecting to peers again,\n-as normal. The torrent will be placed last in queue, i.e. its queue position\n-will be the highest of all torrents in the _\bs_\be_\bs_\bs_\bi_\bo_\bn.\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 wasteful.\n [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\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-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-save_resume_data() asks libtorrent to generate fast-resume data for this\n-torrent. The fast resume data (stored in an _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs object) can be\n-used to resume a torrent in the next _\bs_\be_\bs_\bs_\bi_\bo_\bn without having to check all files\n-for which pieces have been downloaded. It can also be used to save a .torrent\n-file for a _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be.\n-This operation is asynchronous, save_resume_data will return immediately. The\n-resume data is delivered when it's done through a _\bs_\ba_\bv_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b__\ba_\bl_\be_\br_\bt.\n-The operation will fail, and post a _\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 instead, in\n-the following cases:\n- 1. The torrent is in the process of being removed.\n- 2. No torrent state has changed since the last saving of resume\n- data, and the only_if_modified flag is set. metadata (see\n- libtorrent's _\bm_\be_\bt_\ba_\bd_\ba_\bt_\ba_\b _\bf_\br_\bo_\bm_\b _\bp_\be_\be_\br_\bs extension)\n-Note that some _\bc_\bo_\bu_\bn_\bt_\be_\br_\bs may be outdated by the time you receive the fast resume\n-data\n-When saving resume data because of shutting down, make sure not to\n-_\br_\be_\bm_\bo_\bv_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b) before you receive the _\bs_\ba_\bv_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b__\ba_\bl_\be_\br_\bt. There's no need\n-to pause the _\bs_\be_\bs_\bs_\bi_\bo_\bn or torrent when saving resume data.\n-The paused state of a torrent is saved in the resume data, so pausing all\n-torrents before saving resume data will all torrents be restored in a paused\n-state.\n-Note\n-It is typically a good idea to save resume data whenever a torrent is completed\n-or paused. If you save resume data for torrents when they are paused, you can\n-accelerate the shutdown process by not saving resume data again for those\n-torrents. Completed torrents should have their resume data saved when they\n-complete and on exit, since their statistics might be updated.\n-Example code to pause and save resume data for all torrents and wait for the\n-alerts:\n-extern int outstanding_resume_data; // global counter of outstanding resume\n-data\n-std::vector handles = ses.get_torrents();\n-for (torrent_handle const& h : handles) try\n+ v1_hash\n+ compute a v1 piece hash. This is only used by the _\ba_\bs_\by_\bn_\bc_\b__\bh_\ba_\bs_\bh_\b(_\b) call. If\n+ this flag is not set in the _\ba_\bs_\by_\bn_\bc_\b__\bh_\ba_\bs_\bh_\b(_\b) call, the SHA-1 piece hash does\n+ not need to be computed.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ flush_piece\n+ this flag instructs a hash job that we just completed this piece, and it\n+ should be flushed to disk\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_h\bho\bol\bld\bde\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__\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be_\b._\bh_\bp_\bp\"\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- h.save_resume_data(torrent_handle::only_if_modified);\n- ++outstanding_resume_data;\n-}\n-catch (lt::system_error const& e)\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+ 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+ 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* 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- // the handle was invalid, ignore this one and move to the next\n-}\n-\n-while (outstanding_resume_data > 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_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_s\bst\btr\br (int name, std::string val) = 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* f\bfi\bil\ble\be_\b_o\bop\bpe\ben\bn_\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/_\bd_\bi_\bs_\bk_\b__\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be_\b._\bh_\bp_\bp\"\n+ read_only\n+ open the file for reading only\n+ write_only\n+ open the file for writing only\n+ read_write\n+ open the file for reading and writing\n+ rw_mask\n+ the mask for the bits determining read or write mode\n+ sparse\n+ open the file in sparse mode (if supported by the filesystem).\n+ no_atime\n+ don't update the access timestamps on the file (if supported by the\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* 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- alert const* a = ses.wait_for_alert(seconds(30));\n-\n- // if we don't get an alert within 30 seconds, abort\n- if (a == nullptr) break;\n-\n- std::vector alerts;\n- ses.pop_alerts(&alerts);\n-\n- for (alert* i : alerts)\n- {\n- if (alert_cast(i))\n- {\n- process_alert(i);\n- --outstanding_resume_data;\n- continue;\n- }\n+ bool o\bop\bpe\ber\bra\bat\bto\bor\br=\b==\b= (torrent_status const& st) const;\n \n- save_resume_data_alert const* rd =\n-alert_cast(i);\n- if (rd == nullptr)\n- {\n- process_alert(i);\n- continue;\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- std::ofstream out((rd->params.save_path\n- + \"/\" + rd->params.name + \".fastresume\").c_str()\n- , std::ios_base::binary);\n- std::vector buf = write_resume_data_buf(rd->params);\n- out.write(buf.data(), buf.size());\n- --outstanding_resume_data;\n- }\n-}\n-Note\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+ 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* 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 (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+*\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* 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_u\bup\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_t\bto\bop\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-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_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_t\bto\bop\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-queue_position() returns the torrent's position in the download queue. The\n-torrents with the smallest numbers are the ones that are being downloaded. The\n-smaller number, the closer the torrent is to the front of the line to be\n-started.\n-The queue position is also available in the _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bs_\bt_\ba_\bt_\bu_\bs.\n-The queue_position_*() functions adjust the torrents position in the queue. Up\n-means closer to the front and down means closer to the back of the queue. Top\n-and bottom refers to the front and the back of the queue respectively.\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-*\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+ 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-*\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-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-For SSL torrents, use this to specify a path to a .pem file to use as this\n-client's certificate. The certificate must be signed by the certificate in the\n-.torrent file to be valid.\n-The _\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) overload takes the actual certificate, private\n-key and DH params as strings, rather than paths to files.\n-cert is a path to the (signed) certificate in .pem format corresponding to this\n-torrent.\n-private_key is a path to the private key for the specified certificate. This\n-must be in .pem format.\n-dh_params is a path to the Diffie-Hellman parameter file, which needs to be in\n-.pem format. You can generate this file using the openssl command like this:\n-openssl dhparam -outform PEM -out dhparams.pem 512.\n-passphrase may be specified if the private key is encrypted and requires a\n-passphrase to be decrypted.\n-Note that when a torrent first starts up, and it needs a certificate, it will\n-suspend connecting to any peers until it has one. It's typically desirable to\n-resume the torrent after setting the SSL certificate.\n-If you receive a _\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+ 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-*\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-_\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-dht nodes and trackers. A _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo object does not round-trip cleanly when\n-added to a _\bs_\be_\bs_\bs_\bi_\bo_\bn.\n-If you want to save a .torrent file from the _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be, instead call\n-_\bs_\ba_\bv_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b) and _\bw_\br_\bi_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bi_\bl_\be_\b(_\b) the _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs object\n-passed back in the _\ba_\bl_\be_\br_\bt.\n-_\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) returns a c\bco\bop\bpy\by of the internal _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo and\n-piece layer hashes (if it's a v2 torrent). The piece layers will only be\n-included if they are available. If this torrent was added from a .torrent file\n-with piece layers or if it's seeding, the piece layers are available. This\n-function is more expensive than _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bi_\bl_\be_\b(_\b) since it needs to make copies of\n-this information.\n-The _\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) is here for backwards compatibility when\n-constructing a _\bc_\br_\be_\ba_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt object from a _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo that's in a _\bs_\be_\bs_\bs_\bi_\bo_\bn.\n-Prefer _\bs_\ba_\bv_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b) + _\bw_\br_\bi_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bi_\bl_\be_\b(_\b).\n-Note that a torrent added from a magnet link may not have the full merkle trees\n-for all files, and hence not have the complete piece layers. In that state, you\n-cannot create a .torrent file even from the _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo returned from\n-_\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). Once the torrent completes downloading all files,\n-becoming a seed, you can make a .torrent file from it.\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-*\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+ 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-*\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-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+ 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-*\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-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-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-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-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-and so on.\n-The default priority of pieces is 4.\n-Piece priorities can not be changed for torrents that have not downloaded the\n-metadata yet. Magnet links won't have metadata immediately. see the\n-_\bm_\be_\bt_\ba_\bd_\ba_\bt_\ba_\b__\br_\be_\bc_\be_\bi_\bv_\be_\bd_\b__\ba_\bl_\be_\br_\bt.\n-piece_priority sets or gets the priority for an individual piece, specified by\n-index.\n-prioritize_pieces takes a vector of integers, one integer per piece in the\n-torrent. All the piece priorities will be updated with the priorities in the\n-vector. The second overload of prioritize_pieces that takes a vector of pairs\n-will update the priorities of only select pieces, and leave all other\n-unaffected. Each pair is (piece, priority). That is, the first item is the\n-piece index and the second item is the priority of that piece. Invalid entries,\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+ 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-*\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-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-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-The priority values are the same as for _\bp_\bi_\be_\bc_\be_\b__\bp_\br_\bi_\bo_\br_\bi_\bt_\by_\b(_\b). See\n-_\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\b__\bp_\br_\bi_\bo_\br_\bi_\bt_\by_\b__\bt.\n-Whenever a file priority is changed, all other piece priorities are reset to\n-match the file priorities. In order to maintain special priorities for\n-particular pieces, _\bp_\bi_\be_\bc_\be_\b__\bp_\br_\bi_\bo_\br_\bi_\bt_\by_\b(_\b) has to be called again for those pieces.\n-You cannot set the file priorities on a torrent that does not yet have metadata\n-or a torrent that is a seed. file_priority(int, int) and _\bp_\br_\bi_\bo_\br_\bi_\bt_\bi_\bz_\be_\b__\bf_\bi_\bl_\be_\bs_\b(_\b) are\n-both no-ops for such torrents.\n-Since changing file priorities may involve disk operations (of moving files in-\n-and out of the part file), the internal accounting of file priorities happen\n-asynchronously. i.e. setting file priorities and then immediately querying them\n-may not yield the same priorities just set. To synchronize with the priorities\n-taking effect, wait for the _\bf_\bi_\bl_\be_\b__\bp_\br_\bi_\bo_\b__\ba_\bl_\be_\br_\bt.\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+ 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-*\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_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-1 (which is the default), all trackers are re-announce.\n-The flags argument can be used to affect the re-announce. See\n-ignore_min_interval.\n-force_dht_announce will announce the torrent to the DHT immediately.\n-force_lsd_announce will announce the torrent on LSD immediately.\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-*\b**\b**\b**\b**\b* s\bsc\bcr\bra\bap\bpe\be_\b_t\btr\bra\bac\bck\bke\ber\br(\b()\b) *\b**\b**\b**\b**\b*\n-void s\bsc\bcr\bra\bap\bpe\be_\b_t\btr\bra\bac\bck\bke\ber\br (int idx = -1) const;\n-scrape_tracker() will send a scrape request to a tracker. By default (idx = -1)\n-it will scrape the last working tracker. If idx is >= 0, the tracker with the\n-specified index will scraped.\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+ 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-*\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-int d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_l\bli\bim\bmi\bit\bt () 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-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-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-upload_limit and download_limit will return the current limit setting, for\n-upload and download, respectively.\n-Local peers are not rate limited by default. see _\bp_\be_\be_\br_\b _\bc_\bl_\ba_\bs_\bs_\be_\bs.\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-*\b**\b**\b**\b**\b* c\bco\bon\bnn\bne\bec\bct\bt_\b_p\bpe\bee\ber\br(\b()\b) *\b**\b**\b**\b**\b*\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-connect_peer() is a way to manually connect to peers that one believe is a part\n-of the torrent. If the peer does not respond, or is not a member of this\n-torrent, it will simply be disconnected. No harm can be done by using this\n-other than an unnecessary connection attempt is made. If the torrent is\n-uninitialized or in queued or checking mode, this will throw system_error. The\n-second (optional) argument will be bitwise ORed into the source mask of this\n-peer. Typically this is one of the source flags in _\bp_\be_\be_\br_\b__\bi_\bn_\bf_\bo. i.e. tracker,\n-pex, dht etc.\n-For possible values of flags, see _\bp_\be_\bx_\b__\bf_\bl_\ba_\bg_\bs_\b__\bt.\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-*\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+ 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-*\b**\b**\b**\b**\b* m\bma\bax\bx_\b_u\bup\bpl\blo\boa\bad\bds\bs(\b()\b) s\bse\bet\bt_\b_m\bma\bax\bx_\b_u\bup\bpl\blo\boa\bad\bds\bs(\b()\b) *\b**\b**\b**\b**\b*\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+ 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-*\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-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+ 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-*\b**\b**\b**\b**\b* m\bmo\bov\bve\be_\b_s\bst\bto\bor\bra\bag\bge\be(\b()\b) *\b**\b**\b**\b**\b*\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-Moves the file(s) that this torrent are currently seeding from or downloading\n-to. If the given save_path is not located on the same drive as the original\n-save path, the files will be copied to the new drive and removed from their\n-original location. This will block all other disk IO, and other torrents\n-download and upload rates may drop while copying the file.\n-Since disk IO is performed in a separate thread, this operation is also\n-asynchronous. Once the operation completes, the storage_moved_alert is\n-generated, with the new path as the message. If the move fails for some reason,\n-storage_moved_failed_alert is generated instead, containing the error message.\n-The flags argument determines the behavior of the copying/moving of the files\n-in the torrent. see _\bm_\bo_\bv_\be_\b__\bf_\bl_\ba_\bg_\bs_\b__\bt.\n-always_replace_files is the default and replaces any file that exist in both\n-the source directory and the target directory.\n-fail_if_exist first check to see that none of the copy operations would cause\n-an overwrite. If it would, it will fail. Otherwise it will proceed as if it was\n-in always_replace_files mode. Note that there is an inherent race condition\n-here. If the files in the target directory appear after the check but before\n-the copy or move completes, they will be overwritten. When failing because of\n-files already existing in the target path, the error of\n-move_storage_failed_alert is set to boost::system::errc::file_exists.\n-The intention is that a client may use this as a probe, and if it fails, ask\n-the user which mode to use. The client may then re-issue the move_storage call\n-with one of the other modes.\n-dont_replace always keeps the existing file in the target directory, if there\n-is one. The source files will still be removed in that case. Note that it won't\n-automatically re-check files. If an incomplete torrent is moved into a\n-directory with the complete files, pause, move, force-recheck and resume.\n-Without the re-checking, the torrent will keep downloading and files in the new\n-download directory will be overwritten.\n-Files that have been renamed to have absolute paths are not moved by this\n-function. Keep in mind that files that don't belong to the torrent but are\n-stored in the torrent's directory may be moved as well. This goes for files\n-that have been renamed to absolute paths that still end up inside the save\n-path.\n-When copying files, sparse regions are not likely to be preserved. This makes\n-it proportionally more expensive to move a large torrent when only few pieces\n-have been downloaded, since the files are then allocated with zeros in the\n-destination directory.\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-*\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+ 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-*\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+ 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-*\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< (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+ 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-*\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+ 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-*\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 and the _\ba_\bl_\be_\br_\bt dispatch\n-function. This type does not have a stable ABI and should be relied on as\n-little as possible. Accessing the handle returned by this function is not\n-thread safe outside of libtorrent's internal thread (which is used to invoke\n-_\bp_\bl_\bu_\bg_\bi_\bn callbacks). The torrent class is not only eligible for changing ABI\n-across minor versions of libtorrent, its layout is also dependent on build\n-configuration. This adds additional requirements on a client to be built with\n-the exact same build configuration as libtorrent itself. i.e. the TORRENT_\n-macros must match between libtorrent and the client builds.\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-*\b**\b**\b**\b**\b* u\bus\bse\ber\brd\bda\bat\bta\ba(\b()\b) *\b**\b**\b**\b**\b*\n-client_data_t u\bus\bse\ber\brd\bda\bat\bta\ba () const;\n-returns the userdata pointer as set in _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs\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-*\b**\b**\b**\b**\b* i\bin\bn_\b_s\bse\bes\bss\bsi\bio\bon\bn(\b()\b) *\b**\b**\b**\b**\b*\n-bool i\bin\bn_\b_s\bse\bes\bss\bsi\bio\bon\bn () const;\n-Returns true if the torrent is in the _\bs_\be_\bs_\bs_\bi_\bo_\bn. It returns true before session::\n-remove_torrent() is called, and false afterward.\n-Note that this is a blocking function, unlike _\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) which\n-returns immediately.\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- overwrite_existing\n- instruct libtorrent to overwrite any data that may already have been\n- downloaded with the data of the new piece being added. Using this flag\n- when adding a piece that is actively being downloaded from other peers\n- may have some unexpected consequences, as blocks currently being\n- downloaded from peers may not be replaced.\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- query_distributed_copies\n- calculates distributed_copies, distributed_full_copies and\n- distributed_fraction.\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- query_accurate_download_counters\n- includes partial downloaded blocks in total_done and total_wanted_done.\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- query_last_seen_complete\n- includes last_seen_complete.\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- query_pieces\n- populate the pieces field in _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bs_\bt_\ba_\bt_\bu_\bs.\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- query_verified_pieces\n- includes verified_pieces (only applies to torrents in s\bse\bee\bed\bd m\bmo\bod\bde\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- query_torrent_file\n- includes torrent_file, which is all the static information from the\n- .torrent file.\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- query_name\n- includes name, the name of the torrent. This is either derived from the\n- .torrent file, or from the &dn= magnet link argument or possibly some\n- other source. If the name of the torrent is not known, this is an empty\n- string.\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- query_save_path\n- includes save_path, the path to the directory the files of the torrent\n- are saved to.\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- alert_when_available\n- used to ask libtorrent to send an _\ba_\bl_\be_\br_\bt once the piece has been\n- downloaded, by passing alert_when_available. When set, the\n- _\br_\be_\ba_\bd_\b__\bp_\bi_\be_\bc_\be_\b__\ba_\bl_\be_\br_\bt _\ba_\bl_\be_\br_\bt will be delivered, with the piece data, when it's\n- downloaded.\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- piece_granularity\n- only calculate file progress at piece granularity. This makes the\n- _\bf_\bi_\bl_\be_\b__\bp_\br_\bo_\bg_\br_\be_\bs_\bs_\b(_\b) call cheaper and also only takes bytes that have passed\n- the hash check into account, so progress cannot regress in this mode.\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- graceful_pause\n- will delay the disconnect of peers that we're still downloading\n- outstanding requests from. The torrent will not accept any more requests\n- and will disconnect all idle peers. As soon as a peer is done\n- transferring the blocks that were requested from it, it is disconnected.\n- This is a graceful shut down of the torrent in the sense that no\n- downloaded bytes are wasted.\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- flush_disk_cache\n- the disk cache will be flushed before creating the resume data. This\n- avoids a problem with file timestamps in the resume data in case the\n- cache hasn't been flushed yet.\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- save_info_dict\n- the resume data will contain the metadata from the torrent file as well.\n- This is useful for clients that don't keep .torrent files around\n- separately, or for torrents that were added via a magnet link.\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- only_if_modified\n- this flag has the same behavior as the combination of:\n- if_counters_changed | if_download_progress | if_config_changed |\n- if_state_changed | if_metadata_changed\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- if_counters_changed\n- save resume data if any _\bc_\bo_\bu_\bn_\bt_\be_\br_\bs has changed since the last time resume\n- data was saved. This includes upload/download _\bc_\bo_\bu_\bn_\bt_\be_\br_\bs, active time\n- _\bc_\bo_\bu_\bn_\bt_\be_\br_\bs and scrape data. A torrent that is not paused will have its\n- active time _\bc_\bo_\bu_\bn_\bt_\be_\br_\bs incremented continuously.\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- if_download_progress\n- save the resume data if any blocks have been downloaded since the last\n- time resume data was saved. This includes: * checking existing files on\n- disk * downloading a block from a peer\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- if_config_changed\n- save the resume data if configuration options changed since last time the\n- resume data was saved. This includes: * file- or piece priorities *\n- upload- and download rate limits * change max-uploads (unchoke slots) *\n- change max connection limit * enable/disable peer-exchange, local service\n- discovery or DHT * enable/disable apply IP-filter * enable/disable auto-\n- managed * enable/disable share-mode * enable/disable sequential-mode *\n- files renamed * storage moved (save_path changed)\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- if_state_changed\n- save the resume data if torrent state has changed since last time the\n- resume data was saved. This includes: * upload mode * paused state *\n- super-seeding * seed-mode\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- if_metadata_changed\n- save the resume data if any m\bme\bet\bta\bad\bda\bat\bta\ba changed since the last time resume\n- data was saved. This includes: * add/remove web seeds * add/remove\n- trackers * receiving metadata for a magnet link\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- ignore_min_interval\n- by default, force-reannounce will still honor the min-interval published\n- by the tracker. If this flag is set, it will be ignored and the tracker\n- is announced immediately.\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-*\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+ 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-*\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+ 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- 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+ 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- 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+ 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- label\n- not used by libtorrent. It's intended as a potentially user-facing\n- identifier of this peer class.\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- 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+ 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- 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+ 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-*\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+ 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* 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- 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 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+ 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- 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+ 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* 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+*\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* 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+*\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-*\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+ 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-*\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+ 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* 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- 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 (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+ 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 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-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_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+*\b**\b**\b**\b**\b* h\bha\bas\bs_\b_v\bv2\b2(\b()\b) h\bha\bas\bs(\b()\b) h\bha\bas\bs_\b_v\bv1\b1(\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@@ -4463,56 +5505,14 @@\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@@ -4881,41 +5881,37 @@\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* 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_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_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_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-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-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+*\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* 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\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 (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@@ -4930,48 +5926,58 @@\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);\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* 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* 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+*\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_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_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_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, 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 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* 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-|_\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+|_\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@@ -4983,28 +5989,14 @@\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 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\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@@ -5012,23 +6004,68 @@\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* 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* 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@@ -5197,867 +6234,1008 @@\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+*\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-*\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+ 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-*\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+ 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-*\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+ 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-*\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- 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 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- 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- 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- 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- 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_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_g\bge\bet\bt_\b_p\bpe\bee\ber\brs\bs (sha1_hash const& info_hash);\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::shared_ptr ext);\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 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- 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- unsigned short 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- 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- 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_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- 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 p\bpo\bop\bp_\b_a\bal\ble\ber\brt\bts\bs (std::vector* alerts);\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 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 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+ 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-*\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+ 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-*\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-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 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-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+ 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-*\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+ 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-*\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+ 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-*\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+ 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-*\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+ 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-*\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-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-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+ 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-*\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-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-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-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+ 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-*\b**\b**\b**\b**\b* r\bre\bes\bsu\bum\bme\be(\b()\b) i\bis\bs_\b_p\bpa\bau\bus\bse\bed\bd(\b()\b) p\bpa\bau\bus\bse\be(\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+ 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-*\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+ 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-*\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+ 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-*\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+ 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-*\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+ 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-*\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+ 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-*\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+ 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-*\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+ 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-*\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_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_g\bge\bet\bt_\b_p\bpe\bee\ber\brs\bs (sha1_hash const& info_hash);\n-dht_get_peers() will issue a DHT get_peer request to the DHT for the specified\n-info-hash. The response (the peers) will be posted back in a\n-_\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+ 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-*\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+ 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-*\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+ 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-*\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+ 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-*\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::shared_ptr ext);\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-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+ 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-*\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-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+ 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-*\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+ 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-*\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-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-unsigned short 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+ merkle_trees\n+ v2 hashes, if known\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-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+ 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-*\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-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-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-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+ 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-*\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+ 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-*\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+ 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* 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-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+*\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+ operator void c\bco\bon\bns\bst\bt*\b* () const = delete;\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+\n+ template ::value>::type>\n+};\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+*\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* 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-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-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+*\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+operator void c\bco\bon\bns\bst\bt*\b* () const = delete;\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+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* p\bpo\bop\bp_\b_a\bal\ble\ber\brt\bts\bs(\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) *\b**\b**\b**\b**\b*\n-void p\bpo\bop\bp_\b_a\bal\ble\ber\brt\bts\bs (std::vector* alerts);\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-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+*\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 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 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_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-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+*\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 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* 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+*\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* 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+*\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- save_settings\n- saves settings (i.e. the _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bp_\ba_\bc_\bk)\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- 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+*\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- save_extension_state\n- load or save state from plugins\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- save_ip_filter\n- load or save the IP filter set on the _\bs_\be_\bs_\bs_\bi_\bo_\bn\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- global_peer_class_id tcp_peer_class_id local_peer_class_id\n- built-in peer classes\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- delete_files\n- delete the files belonging to the torrent from disk. including the part-\n- file, if there is one\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- delete_partfile\n- delete just the part-file associated with this torrent\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- 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+*\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+ 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- 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+*\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- 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+*\b**\b**\b**\b**\b* f\bfi\bil\ble\be(\b()\b) *\b**\b**\b**\b**\b*\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-*\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- 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 ();\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 (session_proxy const&);\n- s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by (session_proxy&&) noexcept;\n-};\n+ ec\n+ the error that occurred\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-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 ();\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 (session_proxy const&);\n-s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpr\bro\box\bxy\by (session_proxy&&) noexcept;\n-default constructor, does not refer to any _\bs_\be_\bs_\bs_\bi_\bo_\bn implementation object.\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* 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- explicit s\bse\bes\bss\bsi\bio\bon\bn (session_params const& params);\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 (session_params const& 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, 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);\n- s\bse\bes\bss\bsi\bio\bon\bn (session_params&& 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+*\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* 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&& params, session_flags_t flags);\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&& params);\n-s\bse\bes\bss\bsi\bio\bon\bn ();\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+*\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* 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);\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-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+*\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~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+*\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+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& h\bht\btt\btp\bp_\b_c\bca\bat\bte\beg\bgo\bor\bry\by ();\n+returns the error_category for HTTP errors\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+*\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* 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 const& sp);\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- , 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+*\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* 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 const& sp);\n-s\bse\bes\bss\bsi\bio\bon\bn_\b_p\bpa\bar\bra\bam\bms\bs (settings_pack&& sp);\n-This constructor can be used to start with the default plugins (ut_metadata,\n-ut_pex and smart_ban). Pass a _\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+*\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* 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+*\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- settings\n- The settings to configure the _\bs_\be_\bs_\bs_\bi_\bo_\bn with\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- extensions\n- the plugins to add to the _\bs_\be_\bs_\bs_\bi_\bo_\bn as it is constructed\n+*\b**\b**\b**\b**\b**\b* e\ben\bnu\bum\bm i\bi2\b2p\bp_\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/_\bi_\b2_\bp_\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 \n+|_\bn\bn_\ba\ba_\bm\bm_\be\be_\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|_\b0_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bp_\ba_\br_\bs_\be_\b__\bf_\ba_\bi_\bl_\be_\bd_\b _\b _\b _\b|_\b1_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bc_\ba_\bn_\bt_\b__\br_\be_\ba_\bc_\bh_\b__\bp_\be_\be_\br_\b|_\b2_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bi_\b2_\bp_\b__\be_\br_\br_\bo_\br_\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_\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- dht_state\n- DHT node ID and node addresses to bootstrap the DHT with.\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+|failed_hash_check |2 |A piece did not match its piece |\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|_\bh_\ba_\bs_\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 |\n+| | |The .torrent file does not contain|\n+|torrent_is_no_dict |3 |a bencoded dictionary at its top |\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_\be_\bv_\be_\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 |\n+|torrent_missing_info |4 |The .torrent file does not have an|\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_\bn_\bf_\bo_\b _\bd_\bi_\bc_\bt_\bi_\bo_\bn_\ba_\br_\by_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|torrent_info_no_dict |5 |The .torrent file's info _\be_\bn_\bt_\br_\by 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|_\bn_\bo_\bt_\b _\ba_\b _\bd_\bi_\bc_\bt_\bi_\bo_\bn_\ba_\br_\by_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|torrent_missing_piece_length |6 |The .torrent file does not have 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|_\bp_\bi_\be_\bc_\be_\b _\bl_\be_\bn_\bg_\bt_\bh_\b _\be_\bn_\bt_\br_\by_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|torrent_missing_name |7 |The .torrent file does not have 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|_\bn_\ba_\bm_\be_\b _\be_\bn_\bt_\br_\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+|torrent_invalid_name |8 |The .torrent file's name _\be_\bn_\bt_\br_\by 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|_\bi_\bn_\bv_\ba_\bl_\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 |\n+| | |The length of a file, or of the |\n+|torrent_invalid_length |9 |whole .torrent file is invalid. |\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_\bi_\bt_\bh_\be_\br_\b _\bn_\be_\bg_\ba_\bt_\bi_\bv_\be_\b _\bo_\br_\b _\bn_\bo_\bt_\b _\ba_\bn_\b _\bi_\bn_\bt_\be_\bg_\be_\br_\b |\n+|torrent_file_parse_failed |10 |Failed to parse a file _\be_\bn_\bt_\br_\by in |\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|_\bt_\bh_\be_\b _\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 |\n+|torrent_missing_pieces |11 |The pieces field is missing or |\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_\bn_\bv_\ba_\bl_\bi_\bd_\b _\bi_\bn_\b _\bt_\bh_\be_\b _\b._\bt_\bo_\br_\br_\be_\bn_\bt_\b _\bf_\bi_\bl_\be_\b _\b _\b _\b _\b _\b |\n+|torrent_invalid_hashes |12 |The pieces string has incorrect |\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_\be_\bn_\bg_\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 |\n+|too_many_pieces_in_torrent |13 |The .torrent file has more pieces |\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|_\bt_\bh_\ba_\bn_\b _\bi_\bs_\b _\bs_\bu_\bp_\bp_\bo_\br_\bt_\be_\bd_\b _\bb_\by_\b _\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b _\b _\b |\n+| | |The metadata (.torrent file) that |\n+|invalid_swarm_metadata |14 |was received from the swarm |\n+| | |matched the info-hash, but failed |\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|_\bt_\bo_\b _\bb_\be_\b _\bp_\ba_\br_\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 |\n+|invalid_bencoding |15 |The file or buffer is not |\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_\br_\br_\be_\bc_\bt_\bl_\by_\b _\bb_\be_\bn_\bc_\bo_\bd_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|no_files_in_torrent |16 |The .torrent file does not contain|\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|_\ba_\bn_\by_\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 |\n+|invalid_escaped_string |17 |The string was not properly url- |\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_\bn_\bc_\bo_\bd_\be_\bd_\b _\ba_\bs_\b _\be_\bx_\bp_\be_\bc_\bt_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|session_is_closing |18 |Operation is not permitted since |\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|_\bt_\bh_\be_\b _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b _\bi_\bs_\b _\bs_\bh_\bu_\bt_\bt_\bi_\bn_\bg_\b _\bd_\bo_\bw_\bn_\b _\b _\b _\b _\b _\b |\n+| | |There's already a torrent with |\n+|duplicate_torrent |19 |that info-hash added to 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_\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 |\n+|invalid_torrent_handle |20 |The supplied _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be is not|\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_\bf_\be_\br_\br_\bi_\bn_\bg_\b _\bt_\bo_\b _\ba_\b _\bv_\ba_\bl_\bi_\bd_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\b _\b _\b _\b _\b _\b |\n+|invalid_entry_type |21 |The type requested from the _\be_\bn_\bt_\br_\by |\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|_\bd_\bi_\bd_\b _\bn_\bo_\bt_\b _\bm_\ba_\bt_\bc_\bh_\b _\bi_\bt_\bs_\b _\bt_\by_\bp_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|missing_info_hash_in_uri |22 |The specified URI does not contain|\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|_\ba_\b _\bv_\ba_\bl_\bi_\bd_\b _\bi_\bn_\bf_\bo_\b-_\bh_\ba_\bs_\bh_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+| | |One of the files in the torrent |\n+|file_too_short |23 |was unexpectedly small. This might|\n+| | |be caused by files being changed |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bb_\by_\b _\ba_\bn_\b _\be_\bx_\bt_\be_\br_\bn_\ba_\bl_\b _\bp_\br_\bo_\bc_\be_\bs_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+| | |The URL used an unknown protocol. |\n+| | |Currently http and https (if built|\n+|unsupported_url_protocol |24 |with openssl support) are |\n+| | |recognized. For trackers udp is |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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_\bc_\bo_\bg_\bn_\bi_\bz_\be_\bd_\b _\ba_\bs_\b _\bw_\be_\bl_\bl_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|url_parse_error |25 |The URL did not conform to URL |\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_\by_\bn_\bt_\ba_\bx_\b _\ba_\bn_\bd_\b _\bf_\ba_\bi_\bl_\be_\bd_\b _\bt_\bo_\b _\bb_\be_\b _\bp_\ba_\br_\bs_\be_\bd_\b _\b _\b _\b |\n+|peer_sent_empty_piece |26 |The peer sent a piece message of |\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_\be_\bn_\bg_\bt_\bh_\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 |\n+|parse_failed |27 |A bencoded structure was corrupt |\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|_\ba_\bn_\bd_\b _\bf_\ba_\bi_\bl_\be_\bd_\b _\bt_\bo_\b _\bb_\be_\b _\bp_\ba_\br_\bs_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|invalid_file_tag |28 |The fast resume file was missing |\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_\br_\b _\bh_\ba_\bd_\b _\ba_\bn_\b _\bi_\bn_\bv_\ba_\bl_\bi_\bd_\b _\bf_\bi_\bl_\be_\b _\bv_\be_\br_\bs_\bi_\bo_\bn_\b _\bt_\ba_\bg|\n+|missing_info_hash |29 |The fast resume file was missing |\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_\br_\b _\bh_\ba_\bd_\b _\ba_\bn_\b _\bi_\bn_\bv_\ba_\bl_\bi_\bd_\b _\bi_\bn_\bf_\bo_\b-_\bh_\ba_\bs_\bh_\b _\b _\b _\b _\b _\b _\b |\n+|mismatching_info_hash |30 |The info-hash did not match 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|_\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 |\n+|invalid_hostname |31 |The URL contained an invalid |\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|_\bh_\bo_\bs_\bt_\bn_\ba_\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 |\n+|_\bi_\bn_\bv_\ba_\bl_\bi_\bd_\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|_\b3_\b2_\b _\b _\b _\b|_\bT_\bh_\be_\b _\bU_\bR_\bL_\b _\bh_\ba_\bd_\b _\ba_\bn_\b _\bi_\bn_\bv_\ba_\bl_\bi_\bd_\b _\bp_\bo_\br_\bt_\b _\b _\b _\b _\b _\b _\b |\n+| | |The port is blocked by the port- |\n+|port_blocked |33 |filter, and prevented 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|_\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 |\n+|expected_close_bracket_in_address |34 |The IPv6 address was expected to |\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_\bn_\bd_\b _\bw_\bi_\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 |\n+| | |The torrent is being destructed, |\n+|destructing_torrent |35 |preventing the operation to |\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_\bu_\bc_\bc_\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 |\n+|_\bt_\bi_\bm_\be_\bd_\b__\bo_\bu_\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|_\b3_\b6_\b _\b _\b _\b|_\bT_\bh_\be_\b _\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b _\bt_\bi_\bm_\be_\bd_\b _\bo_\bu_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+| | |The peer is upload only, and we |\n+|upload_upload_connection |37 |are upload only. There's no point |\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_\bn_\b _\bk_\be_\be_\bp_\bi_\bn_\bg_\b _\bt_\bh_\be_\b _\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+| | |The peer is upload only, and we're|\n+|uninteresting_upload_peer |38 |not interested in it. There's no |\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|_\bp_\bo_\bi_\bn_\bt_\b _\bi_\bn_\b _\bk_\be_\be_\bp_\bi_\bn_\bg_\b _\bt_\bh_\be_\b _\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b _\b _\b |\n+|_\bi_\bn_\bv_\ba_\bl_\bi_\bd_\b__\bi_\bn_\bf_\bo_\b__\bh_\ba_\bs_\bh_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b3_\b9_\b _\b _\b _\b|_\bT_\bh_\be_\b _\bp_\be_\be_\br_\b _\bs_\be_\bn_\bt_\b _\ba_\bn_\b _\bu_\bn_\bk_\bn_\bo_\bw_\bn_\b _\bi_\bn_\bf_\bo_\b-_\bh_\ba_\bs_\bh|\n+|torrent_paused |40 |The torrent is paused, preventing |\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|_\bt_\bh_\be_\b _\bo_\bp_\be_\br_\ba_\bt_\bi_\bo_\bn_\b _\bf_\br_\bo_\bm_\b _\bs_\bu_\bc_\bc_\be_\be_\bd_\bi_\bn_\bg_\b _\b _\b _\b _\b |\n+| | |The peer sent an invalid have |\n+|invalid_have |41 |message, either wrong size or |\n+| | |referring to a piece that doesn't |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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_\b _\bi_\bn_\b _\bt_\bh_\be_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|invalid_bitfield_size |42 |The _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd message had 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|_\bi_\bn_\bc_\bo_\br_\br_\be_\bc_\bt_\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 |\n+| | |The peer kept requesting pieces |\n+|too_many_requests_when_choked |43 |after it was choked, possible |\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|_\ba_\bb_\bu_\bs_\be_\b _\ba_\bt_\bt_\be_\bm_\bp_\bt_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+| | |The peer sent a piece message that|\n+|invalid_piece |44 |does not correspond to a piece |\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_\bq_\bu_\be_\bs_\bt_\b _\bs_\be_\bn_\bt_\b _\bb_\by_\b _\bt_\bh_\be_\b _\bc_\bl_\bi_\be_\bn_\bt_\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bn_\bo_\b__\bm_\be_\bm_\bo_\br_\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|_\b4_\b5_\b _\b _\b _\b|_\bm_\be_\bm_\bo_\br_\by_\b _\ba_\bl_\bl_\bo_\bc_\ba_\bt_\bi_\bo_\bn_\b _\bf_\ba_\bi_\bl_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|torrent_aborted |46 |The torrent is aborted, preventing|\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|_\bt_\bh_\be_\b _\bo_\bp_\be_\br_\ba_\bt_\bi_\bo_\bn_\b _\bt_\bo_\b _\bs_\bu_\bc_\bc_\be_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|self_connection |47 |The peer is a connection to |\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_\bu_\br_\bs_\be_\bl_\bf_\b,_\b _\bn_\bo_\b _\bp_\bo_\bi_\bn_\bt_\b _\bi_\bn_\b _\bk_\be_\be_\bp_\bi_\bn_\bg_\b _\bi_\bt_\b _\b _\b |\n+| | |The peer sent a piece message with|\n+|invalid_piece_size |48 |invalid size, either negative or |\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|_\bg_\br_\be_\ba_\bt_\be_\br_\b _\bt_\bh_\ba_\bn_\b _\bo_\bn_\be_\b _\bb_\bl_\bo_\bc_\bk_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+| | |The peer has not been interesting |\n+|timed_out_no_interest |49 |or interested in us for too long, |\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|_\bn_\bo_\b _\bp_\bo_\bi_\bn_\bt_\b _\bi_\bn_\b _\bk_\be_\be_\bp_\bi_\bn_\bg_\b _\bi_\bt_\b _\ba_\br_\bo_\bu_\bn_\bd_\b _\b _\b _\b _\b |\n+|timed_out_inactivity |50 |The peer has not said anything in |\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|_\ba_\b _\bl_\bo_\bn_\bg_\b _\bt_\bi_\bm_\be_\b,_\b _\bp_\bo_\bs_\bs_\bi_\bb_\bl_\by_\b _\bd_\be_\ba_\bd_\b _\b _\b _\b _\b _\b _\b _\b |\n+| | |The peer did not send a handshake |\n+|timed_out_no_handshake |51 |within a reasonable amount of |\n+| | |time, it might not be a bittorrent|\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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_\be_\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 |\n+| | |The peer has been unchoked for too|\n+|timed_out_no_request |52 |long without requesting any data. |\n+| | |It might be lying about its |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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_\bt_\be_\br_\be_\bs_\bt_\b _\bi_\bn_\b _\bu_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|invalid_choke |53 |The peer sent an invalid choke |\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|_\bm_\be_\bs_\bs_\ba_\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 |\n+|invalid_unchoke |54 |The peer send an invalid unchoke |\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|_\bm_\be_\bs_\bs_\ba_\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 |\n+|invalid_interested |55 |The peer sent an invalid |\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_\bn_\bt_\be_\br_\be_\bs_\bt_\be_\bd_\b _\bm_\be_\bs_\bs_\ba_\bg_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|invalid_not_interested |56 |The peer sent an invalid not- |\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_\bn_\bt_\be_\br_\be_\bs_\bt_\be_\bd_\b _\bm_\be_\bs_\bs_\ba_\bg_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|invalid_request |57 |The peer sent an invalid piece |\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_\bq_\bu_\be_\bs_\bt_\b _\bm_\be_\bs_\bs_\ba_\bg_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+| | |The peer sent an invalid hash-list|\n+|invalid_hash_list |58 |message (this is part of 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|_\bm_\be_\br_\bk_\bl_\be_\b-_\bt_\bo_\br_\br_\be_\bn_\bt_\b _\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+| | |The peer sent an invalid hash- |\n+|invalid_hash_piece |59 |piece message (this is part of 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|_\bm_\be_\br_\bk_\bl_\be_\b-_\bt_\bo_\br_\br_\be_\bn_\bt_\b _\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|invalid_cancel |60 |The peer sent an invalid cancel |\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|_\bm_\be_\bs_\bs_\ba_\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 |\n+|invalid_dht_port |61 |The peer sent an invalid DHT port-|\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|_\bm_\be_\bs_\bs_\ba_\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 |\n+|invalid_suggest |62 |The peer sent an invalid suggest |\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|_\bp_\bi_\be_\bc_\be_\b-_\bm_\be_\bs_\bs_\ba_\bg_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|invalid_have_all |63 |The peer sent an invalid have all-|\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|_\bm_\be_\bs_\bs_\ba_\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 |\n+|invalid_have_none |64 |The peer sent an invalid have |\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|_\bn_\bo_\bn_\be_\b-_\bm_\be_\bs_\bs_\ba_\bg_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|invalid_reject |65 |The peer sent an invalid reject |\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|_\bm_\be_\bs_\bs_\ba_\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 |\n+|invalid_allow_fast |66 |The peer sent an invalid allow |\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_\ba_\bs_\bt_\b-_\bm_\be_\bs_\bs_\ba_\bg_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|invalid_extended |67 |The peer sent an invalid extension|\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|_\bm_\be_\bs_\bs_\ba_\bg_\be_\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 |\n+|invalid_message |68 |The peer sent an invalid message |\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_\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 |\n+|sync_hash_not_found |69 |The synchronization hash was not |\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_\bo_\bu_\bn_\bd_\b _\bi_\bn_\b _\bt_\bh_\be_\b _\be_\bn_\bc_\br_\by_\bp_\bt_\be_\bd_\b _\bh_\ba_\bn_\bd_\bs_\bh_\ba_\bk_\be_\b _\b |\n+|invalid_encryption_constant |70 |The encryption constant 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 _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bh_\ba_\bn_\bd_\bs_\bh_\ba_\bk_\be_\b _\bi_\bs_\b _\bi_\bn_\bv_\ba_\bl_\bi_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|no_plaintext_mode |71 |The peer does not support plain |\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|_\bt_\be_\bx_\bt_\b,_\b _\bw_\bh_\bi_\bc_\bh_\b _\bi_\bs_\b _\bt_\bh_\be_\b _\bs_\be_\bl_\be_\bc_\bt_\be_\bd_\b _\bm_\bo_\bd_\be_\b _\b |\n+|no_rc4_mode |72 |The peer does not support RC4, |\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_\bh_\bi_\bc_\bh_\b _\bi_\bs_\b _\bt_\bh_\be_\b _\bs_\be_\bl_\be_\bc_\bt_\be_\bd_\b _\bm_\bo_\bd_\be_\b _\b _\b _\b _\b _\b _\b _\b |\n+| | |The peer does not support any of |\n+|unsupported_encryption_mode |73 |the encryption modes that 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|_\bc_\bl_\bi_\be_\bn_\bt_\b _\bs_\bu_\bp_\bp_\bo_\br_\bt_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+| | |The peer selected an encryption |\n+|unsupported_encryption_mode_selected|74 |mode that the client did not |\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|_\ba_\bd_\bv_\be_\br_\bt_\bi_\bs_\be_\b _\ba_\bn_\bd_\b _\bd_\bo_\be_\bs_\b _\bn_\bo_\bt_\b _\bs_\bu_\bp_\bp_\bo_\br_\bt_\b _\b _\b _\b |\n+| | |The pad size used in the |\n+|invalid_pad_size |75 |encryption handshake is of invalid|\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_\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 |\n+|invalid_encrypt_handshake |76 |The encryption handshake 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|_\bi_\bn_\bv_\ba_\bl_\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 |\n+| | |The client is set to not support |\n+|no_incoming_encrypted |77 |incoming encrypted connections and|\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|_\bt_\bh_\bi_\bs_\b _\bi_\bs_\b _\ba_\bn_\b _\be_\bn_\bc_\br_\by_\bp_\bt_\be_\bd_\b _\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b _\b _\b |\n+| | |The client is set to not support |\n+|no_incoming_regular |78 |incoming regular bittorrent |\n+| | |connections, and this is a regular|\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_\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 |\n+|duplicate_peer_id |79 |The client is already connected to|\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|_\bt_\bh_\bi_\bs_\b _\bp_\be_\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 |\n+|_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\br_\be_\bm_\bo_\bv_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b8_\b0_\b _\b _\b _\b|_\bT_\bo_\br_\br_\be_\bn_\bt_\b _\bw_\ba_\bs_\b _\br_\be_\bm_\bo_\bv_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|packet_too_large |81 |The packet size exceeded the upper|\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_\bn_\bi_\bt_\by_\b _\bc_\bh_\be_\bc_\bk_\b-_\bl_\bi_\bm_\bi_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\br_\be_\bs_\be_\br_\bv_\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|_\b8_\b2_\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 |\n+|http_error |83 |The web server responded with an |\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_\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 |\n+|missing_location |84 |The web server response is missing|\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|_\ba_\b _\bl_\bo_\bc_\ba_\bt_\bi_\bo_\bn_\b _\bh_\be_\ba_\bd_\be_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+| | |The web seed redirected to a path |\n+|invalid_redirection |85 |that no longer matches 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|_\b._\bt_\bo_\br_\br_\be_\bn_\bt_\b _\bd_\bi_\br_\be_\bc_\bt_\bo_\br_\by_\b _\bs_\bt_\br_\bu_\bc_\bt_\bu_\br_\be_\b _\b _\b _\b _\b _\b |\n+|redirecting |86 |The connection was closed because |\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 _\br_\be_\bd_\bi_\br_\be_\bc_\bt_\be_\bd_\b _\bt_\bo_\b _\ba_\b _\bd_\bi_\bf_\bf_\be_\br_\be_\bn_\bt_\b _\bU_\bR_\bL_\b _\b |\n+|_\bi_\bn_\bv_\ba_\bl_\bi_\bd_\b__\br_\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|_\b8_\b7_\b _\b _\b _\b|_\bT_\bh_\be_\b _\bH_\bT_\bT_\bP_\b _\br_\ba_\bn_\bg_\be_\b _\bh_\be_\ba_\bd_\be_\br_\b _\bi_\bs_\b _\bi_\bn_\bv_\ba_\bl_\bi_\bd_\b _\b |\n+|no_content_length |88 |The HTTP response did not have 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|_\bc_\bo_\bn_\bt_\be_\bn_\bt_\b _\bl_\be_\bn_\bg_\bt_\bh_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bb_\ba_\bn_\bn_\be_\bd_\b__\bb_\by_\b__\bi_\bp_\b__\bf_\bi_\bl_\bt_\be_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b8_\b9_\b _\b _\b _\b|_\bT_\bh_\be_\b _\bI_\bP_\b _\bi_\bs_\b _\bb_\bl_\bo_\bc_\bk_\be_\bd_\b _\bb_\by_\b _\bt_\bh_\be_\b _\bI_\bP_\b _\bf_\bi_\bl_\bt_\be_\br|\n+|_\bt_\bo_\bo_\b__\bm_\ba_\bn_\by_\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|_\b9_\b0_\b _\b _\b _\b|_\bA_\bt_\b _\bt_\bh_\be_\b _\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b _\bl_\bi_\bm_\bi_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bp_\be_\be_\br_\b__\bb_\ba_\bn_\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|_\b9_\b1_\b _\b _\b _\b|_\bT_\bh_\be_\b _\bp_\be_\be_\br_\b _\bi_\bs_\b _\bm_\ba_\br_\bk_\be_\bd_\b _\ba_\bs_\b _\bb_\ba_\bn_\bn_\be_\bd_\b _\b _\b _\b _\b _\b |\n+|stopping_torrent |92 |The torrent is stopping, causing |\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|_\bt_\bh_\be_\b _\bo_\bp_\be_\br_\ba_\bt_\bi_\bo_\bn_\b _\bt_\bo_\b _\bf_\ba_\bi_\bl_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|too_many_corrupt_pieces |93 |The peer has sent too many corrupt|\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|_\bp_\bi_\be_\bc_\be_\bs_\b _\ba_\bn_\bd_\b _\bi_\bs_\b _\bb_\ba_\bn_\bn_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|torrent_not_ready |94 |The torrent is not ready to |\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_\bc_\be_\bi_\bv_\be_\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 |\n+|peer_not_constructed |95 |The peer is not completely |\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_\bn_\bs_\bt_\br_\bu_\bc_\bt_\be_\bd_\b _\by_\be_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|session_closing |96 |The _\bs_\be_\bs_\bs_\bi_\bo_\bn is closing, causing |\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|_\bt_\bh_\be_\b _\bo_\bp_\be_\br_\ba_\bt_\bi_\bo_\bn_\b _\bt_\bo_\b _\bf_\ba_\bi_\bl_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+| | |The peer was disconnected in order|\n+|optimistic_disconnect |97 |to leave room for a potentially |\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|_\bb_\be_\bt_\bt_\be_\br_\b _\bp_\be_\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 |\n+|_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bi_\bn_\bi_\bs_\bh_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b9_\b8_\b _\b _\b _\b|_\bT_\bh_\be_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\b _\bi_\bs_\b _\bf_\bi_\bn_\bi_\bs_\bh_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bn_\bo_\b__\br_\bo_\bu_\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|_\b9_\b9_\b _\b _\b _\b|_\bN_\bo_\b _\bU_\bP_\bn_\bP_\b _\br_\bo_\bu_\bt_\be_\br_\b _\bf_\bo_\bu_\bn_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|metadata_too_large |100 |The metadata message says 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|_\bm_\be_\bt_\ba_\bd_\ba_\bt_\ba_\b _\be_\bx_\bc_\be_\be_\bd_\bs_\b _\bt_\bh_\be_\b _\bl_\bi_\bm_\bi_\bt_\b _\b _\b _\b _\b _\b _\b _\b |\n+|invalid_metadata_request |101 |The peer sent an invalid 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|_\br_\be_\bq_\bu_\be_\bs_\bt_\b _\bm_\be_\bs_\bs_\ba_\bg_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|invalid_metadata_size |102 |The peer advertised an invalid |\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|_\bm_\be_\bt_\ba_\bd_\ba_\bt_\ba_\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 |\n+|invalid_metadata_offset |103 |The peer sent a message with an |\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_\bn_\bv_\ba_\bl_\bi_\bd_\b _\bm_\be_\bt_\ba_\bd_\ba_\bt_\ba_\b _\bo_\bf_\bf_\bs_\be_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|invalid_metadata_message |104 |The peer sent an invalid 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|_\bm_\be_\bs_\bs_\ba_\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 |\n+|pex_message_too_large |105 |The peer sent a peer exchange |\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|_\bm_\be_\bs_\bs_\ba_\bg_\be_\b _\bt_\bh_\ba_\bt_\b _\bw_\ba_\bs_\b _\bt_\bo_\bo_\b _\bl_\ba_\br_\bg_\be_\b _\b _\b _\b _\b _\b _\b _\b |\n+|invalid_pex_message |106 |The peer sent an invalid peer |\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_\bx_\bc_\bh_\ba_\bn_\bg_\be_\b _\bm_\be_\bs_\bs_\ba_\bg_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|invalid_lt_tracker_message |107 |The peer sent an invalid 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 _\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 _\bm_\be_\bs_\bs_\ba_\bg_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+| | |The peer sent an pex messages too |\n+|too_frequent_pex |108 |often. This is a possible attempt |\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 _\ba_\bn_\bd_\b _\ba_\bt_\bt_\ba_\bc_\bk_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+| | |The operation failed because it |\n+| | |requires the torrent to have the |\n+| | |metadata (.torrent file) and it |\n+|no_metadata |109 |doesn't have it yet. This happens |\n+| | |for magnet links before they have |\n+| | |downloaded the metadata, and also |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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_\bs_\b _\ba_\bd_\bd_\be_\bd_\b _\bb_\by_\b _\bU_\bR_\bL_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+| | |The peer sent an invalid dont_have|\n+| | |message. The don't have message is|\n+|invalid_dont_have |110 |an extension to allow peers to |\n+| | |advertise that the no longer has a|\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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_\bi_\be_\bc_\be_\b _\bt_\bh_\be_\by_\b _\bp_\br_\be_\bv_\bi_\bo_\bu_\bs_\bl_\by_\b _\bh_\ba_\bd_\b._\b _\b _\b _\b _\b _\b _\b _\b |\n+| | |The peer tried to connect to an |\n+|requires_ssl_connection |111 |SSL torrent without connecting |\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_\bv_\be_\br_\b _\bS_\bS_\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 |\n+| | |The peer tried to connect to a |\n+|invalid_ssl_cert |112 |torrent with a certificate for 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|_\bd_\bi_\bf_\bf_\be_\br_\be_\bn_\bt_\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 |\n+| | |the torrent is not an SSL torrent,|\n+|not_an_ssl_torrent |113 |and the operation requires an SSL |\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|_\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 |\n+| | |peer was banned because its listen|\n+|banned_by_port_filter |114 |port is within a banned port |\n+| | |range, as specified by the |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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_\bo_\br_\bt_\b__\bf_\bi_\bl_\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 |\n+|invalid_session_handle |115 |The _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bh_\ba_\bn_\bd_\bl_\be is not |\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_\bf_\be_\br_\br_\bi_\bn_\bg_\b _\bt_\bo_\b _\ba_\b _\bv_\ba_\bl_\bi_\bd_\b _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bi_\bm_\bp_\bl_\b |\n+|invalid_listen_socket |116 |the listen socket associated with |\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|_\bt_\bh_\bi_\bs_\b _\br_\be_\bq_\bu_\be_\bs_\bt_\b _\bw_\ba_\bs_\b _\bc_\bl_\bo_\bs_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bi_\bn_\bv_\ba_\bl_\bi_\bd_\b__\bh_\ba_\bs_\bh_\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|_\b1_\b1_\b7_\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 |\n+|_\bi_\bn_\bv_\ba_\bl_\bi_\bd_\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|_\b1_\b1_\b8_\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 |\n+|_\bi_\bn_\bv_\ba_\bl_\bi_\bd_\b__\bh_\ba_\bs_\bh_\b__\br_\be_\bj_\be_\bc_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b1_\b9_\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 |\n+|_\bd_\be_\bp_\br_\be_\bc_\ba_\bt_\be_\bd_\b__\b1_\b2_\b0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b2_\b0_\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 |\n+|_\bd_\be_\bp_\br_\be_\bc_\ba_\bt_\be_\bd_\b__\b1_\b2_\b1_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b2_\b1_\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 |\n+|_\bd_\be_\bp_\br_\be_\bc_\ba_\bt_\be_\bd_\b__\b1_\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|_\b1_\b2_\b2_\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 |\n+|_\bd_\be_\bp_\br_\be_\bc_\ba_\bt_\be_\bd_\b__\b1_\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|_\b1_\b2_\b3_\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 |\n+|_\bd_\be_\bp_\br_\be_\bc_\ba_\bt_\be_\bd_\b__\b1_\b2_\b4_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b2_\b4_\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 |\n+|missing_file_sizes |130 |The resume data file is missing |\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|_\bt_\bh_\be_\b _\bf_\bi_\bl_\be_\b _\bs_\bi_\bz_\be_\bs_\b _\be_\bn_\bt_\br_\by_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|no_files_in_resume_data |131 |The resume data file file sizes |\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_\bn_\bt_\br_\by_\b _\bi_\bs_\b _\be_\bm_\bp_\bt_\by_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|missing_pieces |132 |The resume data file is missing |\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|_\bt_\bh_\be_\b _\bp_\bi_\be_\bc_\be_\bs_\b _\ba_\bn_\bd_\b _\bs_\bl_\bo_\bt_\bs_\b _\be_\bn_\bt_\br_\by_\b _\b _\b _\b _\b _\b _\b _\b |\n+| | |The number of files in the resume |\n+|mismatching_number_of_files |133 |data does not match the number of |\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_\bi_\bl_\be_\bs_\b _\bi_\bn_\b _\bt_\bh_\be_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+| | |One of the files on disk has a |\n+|mismatching_file_size |134 |different size than in the fast |\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_\bu_\bm_\be_\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 |\n+| | |One of the files on disk has a |\n+|mismatching_file_timestamp |135 |different timestamp than 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 _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bf_\ba_\bs_\bt_\b _\br_\be_\bs_\bu_\bm_\be_\b _\bf_\bi_\bl_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|not_a_dictionary |136 |The resume data file is not 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|_\bd_\bi_\bc_\bt_\bi_\bo_\bn_\ba_\br_\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+|invalid_blocks_per_piece |137 |The blocks per piece _\be_\bn_\bt_\br_\by 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|_\bi_\bn_\bv_\ba_\bl_\bi_\bd_\b _\bi_\bn_\b _\bt_\bh_\be_\b _\br_\be_\bs_\bu_\bm_\be_\b _\bd_\ba_\bt_\ba_\b _\bf_\bi_\bl_\be_\b _\b _\b |\n+| | |The resume file is missing the |\n+|missing_slots |138 |slots _\be_\bn_\bt_\br_\by, which is required for|\n+| | |torrents with compact allocation. |\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|_\bD\bD_\bE\bE_\bP\bP_\bR\bR_\bE\bE_\bC\bC_\bA\bA_\bT\bT_\bE\bE_\bD\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 |\n+|too_many_slots |139 |The resume file contains more |\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_\bl_\bo_\bt_\bs_\b _\bt_\bh_\ba_\bn_\b _\bt_\bh_\be_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|invalid_slot_list |140 |The slot _\be_\bn_\bt_\br_\by is invalid 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 _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\br_\be_\bs_\bu_\bm_\be_\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 |\n+|invalid_piece_index |141 |One index in the slot list 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|_\bi_\bn_\bv_\ba_\bl_\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 |\n+| | |The pieces on disk needs to be re-|\n+| | |ordered for the specified |\n+| | |allocation mode. This happens if |\n+|pieces_need_reorder |142 |you specify sparse allocation and |\n+| | |the files on disk are using |\n+| | |compact storage. The pieces needs |\n+| | |to be moved to their right |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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_\bo_\bs_\bi_\bt_\bi_\bo_\bn_\b._\b _\bD\bD_\bE\bE_\bP\bP_\bR\bR_\bE\bE_\bC\bC_\bA\bA_\bT\bT_\bE\bE_\bD\bD_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+| | |this error is returned when asking|\n+| | |to save resume data and specifying|\n+|resume_data_not_modified |143 |the flag to only save when there's|\n+| | |anything new to save |\n+| | |(_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be_\b:_\b:_\bo_\bn_\bl_\by_\b__\bi_\bf_\b__\bm_\bo_\bd_\bi_\bf_\bi_\be_\bd)|\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|_\ba_\bn_\bd_\b _\bt_\bh_\be_\br_\be_\b _\bw_\ba_\bs_\bn_\b'_\bt_\b _\ba_\bn_\by_\bt_\bh_\bi_\bn_\bg_\b _\bc_\bh_\ba_\bn_\bg_\be_\bd_\b.|\n+|invalid_save_path |144 |the save_path in |\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|_\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs_\b _\bi_\bs_\b _\bn_\bo_\bt_\b _\bv_\ba_\bl_\bi_\bd_\b _\b _\b |\n+|http_parse_error |150 |The HTTP header was not correctly |\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_\bo_\br_\bm_\ba_\bt_\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 |\n+| | |The HTTP response was in the 300- |\n+|http_missing_location |151 |399 range but lacked a location |\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|_\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 _\b _\b _\b _\b _\b _\b _\b |\n+| | |The HTTP response was encoded with|\n+|http_failed_decompress |152 |gzip or deflate but decompressing |\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 _\bf_\ba_\bi_\bl_\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 |\n+|no_i2p_router |160 |The URL specified an i2p address, |\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|_\bb_\bu_\bt_\b _\bn_\bo_\b _\bi_\b2_\bp_\b _\br_\bo_\bu_\bt_\be_\br_\b _\bi_\bs_\b _\bc_\bo_\bn_\bf_\bi_\bg_\bu_\br_\be_\bd_\b _\b _\b |\n+|no_i2p_endpoint |161 |i2p acceptor is not available yet,|\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_\ba_\bn_\b'_\bt_\b _\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b _\bw_\bi_\bt_\bh_\bo_\bu_\bt_\b _\be_\bn_\bd_\bp_\bo_\bi_\bn_\bt_\b _\b _\b |\n+| | |The tracker URL doesn't support |\n+|scrape_not_available |170 |transforming it into a scrape URL.|\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_\b._\be_\b._\b _\bi_\bt_\b _\bd_\bo_\be_\bs_\bn_\b'_\bt_\b _\bc_\bo_\bn_\bt_\ba_\bi_\bn_\b _\b\"_\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b.|\n+|_\bi_\bn_\bv_\ba_\bl_\bi_\bd_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\b__\br_\be_\bs_\bp_\bo_\bn_\bs_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b7_\b1_\b _\b _\b|_\bi_\bn_\bv_\ba_\bl_\bi_\bd_\b _\bt_\br_\ba_\bc_\bk_\be_\br_\b _\br_\be_\bs_\bp_\bo_\bn_\bs_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|invalid_peer_dict |172 |invalid peer dictionary _\be_\bn_\bt_\br_\by. Not|\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|_\ba_\b _\bd_\bi_\bc_\bt_\bi_\bo_\bn_\ba_\br_\by_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bt_\br_\ba_\bc_\bk_\be_\br_\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 _\b _\b|_\b1_\b7_\b3_\b _\b _\b|_\bt_\br_\ba_\bc_\bk_\be_\br_\b _\bs_\be_\bn_\bt_\b _\ba_\b _\bf_\ba_\bi_\bl_\bu_\br_\be_\b _\bm_\be_\bs_\bs_\ba_\bg_\be_\b _\b _\b _\b |\n+|_\bi_\bn_\bv_\ba_\bl_\bi_\bd_\b__\bf_\bi_\bl_\be_\bs_\b__\be_\bn_\bt_\br_\by_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b7_\b4_\b _\b _\b|_\bm_\bi_\bs_\bs_\bi_\bn_\bg_\b _\bo_\br_\b _\bi_\bn_\bv_\ba_\bl_\bi_\bd_\b _\bf_\bi_\bl_\be_\bs_\b _\be_\bn_\bt_\br_\by_\b _\b _\b _\b |\n+|_\bi_\bn_\bv_\ba_\bl_\bi_\bd_\b__\bh_\ba_\bs_\bh_\b__\be_\bn_\bt_\br_\by_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b7_\b5_\b _\b _\b|_\bm_\bi_\bs_\bs_\bi_\bn_\bg_\b _\bo_\br_\b _\bi_\bn_\bv_\ba_\bl_\bi_\bd_\b _\bh_\ba_\bs_\bh_\b _\be_\bn_\bt_\br_\by_\b _\b _\b _\b _\b |\n+|invalid_peers_entry |176 |missing or invalid peers and |\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|_\bp_\be_\be_\br_\bs_\b6_\b _\be_\bn_\bt_\br_\by_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|invalid_tracker_response_length |177 |UDP tracker response packet 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 _\b|_\bi_\bn_\bv_\ba_\bl_\bi_\bd_\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 |\n+|invalid_tracker_transaction_id |178 |invalid transaction id in UDP |\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|_\bt_\br_\ba_\bc_\bk_\be_\br_\b _\br_\be_\bs_\bp_\bo_\bn_\bs_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|invalid_tracker_action |179 |invalid action field in UDP |\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|_\bt_\br_\ba_\bc_\bk_\be_\br_\b _\br_\be_\bs_\bp_\bo_\bn_\bs_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+| | |skipped announce (because it's |\n+|announce_skipped |180 |assumed to be unreachable over 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|_\bg_\bi_\bv_\be_\bn_\b _\bs_\bo_\bu_\br_\bc_\be_\b _\bn_\be_\bt_\bw_\bo_\br_\bk_\b _\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be_\b)_\b _\b _\b |\n+|_\bn_\bo_\b__\be_\bn_\bt_\br_\bo_\bp_\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|_\b2_\b0_\b0_\b _\b _\b|_\br_\ba_\bn_\bd_\bo_\bm_\b _\bn_\bu_\bm_\bb_\be_\br_\b _\bg_\be_\bn_\be_\br_\ba_\bt_\bi_\bo_\bn_\b _\bf_\ba_\bi_\bl_\be_\bd_\b _\b _\b |\n+|_\bs_\bs_\br_\bf_\b__\bm_\bi_\bt_\bi_\bg_\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|_\b2_\b0_\b1_\b _\b _\b|_\bb_\bl_\bo_\bc_\bk_\be_\bd_\b _\bb_\by_\b _\bS_\bS_\bR_\bF_\b _\bm_\bi_\bt_\bi_\bg_\ba_\bt_\bi_\bo_\bn_\b _\b _\b _\b _\b _\b _\b _\b |\n+|blocked_by_idna |202 |blocked because IDNA host names |\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|_\ba_\br_\be_\b _\bb_\ba_\bn_\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 |\n+|torrent_unknown_version |210 |the torrent file has an unknown |\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|_\bm_\be_\bt_\ba_\b _\bv_\be_\br_\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 |\n+|torrent_missing_file_tree |211 |the v2 torrent file has no file |\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|_\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 |\n+|torrent_missing_meta_version |212 |the torrent contains v2 keys but |\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|_\bd_\bo_\be_\bs_\b _\bn_\bo_\bt_\b _\bs_\bp_\be_\bc_\bi_\bf_\by_\b _\bm_\be_\bt_\ba_\b _\bv_\be_\br_\bs_\bi_\bo_\bn_\b _\b2_\b _\b _\b |\n+|torrent_inconsistent_files |213 |the v1 and v2 file metadata does |\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|_\bn_\bo_\bt_\b _\bm_\ba_\bt_\bc_\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 |\n+|torrent_missing_piece_layer |214 |one or more files are missing |\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|_\bp_\bi_\be_\bc_\be_\b _\bl_\ba_\by_\be_\br_\b _\bh_\ba_\bs_\bh_\be_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|torrent_invalid_piece_layer |215 |a piece layer has the wrong size |\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_\br_\b _\bf_\ba_\bi_\bl_\be_\bd_\b _\bh_\ba_\bs_\bh_\b _\bc_\bh_\be_\bc_\bk_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bm_\bi_\bs_\bs_\bi_\bn_\bg_\b__\bp_\bi_\be_\bc_\be_\bs_\b__\br_\bo_\bo_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b2_\b1_\b6_\b _\b _\b|_\ba_\b _\bv_\b2_\b _\bf_\bi_\bl_\be_\b _\be_\bn_\bt_\br_\by_\b _\bh_\ba_\bs_\b _\bn_\bo_\b _\br_\bo_\bo_\bt_\b _\bh_\ba_\bs_\bh_\b _\b |\n+|torrent_inconsistent_hashes |217 |the v1 and v2 hashes do not |\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|_\bd_\be_\bs_\bc_\br_\bi_\bb_\be_\b _\bt_\bh_\be_\b _\bs_\ba_\bm_\be_\b _\bd_\ba_\bt_\ba_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|torrent_invalid_pad_file |218 |a file in the v2 metadata has 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|_\bp_\ba_\bd_\b _\ba_\bt_\bt_\br_\bi_\bb_\bu_\bt_\be_\b _\bs_\be_\bt_\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 _\b|_\b2_\b1_\b9_\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 |\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+*\b**\b**\b**\b**\b**\b* e\ben\bnu\bum\bm h\bht\btt\btp\bp_\b_e\ber\brr\bro\bor\brs\bs *\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 \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|\n+|_\bc_\bo_\bn_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b0_\b0_\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bo_\bk_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b2_\b0_\b0_\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bc_\br_\be_\ba_\bt_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b2_\b0_\b1_\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\ba_\bc_\bc_\be_\bp_\bt_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b2_\b0_\b2_\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bn_\bo_\b__\bc_\bo_\bn_\bt_\be_\bn_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b2_\b0_\b4_\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bm_\bu_\bl_\bt_\bi_\bp_\bl_\be_\b__\bc_\bh_\bo_\bi_\bc_\be_\bs_\b _\b _\b _\b _\b _\b|_\b3_\b0_\b0_\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bm_\bo_\bv_\be_\bd_\b__\bp_\be_\br_\bm_\ba_\bn_\be_\bn_\bt_\bl_\by_\b _\b _\b _\b _\b|_\b3_\b0_\b1_\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bm_\bo_\bv_\be_\bd_\b__\bt_\be_\bm_\bp_\bo_\br_\ba_\br_\bi_\bl_\by_\b _\b _\b _\b _\b|_\b3_\b0_\b2_\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bn_\bo_\bt_\b__\bm_\bo_\bd_\bi_\bf_\bi_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b3_\b0_\b4_\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bb_\ba_\bd_\b__\br_\be_\bq_\bu_\be_\bs_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b4_\b0_\b0_\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bu_\bn_\ba_\bu_\bt_\bh_\bo_\br_\bi_\bz_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b4_\b0_\b1_\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bf_\bo_\br_\bb_\bi_\bd_\bd_\be_\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b4_\b0_\b3_\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bn_\bo_\bt_\b__\bf_\bo_\bu_\bn_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b4_\b0_\b4_\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bi_\bn_\bt_\be_\br_\bn_\ba_\bl_\b__\bs_\be_\br_\bv_\be_\br_\b__\be_\br_\br_\bo_\br_\b|_\b5_\b0_\b0_\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bn_\bo_\bt_\b__\bi_\bm_\bp_\bl_\be_\bm_\be_\bn_\bt_\be_\bd_\b _\b _\b _\b _\b _\b _\b|_\b5_\b0_\b1_\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bb_\ba_\bd_\b__\bg_\ba_\bt_\be_\bw_\ba_\by_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b5_\b0_\b2_\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bs_\be_\br_\bv_\bi_\bc_\be_\b__\bu_\bn_\ba_\bv_\ba_\bi_\bl_\ba_\bb_\bl_\be_\b _\b _\b|_\b5_\b0_\b3_\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- disk_io_constructor\n- function object to create the disk I/O subsystem. Defaults to\n- default_disk_io_constructor.\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- 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+*\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+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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 _\bi_\bn_\bv_\ba_\bl_\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 |\n+|_\ba_\bc_\bt_\bi_\bo_\bn_\b__\bf_\ba_\bi_\bl_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b5_\b0_\b1_\b _\b _\b|_\bT_\bh_\be_\b _\br_\be_\bq_\bu_\be_\bs_\bt_\b _\bf_\ba_\bi_\bl_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|value_not_in_array |714 |The specified value does not exist |\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|_\bi_\bn_\b _\bt_\bh_\be_\b _\ba_\br_\br_\ba_\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+| | |The source IP address cannot be |\n+|source_ip_cannot_be_wildcarded |715 |wild-carded, but must be fully |\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|_\bs_\bp_\be_\bc_\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 |\n+|external_port_cannot_be_wildcarded|716 |The external port cannot be 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|_\bw_\bi_\bl_\bd_\bc_\ba_\br_\bd_\b,_\b _\bb_\bu_\bt_\b _\bm_\bu_\bs_\bt_\b _\bb_\be_\b _\bs_\bp_\be_\bc_\bi_\bf_\bi_\be_\bd_\b _\b _\b _\b _\b |\n+| | |The port mapping _\be_\bn_\bt_\br_\by specified |\n+|port_mapping_conflict |718 |conflicts with a mapping assigned |\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|_\bp_\br_\be_\bv_\bi_\bo_\bu_\bs_\bl_\by_\b _\bt_\bo_\b _\ba_\bn_\bo_\bt_\bh_\be_\br_\b _\bc_\bl_\bi_\be_\bn_\bt_\b _\b _\b _\b _\b _\b _\b _\b |\n+|internal_port_must_match_external |724 |Internal and external port value |\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|_\bm_\bu_\bs_\bt_\b _\bb_\be_\b _\bt_\bh_\be_\b _\bs_\ba_\bm_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+| | |The NAT implementation only supports|\n+|only_permanent_leases_supported |725 |permanent lease times on port |\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|_\bm_\ba_\bp_\bp_\bi_\bn_\bg_\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 |\n+| | |RemoteHost must be a wildcard and |\n+|remote_host_must_be_wildcard |726 |cannot be a specific IP address or |\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|_\bD_\bN_\bS_\b _\bn_\ba_\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 |\n+|external_port_must_be_wildcard |727 |ExternalPort must be a wildcard and |\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|_\bc_\ba_\bn_\bn_\bo_\bt_\b _\bb_\be_\b _\ba_\b _\bs_\bp_\be_\bc_\bi_\bf_\bi_\bc_\b _\bp_\bo_\br_\bt_\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- 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+*\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+|inflated_data_too_large |2 |more bytes than the specified |\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|_\bm_\ba_\bx_\bi_\bm_\bu_\bm_\b _\bs_\bi_\bz_\be_\b,_\b _\ba_\bn_\bd_\b _\bw_\ba_\bs_\b _\br_\be_\bj_\be_\bc_\bt_\be_\bd_\b._\b _\b _\b _\b |\n+|data_did_not_terminate |3 |available inflate data did not |\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|_\bt_\be_\br_\bm_\bi_\bn_\ba_\bt_\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 |\n+|space_exhausted |4 |output space exhausted before |\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_\bm_\bp_\bl_\be_\bt_\bi_\bn_\bg_\b _\bi_\bn_\bf_\bl_\ba_\bt_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|_\bi_\bn_\bv_\ba_\bl_\bi_\bd_\b__\bb_\bl_\bo_\bc_\bk_\b__\bt_\by_\bp_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b5_\b _\b _\b _\b _\b|_\bi_\bn_\bv_\ba_\bl_\bi_\bd_\b _\bb_\bl_\bo_\bc_\bk_\b _\bt_\by_\bp_\be_\b _\b(_\bt_\by_\bp_\be_\b _\b=_\b=_\b _\b3_\b)_\b _\b _\b _\b _\b |\n+|invalid_stored_block_length |6 |stored block length did not match |\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_\bn_\be_\b'_\bs_\b _\bc_\bo_\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 |\n+|too_many_length_or_distance_codes |7 |dynamic block code description: too|\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|_\bm_\ba_\bn_\by_\b _\bl_\be_\bn_\bg_\bt_\bh_\b _\bo_\br_\b _\bd_\bi_\bs_\bt_\ba_\bn_\bc_\be_\b _\bc_\bo_\bd_\be_\bs_\b _\b _\b _\b _\b _\b |\n+|code_lengths_codes_incomplete |8 |dynamic block code description: |\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 _\bl_\be_\bn_\bg_\bt_\bh_\bs_\b _\bc_\bo_\bd_\be_\bs_\b _\bi_\bn_\bc_\bo_\bm_\bp_\bl_\be_\bt_\be_\b _\b _\b _\b _\b _\b |\n+|repeat_lengths_with_no_first_length|9 |dynamic block code description: |\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|_\br_\be_\bp_\be_\ba_\bt_\b _\bl_\be_\bn_\bg_\bt_\bh_\bs_\b _\bw_\bi_\bt_\bh_\b _\bn_\bo_\b _\bf_\bi_\br_\bs_\bt_\b _\bl_\be_\bn_\bg_\bt_\bh|\n+|repeat_more_than_specified_lengths |10 |dynamic block code description: |\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|_\br_\be_\bp_\be_\ba_\bt_\b _\bm_\bo_\br_\be_\b _\bt_\bh_\ba_\bn_\b _\bs_\bp_\be_\bc_\bi_\bf_\bi_\be_\bd_\b _\bl_\be_\bn_\bg_\bt_\bh_\bs_\b |\n+|invalid_literal_length_code_lengths|11 |dynamic block code description: |\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 _\bl_\bi_\bt_\be_\br_\ba_\bl_\b/_\bl_\be_\bn_\bg_\bt_\bh_\b _\bc_\bo_\bd_\be_\b _\bl_\be_\bn_\bg_\bt_\bh_\bs|\n+|invalid_distance_code_lengths |12 |dynamic block code description: |\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 _\bd_\bi_\bs_\bt_\ba_\bn_\bc_\be_\b _\bc_\bo_\bd_\be_\b _\bl_\be_\bn_\bg_\bt_\bh_\bs_\b _\b _\b _\b _\b _\b |\n+|invalid_literal_code_in_block |13 |invalid literal/length or distance |\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* 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+*\b**\b**\b**\b**\b**\b* e\ben\bnu\bum\bm p\bpc\bcp\bp_\b_e\ber\brr\bro\bor\brs\bs *\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+ _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\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+|_\bp_\bc_\bp_\b__\bs_\bu_\bc_\bc_\be_\bs_\bs_\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+|_\bp_\bc_\bp_\b__\bu_\bn_\bs_\bu_\bp_\bp_\b__\bv_\be_\br_\bs_\bi_\bo_\bn_\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+|_\bp_\bc_\bp_\b__\bn_\bo_\bt_\b__\ba_\bu_\bt_\bh_\bo_\br_\bi_\bz_\be_\bd_\b _\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+|_\bp_\bc_\bp_\b__\bm_\ba_\bl_\bf_\bo_\br_\bm_\be_\bd_\b__\br_\be_\bq_\bu_\be_\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 |\n+|_\bp_\bc_\bp_\b__\bu_\bn_\bs_\bu_\bp_\bp_\b__\bo_\bp_\bc_\bo_\bd_\be_\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+|_\bp_\bc_\bp_\b__\bu_\bn_\bs_\bu_\bp_\bp_\b__\bo_\bp_\bt_\bi_\bo_\bn_\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+|_\bp_\bc_\bp_\b__\bm_\ba_\bl_\bf_\bo_\br_\bm_\be_\bd_\b__\bo_\bp_\bt_\bi_\bo_\bn_\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+|_\bp_\bc_\bp_\b__\bn_\be_\bt_\bw_\bo_\br_\bk_\b__\bf_\ba_\bi_\bl_\bu_\br_\be_\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+|_\bp_\bc_\bp_\b__\bn_\bo_\b__\br_\be_\bs_\bo_\bu_\br_\bc_\be_\bs_\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+|_\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 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@@ -6072,46 +7250,46 @@\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 data_type t\bty\byp\bpe\be () const;\n- e\ben\bnt\btr\bry\by (list_type);\n- e\ben\bnt\btr\bry\by (dictionary_type);\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 (span);\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= (integer_type) &;\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= (bdecode_node const&) &;\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= (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= (preformatted_type) &;\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&&) & noexcept;\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= (span) &;\n entry& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (U v) &;\n+ string_type& s\bst\btr\bri\bin\bng\bg ();\n+ list_type& l\bli\bis\bst\bt ();\n+ integer_type& i\bin\bnt\bte\beg\bge\ber\br ();\n+ dictionary_type& d\bdi\bic\bct\bt ();\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 preformatted_type const& p\bpr\bre\bef\bfo\bor\brm\bma\bat\btt\bte\bed\bd () const;\n- list_type const& l\bli\bis\bst\bt () const;\n dictionary_type const& d\bdi\bic\bct\bt () const;\n- preformatted_type& p\bpr\bre\bef\bfo\bor\brm\bma\bat\btt\bte\bed\bd ();\n string_type const& s\bst\btr\bri\bin\bng\bg () const;\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- dictionary_type& d\bdi\bic\bct\bt ();\n- string_type& s\bst\btr\bri\bin\bng\bg ();\n- list_type& l\bli\bis\bst\bt ();\n+ list_type const& l\bli\bis\bst\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+ 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 data_type\n {\n int_t,\n string_t,\n list_t,\n@@ -6122,52 +7300,52 @@\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 [_\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 (list_type);\n-e\ben\bnt\btr\bry\by (dictionary_type);\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 (span);\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= (integer_type) &;\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= (bdecode_node const&) &;\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= (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= (preformatted_type) &;\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&&) & noexcept;\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= (span) &;\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* s\bst\btr\bri\bin\bng\bg(\b()\b) d\bdi\bic\bct\bt(\b()\b) p\bpr\bre\bef\bfo\bor\brm\bma\bat\btt\bte\bed\bd(\b()\b) l\bli\bis\bst\bt(\b()\b) i\bin\bnt\bte\beg\bge\ber\br(\b()\b) *\b**\b**\b**\b**\b*\n+*\b**\b**\b**\b**\b* p\bpr\bre\bef\bfo\bor\brm\bma\bat\btt\bte\bed\bd(\b()\b) s\bst\btr\bri\bin\bng\bg(\b()\b) d\bdi\bic\bct\bt(\b()\b) i\bin\bnt\bte\beg\bge\ber\br(\b()\b) l\bli\bis\bst\bt(\b()\b) *\b**\b**\b**\b**\b*\n+string_type& s\bst\btr\bri\bin\bng\bg ();\n+list_type& l\bli\bis\bst\bt ();\n+integer_type& i\bin\bnt\bte\beg\bge\ber\br ();\n+dictionary_type& d\bdi\bic\bct\bt ();\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 preformatted_type const& p\bpr\bre\bef\bfo\bor\brm\bma\bat\btt\bte\bed\bd () const;\n-list_type const& l\bli\bis\bst\bt () const;\n dictionary_type const& d\bdi\bic\bct\bt () const;\n-preformatted_type& p\bpr\bre\bef\bfo\bor\brm\bma\bat\btt\bte\bed\bd ();\n string_type const& s\bst\btr\bri\bin\bng\bg () const;\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-dictionary_type& d\bdi\bic\bct\bt ();\n-string_type& s\bst\btr\bri\bin\bng\bg ();\n-list_type& l\bli\bis\bst\bt ();\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@@ -6209,16 +7387,16 @@\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* 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+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* t\bto\bo_\b_s\bst\btr\bri\bin\bng\bg(\b()\b) *\b**\b**\b**\b**\b*\n@@ -6250,237 +7428,14 @@\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**\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- 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- bdecode_node l\bli\bis\bst\bt_\b_a\bat\bt (int i) 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- 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- int d\bdi\bic\bct\bt_\b_s\bsi\biz\bze\be () 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_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- 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_i\bin\bnt\bt (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_s\bst\btr\bri\bin\bng\bg (string_view key) 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- string_view s\bst\btr\bri\bin\bng\bg_\b_v\bva\bal\blu\bue\be () 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-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_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\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-bdecode_node l\bli\bis\bst\bt_\b_a\bat\bt (int i) 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-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_a\bat\bt_\b_n\bno\bod\bde\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_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_l\bli\bis\bst\bt(\b()\b)\n-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_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) 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-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-int d\bdi\bic\bct\bt_\b_s\bsi\biz\bze\be () 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_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-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_i\bin\bnt\bt (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_s\bst\btr\bri\bin\bng\bg (string_view key) const;\n-Functions with the dict_ prefix operates on dictionaries. They are only valid\n-if type() == dict_t. In case a key you're looking up contains a 0 byte, you\n-cannot use the 0-terminated string overloads, but have to use string_view\n-instead. dict_find_list will return a valid bdecode_node if the key is found\n-_and_ it is a list. Otherwise it will return a default-constructed\n-_\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-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-string_view s\bst\btr\bri\bin\bng\bg_\b_v\bva\bal\blu\bue\be () 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 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@@ -6681,16 +7636,16 @@\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 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 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@@ -6710,17 +7665,17 @@\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_f\bfa\bai\bil\ble\bed\bd (piece_index_t);\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_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@@ -6779,51 +7734,51 @@\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_c\bch\bho\bok\bke\be ();\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_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_\b_a\bal\bll\bl ();\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_u\bun\bnc\bch\bho\bok\bke\be ();\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_n\bno\bot\bt_\b_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd ();\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 (piece_index_t);\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_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_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_h\bha\bav\bve\be_\b_a\bal\bll\bl ();\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_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_r\bre\beq\bqu\bue\bes\bst\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_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_h\bha\bav\bve\be_\b_n\bno\bon\bne\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_c\bch\bho\bok\bke\be ();\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\bpi\bie\bec\bce\be (peer_request const&);\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_h\bha\bav\bve\be (piece_index_t);\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 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 };\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@@ -6851,46 +7806,46 @@\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_u\bun\bnc\bch\bho\bok\bke\be(\b()\b) o\bon\bn_\b_r\bre\beq\bqu\bue\bes\bst\bt(\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_n\bno\bon\bne\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_d\bdo\bon\bnt\bt_\b_h\bha\bav\bve\be(\b()\b) o\bon\bn_\b_c\bch\bho\bok\bke\be(\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)\n-o\bon\bn_\b_b\bbi\bit\btf\bfi\bie\bel\bld\bd(\b()\b) o\bon\bn_\b_h\bha\bav\bve\be_\b_a\bal\bll\bl(\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+*\b**\b**\b**\b**\b* o\bon\bn_\b_h\bha\bav\bve\be_\b_n\bno\bon\bne\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_u\bun\bnc\bch\bho\bok\bke\be(\b()\b) o\bon\bn_\b_b\bbi\bit\btf\bfi\bie\bel\bld\bd(\b()\b) o\bon\bn_\b_h\bha\bav\bve\be_\b_a\bal\bll\bl\n+(\b()\b) o\bon\bn_\b_d\bdo\bon\bnt\bt_\b_h\bha\bav\bve\be(\b()\b) o\bon\bn_\b_c\bch\bho\bok\bke\be(\b()\b) o\bon\bn_\b_r\bre\beq\bqu\bue\bes\bst\bt(\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_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_c\bch\bho\bok\bke\be ();\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_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_\b_a\bal\bll\bl ();\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_u\bun\bnc\bch\bho\bok\bke\be ();\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_n\bno\bot\bt_\b_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd ();\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 (piece_index_t);\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_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 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_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_u\bun\bnc\bch\bho\bok\bke\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_i\bin\bnt\bte\ber\bre\bes\bst\bte\bed\bd ();\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_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_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 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\bpi\bie\bec\bce\be (peer_request const&);\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_h\bha\bav\bve\be (piece_index_t);\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@@ -6915,17 +7870,17 @@\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_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+*\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_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 [_\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 [_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n@@ -6969,45 +7924,45 @@\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_c\bch\bho\bok\bke\bed\bd () 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 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 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_c\bco\bon\bnn\bne\bec\bct\bti\bin\bng\bg () 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 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 i\bis\bs_\b_c\bco\bon\bnn\bne\bec\bct\bti\bin\bng\bg () 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 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 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- 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+ 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< (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- bool o\bop\bpe\ber\bra\bat\bto\bor\br<\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@@ -7019,25 +7974,14 @@\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_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@@ -7052,492 +7996,2345 @@\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* 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+*\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* 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- bool o\bop\bpe\ber\bra\bat\bto\bor\br=\b==\b= (torrent_status const& st) const;\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+ 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+ 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 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 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+ 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_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+ 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_i\bin\bnt\bt (string_view key) const;\n+ std::int64_t i\bin\bnt\bt_\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+ 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+ 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 state_t\n+ enum type_t\n {\n- checking_files,\n- downloading_metadata,\n- downloading,\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+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+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+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_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()\b)\n+d\bdi\bic\bct\bt_\b_f\bfi\bin\bnd\bd(\b()\b) d\bdi\bic\bct\bt_\b_s\bsi\biz\bze\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_f\bfi\bin\bnd\bd_\b_l\bli\bis\bst\bt(\b()\b)\n+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) *\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+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+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_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+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_i\bin\bnt\bt (string_view key) const;\n+Functions with the dict_ prefix operates on dictionaries. They are only valid\n+if type() == dict_t. In case a key you're looking up contains a 0 byte, you\n+cannot use the 0-terminated string overloads, but have to use string_view\n+instead. dict_find_list will return a valid bdecode_node if the key is found\n+_and_ it is a list. Otherwise it will return a default-constructed\n+_\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_p\bpt\btr\br(\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_v\bva\bal\blu\bue\be(\b()\b) *\b**\b**\b**\b**\b*\n+char const* s\bst\btr\bri\bin\bng\bg_\b_p\bpt\btr\br () 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+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* 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+\n+ enum block_state_t\n+ {\n+ none,\n+ requested,\n+ writing,\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+ 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* 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+*\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+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 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+*\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+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bp_\be_\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 |\n+|requested|1 |The block has been requested, but not completely downloaded|\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\by_\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 |\n+|writing |2 |The block has been downloaded and is currently queued for |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bb_\be_\bi_\bn_\bg_\b _\bw_\br_\bi_\bt_\bt_\be_\bn_\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 |\n+|_\bf_\bi_\bn_\bi_\bs_\bh_\be_\bd_\b _\b|_\b3_\b _\b _\b _\b _\b|_\bT_\bh_\be_\b _\bb_\bl_\bo_\bc_\bk_\b _\bh_\ba_\bs_\b _\bb_\be_\be_\bn_\b _\bw_\br_\bi_\bt_\bt_\be_\bn_\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 |\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+ bytes_progress\n+ the number of bytes that have been received for this block\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+ block_size\n+ the total number of bytes in this block.\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+ state\n+ the state this block is in (see _\bb_\bl_\bo_\bc_\bk_\b__\bs_\bt_\ba_\bt_\be_\b__\bt)\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+ num_peers\n+ the number of peers that is currently requesting this block. Typically\n+ this is 0 or 1, but at the end of the torrent blocks may be requested by\n+ more peers in parallel to speed things up.\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+*\b**\b**\b**\b**\b**\b* p\bpa\bar\brt\bti\bia\bal\bl_\b_p\bpi\bie\bec\bce\be_\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+This class holds information about pieces that have outstanding requests or\n+outstanding writes\n+struct partial_piece_info\n+{\n+ piece_index_t piece_index;\n+ int blocks_in_piece;\n+ int finished;\n+ int writing;\n+ int requested;\n+ block_info const* blocks;\n+};\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+ piece_index\n+ the index of the piece in question. blocks_in_piece is the number of\n+ blocks in this particular piece. This number will be the same for most\n+ pieces, but the last piece may have fewer blocks than the standard\n+ pieces.\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+ blocks_in_piece\n+ the number of blocks in this piece\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+ finished\n+ the number of blocks that are in the finished state\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+ writing\n+ the number of blocks that are in the writing state\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+ requested\n+ the number of blocks that are in the requested state\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+ blocks\n+ this is an array of blocks_in_piece number of items. One for each block\n+ in the piece.\n+ Warning\n+ This is a pointer that points to an array that's owned by the _\bs_\be_\bs_\bs_\bi_\bo_\bn\n+ object. The next time _\bg_\be_\bt_\b__\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\b__\bq_\bu_\be_\bu_\be_\b(_\b) is called, it will be\n+ invalidated. In the case of _\bp_\bi_\be_\bc_\be_\b__\bi_\bn_\bf_\bo_\b__\ba_\bl_\be_\br_\bt, these pointers point into\n+ the _\ba_\bl_\be_\br_\bt object itself, and will be invalidated when the _\ba_\bl_\be_\br_\bt destruct.\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+*\b**\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*\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+You will usually have to store your torrent handles somewhere, since it's the\n+object through which you retrieve information about the torrent and aborts the\n+torrent.\n+Warning\n+Any member function that returns a value or fills in a value has to be made\n+synchronously. This means it has to wait for the main thread to complete the\n+query before it can return. This might potentially be expensive if done from\n+within a GUI thread that needs to stay responsive. Try to avoid querying for\n+information you don't need, and try to do it in as few calls as possible. You\n+can get most of the interesting information about a torrent from the\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) call.\n+The default constructor will initialize the handle to an invalid state. Which\n+means you cannot perform any operation on it, unless you first assign it a\n+valid handle. If you try to perform any operation on an uninitialized handle,\n+it will throw invalid_handle.\n+Warning\n+All operations on a _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be may throw system_error exception, in case\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, 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 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+ 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+ 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 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 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+ 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_p\bpr\bro\bog\bgr\bre\bes\bss\bs (file_progress_flags_t flags = {})\n+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 r\bre\bep\bpl\bla\bac\bce\be_\b_t\btr\bra\bac\bck\bke\ber\brs\bs (std::vector const&) 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+ 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+ void a\bad\bdd\bd_\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 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_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 p\bpa\bau\bus\bse\be (pause_flags_t flags = {}) const;\n+ void r\bre\bes\bsu\bum\bme\be () const;\n+ void u\bun\bns\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 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 () 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+ 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_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_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+ 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::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+ 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\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\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_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) 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+ 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 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 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_d\bdh\bht\bt_\b_a\ban\bnn\bno\bou\bun\bnc\bce\be () 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_d\bdo\bow\bwn\bnl\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_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+ 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+ 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+ 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+ static constexpr status_flags_t q\bqu\bue\ber\bry\by_\b_a\bac\bcc\bcu\bur\bra\bat\bte\be_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_c\bco\bou\bun\bnt\bte\ber\brs\bs = 1_bit;\n+ static constexpr status_flags_t q\bqu\bue\ber\bry\by_\b_l\bla\bas\bst\bt_\b_s\bse\bee\ben\bn_\b_c\bco\bom\bmp\bpl\ble\bet\bte\be = 2_bit;\n+ static constexpr status_flags_t q\bqu\bue\ber\bry\by_\b_p\bpi\bie\bec\bce\bes\bs = 3_bit;\n+ static constexpr status_flags_t q\bqu\bue\ber\bry\by_\b_v\bve\ber\bri\bif\bfi\bie\bed\bd_\b_p\bpi\bie\bec\bce\bes\bs = 4_bit;\n+ static constexpr status_flags_t q\bqu\bue\ber\bry\by_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be = 5_bit;\n+ static constexpr status_flags_t q\bqu\bue\ber\bry\by_\b_n\bna\bam\bme\be = 6_bit;\n+ static constexpr status_flags_t q\bqu\bue\ber\bry\by_\b_s\bsa\bav\bve\be_\b_p\bpa\bat\bth\bh = 7_bit;\n+ static constexpr deadline_flags_t a\bal\ble\ber\brt\bt_\b_w\bwh\bhe\ben\bn_\b_a\bav\bva\bai\bil\bla\bab\bbl\ble\be = 0_bit;\n+ static constexpr file_progress_flags_t p\bpi\bie\bec\bce\be_\b_g\bgr\bra\ban\bnu\bul\bla\bar\bri\bit\bty\by = 0_bit;\n+ static constexpr pause_flags_t g\bgr\bra\bac\bce\bef\bfu\bul\bl_\b_p\bpa\bau\bus\bse\be = 0_bit;\n+ static constexpr resume_data_flags_t f\bfl\blu\bus\bsh\bh_\b_d\bdi\bis\bsk\bk_\b_c\bca\bac\bch\bhe\be = 0_bit;\n+ static constexpr resume_data_flags_t s\bsa\bav\bve\be_\b_i\bin\bnf\bfo\bo_\b_d\bdi\bic\bct\bt = 1_bit;\n+ static constexpr resume_data_flags_t o\bon\bnl\bly\by_\b_i\bif\bf_\b_m\bmo\bod\bdi\bif\bfi\bie\bed\bd = 2_bit;\n+ static constexpr resume_data_flags_t i\bif\bf_\b_c\bco\bou\bun\bnt\bte\ber\brs\bs_\b_c\bch\bha\ban\bng\bge\bed\bd = 3_bit;\n+ static constexpr resume_data_flags_t i\bif\bf_\b_d\bdo\bow\bwn\bnl\blo\boa\bad\bd_\b_p\bpr\bro\bog\bgr\bre\bes\bss\bs = 4_bit;\n+ static constexpr resume_data_flags_t i\bif\bf_\b_c\bco\bon\bnf\bfi\big\bg_\b_c\bch\bha\ban\bng\bge\bed\bd = 5_bit;\n+ static constexpr resume_data_flags_t i\bif\bf_\b_s\bst\bta\bat\bte\be_\b_c\bch\bha\ban\bng\bge\bed\bd = 6_bit;\n+ static constexpr resume_data_flags_t i\bif\bf_\b_m\bme\bet\bta\bad\bda\bat\bta\ba_\b_c\bch\bha\ban\bng\bge\bed\bd = 7_bit;\n+ static constexpr reannounce_flags_t i\big\bgn\bno\bor\bre\be_\b_m\bmi\bin\bn_\b_i\bin\bnt\bte\ber\brv\bva\bal\bl = 0_bit;\n+};\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+*\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- 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+*\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, 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+the hash check by waiting for _\bp_\bi_\be_\bc_\be_\b__\bf_\bi_\bn_\bi_\bs_\bh_\be_\bd_\b__\ba_\bl_\be_\br_\bt or _\bh_\ba_\bs_\bh_\b__\bf_\ba_\bi_\bl_\be_\bd_\b__\ba_\bl_\be_\br_\bt.\n+Adding pieces while the torrent is being checked (i.e. in _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bs_\bt_\ba_\bt_\bu_\bs_\b:_\b:\n+_\bc_\bh_\be_\bc_\bk_\bi_\bn_\bg_\b__\bf_\bi_\bl_\be_\bs state) is not supported.\n+The overload taking a raw pointer to the data is a blocking call. It won't\n+return until the libtorrent thread has copied the data into its disk write\n+buffer. data is expected to point to a buffer of as many bytes as the size of\n+the specified piece. See _\bf_\bi_\bl_\be_\b__\bs_\bt_\bo_\br_\ba_\bg_\be_\b:_\b:_\bp_\bi_\be_\bc_\be_\b__\bs_\bi_\bz_\be_\b(_\b).\n+The data in the buffer is copied and passed on to the disk IO thread to be\n+written at a later point.\n+The overload taking a std::vector is not blocking, it will send the\n+buffer to the main thread and return immediately.\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+*\b**\b**\b**\b**\b* r\bre\bea\bad\bd_\b_p\bpi\bie\bec\bce\be(\b()\b) *\b**\b**\b**\b**\b*\n+void r\bre\bea\bad\bd_\b_p\bpi\bie\bec\bce\be (piece_index_t piece) const;\n+This function starts an asynchronous read operation of the specified piece from\n+this torrent. You must have completed the download of the specified piece\n+before calling this function.\n+When the read operation is completed, it is passed back through an _\ba_\bl_\be_\br_\bt,\n+_\br_\be_\ba_\bd_\b__\bp_\bi_\be_\bc_\be_\b__\ba_\bl_\be_\br_\bt. Since this _\ba_\bl_\be_\br_\bt is a response to an explicit call, it will\n+always be posted, regardless of the _\ba_\bl_\be_\br_\bt mask.\n+Note that if you read multiple pieces, the read operations are not guaranteed\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- 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+*\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- 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+*\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 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- 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+*\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+with the _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bs_\bt_\ba_\bt_\bu_\bs object. To avoid blocking, instead call post_status().\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- 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+*\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+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 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+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- 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+*\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 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+unless the alert_when_available flag is set, in which case it will have the\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- 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+*\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+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+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+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+progress. If left at the default value of 0, the progress will be as accurate\n+as possible, but also more expensive to calculate. If torrent_handle::\n+piece_granularity is specified, the progress will be specified in piece\n+granularity. i.e. only pieces that have been fully downloaded and passed the\n+hash check count. When specifying piece granularity, the operation is a lot\n+cheaper, since libtorrent already keeps track of this internally and no\n+calculation is required.\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+*\b**\b**\b**\b**\b* f\bfi\bil\ble\be_\b_s\bst\bta\bat\btu\bus\bs(\b()\b) *\b**\b**\b**\b**\b*\n+std::vector f\bfi\bil\ble\be_\b_s\bst\bta\bat\btu\bus\bs () const;\n+This function returns a vector with status about files that are open for this\n+torrent. Any file that is not open will not be reported in the vector, i.e.\n+it's possible that the vector is empty when returning, if none of the files in\n+the torrent are currently open.\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- 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+*\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- 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+*\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) 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+std::vector t\btr\bra\bac\bck\bke\ber\brs\bs () 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+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+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+post_trackers() is the asynchronous version of trackers(). It will trigger a\n+_\bt_\br_\ba_\bc_\bk_\be_\br_\b__\bl_\bi_\bs_\bt_\b__\ba_\bl_\be_\br_\bt to be posted.\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- added_time\n- the posix-time when this torrent was added. i.e. what time(nullptr)\n- returned at the time.\n+*\b**\b**\b**\b**\b* u\bur\brl\bl_\b_s\bse\bee\bed\bds\bs(\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) *\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- completed_time\n- the posix-time when this torrent was finished. If the torrent is not yet\n- finished, this is 0.\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+std::set h\bht\btt\btp\bp_\b_s\bse\bee\bed\bds\bs () 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+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- last_seen_complete\n- the time when we, or one of our peers, last saw a complete copy of this\n- torrent.\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+client_data_t)> const& ext\n+ , client_data_t userdata = client_data_t{});\n+add the specified extension to this torrent. The ext argument is a function\n+that will be called from within libtorrent's context passing in the internal\n+torrent object and the specified userdata pointer. The function is expected to\n+return a shared pointer to a _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\bl_\bu_\bg_\bi_\bn instance.\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+*\b**\b**\b**\b**\b* s\bse\bet\bt_\b_m\bme\bet\bta\bad\bda\bat\bta\ba(\b()\b) *\b**\b**\b**\b**\b*\n+bool s\bse\bet\bt_\b_m\bme\bet\bta\bad\bda\bat\bta\ba (span metadata) const;\n+set_metadata expects the i\bin\bnf\bfo\bo section of metadata. i.e. The buffer passed in\n+will be hashed and verified against the info-hash. If it fails, a\n+metadata_failed_alert will be generated. If it passes, a\n+metadata_received_alert is generated. The function returns true if the metadata\n+is successfully set on the torrent, and false otherwise. If the torrent already\n+has metadata, this function will not affect the torrent, and false will be\n+returned.\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+*\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 torrent and false if it hasn't\n+been initialized or if the torrent it refers to has been removed from the\n+_\bs_\be_\bs_\bs_\bi_\bo_\bn AND destructed.\n+To tell if the _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be is in the _\bs_\be_\bs_\bs_\bi_\bo_\bn, use _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be_\b:_\b:_\bi_\bn_\b__\bs_\be_\bs_\bs_\bi_\bo_\bn\n+_\b(_\b). This will return true before _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bh_\ba_\bn_\bd_\bl_\be_\b:_\b:_\br_\be_\bm_\bo_\bv_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b) is called,\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- 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+*\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+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- 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+*\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 u\bun\bns\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 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+added, and it can only be set as part of the _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs flags, when\n+adding the torrent.\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+*\b**\b**\b**\b**\b* f\bfl\blu\bus\bsh\bh_\b_c\bca\bac\bch\bhe\be(\b()\b) *\b**\b**\b**\b**\b*\n+void f\bfl\blu\bus\bsh\bh_\b_c\bca\bac\bch\bhe\be () const;\n+Instructs libtorrent to flush all the disk caches for this torrent and close\n+all file handles. This is done asynchronously and you will be notified that\n+it's complete through _\bc_\ba_\bc_\bh_\be_\b__\bf_\bl_\bu_\bs_\bh_\be_\bd_\b__\ba_\bl_\be_\br_\bt.\n+Note that by the time you get the _\ba_\bl_\be_\br_\bt, libtorrent may have cached more data\n+for the torrent, but you are guaranteed that whatever cached data libtorrent\n+had by the time you called torrent_handle::flush_cache() has been written to\n+disk.\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+*\b**\b**\b**\b**\b* f\bfo\bor\brc\bce\be_\b_r\bre\bec\bch\bhe\bec\bck\bk(\b()\b) *\b**\b**\b**\b**\b*\n+void f\bfo\bor\brc\bce\be_\b_r\bre\bec\bch\bhe\bec\bck\bk () const;\n+force_recheck puts the torrent back in a state where it assumes to have no\n+resume data. All peers will be disconnected and the torrent will stop\n+announcing to the tracker. The torrent will be added to the checking queue, and\n+will be checked (all the files will be read and compared to the piece hashes).\n+Once the check is complete, the torrent will start connecting to peers again,\n+as normal. The torrent will be placed last in queue, i.e. its queue position\n+will be the highest of all torrents in the _\bs_\be_\bs_\bs_\bi_\bo_\bn.\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+*\b**\b**\b**\b**\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+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+save_resume_data() asks libtorrent to generate fast-resume data for this\n+torrent. The fast resume data (stored in an _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs object) can be\n+used to resume a torrent in the next _\bs_\be_\bs_\bs_\bi_\bo_\bn without having to check all files\n+for which pieces have been downloaded. It can also be used to save a .torrent\n+file for a _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be.\n+This operation is asynchronous, save_resume_data will return immediately. The\n+resume data is delivered when it's done through a _\bs_\ba_\bv_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b__\ba_\bl_\be_\br_\bt.\n+The operation will fail, and post a _\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 instead, in\n+the following cases:\n+ 1. The torrent is in the process of being removed.\n+ 2. No torrent state has changed since the last saving of resume\n+ data, and the only_if_modified flag is set. metadata (see\n+ libtorrent's _\bm_\be_\bt_\ba_\bd_\ba_\bt_\ba_\b _\bf_\br_\bo_\bm_\b _\bp_\be_\be_\br_\bs extension)\n+Note that some _\bc_\bo_\bu_\bn_\bt_\be_\br_\bs may be outdated by the time you receive the fast resume\n+data\n+When saving resume data because of shutting down, make sure not to\n+_\br_\be_\bm_\bo_\bv_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b(_\b) before you receive the _\bs_\ba_\bv_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b__\ba_\bl_\be_\br_\bt. There's no need\n+to pause the _\bs_\be_\bs_\bs_\bi_\bo_\bn or torrent when saving resume data.\n+The paused state of a torrent is saved in the resume data, so pausing all\n+torrents before saving resume data will all torrents be restored in a paused\n+state.\n+Note\n+It is typically a good idea to save resume data whenever a torrent is completed\n+or paused. If you save resume data for torrents when they are paused, you can\n+accelerate the shutdown process by not saving resume data again for those\n+torrents. Completed torrents should have their resume data saved when they\n+complete and on exit, since their statistics might be updated.\n+Example code to pause and save resume data for all torrents and wait for the\n+alerts:\n+extern int outstanding_resume_data; // global counter of outstanding resume\n+data\n+std::vector handles = ses.get_torrents();\n+for (torrent_handle const& h : handles) try\n+{\n+ h.save_resume_data(torrent_handle::only_if_modified);\n+ ++outstanding_resume_data;\n+}\n+catch (lt::system_error const& e)\n+{\n+ // the handle was invalid, ignore this one and move to the next\n+}\n+\n+while (outstanding_resume_data > 0)\n+{\n+ alert const* a = ses.wait_for_alert(seconds(30));\n+\n+ // if we don't get an alert within 30 seconds, abort\n+ if (a == nullptr) break;\n+\n+ std::vector alerts;\n+ ses.pop_alerts(&alerts);\n+\n+ for (alert* i : alerts)\n+ {\n+ if (alert_cast(i))\n+ {\n+ process_alert(i);\n+ --outstanding_resume_data;\n+ continue;\n+ }\n+\n+ save_resume_data_alert const* rd =\n+alert_cast(i);\n+ if (rd == nullptr)\n+ {\n+ process_alert(i);\n+ continue;\n+ }\n+\n+ std::ofstream out((rd->params.save_path\n+ + \"/\" + rd->params.name + \".fastresume\").c_str()\n+ , std::ios_base::binary);\n+ std::vector buf = write_resume_data_buf(rd->params);\n+ out.write(buf.data(), buf.size());\n+ --outstanding_resume_data;\n+ }\n+}\n+Note\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- 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+*\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+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- 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+*\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()\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_u\bup\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) *\b**\b**\b**\b**\b*\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_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_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+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+queue_position() returns the torrent's position in the download queue. The\n+torrents with the smallest numbers are the ones that are being downloaded. The\n+smaller number, the closer the torrent is to the front of the line to be\n+started.\n+The queue position is also available in the _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bs_\bt_\ba_\bt_\bu_\bs.\n+The queue_position_*() functions adjust the torrents position in the queue. Up\n+means closer to the front and down means closer to the back of the queue. Top\n+and bottom refers to the front and the back of the queue respectively.\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+*\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- 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+*\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+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+For SSL torrents, use this to specify a path to a .pem file to use as this\n+client's certificate. The certificate must be signed by the certificate in the\n+.torrent file to be valid.\n+The _\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) overload takes the actual certificate, private\n+key and DH params as strings, rather than paths to files.\n+cert is a path to the (signed) certificate in .pem format corresponding to this\n+torrent.\n+private_key is a path to the private key for the specified certificate. This\n+must be in .pem format.\n+dh_params is a path to the Diffie-Hellman parameter file, which needs to be in\n+.pem format. You can generate this file using the openssl command like this:\n+openssl dhparam -outform PEM -out dhparams.pem 512.\n+passphrase may be specified if the private key is encrypted and requires a\n+passphrase to be decrypted.\n+Note that when a torrent first starts up, and it needs a certificate, it will\n+suspend connecting to any peers until it has one. It's typically desirable to\n+resume the torrent after setting the SSL certificate.\n+If you receive a _\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- 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+*\b**\b**\b**\b**\b* t\bto\bor\brr\bre\ben\bnt\bt_\b_f\bfi\bil\ble\be(\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) *\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+_\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+dht nodes and trackers. A _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo object does not round-trip cleanly when\n+added to a _\bs_\be_\bs_\bs_\bi_\bo_\bn.\n+If you want to save a .torrent file from the _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be, instead call\n+_\bs_\ba_\bv_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b) and _\bw_\br_\bi_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bi_\bl_\be_\b(_\b) the _\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs object\n+passed back in the _\ba_\bl_\be_\br_\bt.\n+_\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) returns a c\bco\bop\bpy\by of the internal _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo and\n+piece layer hashes (if it's a v2 torrent). The piece layers will only be\n+included if they are available. If this torrent was added from a .torrent file\n+with piece layers or if it's seeding, the piece layers are available. This\n+function is more expensive than _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bi_\bl_\be_\b(_\b) since it needs to make copies of\n+this information.\n+The _\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) is here for backwards compatibility when\n+constructing a _\bc_\br_\be_\ba_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt object from a _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo that's in a _\bs_\be_\bs_\bs_\bi_\bo_\bn.\n+Prefer _\bs_\ba_\bv_\be_\b__\br_\be_\bs_\bu_\bm_\be_\b__\bd_\ba_\bt_\ba_\b(_\b) + _\bw_\br_\bi_\bt_\be_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bi_\bl_\be_\b(_\b).\n+Note that a torrent added from a magnet link may not have the full merkle trees\n+for all files, and hence not have the complete piece layers. In that state, you\n+cannot create a .torrent file even from the _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bi_\bn_\bf_\bo returned from\n+_\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). Once the torrent completes downloading all files,\n+becoming a seed, you can make a .torrent file from it.\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+*\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- 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+*\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- 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+*\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+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\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+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) 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+and so on.\n+The default priority of pieces is 4.\n+Piece priorities can not be changed for torrents that have not downloaded the\n+metadata yet. Magnet links won't have metadata immediately. see the\n+_\bm_\be_\bt_\ba_\bd_\ba_\bt_\ba_\b__\br_\be_\bc_\be_\bi_\bv_\be_\bd_\b__\ba_\bl_\be_\br_\bt.\n+piece_priority sets or gets the priority for an individual piece, specified by\n+index.\n+prioritize_pieces takes a vector of integers, one integer per piece in the\n+torrent. All the piece priorities will be updated with the priorities in the\n+vector. The second overload of prioritize_pieces that takes a vector of pairs\n+will update the priorities of only select pieces, and leave all other\n+unaffected. Each pair is (piece, priority). That is, the first item is the\n+piece index and the second item is the priority of that piece. Invalid entries,\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- 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+*\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+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 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+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+The priority values are the same as for _\bp_\bi_\be_\bc_\be_\b__\bp_\br_\bi_\bo_\br_\bi_\bt_\by_\b(_\b). See\n+_\bd_\bo_\bw_\bn_\bl_\bo_\ba_\bd_\b__\bp_\br_\bi_\bo_\br_\bi_\bt_\by_\b__\bt.\n+Whenever a file priority is changed, all other piece priorities are reset to\n+match the file priorities. In order to maintain special priorities for\n+particular pieces, _\bp_\bi_\be_\bc_\be_\b__\bp_\br_\bi_\bo_\br_\bi_\bt_\by_\b(_\b) has to be called again for those pieces.\n+You cannot set the file priorities on a torrent that does not yet have metadata\n+or a torrent that is a seed. file_priority(int, int) and _\bp_\br_\bi_\bo_\br_\bi_\bt_\bi_\bz_\be_\b__\bf_\bi_\bl_\be_\bs_\b(_\b) are\n+both no-ops for such torrents.\n+Since changing file priorities may involve disk operations (of moving files in-\n+and out of the part file), the internal accounting of file priorities happen\n+asynchronously. i.e. setting file priorities and then immediately querying them\n+may not yield the same priorities just set. To synchronize with the priorities\n+taking effect, wait for the _\bf_\bi_\bl_\be_\b__\bp_\br_\bi_\bo_\b__\ba_\bl_\be_\br_\bt.\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- num_uploads\n- the number of unchoked peers in this torrent.\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_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_d\bdh\bht\bt_\b_a\ban\bnn\bno\bou\bun\bnc\bce\be () 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+1 (which is the default), all trackers are re-announce.\n+The flags argument can be used to affect the re-announce. See\n+ignore_min_interval.\n+force_dht_announce will announce the torrent to the DHT immediately.\n+force_lsd_announce will announce the torrent on LSD immediately.\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+*\b**\b**\b**\b**\b* s\bsc\bcr\bra\bap\bpe\be_\b_t\btr\bra\bac\bck\bke\ber\br(\b()\b) *\b**\b**\b**\b**\b*\n+void s\bsc\bcr\bra\bap\bpe\be_\b_t\btr\bra\bac\bck\bke\ber\br (int idx = -1) const;\n+scrape_tracker() will send a scrape request to a tracker. By default (idx = -1)\n+it will scrape the last working tracker. If idx is >= 0, the tracker with the\n+specified index will scraped.\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- uploads_limit\n- the set limit of upload slots (unchoked peers) for this torrent.\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) 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)\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_d\bdo\bow\bwn\bnl\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_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+upload_limit and download_limit will return the current limit setting, for\n+upload and download, respectively.\n+Local peers are not rate limited by default. 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- connections_limit\n- the set limit of number of connections for this torrent.\n+*\b**\b**\b**\b**\b* c\bco\bon\bnn\bne\bec\bct\bt_\b_p\bpe\bee\ber\br(\b()\b) *\b**\b**\b**\b**\b*\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+connect_peer() is a way to manually connect to peers that one believe is a part\n+of the torrent. If the peer does not respond, or is not a member of this\n+torrent, it will simply be disconnected. No harm can be done by using this\n+other than an unnecessary connection attempt is made. If the torrent is\n+uninitialized or in queued or checking mode, this will throw system_error. The\n+second (optional) argument will be bitwise ORed into the source mask of this\n+peer. Typically this is one of the source flags in _\bp_\be_\be_\br_\b__\bi_\bn_\bf_\bo. i.e. tracker,\n+pex, dht etc.\n+For possible values of flags, see _\bp_\be_\bx_\b__\bf_\bl_\ba_\bg_\bs_\b__\bt.\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+*\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- 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+*\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+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- 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+*\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+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 [_\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+*\b**\b**\b**\b**\b* m\bmo\bov\bve\be_\b_s\bst\bto\bor\bra\bag\bge\be(\b()\b) *\b**\b**\b**\b**\b*\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+Moves the file(s) that this torrent are currently seeding from or downloading\n+to. If the given save_path is not located on the same drive as the original\n+save path, the files will be copied to the new drive and removed from their\n+original location. This will block all other disk IO, and other torrents\n+download and upload rates may drop while copying the file.\n+Since disk IO is performed in a separate thread, this operation is also\n+asynchronous. Once the operation completes, the storage_moved_alert is\n+generated, with the new path as the message. If the move fails for some reason,\n+storage_moved_failed_alert is generated instead, containing the error message.\n+The flags argument determines the behavior of the copying/moving of the files\n+in the torrent. see _\bm_\bo_\bv_\be_\b__\bf_\bl_\ba_\bg_\bs_\b__\bt.\n+always_replace_files is the default and replaces any file that exist in both\n+the source directory and the target directory.\n+fail_if_exist first check to see that none of the copy operations would cause\n+an overwrite. If it would, it will fail. Otherwise it will proceed as if it was\n+in always_replace_files mode. Note that there is an inherent race condition\n+here. If the files in the target directory appear after the check but before\n+the copy or move completes, they will be overwritten. When failing because of\n+files already existing in the target path, the error of\n+move_storage_failed_alert is set to boost::system::errc::file_exists.\n+The intention is that a client may use this as a probe, and if it fails, ask\n+the user which mode to use. The client may then re-issue the move_storage call\n+with one of the other modes.\n+dont_replace always keeps the existing file in the target directory, if there\n+is one. The source files will still be removed in that case. Note that it won't\n+automatically re-check files. If an incomplete torrent is moved into a\n+directory with the complete files, pause, move, force-recheck and resume.\n+Without the re-checking, the torrent will keep downloading and files in the new\n+download directory will be overwritten.\n+Files that have been renamed to have absolute paths are not moved by this\n+function. Keep in mind that files that don't belong to the torrent but are\n+stored in the torrent's directory may be moved as well. This goes for files\n+that have been renamed to absolute paths that still end up inside the save\n+path.\n+When copying files, sparse regions are not likely to be preserved. This makes\n+it proportionally more expensive to move a large torrent when only few pieces\n+have been downloaded, since the files are then allocated with zeros in the\n+destination directory.\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+*\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- 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+*\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+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- 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+*\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< (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==\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- has_incoming\n- true if there has ever been an incoming connection attempt to this\n- torrent.\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- 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+*\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 and the _\ba_\bl_\be_\br_\bt dispatch\n+function. This type does not have a stable ABI and should be relied on as\n+little as possible. Accessing the handle returned by this function is not\n+thread safe outside of libtorrent's internal thread (which is used to invoke\n+_\bp_\bl_\bu_\bg_\bi_\bn callbacks). The torrent class is not only eligible for changing ABI\n+across minor versions of libtorrent, its layout is also dependent on build\n+configuration. This adds additional requirements on a client to be built with\n+the exact same build configuration as libtorrent itself. i.e. the TORRENT_\n+macros must match between libtorrent and the client builds.\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+*\b**\b**\b**\b**\b* u\bus\bse\ber\brd\bda\bat\bta\ba(\b()\b) *\b**\b**\b**\b**\b*\n+client_data_t u\bus\bse\ber\brd\bda\bat\bta\ba () const;\n+returns the userdata pointer as set in _\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* i\bin\bn_\b_s\bse\bes\bss\bsi\bio\bon\bn(\b()\b) *\b**\b**\b**\b**\b*\n+bool i\bin\bn_\b_s\bse\bes\bss\bsi\bio\bon\bn () const;\n+Returns true if the torrent is in the _\bs_\be_\bs_\bs_\bi_\bo_\bn. It returns true before session::\n+remove_torrent() is called, and false afterward.\n+Note that this is a blocking function, unlike _\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) which\n+returns immediately.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ overwrite_existing\n+ instruct libtorrent to overwrite any data that may already have been\n+ downloaded with the data of the new piece being added. Using this flag\n+ when adding a piece that is actively being downloaded from other peers\n+ may have some unexpected consequences, as blocks currently being\n+ downloaded from peers may not be replaced.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ query_distributed_copies\n+ calculates distributed_copies, distributed_full_copies and\n+ distributed_fraction.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ query_accurate_download_counters\n+ includes partial downloaded blocks in total_done and total_wanted_done.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ query_last_seen_complete\n+ includes last_seen_complete.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ query_pieces\n+ populate the pieces field 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+ query_verified_pieces\n+ includes verified_pieces (only applies to torrents in s\bse\bee\bed\bd m\bmo\bod\bde\be).\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ query_torrent_file\n+ includes torrent_file, which is all the static information from the\n+ .torrent file.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ query_name\n+ includes name, the name of the torrent. This is either derived from the\n+ .torrent file, or from the &dn= magnet link argument or possibly some\n+ other source. If the name of the torrent is not known, this is an empty\n+ string.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ query_save_path\n+ includes save_path, the path to the directory the files of the torrent\n+ are saved to.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ alert_when_available\n+ used to ask libtorrent to send an _\ba_\bl_\be_\br_\bt once the piece has been\n+ downloaded, by passing alert_when_available. When set, the\n+ _\br_\be_\ba_\bd_\b__\bp_\bi_\be_\bc_\be_\b__\ba_\bl_\be_\br_\bt _\ba_\bl_\be_\br_\bt will be delivered, with the piece data, when it's\n+ downloaded.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ piece_granularity\n+ only calculate file progress at piece granularity. This makes the\n+ _\bf_\bi_\bl_\be_\b__\bp_\br_\bo_\bg_\br_\be_\bs_\bs_\b(_\b) call cheaper and also only takes bytes that have passed\n+ the hash check into account, so progress cannot regress in this mode.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ graceful_pause\n+ will delay the disconnect of peers that we're still downloading\n+ outstanding requests from. The torrent will not accept any more requests\n+ and will disconnect all idle peers. As soon as a peer is done\n+ transferring the blocks that were requested from it, it is disconnected.\n+ This is a graceful shut down of the torrent in the sense that no\n+ downloaded bytes are wasted.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ flush_disk_cache\n+ the disk cache will be flushed before creating the resume data. This\n+ avoids a problem with file timestamps in the resume data in case the\n+ cache hasn't been flushed yet.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ save_info_dict\n+ the resume data will contain the metadata from the torrent file as well.\n+ This is useful for clients that don't keep .torrent files around\n+ separately, or for torrents that were added via a magnet link.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ only_if_modified\n+ this flag has the same behavior as the combination of:\n+ if_counters_changed | if_download_progress | if_config_changed |\n+ if_state_changed | if_metadata_changed\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ if_counters_changed\n+ save resume data if any _\bc_\bo_\bu_\bn_\bt_\be_\br_\bs has changed since the last time resume\n+ data was saved. This includes upload/download _\bc_\bo_\bu_\bn_\bt_\be_\br_\bs, active time\n+ _\bc_\bo_\bu_\bn_\bt_\be_\br_\bs and scrape data. A torrent that is not paused will have its\n+ active time _\bc_\bo_\bu_\bn_\bt_\be_\br_\bs incremented continuously.\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ if_download_progress\n+ save the resume data if any blocks have been downloaded since the last\n+ time resume data was saved. This includes: * checking existing files on\n+ disk * downloading a block from a peer\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ if_config_changed\n+ save the resume data if configuration options changed since last time the\n+ resume data was saved. This includes: * file- or piece priorities *\n+ upload- and download rate limits * change max-uploads (unchoke slots) *\n+ change max connection limit * enable/disable peer-exchange, local service\n+ discovery or DHT * enable/disable apply IP-filter * enable/disable auto-\n+ managed * enable/disable share-mode * enable/disable sequential-mode *\n+ files renamed * storage moved (save_path changed)\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ if_state_changed\n+ save the resume data if torrent state has changed since last time the\n+ resume data was saved. This includes: * upload mode * paused state *\n+ super-seeding * seed-mode\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ if_metadata_changed\n+ save the resume data if any m\bme\bet\bta\bad\bda\bat\bta\ba changed since the last time resume\n+ data was saved. This includes: * add/remove web seeds * add/remove\n+ trackers * receiving metadata for a magnet link\n+[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n+ ignore_min_interval\n+ by default, force-reannounce will still honor the min-interval published\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+[_\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+ 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);\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 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+ torrent_handle a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt (add_torrent_params&& params, error_code& ec);\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+ 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+ unsigned short 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+ 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+ 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_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 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+ 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* g\bge\bet\bt_\b_t\bto\bor\brr\bre\ben\bnt\bt_\b_s\bst\bta\bat\btu\bus\bs(\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) *\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* 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+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);\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 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+torrent_handle a\bad\bdd\bd_\b_t\bto\bor\brr\bre\ben\bnt\bt (add_torrent_params&& params, error_code& ec);\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* 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+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+unsigned short 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+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+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+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* 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+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* 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) p\bpo\bop\bp_\b_a\bal\ble\ber\brt\bts\bs(\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+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+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* d\bde\bel\ble\bet\bte\be_\b_p\bpo\bor\brt\bt_\b_m\bma\bap\bpp\bpi\bin\bng\bg(\b()\b) a\bad\bdd\bd_\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\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 const& sp);\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 ();\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 const& sp);\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 ();\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_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+ 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+ 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+ ~\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+};\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+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+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+~\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+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+ s\bse\bes\bss\bsi\bio\bon\bn ();\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&& params, session_flags_t flags);\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);\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+s\bse\bes\bss\bsi\bio\bon\bn ();\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&& params, session_flags_t flags);\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, 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);\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* 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) 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*\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* 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- the info-hash for this torrent\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- last_upload last_download\n- the timestamps of the last time this torrent uploaded or downloaded\n- payload to any peer.\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- 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+*\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+ 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 (announce_entry const&);\n+ ~\b~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- flags\n- reflects several of the torrent's flags. For more information, see\n- torrent_handle::flags().\n+*\b**\b**\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~a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by(\b()\b) *\b**\b**\b**\b**\b*\n+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 (announce_entry const&);\n+~\b~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+|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* 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 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 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+ 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 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@@ -7577,41 +10374,41 @@\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 (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- std::vector g\bge\ben\bne\ber\bra\bat\bte\be_\b_b\bbu\buf\bf () const;\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 void s\bse\bet\bt_\b_p\bpr\bri\biv\bv (bool p);\n bool p\bpr\bri\biv\bv () 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+ 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+ 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@@ -7639,17 +10436,17 @@\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\bbu\buf\bf(\b()\b) g\bge\ben\bne\ber\bra\bat\bte\be(\b()\b) *\b**\b**\b**\b**\b*\n-std::vector g\bge\ben\bne\ber\bra\bat\bte\be_\b_b\bbu\buf\bf () const;\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@@ -7706,15 +10503,15 @@\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_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+*\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@@ -7771,17 +10568,17 @@\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+*\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_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_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@@ -7861,2649 +10658,35 @@\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 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 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 , 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 , 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 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-[_\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- 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&& 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 (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 c\bcl\ble\bea\bar\br_\b_b\bbi\bit\bt (int index) noexcept;\n- void s\bse\bet\bt_\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* 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-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&& 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 (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* 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* 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 c\bcl\ble\bea\bar\br_\b_b\bbi\bit\bt (int index) noexcept;\n-void s\bse\bet\bt_\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 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-*\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-[_\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 (hasher const&);\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- 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-explicit h\bha\bas\bsh\bhe\ber\br (span data);\n-h\bha\bas\bsh\bhe\ber\br (hasher const&);\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-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- h\bha\bas\bsh\bhe\ber\br2\b25\b56\b6 (hasher256 const&);\n- explicit h\bha\bas\bsh\bhe\ber\br2\b25\b56\b6 (span data);\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- 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-h\bha\bas\bsh\bhe\ber\br2\b25\b56\b6 (hasher256 const&);\n-explicit h\bha\bas\bsh\bhe\ber\br2\b25\b56\b6 (span data);\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-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* 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* 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 (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 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 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- 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_s\bsi\biz\bze\be (file_index_t index) const;\n- std::string s\bsy\bym\bml\bli\bin\bnk\bk (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- sha256_hash r\bro\boo\bot\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::time_t m\bmt\bti\bim\bme\be (file_index_t index) const;\n- sha1_hash h\bha\bas\bsh\bh (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::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- 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_p\bpi\bie\bec\bce\bes\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- 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 (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-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-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* 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-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* 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* 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* r\bro\boo\bot\bt(\b()\b) f\bfi\bil\ble\be_\b_s\bsi\biz\bze\be(\b()\b) m\bmt\bti\bim\bme\be(\b()\b) r\bro\boo\bot\bt_\b_p\bpt\btr\br(\b()\b) p\bpa\bad\bd_\b_f\bfi\bil\ble\be_\b_a\bat\bt(\b()\b) f\bfi\bil\ble\be_\b_o\bof\bff\bfs\bse\bet\bt(\b()\b)\n-f\bfi\bil\ble\be_\b_p\bpa\bat\bth\bh(\b()\b) h\bha\bas\bsh\bh(\b()\b) f\bfi\bil\ble\be_\b_n\bna\bam\bme\be(\b()\b) s\bsy\bym\bml\bli\bin\bnk\bk(\b()\b) *\b**\b**\b**\b**\b*\n-std::int64_t f\bfi\bil\ble\be_\b_s\bsi\biz\bze\be (file_index_t index) const;\n-std::string s\bsy\bym\bml\bli\bin\bnk\bk (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-sha256_hash r\bro\boo\bot\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::time_t m\bmt\bti\bim\bme\be (file_index_t index) const;\n-sha1_hash h\bha\bas\bsh\bh (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::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-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_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_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_p\bpi\bie\bec\bce\bes\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_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-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* 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* 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* 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* 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-| | |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* 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- i\bip\bp_\b_f\bfi\bil\blt\bte\ber\br (ip_filter const&);\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- 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- 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- 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- ~\b~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&&);\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* 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 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* 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 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-_\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* 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- 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- ~\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- a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by (announce_entry const&);\n-\n- enum tracker_source\n- {\n- source_torrent,\n- source_client,\n- source_magnet_link,\n- source_tex,\n- };\n-\n- std::string url;\n- std::string trackerid;\n- std::vector 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-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-~\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-a\ban\bnn\bno\bou\bun\bnc\bce\be_\b_e\ben\bnt\btr\bry\by (announce_entry const&);\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-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-function to the _\bs_\be_\bs_\bs_\bi_\bo_\bn constructor (via _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bp_\ba_\br_\ba_\bm_\bs).\n-Example use:\n-struct temp_storage\n-{\n- explicit temp_storage(lt::file_storage const& fs) : m_files(fs) {}\n-\n- lt::span readv(lt::peer_request const r, lt::storage_error& ec)\n-const\n- {\n- auto const i = m_file_data.find(r.piece);\n- if (i == m_file_data.end())\n- {\n- ec.operation = lt::operation_t::file_read;\n- ec.ec = boost::asio::error::eof;\n- return {};\n- }\n- if (int(i->second.size()) <= r.start)\n- {\n- ec.operation = lt::operation_t::file_read;\n- ec.ec = boost::asio::error::eof;\n- return {};\n- }\n- return { i->second.data() + r.start, std::min(r.length, int(i->second.size\n-()) - r.start) };\n- }\n- void writev(lt::span const b, lt::piece_index_t const piece, int\n-const offset)\n- {\n- auto& data = m_file_data[piece];\n- if (data.empty())\n- {\n- // allocate the whole piece, otherwise we'll invalidate the pointers\n- // we have returned back to libtorrent\n- int const size = piece_size(piece);\n- data.resize(std::size_t(size));\n- }\n- TORRENT_ASSERT(offset + b.size() <= int(data.size()));\n- std::memcpy(data.data() + offset, b.data(), std::size_t(b.size()));\n- }\n- lt::sha1_hash hash(lt::piece_index_t const piece\n- , lt::span const block_hashes, lt::storage_error& ec)\n-const\n- {\n- auto const i = m_file_data.find(piece);\n- if (i == m_file_data.end())\n- {\n- ec.operation = lt::operation_t::file_read;\n- ec.ec = boost::asio::error::eof;\n- return {};\n- }\n- if (!block_hashes.empty())\n- {\n- int const piece_size2 = m_files.piece_size2(piece);\n- int const blocks_in_piece2 = m_files.blocks_in_piece2(piece);\n- char const* buf = i->second.data();\n- std::int64_t offset = 0;\n- for (int k = 0; k < blocks_in_piece2; ++k)\n- {\n- lt::hasher256 h2;\n- std::ptrdiff_t const len2 = std::min(lt::default_block_size, int\n-(piece_size2 - offset));\n- h2.update({ buf, len2 });\n- buf += len2;\n- offset += len2;\n- block_hashes[k] = h2.final();\n- }\n- }\n- return lt::hasher(i->second).final();\n- }\n- lt::sha256_hash hash2(lt::piece_index_t const piece, int const offset, lt::\n-storage_error& ec)\n- {\n- auto const i = m_file_data.find(piece);\n- if (i == m_file_data.end())\n- {\n- ec.operation = lt::operation_t::file_read;\n- ec.ec = boost::asio::error::eof;\n- return {};\n- }\n-\n- int const piece_size = m_files.piece_size2(piece);\n-\n- std::ptrdiff_t const len = std::min(lt::default_block_size, piece_size -\n-offset);\n-\n- lt::span b = {i->second.data() + offset, len};\n- return lt::hasher256(b).final();\n- }\n-\n-private:\n- int piece_size(lt::piece_index_t piece) const\n- {\n- int const num_pieces = static_cast((m_files.total_size() +\n-m_files.piece_length() - 1) / m_files.piece_length());\n- return static_cast(piece) < num_pieces - 1\n- ? m_files.piece_length() : static_cast(m_files.total_size() - std::\n-int64_t(num_pieces - 1) * m_files.piece_length());\n- }\n-\n- lt::file_storage const& m_files;\n- std::map> m_file_data;\n-};\n-\n-lt::storage_index_t pop(std::vector& q)\n-{\n- TORRENT_ASSERT(!q.empty());\n- lt::storage_index_t const ret = q.back();\n- q.pop_back();\n- return ret;\n-}\n-\n-struct temp_disk_io final : lt::disk_interface\n- , lt::buffer_allocator_interface\n-{\n- explicit temp_disk_io(lt::io_context& ioc): m_ioc(ioc) {}\n-\n- void settings_updated() override {}\n-\n- lt::storage_holder new_torrent(lt::storage_params const& params\n- , std::shared_ptr const&) override\n- {\n- lt::storage_index_t const idx = m_free_slots.empty()\n- ? m_torrents.end_index()\n- : pop(m_free_slots);\n- auto storage = std::make_unique(params.files);\n- if (idx == m_torrents.end_index()) m_torrents.emplace_back(std::move\n-(storage));\n- else m_torrents[idx] = std::move(storage);\n- return lt::storage_holder(idx, *this);\n- }\n-\n- void remove_torrent(lt::storage_index_t const idx) override\n- {\n- m_torrents[idx].reset();\n- m_free_slots.push_back(idx);\n- }\n-\n- void abort(bool) override {}\n-\n- void async_read(lt::storage_index_t storage, lt::peer_request const& r\n- , std::function handler\n- , lt::disk_job_flags_t) override\n- {\n- // this buffer is owned by the storage. It will remain valid for as\n- // long as the torrent remains in the session. We don't need any lifetime\n- // management of it.\n- lt::storage_error error;\n- lt::span b = m_torrents[storage]->readv(r, error);\n-\n- post(m_ioc, [handler, error, b, this]\n- { handler(lt::disk_buffer_holder(*this, const_cast(b.data()), int\n-(b.size())), error); });\n- }\n-\n- bool async_write(lt::storage_index_t storage, lt::peer_request const& r\n- , char const* buf, std::shared_ptr\n- , std::function handler\n- , lt::disk_job_flags_t) override\n- {\n- lt::span const b = { buf, r.length };\n-\n- m_torrents[storage]->writev(b, r.piece, r.start);\n-\n- post(m_ioc, [=]{ handler(lt::storage_error()); });\n- return false;\n- }\n-\n- void async_hash(lt::storage_index_t storage, lt::piece_index_t const piece\n- , lt::span block_hashes, lt::disk_job_flags_t\n- , std::function handler) override\n- {\n- lt::storage_error error;\n- lt::sha1_hash const hash = m_torrents[storage]->hash(piece, block_hashes,\n-error);\n- post(m_ioc, [=]{ handler(piece, hash, error); });\n- }\n-\n- void async_hash2(lt::storage_index_t storage, lt::piece_index_t const piece\n- , int const offset, lt::disk_job_flags_t\n- , std::function handler) override\n- {\n- lt::storage_error error;\n- lt::sha256_hash const hash = m_torrents[storage]->hash2(piece, offset,\n-error);\n- post(m_ioc, [=]{ handler(piece, hash, error); });\n- }\n-\n- void async_move_storage(lt::storage_index_t, std::string p, lt::move_flags_t\n- , std::function handler) override\n- {\n- post(m_ioc, [=]{\n- handler(lt::status_t::fatal_disk_error, p\n- , lt::storage_error(lt::error_code(boost::system::errc::\n-operation_not_supported, lt::system_category())));\n- });\n- }\n-\n- void async_release_files(lt::storage_index_t, std::function) override\n-{}\n-\n- void async_delete_files(lt::storage_index_t, lt::remove_flags_t\n- , std::function handler) override\n- {\n- post(m_ioc, [=]{ handler(lt::storage_error()); });\n- }\n-\n- void async_check_files(lt::storage_index_t\n- , lt::add_torrent_params const*\n- , lt::aux::vector\n- , std::function handler)\n-override\n- {\n- post(m_ioc, [=]{ handler(lt::status_t::no_error, lt::storage_error()); });\n- }\n-\n- void async_rename_file(lt::storage_index_t\n- , lt::file_index_t const idx\n- , std::string const name\n- , std::function handler) override\n- {\n- post(m_ioc, [=]{ handler(name, idx, lt::storage_error()); });\n- }\n-\n- void async_stop_torrent(lt::storage_index_t, std::function handler)\n-override\n- {\n- post(m_ioc, handler);\n- }\n-\n- void async_set_file_priority(lt::storage_index_t\n- , lt::aux::vector prio\n- , std::function)> handler)\n-override\n- {\n- post(m_ioc, [=]{\n- handler(lt::storage_error(lt::error_code(\n- boost::system::errc::operation_not_supported, lt::system_category())),\n-std::move(prio));\n- });\n- }\n-\n- void async_clear_piece(lt::storage_index_t, lt::piece_index_t index\n- , std::function handler) override\n- {\n- post(m_ioc, [=]{ handler(index); });\n- }\n-\n- // implements buffer_allocator_interface\n- void free_disk_buffer(char*) override\n- {\n- // never free any buffer. We only return buffers owned by the storage\n- // object\n- }\n-\n- void update_stats_counters(lt::counters&) const override {}\n-\n- std::vector get_status(lt::storage_index_t) const\n-override\n- { return {}; }\n-\n- void submit_jobs() override {}\n-\n-private:\n-\n- lt::aux::vector, lt::storage_index_t>\n-m_torrents;\n-\n- // slots that are unused in the m_torrents vector\n- std::vector m_free_slots;\n-\n- // callbacks are posted on this\n- lt::io_context& m_ioc;\n-};\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 bool h\bha\bas\bs_\b_v\bva\bal\bl (int name) const = 0;\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 void s\bse\bet\bt_\b_s\bst\btr\br (int name, std::string val) = 0;\n- virtual bool g\bge\bet\bt_\b_b\bbo\boo\bol\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 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* 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-implementing _\bd_\bi_\bs_\bk_\b__\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be, this must also be implemented in order to return\n-disk buffers back to libtorrent\n-struct buffer_allocator_interface\n-{\n- virtual void f\bfr\bre\bee\be_\b_d\bdi\bis\bsk\bk_\b_b\bbu\buf\bff\bfe\ber\br (char* b) = 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_b\bbu\buf\bff\bfe\ber\br_\b_h\bho\bol\bld\bde\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__\bb_\bu_\bf_\bf_\be_\br_\b__\bh_\bo_\bl_\bd_\be_\br_\b._\bh_\bp_\bp\"\n-The disk buffer holder acts like a unique_ptr that frees a disk buffer when\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- disk_buffer_holder& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (disk_buffer_holder&&) & noexcept;\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- 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- bool i\bis\bs_\b_m\bmu\but\bta\bab\bbl\ble\be () const noexcept;\n- explicit operator b\bbo\boo\bol\bl () const noexcept;\n- std::ptrdiff_t s\bsi\biz\bze\be () const;\n-};\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* d\bdi\bis\bsk\bk_\b_b\bbu\buf\bff\bfe\ber\br_\b_h\bho\bol\bld\bde\ber\br(\b()\b) *\b**\b**\b**\b**\b*\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-construct a buffer holder that will free the held buffer using a disk buffer\n-pool directly (there's only one disk_buffer_pool per _\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* d\bdi\bis\bsk\bk_\b_b\bbu\buf\bff\bfe\ber\br_\b_h\bho\bol\bld\bde\ber\br(\b()\b) *\b**\b**\b**\b**\b*\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-default construct a holder that does not own any buffer\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_b\bbu\buf\bff\bfe\ber\br_\b_h\bho\bol\bld\bde\ber\br(\b()\b) *\b**\b**\b**\b**\b*\n-~\b~d\bdi\bis\bsk\bk_\b_b\bbu\buf\bff\bfe\ber\br_\b_h\bho\bol\bld\bde\ber\br ();\n-frees disk buffer held by this object\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 () const noexcept;\n-return a pointer to the held buffer, if any. Otherwise returns nullptr.\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-free the held disk buffer, if any, and clear the holder. This sets the holder\n-object to a default-constructed state\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 (disk_buffer_holder& h) noexcept;\n-swap pointers of two disk buffer holders.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* i\bis\bs_\b_m\bmu\but\bta\bab\bbl\ble\be(\b()\b) *\b**\b**\b**\b**\b*\n-bool i\bis\bs_\b_m\bmu\but\bta\bab\bbl\ble\be () const noexcept;\n-if this returns true, the buffer may not be modified in place\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-implicitly convertible to true if the object is currently holding a buffer\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- file_open_mode_t open_mode;\n- time_point last_use;\n-};\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- file_index\n- the index of the file this _\be_\bn_\bt_\br_\by refers to into the file_storage file\n- list of this torrent. This starts indexing at 0.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- open_mode\n- open_mode is a bitmask of the file flags this file is currently opened\n- with. For possible flags, see _\bf_\bi_\bl_\be_\b__\bo_\bp_\be_\bn_\b__\bm_\bo_\bd_\be_\b__\bt.\n- Note that the read/write mode is not a bitmask. The two least significant\n- bits are used to represent the read/write mode. Those bits can be masked\n- out using the rw_mask constant.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- last_use\n- a (high precision) timestamp of when the file was last used.\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_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__\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be_\b._\bh_\bp_\bp\"\n-The _\bd_\bi_\bs_\bk_\b__\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be is the customization point for disk I/O in libtorrent.\n-implement this interface and provide a factory function to the _\bs_\be_\bs_\bs_\bi_\bo_\bn\n-constructor use custom disk I/O. All functions on the disk subsystem\n-(implementing _\bd_\bi_\bs_\bk_\b__\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be) are called from within libtorrent's network\n-thread. For disk I/O to be performed in a separate thread, the disk subsystem\n-has to manage that itself.\n-Although the functions are called async_*, they do not technically h\bha\bav\bve\be to be\n-asynchronous, but they support being asynchronous, by expecting the result\n-passed back into a callback. The callbacks must be posted back onto the network\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 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- , std::function handler) = 0;\n- virtual void a\bas\bsy\byn\bnc\bc_\b_m\bmo\bov\bve\be_\b_s\bst\bto\bor\bra\bag\bge\be (storage_index_t storage, std::string p,\n-move_flags_t flags\n- , std::function\n-handler) = 0;\n- virtual void a\bas\bsy\byn\bnc\bc_\b_r\bre\bel\ble\bea\bas\bse\be_\b_f\bfi\bil\ble\bes\bs (storage_index_t storage\n- , std::function handler = std::function()) = 0;\n- virtual void a\bas\bsy\byn\bnc\bc_\b_c\bch\bhe\bec\bck\bk_\b_f\bfi\bil\ble\bes\bs (storage_index_t storage\n- , add_torrent_params const* resume_data\n- , aux::vector links\n- , std::function handler) = 0;\n- virtual void a\bas\bsy\byn\bnc\bc_\b_s\bst\bto\bop\bp_\b_t\bto\bor\brr\bre\ben\bnt\bt (storage_index_t storage\n- , std::function handler = std::function()) = 0;\n- virtual void a\bas\bsy\byn\bnc\bc_\b_r\bre\ben\bna\bam\bme\be_\b_f\bfi\bil\ble\be (storage_index_t storage\n- , file_index_t index, std::string name\n- , std::function handler) = 0;\n- virtual void a\bas\bsy\byn\bnc\bc_\b_d\bde\bel\ble\bet\bte\be_\b_f\bfi\bil\ble\bes\bs (storage_index_t storage, remove_flags_t\n-options\n- , std::function handler) = 0;\n- virtual void a\bas\bsy\byn\bnc\bc_\b_s\bse\bet\bt_\b_f\bfi\bil\ble\be_\b_p\bpr\bri\bio\bor\bri\bit\bty\by (storage_index_t storage\n- , aux::vector prio\n- , std::function)> handler) = 0;\n- virtual void a\bas\bsy\byn\bnc\bc_\b_c\bcl\ble\bea\bar\br_\b_p\bpi\bie\bec\bce\be (storage_index_t storage, piece_index_t index\n- , std::function handler) = 0;\n- virtual void u\bup\bpd\bda\bat\bte\be_\b_s\bst\bta\bat\bts\bs_\b_c\bco\bou\bun\bnt\bte\ber\brs\bs (counters& c) const = 0;\n- virtual std::vector g\bge\bet\bt_\b_s\bst\bta\bat\btu\bus\bs (storage_index_t) const = 0;\n- virtual void a\bab\bbo\bor\brt\bt (bool wait) = 0;\n- virtual void s\bsu\bub\bbm\bmi\bit\bt_\b_j\bjo\bob\bbs\bs () = 0;\n- virtual void s\bse\bet\btt\bti\bin\bng\bgs\bs_\b_u\bup\bpd\bda\bat\bte\bed\bd () = 0;\n-\n- static constexpr disk_job_flags_t f\bfo\bor\brc\bce\be_\b_c\bco\bop\bpy\by = 0_bit;\n- static constexpr disk_job_flags_t s\bse\beq\bqu\bue\ben\bnt\bti\bia\bal\bl_\b_a\bac\bcc\bce\bes\bss\bs = 3_bit;\n- static constexpr disk_job_flags_t v\bvo\bol\bla\bat\bti\bil\ble\be_\b_r\bre\bea\bad\bd = 4_bit;\n- static constexpr disk_job_flags_t v\bv1\b1_\b_h\bha\bas\bsh\bh = 5_bit;\n- static constexpr disk_job_flags_t f\bfl\blu\bus\bsh\bh_\b_p\bpi\bie\bec\bce\be = 7_bit;\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_t\bto\bor\brr\bre\ben\bnt\bt(\b()\b) *\b**\b**\b**\b**\b*\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-this is called when a new torrent is added. The shared_ptr can be used to hold\n-the internal torrent object alive as long as there are outstanding disk\n-operations on the storage. The returned _\bs_\bt_\bo_\br_\ba_\bg_\be_\b__\bh_\bo_\bl_\bd_\be_\br is an owning reference\n-to the underlying storage that was just created. It is fundamentally a\n-storage_index_t\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-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-will stop further writes and wait for the passed-in disk_observer to be\n-notified before resuming.\n-Note that for async_read, the _\bp_\be_\be_\br_\b__\br_\be_\bq_\bu_\be_\bs_\bt (r) is not necessarily aligned to\n-blocks (but it is most of the time). However, all writes (passed to\n-async_write) are guaranteed to be block aligned.\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_h\bha\bas\bsh\bh(\b()\b) *\b**\b**\b**\b**\b*\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-Compute hash(es) for the specified piece. Unless the v1_hash flag is set (in\n-flags), the SHA-1 hash of the whole piece does not need to be computed.\n-Thev2span is optional and can be empty, which means v2 hashes should not be\n-computed. If v2 is non-empty it must be at least large enough to hold all v2\n-blocks in the piece, and this function will fill in the span with the SHA-256\n-block hashes of the piece.\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_h\bha\bas\bsh\bh2\b2(\b()\b) *\b**\b**\b**\b**\b*\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- , std::function handler) = 0;\n-computes the v2 hash (SHA-256) of a single block. The block at offset in piece\n-piece.\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_m\bmo\bov\bve\be_\b_s\bst\bto\bor\bra\bag\bge\be(\b()\b) *\b**\b**\b**\b**\b*\n-virtual void a\bas\bsy\byn\bnc\bc_\b_m\bmo\bov\bve\be_\b_s\bst\bto\bor\bra\bag\bge\be (storage_index_t storage, std::string p,\n-move_flags_t flags\n- , std::function\n-handler) = 0;\n-called to request the files for the specified storage/torrent be moved to a new\n-location. It is the disk I/O object's responsibility to synchronize this with\n-any currently outstanding disk operations to the storage. Whether files are\n-replaced at the destination path or not is controlled by flags (see\n-_\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* a\bas\bsy\byn\bnc\bc_\b_r\bre\bel\ble\bea\bas\bse\be_\b_f\bfi\bil\ble\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n-virtual void a\bas\bsy\byn\bnc\bc_\b_r\bre\bel\ble\bea\bas\bse\be_\b_f\bfi\bil\ble\bes\bs (storage_index_t storage\n- , std::function handler = std::function()) = 0;\n-This is called on disk I/O objects to request they close all open files for the\n-specified storage/torrent. If file handles are not pooled/cached, it can be a\n-no-op. For truly asynchronous disk I/O, this should provide at least one point\n-in time when all files are closed. It is possible that later asynchronous\n-operations will re-open some of the files, by the time this completion handler\n-is called, that's fine.\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_c\bch\bhe\bec\bck\bk_\b_f\bfi\bil\ble\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n-virtual void a\bas\bsy\byn\bnc\bc_\b_c\bch\bhe\bec\bck\bk_\b_f\bfi\bil\ble\bes\bs (storage_index_t storage\n- , add_torrent_params const* resume_data\n- , aux::vector links\n- , std::function handler) = 0;\n-this is called when torrents are added to validate their resume data against\n-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 torrent. The\n-string being a path to an existing identical file. The default behavior is to\n-create hard links of those files into the storage of the new torrent (specified\n-by storage). An empty string indicates that there is no known identical file.\n-This is part 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 files/pieces\n-are expected to be on disk already. This should be verified. Not just the\n-existence of the file, but also that it has the correct size.\n-Any file with a piece set in the resume_data->have_pieces bitmask should exist\n-on disk, this should be verified. Pad files and files with zero priority may be\n-skipped.\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_s\bst\bto\bop\bp_\b_t\bto\bor\brr\bre\ben\bnt\bt(\b()\b) *\b**\b**\b**\b**\b*\n-virtual void a\bas\bsy\byn\bnc\bc_\b_s\bst\bto\bop\bp_\b_t\bto\bor\brr\bre\ben\bnt\bt (storage_index_t storage\n- , std::function handler = std::function()) = 0;\n-This is called when a torrent is stopped. It gives the disk I/O object an\n-opportunity to flush any data to disk that's currently kept cached. This\n-function should at least do the same thing as _\ba_\bs_\by_\bn_\bc_\b__\br_\be_\bl_\be_\ba_\bs_\be_\b__\bf_\bi_\bl_\be_\bs_\b(_\b).\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\ben\bna\bam\bme\be_\b_f\bfi\bil\ble\be(\b()\b) *\b**\b**\b**\b**\b*\n-virtual void a\bas\bsy\byn\bnc\bc_\b_r\bre\ben\bna\bam\bme\be_\b_f\bfi\bil\ble\be (storage_index_t storage\n- , file_index_t index, std::string name\n- , std::function handler) = 0;\n-This function is called when the name of a file in the specified storage has\n-been requested to be renamed. The disk I/O object is responsible for renaming\n-the file without racing with other potentially outstanding operations against\n-the file (such as read, write, move, etc.).\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_d\bde\bel\ble\bet\bte\be_\b_f\bfi\bil\ble\bes\bs(\b()\b) *\b**\b**\b**\b**\b*\n-virtual void a\bas\bsy\byn\bnc\bc_\b_d\bde\bel\ble\bet\bte\be_\b_f\bfi\bil\ble\bes\bs (storage_index_t storage, remove_flags_t\n-options\n- , std::function handler) = 0;\n-This function is called when some file(s) on disk have been requested to be\n-removed by the client. storage indicates which torrent is referred to. See\n-_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bh_\ba_\bn_\bd_\bl_\be for remove_flags_t flags indicating which files are to be\n-removed. e.g. _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bh_\ba_\bn_\bd_\bl_\be_\b:_\b:_\bd_\be_\bl_\be_\bt_\be_\b__\bf_\bi_\bl_\be_\bs - delete all files _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bh_\ba_\bn_\bd_\bl_\be_\b:_\b:\n-_\bd_\be_\bl_\be_\bt_\be_\b__\bp_\ba_\br_\bt_\bf_\bi_\bl_\be - only delete part file.\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_s\bse\bet\bt_\b_f\bfi\bil\ble\be_\b_p\bpr\bri\bio\bor\bri\bit\bty\by(\b()\b) *\b**\b**\b**\b**\b*\n-virtual void a\bas\bsy\byn\bnc\bc_\b_s\bse\bet\bt_\b_f\bfi\bil\ble\be_\b_p\bpr\bri\bio\bor\bri\bit\bty\by (storage_index_t storage\n- , aux::vector prio\n- , std::function)> handler) = 0;\n-This is called to set the priority of some or all files. Changing the priority\n-from or to 0 may involve moving data to and from the partfile. The disk I/\n-O object is responsible for correctly synchronizing this work to not race with\n-any potentially outstanding asynchronous operations affecting these files.\n-prio is a vector of the file priority for all files. If it's shorter than the\n-total number of files in the torrent, they are assumed to be set to the default\n-priority.\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_c\bcl\ble\bea\bar\br_\b_p\bpi\bie\bec\bce\be(\b()\b) *\b**\b**\b**\b**\b*\n-virtual void a\bas\bsy\byn\bnc\bc_\b_c\bcl\ble\bea\bar\br_\b_p\bpi\bie\bec\bce\be (storage_index_t storage, piece_index_t index\n- , std::function handler) = 0;\n-This is called when a piece fails the hash check, to ensure there are no\n-outstanding disk operations to the piece before blocks are re-requested from\n-peers to overwrite the existing blocks. The disk I/O object does not need to\n-perform any action other than synchronize with all outstanding disk operations\n-to the specified piece before posting the result back.\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_s\bst\bta\bat\bts\bs_\b_c\bco\bou\bun\bnt\bte\ber\brs\bs(\b()\b) *\b**\b**\b**\b**\b*\n-virtual void u\bup\bpd\bda\bat\bte\be_\b_s\bst\bta\bat\bts\bs_\b_c\bco\bou\bun\bnt\bte\ber\brs\bs (counters& c) const = 0;\n-_\bu_\bp_\bd_\ba_\bt_\be_\b__\bs_\bt_\ba_\bt_\bs_\b__\bc_\bo_\bu_\bn_\bt_\be_\br_\bs_\b(_\b) is called to give the disk storage an opportunity to\n-update gauges in the c stats _\bc_\bo_\bu_\bn_\bt_\be_\br_\bs, that aren't updated continuously as\n-operations are performed. This is called before a snapshot of the _\bc_\bo_\bu_\bn_\bt_\be_\br_\bs are\n-passed to the client.\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\bta\bat\btu\bus\bs(\b()\b) *\b**\b**\b**\b**\b*\n-virtual std::vector g\bge\bet\bt_\b_s\bst\bta\bat\btu\bus\bs (storage_index_t) const = 0;\n-Return a list of all the files that are currently open for the specified\n-storage/torrent. This is is just used for the client to query the currently\n-open files, and which modes those files are open in.\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 (bool wait) = 0;\n-this is called when the _\bs_\be_\bs_\bs_\bi_\bo_\bn is starting to shut down. The disk I/O object\n-is expected to flush any outstanding write jobs, cancel hash jobs and initiate\n-tearing down of any internal threads. If wait is true, this should be\n-asynchronous. i.e. this call should not return until all threads have stopped\n-and all jobs have either been aborted or completed and the disk I/O object is\n-ready to be destructed.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* s\bsu\bub\bbm\bmi\bit\bt_\b_j\bjo\bob\bbs\bs(\b()\b) *\b**\b**\b**\b**\b*\n-virtual void s\bsu\bub\bbm\bmi\bit\bt_\b_j\bjo\bob\bbs\bs () = 0;\n-This will be called after a batch of disk jobs has been issues (via the async_*\n-). It gives the disk I/O object an opportunity to notify any potential\n-condition variables to wake up the disk thread(s). The async_* calls can of\n-course also notify condition variables, but doing it in this call allows for\n-batching jobs, by issuing the notification once for a collection of jobs.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n-*\b**\b**\b**\b**\b* s\bse\bet\btt\bti\bin\bng\bgs\bs_\b_u\bup\bpd\bda\bat\bte\bed\bd(\b()\b) *\b**\b**\b**\b**\b*\n-virtual void s\bse\bet\btt\bti\bin\bng\bgs\bs_\b_u\bup\bpd\bda\bat\bte\bed\bd () = 0;\n-This is called to notify the disk I/O object that the settings have been\n-updated. In the disk io constructor, a _\bs_\be_\bt_\bt_\bi_\bn_\bg_\bs_\b__\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be reference is passed\n-in. Whenever these settings are updated, this function is called to allow the\n-disk I/O object to react to any changed settings relevant to its operations.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- force_copy\n- force making a copy of the cached block, rather than getting a reference\n- to a block already in the cache. This is used the block is expected to be\n- overwritten very soon, by async_write()`, and we need access to the\n- previous content.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- sequential_access\n- hint that there may be more disk operations with sequential access to the\n- file\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\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 wasteful.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- v1_hash\n- compute a v1 piece hash. This is only used by the _\ba_\bs_\by_\bn_\bc_\b__\bh_\ba_\bs_\bh_\b(_\b) call. If\n- this flag is not set in the _\ba_\bs_\by_\bn_\bc_\b__\bh_\ba_\bs_\bh_\b(_\b) call, the SHA-1 piece hash does\n- not need to be computed.\n-[_\br_\be_\bp_\bo_\br_\bt_\b _\bi_\bs_\bs_\bu_\be]\n- flush_piece\n- this flag instructs a hash job that we just completed this piece, and it\n- should be flushed to disk\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_h\bho\bol\bld\bde\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__\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be_\b._\bh_\bp_\bp\"\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 (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- ~\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- 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- 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* f\bfi\bil\ble\be_\b_o\bop\bpe\ben\bn_\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/_\bd_\bi_\bs_\bk_\b__\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be_\b._\bh_\bp_\bp\"\n- read_only\n- open the file for reading only\n- write_only\n- open the file for writing only\n- read_write\n- open the file for reading and writing\n- rw_mask\n- the mask for the bits determining read or write mode\n- sparse\n- open the file in sparse mode (if supported by the filesystem).\n- no_atime\n- don't update the access timestamps on the file (if supported by the\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* 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- operator void c\bco\bon\bns\bst\bt*\b* () const = delete;\n- client_data_t& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (void*) = 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* 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-operator void c\bco\bon\bns\bst\bt*\b* () const = delete;\n-client_data_t& o\bop\bpe\ber\bra\bat\bto\bor\br=\b= (void*) = 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-[_\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* 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-\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-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* 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* 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* 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* 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-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& h\bht\btt\btp\bp_\b_c\bca\bat\bte\beg\bgo\bor\bry\by ();\n-returns the error_category for HTTP errors\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\bpc\bcp\bp_\b_e\ber\brr\bro\bor\brs\bs *\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- _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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|_\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-|_\bp_\bc_\bp_\b__\bs_\bu_\bc_\bc_\be_\bs_\bs_\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-|_\bp_\bc_\bp_\b__\bu_\bn_\bs_\bu_\bp_\bp_\b__\bv_\be_\br_\bs_\bi_\bo_\bn_\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-|_\bp_\bc_\bp_\b__\bn_\bo_\bt_\b__\ba_\bu_\bt_\bh_\bo_\br_\bi_\bz_\be_\bd_\b _\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-|_\bp_\bc_\bp_\b__\bm_\ba_\bl_\bf_\bo_\br_\bm_\be_\bd_\b__\br_\be_\bq_\bu_\be_\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 |\n-|_\bp_\bc_\bp_\b__\bu_\bn_\bs_\bu_\bp_\bp_\b__\bo_\bp_\bc_\bo_\bd_\be_\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-|_\bp_\bc_\bp_\b__\bu_\bn_\bs_\bu_\bp_\bp_\b__\bo_\bp_\bt_\bi_\bo_\bn_\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-|_\bp_\bc_\bp_\b__\bm_\ba_\bl_\bf_\bo_\br_\bm_\be_\bd_\b__\bo_\bp_\bt_\bi_\bo_\bn_\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-|_\bp_\bc_\bp_\b__\bn_\be_\bt_\bw_\bo_\br_\bk_\b__\bf_\ba_\bi_\bl_\bu_\br_\be_\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-|_\bp_\bc_\bp_\b__\bn_\bo_\b__\br_\be_\bs_\bo_\bu_\br_\bc_\be_\bs_\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-|_\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 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-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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 _\bi_\bn_\bv_\ba_\bl_\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 |\n-|_\ba_\bc_\bt_\bi_\bo_\bn_\b__\bf_\ba_\bi_\bl_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b5_\b0_\b1_\b _\b _\b|_\bT_\bh_\be_\b _\br_\be_\bq_\bu_\be_\bs_\bt_\b _\bf_\ba_\bi_\bl_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|value_not_in_array |714 |The specified value does not exist |\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|_\bi_\bn_\b _\bt_\bh_\be_\b _\ba_\br_\br_\ba_\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-| | |The source IP address cannot be |\n-|source_ip_cannot_be_wildcarded |715 |wild-carded, but must be fully |\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|_\bs_\bp_\be_\bc_\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 |\n-|external_port_cannot_be_wildcarded|716 |The external port cannot be 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|_\bw_\bi_\bl_\bd_\bc_\ba_\br_\bd_\b,_\b _\bb_\bu_\bt_\b _\bm_\bu_\bs_\bt_\b _\bb_\be_\b _\bs_\bp_\be_\bc_\bi_\bf_\bi_\be_\bd_\b _\b _\b _\b _\b |\n-| | |The port mapping _\be_\bn_\bt_\br_\by specified |\n-|port_mapping_conflict |718 |conflicts with a mapping assigned |\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|_\bp_\br_\be_\bv_\bi_\bo_\bu_\bs_\bl_\by_\b _\bt_\bo_\b _\ba_\bn_\bo_\bt_\bh_\be_\br_\b _\bc_\bl_\bi_\be_\bn_\bt_\b _\b _\b _\b _\b _\b _\b _\b |\n-|internal_port_must_match_external |724 |Internal and external port value |\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|_\bm_\bu_\bs_\bt_\b _\bb_\be_\b _\bt_\bh_\be_\b _\bs_\ba_\bm_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-| | |The NAT implementation only supports|\n-|only_permanent_leases_supported |725 |permanent lease times on port |\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|_\bm_\ba_\bp_\bp_\bi_\bn_\bg_\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 |\n-| | |RemoteHost must be a wildcard and |\n-|remote_host_must_be_wildcard |726 |cannot be a specific IP address or |\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|_\bD_\bN_\bS_\b _\bn_\ba_\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 |\n-|external_port_must_be_wildcard |727 |ExternalPort must be a wildcard and |\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|_\bc_\ba_\bn_\bn_\bo_\bt_\b _\bb_\be_\b _\ba_\b _\bs_\bp_\be_\bc_\bi_\bf_\bi_\bc_\b _\bp_\bo_\br_\bt_\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-|inflated_data_too_large |2 |more bytes than the specified |\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|_\bm_\ba_\bx_\bi_\bm_\bu_\bm_\b _\bs_\bi_\bz_\be_\b,_\b _\ba_\bn_\bd_\b _\bw_\ba_\bs_\b _\br_\be_\bj_\be_\bc_\bt_\be_\bd_\b._\b _\b _\b _\b |\n-|data_did_not_terminate |3 |available inflate data did not |\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|_\bt_\be_\br_\bm_\bi_\bn_\ba_\bt_\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 |\n-|space_exhausted |4 |output space exhausted before |\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_\bm_\bp_\bl_\be_\bt_\bi_\bn_\bg_\b _\bi_\bn_\bf_\bl_\ba_\bt_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bi_\bn_\bv_\ba_\bl_\bi_\bd_\b__\bb_\bl_\bo_\bc_\bk_\b__\bt_\by_\bp_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b5_\b _\b _\b _\b _\b|_\bi_\bn_\bv_\ba_\bl_\bi_\bd_\b _\bb_\bl_\bo_\bc_\bk_\b _\bt_\by_\bp_\be_\b _\b(_\bt_\by_\bp_\be_\b _\b=_\b=_\b _\b3_\b)_\b _\b _\b _\b _\b |\n-|invalid_stored_block_length |6 |stored block length did not match |\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_\bn_\be_\b'_\bs_\b _\bc_\bo_\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 |\n-|too_many_length_or_distance_codes |7 |dynamic block code description: too|\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|_\bm_\ba_\bn_\by_\b _\bl_\be_\bn_\bg_\bt_\bh_\b _\bo_\br_\b _\bd_\bi_\bs_\bt_\ba_\bn_\bc_\be_\b _\bc_\bo_\bd_\be_\bs_\b _\b _\b _\b _\b _\b |\n-|code_lengths_codes_incomplete |8 |dynamic block code description: |\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 _\bl_\be_\bn_\bg_\bt_\bh_\bs_\b _\bc_\bo_\bd_\be_\bs_\b _\bi_\bn_\bc_\bo_\bm_\bp_\bl_\be_\bt_\be_\b _\b _\b _\b _\b _\b |\n-|repeat_lengths_with_no_first_length|9 |dynamic block code description: |\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|_\br_\be_\bp_\be_\ba_\bt_\b _\bl_\be_\bn_\bg_\bt_\bh_\bs_\b _\bw_\bi_\bt_\bh_\b _\bn_\bo_\b _\bf_\bi_\br_\bs_\bt_\b _\bl_\be_\bn_\bg_\bt_\bh|\n-|repeat_more_than_specified_lengths |10 |dynamic block code description: |\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|_\br_\be_\bp_\be_\ba_\bt_\b _\bm_\bo_\br_\be_\b _\bt_\bh_\ba_\bn_\b _\bs_\bp_\be_\bc_\bi_\bf_\bi_\be_\bd_\b _\bl_\be_\bn_\bg_\bt_\bh_\bs_\b |\n-|invalid_literal_length_code_lengths|11 |dynamic block code description: |\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 _\bl_\bi_\bt_\be_\br_\ba_\bl_\b/_\bl_\be_\bn_\bg_\bt_\bh_\b _\bc_\bo_\bd_\be_\b _\bl_\be_\bn_\bg_\bt_\bh_\bs|\n-|invalid_distance_code_lengths |12 |dynamic block code description: |\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 _\bd_\bi_\bs_\bt_\ba_\bn_\bc_\be_\b _\bc_\bo_\bd_\be_\b _\bl_\be_\bn_\bg_\bt_\bh_\bs_\b _\b _\b _\b _\b _\b |\n-|invalid_literal_code_in_block |13 |invalid literal/length or distance |\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 i\bi2\b2p\bp_\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/_\bi_\b2_\bp_\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 \n-|_\bn\bn_\ba\ba_\bm\bm_\be\be_\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|_\b0_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bp_\ba_\br_\bs_\be_\b__\bf_\ba_\bi_\bl_\be_\bd_\b _\b _\b _\b|_\b1_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bc_\ba_\bn_\bt_\b__\br_\be_\ba_\bc_\bh_\b__\bp_\be_\be_\br_\b|_\b2_\b _\b _\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bi_\b2_\bp_\b__\be_\br_\br_\bo_\br_\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_\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 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-|failed_hash_check |2 |A piece did not match its piece |\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|_\bh_\ba_\bs_\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 |\n-| | |The .torrent file does not contain|\n-|torrent_is_no_dict |3 |a bencoded dictionary at its top |\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_\be_\bv_\be_\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 |\n-|torrent_missing_info |4 |The .torrent file does not have an|\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_\bn_\bf_\bo_\b _\bd_\bi_\bc_\bt_\bi_\bo_\bn_\ba_\br_\by_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|torrent_info_no_dict |5 |The .torrent file's info _\be_\bn_\bt_\br_\by 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|_\bn_\bo_\bt_\b _\ba_\b _\bd_\bi_\bc_\bt_\bi_\bo_\bn_\ba_\br_\by_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|torrent_missing_piece_length |6 |The .torrent file does not have 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|_\bp_\bi_\be_\bc_\be_\b _\bl_\be_\bn_\bg_\bt_\bh_\b _\be_\bn_\bt_\br_\by_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|torrent_missing_name |7 |The .torrent file does not have 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|_\bn_\ba_\bm_\be_\b _\be_\bn_\bt_\br_\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-|torrent_invalid_name |8 |The .torrent file's name _\be_\bn_\bt_\br_\by 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|_\bi_\bn_\bv_\ba_\bl_\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 |\n-| | |The length of a file, or of the |\n-|torrent_invalid_length |9 |whole .torrent file is invalid. |\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_\bi_\bt_\bh_\be_\br_\b _\bn_\be_\bg_\ba_\bt_\bi_\bv_\be_\b _\bo_\br_\b _\bn_\bo_\bt_\b _\ba_\bn_\b _\bi_\bn_\bt_\be_\bg_\be_\br_\b |\n-|torrent_file_parse_failed |10 |Failed to parse a file _\be_\bn_\bt_\br_\by in |\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|_\bt_\bh_\be_\b _\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 |\n-|torrent_missing_pieces |11 |The pieces field is missing or |\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_\bn_\bv_\ba_\bl_\bi_\bd_\b _\bi_\bn_\b _\bt_\bh_\be_\b _\b._\bt_\bo_\br_\br_\be_\bn_\bt_\b _\bf_\bi_\bl_\be_\b _\b _\b _\b _\b _\b |\n-|torrent_invalid_hashes |12 |The pieces string has incorrect |\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_\be_\bn_\bg_\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 |\n-|too_many_pieces_in_torrent |13 |The .torrent file has more pieces |\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|_\bt_\bh_\ba_\bn_\b _\bi_\bs_\b _\bs_\bu_\bp_\bp_\bo_\br_\bt_\be_\bd_\b _\bb_\by_\b _\bl_\bi_\bb_\bt_\bo_\br_\br_\be_\bn_\bt_\b _\b _\b |\n-| | |The metadata (.torrent file) that |\n-|invalid_swarm_metadata |14 |was received from the swarm |\n-| | |matched the info-hash, but failed |\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|_\bt_\bo_\b _\bb_\be_\b _\bp_\ba_\br_\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 |\n-|invalid_bencoding |15 |The file or buffer is not |\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_\br_\br_\be_\bc_\bt_\bl_\by_\b _\bb_\be_\bn_\bc_\bo_\bd_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|no_files_in_torrent |16 |The .torrent file does not contain|\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|_\ba_\bn_\by_\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 |\n-|invalid_escaped_string |17 |The string was not properly url- |\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_\bn_\bc_\bo_\bd_\be_\bd_\b _\ba_\bs_\b _\be_\bx_\bp_\be_\bc_\bt_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|session_is_closing |18 |Operation is not permitted since |\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|_\bt_\bh_\be_\b _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b _\bi_\bs_\b _\bs_\bh_\bu_\bt_\bt_\bi_\bn_\bg_\b _\bd_\bo_\bw_\bn_\b _\b _\b _\b _\b _\b |\n-| | |There's already a torrent with |\n-|duplicate_torrent |19 |that info-hash added to 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_\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 |\n-|invalid_torrent_handle |20 |The supplied _\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be is not|\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_\bf_\be_\br_\br_\bi_\bn_\bg_\b _\bt_\bo_\b _\ba_\b _\bv_\ba_\bl_\bi_\bd_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\b _\b _\b _\b _\b _\b |\n-|invalid_entry_type |21 |The type requested from the _\be_\bn_\bt_\br_\by |\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|_\bd_\bi_\bd_\b _\bn_\bo_\bt_\b _\bm_\ba_\bt_\bc_\bh_\b _\bi_\bt_\bs_\b _\bt_\by_\bp_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|missing_info_hash_in_uri |22 |The specified URI does not contain|\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|_\ba_\b _\bv_\ba_\bl_\bi_\bd_\b _\bi_\bn_\bf_\bo_\b-_\bh_\ba_\bs_\bh_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-| | |One of the files in the torrent |\n-|file_too_short |23 |was unexpectedly small. This might|\n-| | |be caused by files being changed |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bb_\by_\b _\ba_\bn_\b _\be_\bx_\bt_\be_\br_\bn_\ba_\bl_\b _\bp_\br_\bo_\bc_\be_\bs_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-| | |The URL used an unknown protocol. |\n-| | |Currently http and https (if built|\n-|unsupported_url_protocol |24 |with openssl support) are |\n-| | |recognized. For trackers udp is |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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_\bc_\bo_\bg_\bn_\bi_\bz_\be_\bd_\b _\ba_\bs_\b _\bw_\be_\bl_\bl_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|url_parse_error |25 |The URL did not conform to URL |\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_\by_\bn_\bt_\ba_\bx_\b _\ba_\bn_\bd_\b _\bf_\ba_\bi_\bl_\be_\bd_\b _\bt_\bo_\b _\bb_\be_\b _\bp_\ba_\br_\bs_\be_\bd_\b _\b _\b _\b |\n-|peer_sent_empty_piece |26 |The peer sent a piece message of |\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_\be_\bn_\bg_\bt_\bh_\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 |\n-|parse_failed |27 |A bencoded structure was corrupt |\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|_\ba_\bn_\bd_\b _\bf_\ba_\bi_\bl_\be_\bd_\b _\bt_\bo_\b _\bb_\be_\b _\bp_\ba_\br_\bs_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|invalid_file_tag |28 |The fast resume file was missing |\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_\br_\b _\bh_\ba_\bd_\b _\ba_\bn_\b _\bi_\bn_\bv_\ba_\bl_\bi_\bd_\b _\bf_\bi_\bl_\be_\b _\bv_\be_\br_\bs_\bi_\bo_\bn_\b _\bt_\ba_\bg|\n-|missing_info_hash |29 |The fast resume file was missing |\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_\br_\b _\bh_\ba_\bd_\b _\ba_\bn_\b _\bi_\bn_\bv_\ba_\bl_\bi_\bd_\b _\bi_\bn_\bf_\bo_\b-_\bh_\ba_\bs_\bh_\b _\b _\b _\b _\b _\b _\b |\n-|mismatching_info_hash |30 |The info-hash did not match 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|_\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 |\n-|invalid_hostname |31 |The URL contained an invalid |\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|_\bh_\bo_\bs_\bt_\bn_\ba_\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 |\n-|_\bi_\bn_\bv_\ba_\bl_\bi_\bd_\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|_\b3_\b2_\b _\b _\b _\b|_\bT_\bh_\be_\b _\bU_\bR_\bL_\b _\bh_\ba_\bd_\b _\ba_\bn_\b _\bi_\bn_\bv_\ba_\bl_\bi_\bd_\b _\bp_\bo_\br_\bt_\b _\b _\b _\b _\b _\b _\b |\n-| | |The port is blocked by the port- |\n-|port_blocked |33 |filter, and prevented 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|_\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 |\n-|expected_close_bracket_in_address |34 |The IPv6 address was expected to |\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_\bn_\bd_\b _\bw_\bi_\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 |\n-| | |The torrent is being destructed, |\n-|destructing_torrent |35 |preventing the operation to |\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_\bu_\bc_\bc_\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 |\n-|_\bt_\bi_\bm_\be_\bd_\b__\bo_\bu_\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|_\b3_\b6_\b _\b _\b _\b|_\bT_\bh_\be_\b _\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b _\bt_\bi_\bm_\be_\bd_\b _\bo_\bu_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-| | |The peer is upload only, and we |\n-|upload_upload_connection |37 |are upload only. There's no point |\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_\bn_\b _\bk_\be_\be_\bp_\bi_\bn_\bg_\b _\bt_\bh_\be_\b _\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-| | |The peer is upload only, and we're|\n-|uninteresting_upload_peer |38 |not interested in it. There's no |\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|_\bp_\bo_\bi_\bn_\bt_\b _\bi_\bn_\b _\bk_\be_\be_\bp_\bi_\bn_\bg_\b _\bt_\bh_\be_\b _\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b _\b _\b |\n-|_\bi_\bn_\bv_\ba_\bl_\bi_\bd_\b__\bi_\bn_\bf_\bo_\b__\bh_\ba_\bs_\bh_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b3_\b9_\b _\b _\b _\b|_\bT_\bh_\be_\b _\bp_\be_\be_\br_\b _\bs_\be_\bn_\bt_\b _\ba_\bn_\b _\bu_\bn_\bk_\bn_\bo_\bw_\bn_\b _\bi_\bn_\bf_\bo_\b-_\bh_\ba_\bs_\bh|\n-|torrent_paused |40 |The torrent is paused, preventing |\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|_\bt_\bh_\be_\b _\bo_\bp_\be_\br_\ba_\bt_\bi_\bo_\bn_\b _\bf_\br_\bo_\bm_\b _\bs_\bu_\bc_\bc_\be_\be_\bd_\bi_\bn_\bg_\b _\b _\b _\b _\b |\n-| | |The peer sent an invalid have |\n-|invalid_have |41 |message, either wrong size or |\n-| | |referring to a piece that doesn't |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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_\b _\bi_\bn_\b _\bt_\bh_\be_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|invalid_bitfield_size |42 |The _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd message had 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|_\bi_\bn_\bc_\bo_\br_\br_\be_\bc_\bt_\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 |\n-| | |The peer kept requesting pieces |\n-|too_many_requests_when_choked |43 |after it was choked, possible |\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|_\ba_\bb_\bu_\bs_\be_\b _\ba_\bt_\bt_\be_\bm_\bp_\bt_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-| | |The peer sent a piece message that|\n-|invalid_piece |44 |does not correspond to a piece |\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_\bq_\bu_\be_\bs_\bt_\b _\bs_\be_\bn_\bt_\b _\bb_\by_\b _\bt_\bh_\be_\b _\bc_\bl_\bi_\be_\bn_\bt_\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bn_\bo_\b__\bm_\be_\bm_\bo_\br_\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|_\b4_\b5_\b _\b _\b _\b|_\bm_\be_\bm_\bo_\br_\by_\b _\ba_\bl_\bl_\bo_\bc_\ba_\bt_\bi_\bo_\bn_\b _\bf_\ba_\bi_\bl_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|torrent_aborted |46 |The torrent is aborted, preventing|\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|_\bt_\bh_\be_\b _\bo_\bp_\be_\br_\ba_\bt_\bi_\bo_\bn_\b _\bt_\bo_\b _\bs_\bu_\bc_\bc_\be_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|self_connection |47 |The peer is a connection to |\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_\bu_\br_\bs_\be_\bl_\bf_\b,_\b _\bn_\bo_\b _\bp_\bo_\bi_\bn_\bt_\b _\bi_\bn_\b _\bk_\be_\be_\bp_\bi_\bn_\bg_\b _\bi_\bt_\b _\b _\b |\n-| | |The peer sent a piece message with|\n-|invalid_piece_size |48 |invalid size, either negative or |\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|_\bg_\br_\be_\ba_\bt_\be_\br_\b _\bt_\bh_\ba_\bn_\b _\bo_\bn_\be_\b _\bb_\bl_\bo_\bc_\bk_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-| | |The peer has not been interesting |\n-|timed_out_no_interest |49 |or interested in us for too long, |\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|_\bn_\bo_\b _\bp_\bo_\bi_\bn_\bt_\b _\bi_\bn_\b _\bk_\be_\be_\bp_\bi_\bn_\bg_\b _\bi_\bt_\b _\ba_\br_\bo_\bu_\bn_\bd_\b _\b _\b _\b _\b |\n-|timed_out_inactivity |50 |The peer has not said anything in |\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|_\ba_\b _\bl_\bo_\bn_\bg_\b _\bt_\bi_\bm_\be_\b,_\b _\bp_\bo_\bs_\bs_\bi_\bb_\bl_\by_\b _\bd_\be_\ba_\bd_\b _\b _\b _\b _\b _\b _\b _\b |\n-| | |The peer did not send a handshake |\n-|timed_out_no_handshake |51 |within a reasonable amount of |\n-| | |time, it might not be a bittorrent|\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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_\be_\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 |\n-| | |The peer has been unchoked for too|\n-|timed_out_no_request |52 |long without requesting any data. |\n-| | |It might be lying about its |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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_\bt_\be_\br_\be_\bs_\bt_\b _\bi_\bn_\b _\bu_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|invalid_choke |53 |The peer sent an invalid choke |\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|_\bm_\be_\bs_\bs_\ba_\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 |\n-|invalid_unchoke |54 |The peer send an invalid unchoke |\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|_\bm_\be_\bs_\bs_\ba_\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 |\n-|invalid_interested |55 |The peer sent an invalid |\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_\bn_\bt_\be_\br_\be_\bs_\bt_\be_\bd_\b _\bm_\be_\bs_\bs_\ba_\bg_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|invalid_not_interested |56 |The peer sent an invalid not- |\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_\bn_\bt_\be_\br_\be_\bs_\bt_\be_\bd_\b _\bm_\be_\bs_\bs_\ba_\bg_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|invalid_request |57 |The peer sent an invalid piece |\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_\bq_\bu_\be_\bs_\bt_\b _\bm_\be_\bs_\bs_\ba_\bg_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-| | |The peer sent an invalid hash-list|\n-|invalid_hash_list |58 |message (this is part of 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|_\bm_\be_\br_\bk_\bl_\be_\b-_\bt_\bo_\br_\br_\be_\bn_\bt_\b _\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-| | |The peer sent an invalid hash- |\n-|invalid_hash_piece |59 |piece message (this is part of 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|_\bm_\be_\br_\bk_\bl_\be_\b-_\bt_\bo_\br_\br_\be_\bn_\bt_\b _\be_\bx_\bt_\be_\bn_\bs_\bi_\bo_\bn_\b)_\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|invalid_cancel |60 |The peer sent an invalid cancel |\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|_\bm_\be_\bs_\bs_\ba_\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 |\n-|invalid_dht_port |61 |The peer sent an invalid DHT port-|\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|_\bm_\be_\bs_\bs_\ba_\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 |\n-|invalid_suggest |62 |The peer sent an invalid suggest |\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|_\bp_\bi_\be_\bc_\be_\b-_\bm_\be_\bs_\bs_\ba_\bg_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|invalid_have_all |63 |The peer sent an invalid have all-|\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|_\bm_\be_\bs_\bs_\ba_\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 |\n-|invalid_have_none |64 |The peer sent an invalid have |\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|_\bn_\bo_\bn_\be_\b-_\bm_\be_\bs_\bs_\ba_\bg_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|invalid_reject |65 |The peer sent an invalid reject |\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|_\bm_\be_\bs_\bs_\ba_\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 |\n-|invalid_allow_fast |66 |The peer sent an invalid allow |\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_\ba_\bs_\bt_\b-_\bm_\be_\bs_\bs_\ba_\bg_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|invalid_extended |67 |The peer sent an invalid extension|\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|_\bm_\be_\bs_\bs_\ba_\bg_\be_\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 |\n-|invalid_message |68 |The peer sent an invalid message |\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_\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 |\n-|sync_hash_not_found |69 |The synchronization hash was not |\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_\bo_\bu_\bn_\bd_\b _\bi_\bn_\b _\bt_\bh_\be_\b _\be_\bn_\bc_\br_\by_\bp_\bt_\be_\bd_\b _\bh_\ba_\bn_\bd_\bs_\bh_\ba_\bk_\be_\b _\b |\n-|invalid_encryption_constant |70 |The encryption constant 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 _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bh_\ba_\bn_\bd_\bs_\bh_\ba_\bk_\be_\b _\bi_\bs_\b _\bi_\bn_\bv_\ba_\bl_\bi_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|no_plaintext_mode |71 |The peer does not support plain |\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|_\bt_\be_\bx_\bt_\b,_\b _\bw_\bh_\bi_\bc_\bh_\b _\bi_\bs_\b _\bt_\bh_\be_\b _\bs_\be_\bl_\be_\bc_\bt_\be_\bd_\b _\bm_\bo_\bd_\be_\b _\b |\n-|no_rc4_mode |72 |The peer does not support RC4, |\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_\bh_\bi_\bc_\bh_\b _\bi_\bs_\b _\bt_\bh_\be_\b _\bs_\be_\bl_\be_\bc_\bt_\be_\bd_\b _\bm_\bo_\bd_\be_\b _\b _\b _\b _\b _\b _\b _\b |\n-| | |The peer does not support any of |\n-|unsupported_encryption_mode |73 |the encryption modes that 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|_\bc_\bl_\bi_\be_\bn_\bt_\b _\bs_\bu_\bp_\bp_\bo_\br_\bt_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-| | |The peer selected an encryption |\n-|unsupported_encryption_mode_selected|74 |mode that the client did not |\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|_\ba_\bd_\bv_\be_\br_\bt_\bi_\bs_\be_\b _\ba_\bn_\bd_\b _\bd_\bo_\be_\bs_\b _\bn_\bo_\bt_\b _\bs_\bu_\bp_\bp_\bo_\br_\bt_\b _\b _\b _\b |\n-| | |The pad size used in the |\n-|invalid_pad_size |75 |encryption handshake is of invalid|\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_\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 |\n-|invalid_encrypt_handshake |76 |The encryption handshake 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|_\bi_\bn_\bv_\ba_\bl_\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 |\n-| | |The client is set to not support |\n-|no_incoming_encrypted |77 |incoming encrypted connections and|\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|_\bt_\bh_\bi_\bs_\b _\bi_\bs_\b _\ba_\bn_\b _\be_\bn_\bc_\br_\by_\bp_\bt_\be_\bd_\b _\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b _\b _\b |\n-| | |The client is set to not support |\n-|no_incoming_regular |78 |incoming regular bittorrent |\n-| | |connections, and this is a regular|\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_\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 |\n-|duplicate_peer_id |79 |The client is already connected to|\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|_\bt_\bh_\bi_\bs_\b _\bp_\be_\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 |\n-|_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\br_\be_\bm_\bo_\bv_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b8_\b0_\b _\b _\b _\b|_\bT_\bo_\br_\br_\be_\bn_\bt_\b _\bw_\ba_\bs_\b _\br_\be_\bm_\bo_\bv_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|packet_too_large |81 |The packet size exceeded the upper|\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_\bn_\bi_\bt_\by_\b _\bc_\bh_\be_\bc_\bk_\b-_\bl_\bi_\bm_\bi_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\br_\be_\bs_\be_\br_\bv_\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|_\b8_\b2_\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 |\n-|http_error |83 |The web server responded with an |\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_\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 |\n-|missing_location |84 |The web server response is missing|\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|_\ba_\b _\bl_\bo_\bc_\ba_\bt_\bi_\bo_\bn_\b _\bh_\be_\ba_\bd_\be_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-| | |The web seed redirected to a path |\n-|invalid_redirection |85 |that no longer matches 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|_\b._\bt_\bo_\br_\br_\be_\bn_\bt_\b _\bd_\bi_\br_\be_\bc_\bt_\bo_\br_\by_\b _\bs_\bt_\br_\bu_\bc_\bt_\bu_\br_\be_\b _\b _\b _\b _\b _\b |\n-|redirecting |86 |The connection was closed because |\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 _\br_\be_\bd_\bi_\br_\be_\bc_\bt_\be_\bd_\b _\bt_\bo_\b _\ba_\b _\bd_\bi_\bf_\bf_\be_\br_\be_\bn_\bt_\b _\bU_\bR_\bL_\b _\b |\n-|_\bi_\bn_\bv_\ba_\bl_\bi_\bd_\b__\br_\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|_\b8_\b7_\b _\b _\b _\b|_\bT_\bh_\be_\b _\bH_\bT_\bT_\bP_\b _\br_\ba_\bn_\bg_\be_\b _\bh_\be_\ba_\bd_\be_\br_\b _\bi_\bs_\b _\bi_\bn_\bv_\ba_\bl_\bi_\bd_\b _\b |\n-|no_content_length |88 |The HTTP response did not have 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|_\bc_\bo_\bn_\bt_\be_\bn_\bt_\b _\bl_\be_\bn_\bg_\bt_\bh_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bb_\ba_\bn_\bn_\be_\bd_\b__\bb_\by_\b__\bi_\bp_\b__\bf_\bi_\bl_\bt_\be_\br_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b8_\b9_\b _\b _\b _\b|_\bT_\bh_\be_\b _\bI_\bP_\b _\bi_\bs_\b _\bb_\bl_\bo_\bc_\bk_\be_\bd_\b _\bb_\by_\b _\bt_\bh_\be_\b _\bI_\bP_\b _\bf_\bi_\bl_\bt_\be_\br|\n-|_\bt_\bo_\bo_\b__\bm_\ba_\bn_\by_\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|_\b9_\b0_\b _\b _\b _\b|_\bA_\bt_\b _\bt_\bh_\be_\b _\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\b _\bl_\bi_\bm_\bi_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bp_\be_\be_\br_\b__\bb_\ba_\bn_\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|_\b9_\b1_\b _\b _\b _\b|_\bT_\bh_\be_\b _\bp_\be_\be_\br_\b _\bi_\bs_\b _\bm_\ba_\br_\bk_\be_\bd_\b _\ba_\bs_\b _\bb_\ba_\bn_\bn_\be_\bd_\b _\b _\b _\b _\b _\b |\n-|stopping_torrent |92 |The torrent is stopping, causing |\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|_\bt_\bh_\be_\b _\bo_\bp_\be_\br_\ba_\bt_\bi_\bo_\bn_\b _\bt_\bo_\b _\bf_\ba_\bi_\bl_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|too_many_corrupt_pieces |93 |The peer has sent too many corrupt|\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|_\bp_\bi_\be_\bc_\be_\bs_\b _\ba_\bn_\bd_\b _\bi_\bs_\b _\bb_\ba_\bn_\bn_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|torrent_not_ready |94 |The torrent is not ready to |\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_\bc_\be_\bi_\bv_\be_\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 |\n-|peer_not_constructed |95 |The peer is not completely |\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_\bn_\bs_\bt_\br_\bu_\bc_\bt_\be_\bd_\b _\by_\be_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|session_closing |96 |The _\bs_\be_\bs_\bs_\bi_\bo_\bn is closing, causing |\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|_\bt_\bh_\be_\b _\bo_\bp_\be_\br_\ba_\bt_\bi_\bo_\bn_\b _\bt_\bo_\b _\bf_\ba_\bi_\bl_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-| | |The peer was disconnected in order|\n-|optimistic_disconnect |97 |to leave room for a potentially |\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|_\bb_\be_\bt_\bt_\be_\br_\b _\bp_\be_\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 |\n-|_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bf_\bi_\bn_\bi_\bs_\bh_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b9_\b8_\b _\b _\b _\b|_\bT_\bh_\be_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\b _\bi_\bs_\b _\bf_\bi_\bn_\bi_\bs_\bh_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bn_\bo_\b__\br_\bo_\bu_\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|_\b9_\b9_\b _\b _\b _\b|_\bN_\bo_\b _\bU_\bP_\bn_\bP_\b _\br_\bo_\bu_\bt_\be_\br_\b _\bf_\bo_\bu_\bn_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|metadata_too_large |100 |The metadata message says 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|_\bm_\be_\bt_\ba_\bd_\ba_\bt_\ba_\b _\be_\bx_\bc_\be_\be_\bd_\bs_\b _\bt_\bh_\be_\b _\bl_\bi_\bm_\bi_\bt_\b _\b _\b _\b _\b _\b _\b _\b |\n-|invalid_metadata_request |101 |The peer sent an invalid 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|_\br_\be_\bq_\bu_\be_\bs_\bt_\b _\bm_\be_\bs_\bs_\ba_\bg_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|invalid_metadata_size |102 |The peer advertised an invalid |\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|_\bm_\be_\bt_\ba_\bd_\ba_\bt_\ba_\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 |\n-|invalid_metadata_offset |103 |The peer sent a message with an |\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_\bn_\bv_\ba_\bl_\bi_\bd_\b _\bm_\be_\bt_\ba_\bd_\ba_\bt_\ba_\b _\bo_\bf_\bf_\bs_\be_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|invalid_metadata_message |104 |The peer sent an invalid 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|_\bm_\be_\bs_\bs_\ba_\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 |\n-|pex_message_too_large |105 |The peer sent a peer exchange |\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|_\bm_\be_\bs_\bs_\ba_\bg_\be_\b _\bt_\bh_\ba_\bt_\b _\bw_\ba_\bs_\b _\bt_\bo_\bo_\b _\bl_\ba_\br_\bg_\be_\b _\b _\b _\b _\b _\b _\b _\b |\n-|invalid_pex_message |106 |The peer sent an invalid peer |\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_\bx_\bc_\bh_\ba_\bn_\bg_\be_\b _\bm_\be_\bs_\bs_\ba_\bg_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|invalid_lt_tracker_message |107 |The peer sent an invalid 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 _\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 _\bm_\be_\bs_\bs_\ba_\bg_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-| | |The peer sent an pex messages too |\n-|too_frequent_pex |108 |often. This is a possible attempt |\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 _\ba_\bn_\bd_\b _\ba_\bt_\bt_\ba_\bc_\bk_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-| | |The operation failed because it |\n-| | |requires the torrent to have the |\n-| | |metadata (.torrent file) and it |\n-|no_metadata |109 |doesn't have it yet. This happens |\n-| | |for magnet links before they have |\n-| | |downloaded the metadata, and also |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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_\bs_\b _\ba_\bd_\bd_\be_\bd_\b _\bb_\by_\b _\bU_\bR_\bL_\b._\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-| | |The peer sent an invalid dont_have|\n-| | |message. The don't have message is|\n-|invalid_dont_have |110 |an extension to allow peers to |\n-| | |advertise that the no longer has a|\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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_\bi_\be_\bc_\be_\b _\bt_\bh_\be_\by_\b _\bp_\br_\be_\bv_\bi_\bo_\bu_\bs_\bl_\by_\b _\bh_\ba_\bd_\b._\b _\b _\b _\b _\b _\b _\b _\b |\n-| | |The peer tried to connect to an |\n-|requires_ssl_connection |111 |SSL torrent without connecting |\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_\bv_\be_\br_\b _\bS_\bS_\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 |\n-| | |The peer tried to connect to a |\n-|invalid_ssl_cert |112 |torrent with a certificate for 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|_\bd_\bi_\bf_\bf_\be_\br_\be_\bn_\bt_\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 |\n-| | |the torrent is not an SSL torrent,|\n-|not_an_ssl_torrent |113 |and the operation requires an SSL |\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|_\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 |\n-| | |peer was banned because its listen|\n-|banned_by_port_filter |114 |port is within a banned port |\n-| | |range, as specified by the |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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_\bo_\br_\bt_\b__\bf_\bi_\bl_\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 |\n-|invalid_session_handle |115 |The _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bh_\ba_\bn_\bd_\bl_\be is not |\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_\bf_\be_\br_\br_\bi_\bn_\bg_\b _\bt_\bo_\b _\ba_\b _\bv_\ba_\bl_\bi_\bd_\b _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bi_\bm_\bp_\bl_\b |\n-|invalid_listen_socket |116 |the listen socket associated with |\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|_\bt_\bh_\bi_\bs_\b _\br_\be_\bq_\bu_\be_\bs_\bt_\b _\bw_\ba_\bs_\b _\bc_\bl_\bo_\bs_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bi_\bn_\bv_\ba_\bl_\bi_\bd_\b__\bh_\ba_\bs_\bh_\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|_\b1_\b1_\b7_\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 |\n-|_\bi_\bn_\bv_\ba_\bl_\bi_\bd_\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|_\b1_\b1_\b8_\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 |\n-|_\bi_\bn_\bv_\ba_\bl_\bi_\bd_\b__\bh_\ba_\bs_\bh_\b__\br_\be_\bj_\be_\bc_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b1_\b9_\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 |\n-|_\bd_\be_\bp_\br_\be_\bc_\ba_\bt_\be_\bd_\b__\b1_\b2_\b0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b2_\b0_\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 |\n-|_\bd_\be_\bp_\br_\be_\bc_\ba_\bt_\be_\bd_\b__\b1_\b2_\b1_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b2_\b1_\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 |\n-|_\bd_\be_\bp_\br_\be_\bc_\ba_\bt_\be_\bd_\b__\b1_\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|_\b1_\b2_\b2_\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 |\n-|_\bd_\be_\bp_\br_\be_\bc_\ba_\bt_\be_\bd_\b__\b1_\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|_\b1_\b2_\b3_\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 |\n-|_\bd_\be_\bp_\br_\be_\bc_\ba_\bt_\be_\bd_\b__\b1_\b2_\b4_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b2_\b4_\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 |\n-|missing_file_sizes |130 |The resume data file is missing |\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|_\bt_\bh_\be_\b _\bf_\bi_\bl_\be_\b _\bs_\bi_\bz_\be_\bs_\b _\be_\bn_\bt_\br_\by_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|no_files_in_resume_data |131 |The resume data file file sizes |\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_\bn_\bt_\br_\by_\b _\bi_\bs_\b _\be_\bm_\bp_\bt_\by_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|missing_pieces |132 |The resume data file is missing |\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|_\bt_\bh_\be_\b _\bp_\bi_\be_\bc_\be_\bs_\b _\ba_\bn_\bd_\b _\bs_\bl_\bo_\bt_\bs_\b _\be_\bn_\bt_\br_\by_\b _\b _\b _\b _\b _\b _\b _\b |\n-| | |The number of files in the resume |\n-|mismatching_number_of_files |133 |data does not match the number of |\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_\bi_\bl_\be_\bs_\b _\bi_\bn_\b _\bt_\bh_\be_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-| | |One of the files on disk has a |\n-|mismatching_file_size |134 |different size than in the fast |\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_\bu_\bm_\be_\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 |\n-| | |One of the files on disk has a |\n-|mismatching_file_timestamp |135 |different timestamp than 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 _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\bf_\ba_\bs_\bt_\b _\br_\be_\bs_\bu_\bm_\be_\b _\bf_\bi_\bl_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|not_a_dictionary |136 |The resume data file is not 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|_\bd_\bi_\bc_\bt_\bi_\bo_\bn_\ba_\br_\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-|invalid_blocks_per_piece |137 |The blocks per piece _\be_\bn_\bt_\br_\by 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|_\bi_\bn_\bv_\ba_\bl_\bi_\bd_\b _\bi_\bn_\b _\bt_\bh_\be_\b _\br_\be_\bs_\bu_\bm_\be_\b _\bd_\ba_\bt_\ba_\b _\bf_\bi_\bl_\be_\b _\b _\b |\n-| | |The resume file is missing the |\n-|missing_slots |138 |slots _\be_\bn_\bt_\br_\by, which is required for|\n-| | |torrents with compact allocation. |\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|_\bD\bD_\bE\bE_\bP\bP_\bR\bR_\bE\bE_\bC\bC_\bA\bA_\bT\bT_\bE\bE_\bD\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 |\n-|too_many_slots |139 |The resume file contains more |\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_\bl_\bo_\bt_\bs_\b _\bt_\bh_\ba_\bn_\b _\bt_\bh_\be_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|invalid_slot_list |140 |The slot _\be_\bn_\bt_\br_\by is invalid 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 _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b|_\br_\be_\bs_\bu_\bm_\be_\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 |\n-|invalid_piece_index |141 |One index in the slot list 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|_\bi_\bn_\bv_\ba_\bl_\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 |\n-| | |The pieces on disk needs to be re-|\n-| | |ordered for the specified |\n-| | |allocation mode. This happens if |\n-|pieces_need_reorder |142 |you specify sparse allocation and |\n-| | |the files on disk are using |\n-| | |compact storage. The pieces needs |\n-| | |to be moved to their right |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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_\bo_\bs_\bi_\bt_\bi_\bo_\bn_\b._\b _\bD\bD_\bE\bE_\bP\bP_\bR\bR_\bE\bE_\bC\bC_\bA\bA_\bT\bT_\bE\bE_\bD\bD_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-| | |this error is returned when asking|\n-| | |to save resume data and specifying|\n-|resume_data_not_modified |143 |the flag to only save when there's|\n-| | |anything new to save |\n-| | |(_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be_\b:_\b:_\bo_\bn_\bl_\by_\b__\bi_\bf_\b__\bm_\bo_\bd_\bi_\bf_\bi_\be_\bd)|\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|_\ba_\bn_\bd_\b _\bt_\bh_\be_\br_\be_\b _\bw_\ba_\bs_\bn_\b'_\bt_\b _\ba_\bn_\by_\bt_\bh_\bi_\bn_\bg_\b _\bc_\bh_\ba_\bn_\bg_\be_\bd_\b.|\n-|invalid_save_path |144 |the save_path in |\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|_\ba_\bd_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bp_\ba_\br_\ba_\bm_\bs_\b _\bi_\bs_\b _\bn_\bo_\bt_\b _\bv_\ba_\bl_\bi_\bd_\b _\b _\b |\n-|http_parse_error |150 |The HTTP header was not correctly |\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_\bo_\br_\bm_\ba_\bt_\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 |\n-| | |The HTTP response was in the 300- |\n-|http_missing_location |151 |399 range but lacked a location |\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|_\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 _\b _\b _\b _\b _\b _\b _\b |\n-| | |The HTTP response was encoded with|\n-|http_failed_decompress |152 |gzip or deflate but decompressing |\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 _\bf_\ba_\bi_\bl_\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 |\n-|no_i2p_router |160 |The URL specified an i2p address, |\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|_\bb_\bu_\bt_\b _\bn_\bo_\b _\bi_\b2_\bp_\b _\br_\bo_\bu_\bt_\be_\br_\b _\bi_\bs_\b _\bc_\bo_\bn_\bf_\bi_\bg_\bu_\br_\be_\bd_\b _\b _\b |\n-|no_i2p_endpoint |161 |i2p acceptor is not available yet,|\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_\ba_\bn_\b'_\bt_\b _\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b _\bw_\bi_\bt_\bh_\bo_\bu_\bt_\b _\be_\bn_\bd_\bp_\bo_\bi_\bn_\bt_\b _\b _\b |\n-| | |The tracker URL doesn't support |\n-|scrape_not_available |170 |transforming it into a scrape URL.|\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_\b._\be_\b._\b _\bi_\bt_\b _\bd_\bo_\be_\bs_\bn_\b'_\bt_\b _\bc_\bo_\bn_\bt_\ba_\bi_\bn_\b _\b\"_\ba_\bn_\bn_\bo_\bu_\bn_\bc_\be_\b.|\n-|_\bi_\bn_\bv_\ba_\bl_\bi_\bd_\b__\bt_\br_\ba_\bc_\bk_\be_\br_\b__\br_\be_\bs_\bp_\bo_\bn_\bs_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b7_\b1_\b _\b _\b|_\bi_\bn_\bv_\ba_\bl_\bi_\bd_\b _\bt_\br_\ba_\bc_\bk_\be_\br_\b _\br_\be_\bs_\bp_\bo_\bn_\bs_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|invalid_peer_dict |172 |invalid peer dictionary _\be_\bn_\bt_\br_\by. Not|\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|_\ba_\b _\bd_\bi_\bc_\bt_\bi_\bo_\bn_\ba_\br_\by_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bt_\br_\ba_\bc_\bk_\be_\br_\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 _\b _\b|_\b1_\b7_\b3_\b _\b _\b|_\bt_\br_\ba_\bc_\bk_\be_\br_\b _\bs_\be_\bn_\bt_\b _\ba_\b _\bf_\ba_\bi_\bl_\bu_\br_\be_\b _\bm_\be_\bs_\bs_\ba_\bg_\be_\b _\b _\b _\b |\n-|_\bi_\bn_\bv_\ba_\bl_\bi_\bd_\b__\bf_\bi_\bl_\be_\bs_\b__\be_\bn_\bt_\br_\by_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b7_\b4_\b _\b _\b|_\bm_\bi_\bs_\bs_\bi_\bn_\bg_\b _\bo_\br_\b _\bi_\bn_\bv_\ba_\bl_\bi_\bd_\b _\bf_\bi_\bl_\be_\bs_\b _\be_\bn_\bt_\br_\by_\b _\b _\b _\b |\n-|_\bi_\bn_\bv_\ba_\bl_\bi_\bd_\b__\bh_\ba_\bs_\bh_\b__\be_\bn_\bt_\br_\by_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b7_\b5_\b _\b _\b|_\bm_\bi_\bs_\bs_\bi_\bn_\bg_\b _\bo_\br_\b _\bi_\bn_\bv_\ba_\bl_\bi_\bd_\b _\bh_\ba_\bs_\bh_\b _\be_\bn_\bt_\br_\by_\b _\b _\b _\b _\b |\n-|invalid_peers_entry |176 |missing or invalid peers and |\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|_\bp_\be_\be_\br_\bs_\b6_\b _\be_\bn_\bt_\br_\by_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|invalid_tracker_response_length |177 |UDP tracker response packet 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 _\b|_\bi_\bn_\bv_\ba_\bl_\bi_\bd_\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 |\n-|invalid_tracker_transaction_id |178 |invalid transaction id in UDP |\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|_\bt_\br_\ba_\bc_\bk_\be_\br_\b _\br_\be_\bs_\bp_\bo_\bn_\bs_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|invalid_tracker_action |179 |invalid action field in UDP |\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|_\bt_\br_\ba_\bc_\bk_\be_\br_\b _\br_\be_\bs_\bp_\bo_\bn_\bs_\be_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-| | |skipped announce (because it's |\n-|announce_skipped |180 |assumed to be unreachable over 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|_\bg_\bi_\bv_\be_\bn_\b _\bs_\bo_\bu_\br_\bc_\be_\b _\bn_\be_\bt_\bw_\bo_\br_\bk_\b _\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be_\b)_\b _\b _\b |\n-|_\bn_\bo_\b__\be_\bn_\bt_\br_\bo_\bp_\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|_\b2_\b0_\b0_\b _\b _\b|_\br_\ba_\bn_\bd_\bo_\bm_\b _\bn_\bu_\bm_\bb_\be_\br_\b _\bg_\be_\bn_\be_\br_\ba_\bt_\bi_\bo_\bn_\b _\bf_\ba_\bi_\bl_\be_\bd_\b _\b _\b |\n-|_\bs_\bs_\br_\bf_\b__\bm_\bi_\bt_\bi_\bg_\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|_\b2_\b0_\b1_\b _\b _\b|_\bb_\bl_\bo_\bc_\bk_\be_\bd_\b _\bb_\by_\b _\bS_\bS_\bR_\bF_\b _\bm_\bi_\bt_\bi_\bg_\ba_\bt_\bi_\bo_\bn_\b _\b _\b _\b _\b _\b _\b _\b |\n-|blocked_by_idna |202 |blocked because IDNA host names |\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|_\ba_\br_\be_\b _\bb_\ba_\bn_\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 |\n-|torrent_unknown_version |210 |the torrent file has an unknown |\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|_\bm_\be_\bt_\ba_\b _\bv_\be_\br_\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 |\n-|torrent_missing_file_tree |211 |the v2 torrent file has no file |\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|_\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 |\n-|torrent_missing_meta_version |212 |the torrent contains v2 keys but |\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|_\bd_\bo_\be_\bs_\b _\bn_\bo_\bt_\b _\bs_\bp_\be_\bc_\bi_\bf_\by_\b _\bm_\be_\bt_\ba_\b _\bv_\be_\br_\bs_\bi_\bo_\bn_\b _\b2_\b _\b _\b |\n-|torrent_inconsistent_files |213 |the v1 and v2 file metadata does |\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|_\bn_\bo_\bt_\b _\bm_\ba_\bt_\bc_\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 |\n-|torrent_missing_piece_layer |214 |one or more files are missing |\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|_\bp_\bi_\be_\bc_\be_\b _\bl_\ba_\by_\be_\br_\b _\bh_\ba_\bs_\bh_\be_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|torrent_invalid_piece_layer |215 |a piece layer has the wrong size |\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_\br_\b _\bf_\ba_\bi_\bl_\be_\bd_\b _\bh_\ba_\bs_\bh_\b _\bc_\bh_\be_\bc_\bk_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bt_\bo_\br_\br_\be_\bn_\bt_\b__\bm_\bi_\bs_\bs_\bi_\bn_\bg_\b__\bp_\bi_\be_\bc_\be_\bs_\b__\br_\bo_\bo_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b2_\b1_\b6_\b _\b _\b|_\ba_\b _\bv_\b2_\b _\bf_\bi_\bl_\be_\b _\be_\bn_\bt_\br_\by_\b _\bh_\ba_\bs_\b _\bn_\bo_\b _\br_\bo_\bo_\bt_\b _\bh_\ba_\bs_\bh_\b _\b |\n-|torrent_inconsistent_hashes |217 |the v1 and v2 hashes do not |\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|_\bd_\be_\bs_\bc_\br_\bi_\bb_\be_\b _\bt_\bh_\be_\b _\bs_\ba_\bm_\be_\b _\bd_\ba_\bt_\ba_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|torrent_invalid_pad_file |218 |a file in the v2 metadata has 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|_\bp_\ba_\bd_\b _\ba_\bt_\bt_\br_\bi_\bb_\bu_\bt_\be_\b _\bs_\be_\bt_\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 _\b|_\b2_\b1_\b9_\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 |\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 h\bht\btt\btp\bp_\b_e\ber\brr\bro\bor\brs\bs *\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 \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|\n-|_\bc_\bo_\bn_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b1_\b0_\b0_\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bo_\bk_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b2_\b0_\b0_\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bc_\br_\be_\ba_\bt_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b2_\b0_\b1_\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\ba_\bc_\bc_\be_\bp_\bt_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b2_\b0_\b2_\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bn_\bo_\b__\bc_\bo_\bn_\bt_\be_\bn_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b2_\b0_\b4_\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bm_\bu_\bl_\bt_\bi_\bp_\bl_\be_\b__\bc_\bh_\bo_\bi_\bc_\be_\bs_\b _\b _\b _\b _\b _\b|_\b3_\b0_\b0_\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bm_\bo_\bv_\be_\bd_\b__\bp_\be_\br_\bm_\ba_\bn_\be_\bn_\bt_\bl_\by_\b _\b _\b _\b _\b|_\b3_\b0_\b1_\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bm_\bo_\bv_\be_\bd_\b__\bt_\be_\bm_\bp_\bo_\br_\ba_\br_\bi_\bl_\by_\b _\b _\b _\b _\b|_\b3_\b0_\b2_\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bn_\bo_\bt_\b__\bm_\bo_\bd_\bi_\bf_\bi_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b3_\b0_\b4_\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bb_\ba_\bd_\b__\br_\be_\bq_\bu_\be_\bs_\bt_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b4_\b0_\b0_\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bu_\bn_\ba_\bu_\bt_\bh_\bo_\br_\bi_\bz_\be_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b4_\b0_\b1_\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bf_\bo_\br_\bb_\bi_\bd_\bd_\be_\bn_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b4_\b0_\b3_\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bn_\bo_\bt_\b__\bf_\bo_\bu_\bn_\bd_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b4_\b0_\b4_\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bi_\bn_\bt_\be_\br_\bn_\ba_\bl_\b__\bs_\be_\br_\bv_\be_\br_\b__\be_\br_\br_\bo_\br_\b|_\b5_\b0_\b0_\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bn_\bo_\bt_\b__\bi_\bm_\bp_\bl_\be_\bm_\be_\bn_\bt_\be_\bd_\b _\b _\b _\b _\b _\b _\b|_\b5_\b0_\b1_\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bb_\ba_\bd_\b__\bg_\ba_\bt_\be_\bw_\ba_\by_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b5_\b0_\b2_\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|_\bs_\be_\br_\bv_\bi_\bc_\be_\b__\bu_\bn_\ba_\bv_\ba_\bi_\bl_\ba_\bb_\bl_\be_\b _\b _\b|_\b5_\b0_\b3_\b _\b _\b|_\b\u00a0_\b _\b _\b _\b _\b _\b _\b _\b _\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@@ -11912,24 +12095,24 @@\n connect to the external NAT-PMP port (configured using announce_port) instead\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_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+ 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, flags::bitfield_flag const val);\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+ 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 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 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@@ -11999,19 +12182,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_i\bin\bnt\bt(\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) *\b**\b**\b**\b**\b*\n-void s\bse\bet\bt_\b_s\bst\btr\br (int name, std::string val) override;\n+*\b**\b**\b**\b**\b* s\bse\bet\bt_\b_s\bst\btr\br(\b()\b) s\bse\bet\bt_\b_i\bin\bnt\bt(\b()\b) s\bse\bet\bt_\b_b\bbo\boo\bol\bl(\b()\b) *\b**\b**\b**\b**\b*\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+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, flags::bitfield_flag const val);\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@@ -12022,18 +12205,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+*\b**\b**\b**\b**\b* g\bge\bet\bt_\b_i\bin\bnt\bt(\b()\b) g\bge\bet\bt_\b_b\bbo\boo\bol\bl(\b()\b) g\bge\bet\bt_\b_s\bst\btr\br(\b()\b) *\b**\b**\b**\b**\b*\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 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 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@@ -12160,38 +12343,14 @@\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-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-for the basis, and should be tweaked to fit your needs better.\n-min_memory_usage returns settings that will use the minimal amount of RAM, at\n-the potential expense of upload and download performance. It adjusts the socket\n-buffer sizes, disables the disk cache, lowers the send buffer watermarks so\n-that each connection only has at most one block in use at any one time. It\n-lowers the outstanding blocks send to the disk I/O thread so that connections\n-only have one block waiting to be flushed to disk at any given time. It lowers\n-the max number of peers in the peer list for torrents. It performs multiple\n-smaller reads when it hashes pieces, instead of reading it all into memory\n-before hashing.\n-This configuration is intended to be the starting point for embedded devices.\n-It will significantly reduce memory usage.\n-high_performance_seed returns settings optimized for a seed box, serving many\n-peers and that doesn't do any downloading. It has a 128 MB disk cache and has a\n-limit of 400 files in its file pool. It support fast upload rates by allowing\n-large send buffers.\n-[_\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@@ -12221,476 +12380,37 @@\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* 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, 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);\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, load_torrent_limits const& cfg,\n-from_span_t);\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 (info_hash_t const& info_hash);\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 (span buffer, from_span_t);\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- ~\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- 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 const& t\btr\bra\bac\bck\bke\ber\brs\bs () const;\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- 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- 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_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::int64_t t\bto\bot\bta\bal\bl_\b_s\bsi\biz\bze\be () 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- 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- 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, 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);\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, load_torrent_limits const& cfg,\n-from_span_t);\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 (info_hash_t const& info_hash);\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 (span buffer, from_span_t);\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-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* 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-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 const& t\btr\bra\bac\bck\bke\ber\brs\bs () const;\n-add_tracker() adds a tracker to the announce-list. The tier determines the\n-order in which the trackers are to be tried. The trackers() function will\n-return a sorted vector of _\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_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 (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-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_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-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 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-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\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-[_\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()\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-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+*\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+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+for the basis, and should be tweaked to fit your needs better.\n+min_memory_usage returns settings that will use the minimal amount of RAM, at\n+the potential expense of upload and download performance. It adjusts the socket\n+buffer sizes, disables the disk cache, lowers the send buffer watermarks so\n+that each connection only has at most one block in use at any one time. It\n+lowers the outstanding blocks send to the disk I/O thread so that connections\n+only have one block waiting to be flushed to disk at any given time. It lowers\n+the max number of peers in the peer list for torrents. It performs multiple\n+smaller reads when it hashes pieces, instead of reading it all into memory\n+before hashing.\n+This configuration is intended to be the starting point for embedded devices.\n+It will significantly reduce memory usage.\n+high_performance_seed returns settings optimized for a seed box, serving many\n+peers and that doesn't do any downloading. It has a 128 MB disk cache and has a\n+limit of 400 files in its file pool. It support fast upload rates by allowing\n+large send buffers.\n [_\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\bto\bor\bra\bag\bge\be_\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/_\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 This structure hold the relevant _\bc_\bo_\bu_\bn_\bt_\be_\br_\bs for the storage\n struct dht_storage_counters\n {\n void r\bre\bes\bse\bet\bt ();\n@@ -12912,45 +12632,45 @@\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\bbu\buf\bf(\b()\b) w\bwr\bri\bit\bte\be_\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/_\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+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 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);\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 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+ , 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 , 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"}]}, {"source1": "./usr/share/doc/libtorrent-rasterbar-doc/html/todo.html", "source2": "./usr/share/doc/libtorrent-rasterbar-doc/html/todo.html", "unified_diff": "@@ -459,226 +459,452 @@\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/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+
    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+\t\t\t++i;\n+\t\t\tp->disconnect(errors::stopping_torrent, operation_t::bittorrent);\n+\t\t}\n+\n+\t\t// close the listen sockets\n+\t\tfor (auto const& l : m_listen_sockets)\n+\t\t{\n+\t\t\tif (l->sock)\n+\t\t\t{\n+\t\t\t\tl->sock->close(ec);\n+\t\t\t\tTORRENT_ASSERT(!ec);\n+\t\t\t}\n+\n+
    \t\t\tif (l->udp_sock)\n+
    \t\t\t{\n+\t\t\t\tl->udp_sock->sock.close();\n+\t\t\t}\n+\t\t}\n+\n+\t\t// we need to give all the sockets an opportunity to actually have their handlers\n+\t\t// called and cancelled before we continue the shutdown. This is a bit\n+\t\t// complicated, if there are no \"undead\" peers, it's safe to resume the\n+\t\t// shutdown, but if there are, we have to wait for them to be cleared out\n+\t\t// first. In session_impl::on_tick() we check them periodically. If we're\n+\t\t// shutting down and we remove the last one, we'll initiate\n+\t\t// shutdown_stage2 from there.\n+\t\tif (m_undead_peers.empty())\n+\t\t{\n+\t\t\tpost(m_io_context, make_handler([this] { abort_stage2(); }\n+\t\t\t\t, m_abort_handler_storage, *this));\n+\t\t}\n \t}\n \n-\tvoid session_handle::dht_get_item(std::array<char, 32> key\n-\t\t, std::string salt)\n+\tvoid session_impl::abort_stage2() noexcept\n \t{\n-#ifndef TORRENT_DISABLE_DHT\n-\t\tasync_call(&session_impl::dht_get_mutable_item, key, salt);\n-#else\n-\t\tTORRENT_UNUSED(key);\n-\t\tTORRENT_UNUSED(salt);\n+\t\tm_download_rate.close();\n+\t\tm_upload_rate.close();\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+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-\t}\n \n-
    \tsha1_hash session_handle::dht_put_item(entry data)\n-
    \t{\n-\t\tstd::vector<char> buf;\n-\t\tbencode(std::back_inserter(buf), data);\n-\t\tsha1_hash const ret = hasher(buf).final();\n+\t\tauto ret = std::make_shared<listen_socket_t>();\n+\t\tret->ssl = lep.ssl;\n+\t\tret->original_port = bind_ep.port();\n+\t\tret->flags = lep.flags;\n+\t\tret->netmask = lep.netmask;\n+\t\toperation_t last_op = operation_t::unknown;\n+\t\tsocket_type_t const sock_type\n+\t\t\t= (lep.ssl == transport::ssl)\n+\t\t\t? socket_type_t::tcp_ssl\n+\t\t\t: socket_type_t::tcp;\n \n-#ifndef TORRENT_DISABLE_DHT\n-\t\tasync_call(&session_impl::dht_put_immutable_item, data, ret);\n+\t\t// if we're in force-proxy mode, don't open TCP listen sockets. We cannot\n+\t\t// accept connections on our local machine in this case.\n+
    \t\tif (ret->flags & listen_socket_t::accept_incoming)\n+
    \t\t{\n+\t\t\tret->sock = std::make_shared<tcp::acceptor>(m_io_context);\n+\t\t\tret->sock->open(bind_ep.protocol(), ec);\n+\t\t\tlast_op = operation_t::sock_open;\n+\t\t\tif (ec)\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\tsession_log(\"failed to open socket: %s\"\n+\t\t\t\t\t\t, ec.message().c_str());\n+\t\t\t\t}\n #endif\n-\t\treturn ret;\n-\t}\n \n-\tvoid session_handle::dht_put_item(std::array<char, 32> key\n-\t\t, std::function<void(entry&, std::array<char,64>&\n-\t\t\t, std::int64_t&, std::string const&)> cb\n-\t\t, std::string salt)\n-\t{\n-#ifndef TORRENT_DISABLE_DHT\n-\t\tasync_call(&session_impl::dht_put_mutable_item, key, cb, salt);\n-#else\n-\t\tTORRENT_UNUSED(key);\n-\t\tTORRENT_UNUSED(cb);\n-\t\tTORRENT_UNUSED(salt);\n+\t\t\t\tif (m_alerts.should_post<listen_failed_alert>())\n+\t\t\t\t\tm_alerts.emplace_alert<listen_failed_alert>(lep.device, bind_ep, last_op\n+\t\t\t\t\t\t, ec, sock_type);\n+\t\t\t\treturn ret;\n+\t\t\t}\n+\n+#ifdef TORRENT_WINDOWS\n+\t\t\t{\n+\t\t\t\t// this is best-effort. ignore errors\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+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 #endif\n-\t}\n+\t\t\tm_utp_socket_manager;\n \n-\tvoid session_handle::dht_get_peers(sha1_hash const& info_hash)\n-\t{\n-#ifndef TORRENT_DISABLE_DHT\n-\t\tasync_call(&session_impl::dht_get_peers, info_hash);\n-#else\n-
    relevance 3../src/peer_connection.cpp:3133instead of having to ask the torrent whether it's in graceful pause mode or not, the peers should keep that state (and the torrent should update them when it enters graceful pause). When a peer enters graceful pause mode, it should cancel all outstanding requests and clear its request queue.

    instead of having to ask the torrent whether it's in graceful\n-pause mode or not, the peers should keep that state (and the torrent\n-should update them when it enters graceful pause). When a peer enters\n-graceful pause mode, it should cancel all outstanding requests and\n-clear its request queue.

    ../src/peer_connection.cpp:3133

    \t\t// to disk or are in the disk write cache\n-\t\tif (picker.is_piece_finished(p.piece) && !was_finished)\n+\t\tfor (;;)\n \t\t{\n-#if TORRENT_USE_INVARIANT_CHECKS\n-\t\t\tcheck_postcondition post_checker2_(t, false);\n+\t\t\taux::array<udp_socket::packet, 50> p;\n+\t\t\terror_code err;\n+\t\t\tint const num_packets = s->sock.read(p, err);\n+\n+\t\t\tfor (udp_socket::packet& packet : span<udp_socket::packet>(p).first(num_packets))\n+\t\t\t{\n+\t\t\t\tif (packet.error)\n+\t\t\t\t{\n+
    \n+
    #ifndef TORRENT_DISABLE_DHT\n+\t\t\t\t\tif (m_dht)\n+\t\t\t\t\t\tm_dht->incoming_error(packet.error, packet.from);\n #endif\n-\t\t\tt->verify_piece(p.piece);\n-\t\t}\n \n-\t\tcheck_graceful_pause();\n+\t\t\t\t\tm_tracker_manager.incoming_error(packet.error, packet.from);\n+\t\t\t\t\tcontinue;\n+\t\t\t\t}\n \n-\t\tif (is_disconnecting()) return;\n+\t\t\t\tspan<char const> const buf = packet.data;\n+\t\t\t\tif (!packet.hostname.empty())\n+\t\t\t\t{\n+\t\t\t\t\t// only the tracker manager supports receiving UDP packets\n+\t\t\t\t\t// from hostnames. If it won't handle it, no one else will\n+\t\t\t\t\t// either\n+\t\t\t\t\tm_tracker_manager.incoming_packet(packet.hostname, buf);\n+\t\t\t\t\tcontinue;\n+\t\t\t\t}\n \n-\t\tif (request_a_block(*t, *this))\n-\t\t\tm_counters.inc_stats_counter(counters::incoming_piece_picks);\n-\t\tsend_block_requests();\n-\t}\n+\t\t\t\t// give the uTP socket manager first dibs on the packet. Presumably\n+\t\t\t\t// the majority of packets are uTP packets.\n+\t\t\t\tif (!mgr.incoming_packet(ls, packet.from, buf))\n+\t\t\t\t{\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+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-\tvoid peer_connection::check_graceful_pause()\n+\tvoid session_impl::recalculate_optimistic_unchoke_slots()\n \t{\n-
    \t\tstd::shared_ptr<torrent> t = m_torrent.lock();\n-
    \t\tif (!t || !t->graceful_pause()) return;\n+\t\tINVARIANT_CHECK;\n \n-\t\tif (m_outstanding_bytes > 0) return;\n+\t\tTORRENT_ASSERT(is_single_thread());\n+\t\tif (m_stats_counters[counters::num_unchoke_slots] == 0) return;\n \n-#ifndef TORRENT_DISABLE_LOGGING\n-\t\tpeer_log(peer_log_alert::info, \"GRACEFUL_PAUSE\", \"NO MORE DOWNLOAD\");\n-#endif\n-\t\tdisconnect(errors::torrent_paused, operation_t::bittorrent);\n-\t}\n+\t\t// if we unchoke everyone, skip this logic\n+\t\tif (settings().get_int(settings_pack::choking_algorithm) == settings_pack::fixed_slots_choker\n+\t\t\t&& settings().get_int(settings_pack::unchoke_slots_limit) < 0)\n+\t\t\treturn;\n \n-\tvoid peer_connection::on_disk_write_complete(storage_error const& error\n-\t\t, peer_request const& p, std::shared_ptr<torrent> t)\n-\t{\n-\t\tTORRENT_ASSERT(is_single_thread());\n-#ifndef TORRENT_DISABLE_LOGGING\n-\t\tif (should_log(peer_log_alert::info))\n-\t\t{\n-\t\t\tpeer_log(peer_log_alert::info, \"FILE_ASYNC_WRITE_COMPLETE\", \"piece: %d s: %x l: %x e: %s\"\n-\t\t\t\t, static_cast<int>(p.piece), p.start, p.length, error.ec.message().c_str());\n-\t\t}\n-#endif\n+\t\tstd::vector<opt_unchoke_candidate> opt_unchoke;\n \n-\t\tm_counters.inc_stats_counter(counters::queued_write_bytes, -p.length);\n-\t\tm_outstanding_writing_bytes -= p.length;\n+\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\tTORRENT_ASSERT(m_outstanding_writing_bytes >= 0);\n+
    \t\tfor (auto& i : m_connections)\n+
    \t\t{\n+\t\t\tpeer_connection* const p = i.get();\n+\t\t\tTORRENT_ASSERT(p);\n+\t\t\ttorrent_peer* pi = p->peer_info_struct();\n+\t\t\tif (!pi) continue;\n+\t\t\tif (pi->web_seed) continue;\n \n-\t\t// every peer is entitled to allocate a disk buffer if it has no writes outstanding\n-\t\t// see the comment in incoming_piece\n-\t\tif (m_outstanding_writing_bytes == 0\n-
    relevance 3../src/peer_connection.cpp:4044once peers are properly put in graceful pause mode, they can cancel all outstanding requests and this test can be removed.

    once peers are properly put in graceful pause mode, they can\n-cancel all outstanding requests and this test can be removed.

    ../src/peer_connection.cpp:4044

    \n-\t\t\tif (!p->m_deferred_send_block_requests)\n-\t\t\t\treturn;\n+\t\t\tif (pi->optimistically_unchoked)\n+\t\t\t{\n+\t\t\t\tprev_opt_unchoke.push_back(pi);\n+\t\t\t}\n \n-\t\t\tp->m_deferred_send_block_requests = false;\n-\t\t\tp->send_block_requests_impl();\n-\t\t});\n-\t\tm_deferred_send_block_requests = true;\n-\t}\n+\t\t\ttorrent const* t = p->associated_torrent().lock().get();\n+\t\t\tif (!t) continue;\n \n-\tvoid peer_connection::send_block_requests_impl()\n-\t{\n-\t\tTORRENT_ASSERT(is_single_thread());\n-\t\tINVARIANT_CHECK;\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\tstd::shared_ptr<torrent> t = m_torrent.lock();\n-\t\tif (!t) return;\n+\t\tfor (auto& i : m_connections)\n+\t\t{\n+\t\t\tpeer_connection* const p = i.get();\n+\t\t\tTORRENT_ASSERT(p);\n+\t\t\ttorrent_peer* pi = p->peer_info_struct();\n+\t\t\tif (!pi) continue;\n+\t\t\tif (pi->web_seed) continue;\n \n-\t\tif (m_disconnecting) return;\n+\t\t\tif (pi->optimistically_unchoked)\n+\t\t\t{\n+\t\t\t\tprev_opt_unchoke.push_back(pi);\n+\t\t\t}\n \n-
    \t\tif (t->graceful_pause()) return;\n+\t\t\ttorrent const* t = p->associated_torrent().lock().get();\n+\t\t\tif (!t) continue;\n+\n+
    \t\t\tif (t->is_paused()) continue;\n
    \n-\t\t// we can't download pieces in these states\n-\t\tif (t->state() == torrent_status::checking_files\n-\t\t\t|| t->state() == torrent_status::checking_resume_data\n-\t\t\t|| t->state() == torrent_status::downloading_metadata)\n-\t\t\treturn;\n+\t\t\tif (!p->is_connecting()\n+\t\t\t\t&& !p->is_disconnecting()\n+\t\t\t\t&& p->is_peer_interested()\n+\t\t\t\t&& t->free_upload_slots()\n+\t\t\t\t&& (p->is_choked() || pi->optimistically_unchoked)\n+\t\t\t\t&& !p->ignore_unchoke_slots()\n+\t\t\t\t&& t->valid_metadata())\n+\t\t\t{\n+\t\t\t\topt_unchoke.emplace_back(&i);\n+\t\t\t}\n+\t\t}\n \n-\t\tif (int(m_download_queue.size()) >= m_desired_queue_size\n-\t\t\t|| t->upload_mode()) return;\n+\t\t// find the peers that has been waiting the longest to be optimistically\n+\t\t// unchoked\n \n-\t\tbool const empty_download_queue = m_download_queue.empty();\n+\t\tint num_opt_unchoke = m_settings.get_int(settings_pack::num_optimistic_unchoke_slots);\n+\t\tint const allowed_unchoke_slots = int(m_stats_counters[counters::num_unchoke_slots]);\n+\t\tif (num_opt_unchoke == 0) num_opt_unchoke = std::max(1, allowed_unchoke_slots / 5);\n+\t\tif (num_opt_unchoke > int(opt_unchoke.size())) num_opt_unchoke =\n+\t\t\tint(opt_unchoke.size());\n \n-\t\twhile (!m_request_queue.empty()\n-\t\t\t&& (int(m_download_queue.size()) < m_desired_queue_size\n-\t\t\t\t|| m_queued_time_critical > 0))\n-\t\t{\n-\t\t\tpending_block block = m_request_queue.front();\n+\t\t// find the n best optimistic unchoke candidates\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+unchoking

    ../src/session_impl.cpp:4424

    \t}\n \n-\t\t\tm_request_queue.erase(m_request_queue.begin());\n-\t\t\tif (m_queued_time_critical) --m_queued_time_critical;\n+\tvoid session_impl::recalculate_unchoke_slots()\n+\t{\n+\t\tTORRENT_ASSERT(is_single_thread());\n \n-\t\t\t// if we're a seed, we don't have a piece picker\n-\t\t\t// so we don't have to worry about invariants getting\n-\t\t\t// out of sync with it\n-\t\t\tif (!t->has_picker()) continue;\n+\t\ttime_point const now = aux::time_now();\n+\t\ttime_duration const unchoke_interval = now - m_last_choke;\n+\t\tm_last_choke = now;\n \n-\t\t\t// this can happen if a block times out, is re-requested and\n-\t\t\t// then arrives \"unexpectedly\"\n-\t\t\tif (t->picker().is_downloaded(block.block))\n-\t\t\t{\n-
    relevance 3../src/peer_connection.cpp:4730new_piece should be an optional. piece index -1 should not be allowed

    new_piece should be an optional. piece index -1\n-should not be allowed

    ../src/peer_connection.cpp:4730

    \n-\t\t// pieces may be empty if we don't have metadata yet\n-\t\tif (p.pieces.empty())\n+\t\t// if we unchoke everyone, skip this logic\n+\t\tif (settings().get_int(settings_pack::choking_algorithm) == settings_pack::fixed_slots_choker\n+\t\t\t&& settings().get_int(settings_pack::unchoke_slots_limit) < 0)\n \t\t{\n-\t\t\tp.progress = 0.f;\n-\t\t\tp.progress_ppm = 0;\n+\t\t\tm_stats_counters.set_value(counters::num_unchoke_slots, std::numeric_limits<int>::max());\n+\t\t\treturn;\n \t\t}\n-\t\telse\n+\n+\t\t// build list of all peers that are\n+\t\t// unchokable.\n+
    \t\tstd::vector<peer_connection*> peers;\n+
    \t\tfor (auto i = m_connections.begin(); i != m_connections.end();)\n \t\t{\n-#if TORRENT_NO_FPU\n-\t\t\tp.progress = 0.f;\n-#else\n-\t\t\tp.progress = float(p.pieces.count()) / float(p.pieces.size());\n-#endif\n-\t\t\tp.progress_ppm = int(std::int64_t(p.pieces.count()) * 1000000 / p.pieces.size());\n-\t\t}\n+\t\t\tstd::shared_ptr<peer_connection> p = *i;\n+\t\t\tTORRENT_ASSERT(p);\n+\t\t\t++i;\n+\t\t\ttorrent* const t = p->associated_torrent().lock().get();\n+\t\t\ttorrent_peer* const pi = p->peer_info_struct();\n+\n+\t\t\tif (p->ignore_unchoke_slots() || t == nullptr || pi == nullptr\n+\t\t\t\t|| pi->web_seed || t->is_paused())\n+\t\t\t{\n+\t\t\t\tp->reset_choke_counters();\n+\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+\t\t\t\t// this peer is not unchokable. So, if it's unchoked\n+\t\t\t\t// already, make sure to choke it.\n+\t\t\t\tif (p->is_choked())\n+\t\t\t\t{\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+\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+\t// callback for dht_mutable_get\n+\tvoid session_impl::get_mutable_callback(dht::item const& i\n+\t\t, bool const authoritative)\n+\t{\n+\t\tTORRENT_ASSERT(i.is_mutable());\n+\t\tm_alerts.emplace_alert<dht_mutable_item_alert>(i.pk().bytes\n+\t\t\t, i.sig().bytes, i.seq().value\n+\t\t\t, i.salt(), i.value(), authoritative);\n \t}\n \n-#ifndef TORRENT_DISABLE_SUPERSEEDING\n-
    \tvoid peer_connection::superseed_piece(piece_index_t const replace_piece\n-
    \t\t, piece_index_t const new_piece)\n+\t// key is a 32-byte binary string, the public key to look up.\n+\t// the salt is optional\n+
    \tvoid session_impl::dht_get_mutable_item(std::array<char, 32> key\n+
    \t\t, std::string salt)\n \t{\n-\t\tTORRENT_ASSERT(is_single_thread());\n+\t\tif (!m_dht) return;\n+\t\tm_dht->get_item(dht::public_key(key.data()), std::bind(&session_impl::get_mutable_callback\n+\t\t\t, this, _1, _2), std::move(salt));\n+\t}\n \n-\t\tif (is_connecting()) return;\n-\t\tif (in_handshake()) return;\n+\tnamespace {\n \n-\t\tif (new_piece == piece_index_t(-1))\n+\t\tvoid on_dht_put_immutable_item(aux::alert_manager& alerts, sha1_hash target, int num)\n \t\t{\n-\t\t\tif (m_superseed_piece[0] == piece_index_t(-1)) return;\n-\t\t\tm_superseed_piece[0] = piece_index_t(-1);\n-\t\t\tm_superseed_piece[1] = piece_index_t(-1);\n+\t\t\tif (alerts.should_post<dht_put_alert>())\n+\t\t\t\talerts.emplace_alert<dht_put_alert>(target, num);\n+\t\t}\n \n-#ifndef TORRENT_DISABLE_LOGGING\n-\t\t\tpeer_log(peer_log_alert::info, \"SUPER_SEEDING\", \"ending\");\n+\t\tvoid on_dht_put_mutable_item(aux::alert_manager& alerts, dht::item const& i, int num)\n+\t\t{\n+\t\t\tif (alerts.should_post<dht_put_alert>())\n+\t\t\t{\n+\t\t\t\tdht::signature const sig = i.sig();\n+\t\t\t\tdht::public_key const pk = i.pk();\n+\t\t\t\tdht::sequence_number const seq = i.seq();\n+\t\t\t\tstd::string salt = i.salt();\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/ut_metadata.cpp:268use the aux::write_* functions and the span here instead, it will fit better with send_buffer()

    use the aux::write_* functions and the span here instead, it\n+will fit better with send_buffer()

    ../src/ut_metadata.cpp:268

    \t\t\tint metadata_piece_size = 0;\n+\n+\t\t\tif (m_torrent.valid_metadata())\n+\t\t\t\te[\"total_size\"] = m_tp.metadata().size();\n+\n+\t\t\tif (type == msg_t::piece)\n+\t\t\t{\n+\t\t\t\tTORRENT_ASSERT(piece >= 0 && piece < (m_tp.metadata().size() + 16 * 1024 - 1) / (16 * 1024));\n+\t\t\t\tTORRENT_ASSERT(m_pc.associated_torrent().lock()->valid_metadata());\n+\t\t\t\tTORRENT_ASSERT(m_torrent.valid_metadata());\n+\n+\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+
    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 #endif\n-\t\t\tstd::shared_ptr<torrent> t = m_torrent.lock();\n-\t\t\tTORRENT_ASSERT(t);\n+\t}\n \n-\t\t\t// this will either send a full bitfield or\n-\t\t\t// a have-all message, effectively terminating\n-\t\t\t// super-seeding, since the peer may pick any piece\n-\t\t\twrite_bitfield();\n+\tvoid session_handle::dht_get_item(std::array<char, 32> key\n+\t\t, std::string salt)\n+\t{\n+#ifndef TORRENT_DISABLE_DHT\n+\t\tasync_call(&session_impl::dht_get_mutable_item, key, salt);\n+#else\n+\t\tTORRENT_UNUSED(key);\n+\t\tTORRENT_UNUSED(salt);\n+#endif\n+\t}\n \n-\t\t\treturn;\n-\t\t}\n+
    \tsha1_hash session_handle::dht_put_item(entry data)\n+
    \t{\n+\t\tstd::vector<char> buf;\n+\t\tbencode(std::back_inserter(buf), data);\n+\t\tsha1_hash const ret = hasher(buf).final();\n \n-\t\tTORRENT_ASSERT(!has_piece(new_piece));\n+#ifndef TORRENT_DISABLE_DHT\n+\t\tasync_call(&session_impl::dht_put_immutable_item, data, ret);\n+#endif\n+\t\treturn ret;\n+\t}\n \n-#ifndef TORRENT_DISABLE_LOGGING\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+\tvoid session_handle::dht_put_item(std::array<char, 32> key\n+\t\t, std::function<void(entry&, std::array<char,64>&\n+\t\t\t, std::int64_t&, std::string const&)> cb\n+\t\t, std::string salt)\n+\t{\n+#ifndef TORRENT_DISABLE_DHT\n+\t\tasync_call(&session_impl::dht_put_mutable_item, key, cb, salt);\n+#else\n+\t\tTORRENT_UNUSED(key);\n+\t\tTORRENT_UNUSED(cb);\n+\t\tTORRENT_UNUSED(salt);\n+#endif\n+\t}\n+\n+\tvoid session_handle::dht_get_peers(sha1_hash const& info_hash)\n+\t{\n+#ifndef TORRENT_DISABLE_DHT\n+\t\tasync_call(&session_impl::dht_get_peers, info_hash);\n+#else\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@@ -722,15 +948,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@@ -774,15 +1000,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@@ -825,15 +1051,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@@ -878,47 +1104,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/ut_metadata.cpp:268use the aux::write_* functions and the span here instead, it will fit better with send_buffer()

    use the aux::write_* functions and the span here instead, it\n-will fit better with send_buffer()

    ../src/ut_metadata.cpp:268

    \t\t\tint metadata_piece_size = 0;\n-\n-\t\t\tif (m_torrent.valid_metadata())\n-\t\t\t\te[\"total_size\"] = m_tp.metadata().size();\n-\n-\t\t\tif (type == msg_t::piece)\n-\t\t\t{\n-\t\t\t\tTORRENT_ASSERT(piece >= 0 && piece < (m_tp.metadata().size() + 16 * 1024 - 1) / (16 * 1024));\n-\t\t\t\tTORRENT_ASSERT(m_pc.associated_torrent().lock()->valid_metadata());\n-\t\t\t\tTORRENT_ASSERT(m_torrent.valid_metadata());\n-\n-\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-
    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+
    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@@ -961,15 +1155,15 @@\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+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@@ -1013,15 +1207,15 @@\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+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@@ -1065,15 +1259,15 @@\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+
    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@@ -1116,15 +1310,15 @@\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+
    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@@ -1149,15 +1343,15 @@\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+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@@ -1201,367 +1395,173 @@\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_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+
    relevance 3../src/peer_connection.cpp:3133instead of having to ask the torrent whether it's in graceful pause mode or not, the peers should keep that state (and the torrent should update them when it enters graceful pause). When a peer enters graceful pause mode, it should cancel all outstanding requests and clear its request queue.

    instead of having to ask the torrent whether it's in graceful\n+pause mode or not, the peers should keep that state (and the torrent\n+should update them when it enters graceful pause). When a peer enters\n+graceful pause mode, it should cancel all outstanding requests and\n+clear its request queue.

    ../src/peer_connection.cpp:3133

    \t\t// to disk or are in the disk write cache\n+\t\tif (picker.is_piece_finished(p.piece) && !was_finished)\n \t\t{\n-\t\t\tpeer_connection* p = (*i).get();\n-\t\t\t++i;\n-\t\t\tp->disconnect(errors::stopping_torrent, operation_t::bittorrent);\n+#if TORRENT_USE_INVARIANT_CHECKS\n+\t\t\tcheck_postcondition post_checker2_(t, false);\n+#endif\n+\t\t\tt->verify_piece(p.piece);\n \t\t}\n \n-\t\t// close the listen sockets\n-\t\tfor (auto const& l : m_listen_sockets)\n-\t\t{\n-\t\t\tif (l->sock)\n-\t\t\t{\n-\t\t\t\tl->sock->close(ec);\n-\t\t\t\tTORRENT_ASSERT(!ec);\n-\t\t\t}\n+\t\tcheck_graceful_pause();\n \n-
    \t\t\tif (l->udp_sock)\n-
    \t\t\t{\n-\t\t\t\tl->udp_sock->sock.close();\n-\t\t\t}\n-\t\t}\n+\t\tif (is_disconnecting()) return;\n \n-\t\t// we need to give all the sockets an opportunity to actually have their handlers\n-\t\t// called and cancelled before we continue the shutdown. This is a bit\n-\t\t// complicated, if there are no \"undead\" peers, it's safe to resume the\n-\t\t// shutdown, but if there are, we have to wait for them to be cleared out\n-\t\t// first. In session_impl::on_tick() we check them periodically. If we're\n-\t\t// shutting down and we remove the last one, we'll initiate\n-\t\t// shutdown_stage2 from there.\n-\t\tif (m_undead_peers.empty())\n-\t\t{\n-\t\t\tpost(m_io_context, make_handler([this] { abort_stage2(); }\n-\t\t\t\t, m_abort_handler_storage, *this));\n-\t\t}\n+\t\tif (request_a_block(*t, *this))\n+\t\t\tm_counters.inc_stats_counter(counters::incoming_piece_picks);\n+\t\tsend_block_requests();\n \t}\n \n-\tvoid session_impl::abort_stage2() noexcept\n+\tvoid peer_connection::check_graceful_pause()\n \t{\n-\t\tm_download_rate.close();\n-\t\tm_upload_rate.close();\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-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+
    \t\tstd::shared_ptr<torrent> t = m_torrent.lock();\n+
    \t\tif (!t || !t->graceful_pause()) return;\n \n-\t\tauto ret = std::make_shared<listen_socket_t>();\n-\t\tret->ssl = lep.ssl;\n-\t\tret->original_port = bind_ep.port();\n-\t\tret->flags = lep.flags;\n-\t\tret->netmask = lep.netmask;\n-\t\toperation_t last_op = operation_t::unknown;\n-\t\tsocket_type_t const sock_type\n-\t\t\t= (lep.ssl == transport::ssl)\n-\t\t\t? socket_type_t::tcp_ssl\n-\t\t\t: socket_type_t::tcp;\n+\t\tif (m_outstanding_bytes > 0) return;\n \n-\t\t// if we're in force-proxy mode, don't open TCP listen sockets. We cannot\n-\t\t// accept connections on our local machine in this case.\n-
    \t\tif (ret->flags & listen_socket_t::accept_incoming)\n-
    \t\t{\n-\t\t\tret->sock = std::make_shared<tcp::acceptor>(m_io_context);\n-\t\t\tret->sock->open(bind_ep.protocol(), ec);\n-\t\t\tlast_op = operation_t::sock_open;\n-\t\t\tif (ec)\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\tsession_log(\"failed to open socket: %s\"\n-\t\t\t\t\t\t, ec.message().c_str());\n-\t\t\t\t}\n+\t\tpeer_log(peer_log_alert::info, \"GRACEFUL_PAUSE\", \"NO MORE DOWNLOAD\");\n #endif\n+\t\tdisconnect(errors::torrent_paused, operation_t::bittorrent);\n+\t}\n \n-\t\t\t\tif (m_alerts.should_post<listen_failed_alert>())\n-\t\t\t\t\tm_alerts.emplace_alert<listen_failed_alert>(lep.device, bind_ep, last_op\n-\t\t\t\t\t\t, ec, sock_type);\n-\t\t\t\treturn ret;\n-\t\t\t}\n-\n-#ifdef TORRENT_WINDOWS\n-\t\t\t{\n-\t\t\t\t// this is best-effort. ignore errors\n-\t\t\t\terror_code err;\n-\t\t\t\tret->sock->set_option(exclusive_address_use(true), err);\n+\tvoid peer_connection::on_disk_write_complete(storage_error const& error\n+\t\t, peer_request const& p, std::shared_ptr<torrent> t)\n+\t{\n+\t\tTORRENT_ASSERT(is_single_thread());\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-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-#endif\n-\t\t\tm_utp_socket_manager;\n-\n-\t\tfor (;;)\n+\t\tif (should_log(peer_log_alert::info))\n \t\t{\n-\t\t\taux::array<udp_socket::packet, 50> p;\n-\t\t\terror_code err;\n-\t\t\tint const num_packets = s->sock.read(p, err);\n-\n-\t\t\tfor (udp_socket::packet& packet : span<udp_socket::packet>(p).first(num_packets))\n-\t\t\t{\n-\t\t\t\tif (packet.error)\n-\t\t\t\t{\n-
    \n-
    #ifndef TORRENT_DISABLE_DHT\n-\t\t\t\t\tif (m_dht)\n-\t\t\t\t\t\tm_dht->incoming_error(packet.error, packet.from);\n+\t\t\tpeer_log(peer_log_alert::info, \"FILE_ASYNC_WRITE_COMPLETE\", \"piece: %d s: %x l: %x e: %s\"\n+\t\t\t\t, static_cast<int>(p.piece), p.start, p.length, error.ec.message().c_str());\n+\t\t}\n #endif\n \n-\t\t\t\t\tm_tracker_manager.incoming_error(packet.error, packet.from);\n-\t\t\t\t\tcontinue;\n-\t\t\t\t}\n+\t\tm_counters.inc_stats_counter(counters::queued_write_bytes, -p.length);\n+\t\tm_outstanding_writing_bytes -= p.length;\n \n-\t\t\t\tspan<char const> const buf = packet.data;\n-\t\t\t\tif (!packet.hostname.empty())\n-\t\t\t\t{\n-\t\t\t\t\t// only the tracker manager supports receiving UDP packets\n-\t\t\t\t\t// from hostnames. If it won't handle it, no one else will\n-\t\t\t\t\t// either\n-\t\t\t\t\tm_tracker_manager.incoming_packet(packet.hostname, buf);\n-\t\t\t\t\tcontinue;\n-\t\t\t\t}\n+\t\tTORRENT_ASSERT(m_outstanding_writing_bytes >= 0);\n \n-\t\t\t\t// give the uTP socket manager first dibs on the packet. Presumably\n-\t\t\t\t// the majority of packets are uTP packets.\n-\t\t\t\tif (!mgr.incoming_packet(ls, packet.from, buf))\n-\t\t\t\t{\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-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+\t\t// every peer is entitled to allocate a disk buffer if it has no writes outstanding\n+\t\t// see the comment in incoming_piece\n+\t\tif (m_outstanding_writing_bytes == 0\n+
    relevance 3../src/peer_connection.cpp:4044once peers are properly put in graceful pause mode, they can cancel all outstanding requests and this test can be removed.

    once peers are properly put in graceful pause mode, they can\n+cancel all outstanding requests and this test can be removed.

    ../src/peer_connection.cpp:4044

    \n+\t\t\tif (!p->m_deferred_send_block_requests)\n+\t\t\t\treturn;\n \n-\tvoid session_impl::recalculate_optimistic_unchoke_slots()\n-\t{\n-\t\tINVARIANT_CHECK;\n+\t\t\tp->m_deferred_send_block_requests = false;\n+\t\t\tp->send_block_requests_impl();\n+\t\t});\n+\t\tm_deferred_send_block_requests = true;\n+\t}\n \n+\tvoid peer_connection::send_block_requests_impl()\n+\t{\n \t\tTORRENT_ASSERT(is_single_thread());\n-\t\tif (m_stats_counters[counters::num_unchoke_slots] == 0) return;\n-\n-\t\t// if we unchoke everyone, skip this logic\n-\t\tif (settings().get_int(settings_pack::choking_algorithm) == settings_pack::fixed_slots_choker\n-\t\t\t&& settings().get_int(settings_pack::unchoke_slots_limit) < 0)\n-\t\t\treturn;\n-\n-\t\tstd::vector<opt_unchoke_candidate> opt_unchoke;\n+\t\tINVARIANT_CHECK;\n \n-\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+\t\tstd::shared_ptr<torrent> t = m_torrent.lock();\n+\t\tif (!t) return;\n \n-
    \t\tfor (auto& i : m_connections)\n-
    \t\t{\n-\t\t\tpeer_connection* const p = i.get();\n-\t\t\tTORRENT_ASSERT(p);\n-\t\t\ttorrent_peer* pi = p->peer_info_struct();\n-\t\t\tif (!pi) continue;\n-\t\t\tif (pi->web_seed) continue;\n+\t\tif (m_disconnecting) return;\n \n-\t\t\tif (pi->optimistically_unchoked)\n-\t\t\t{\n-\t\t\t\tprev_opt_unchoke.push_back(pi);\n-\t\t\t}\n+
    \t\tif (t->graceful_pause()) return;\n+
    \n+\t\t// we can't download pieces in these states\n+\t\tif (t->state() == torrent_status::checking_files\n+\t\t\t|| t->state() == torrent_status::checking_resume_data\n+\t\t\t|| t->state() == torrent_status::downloading_metadata)\n+\t\t\treturn;\n \n-\t\t\ttorrent const* t = p->associated_torrent().lock().get();\n-\t\t\tif (!t) continue;\n+\t\tif (int(m_download_queue.size()) >= m_desired_queue_size\n+\t\t\t|| t->upload_mode()) return;\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-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+\t\tbool const empty_download_queue = m_download_queue.empty();\n \n-\t\tfor (auto& i : m_connections)\n+\t\twhile (!m_request_queue.empty()\n+\t\t\t&& (int(m_download_queue.size()) < m_desired_queue_size\n+\t\t\t\t|| m_queued_time_critical > 0))\n \t\t{\n-\t\t\tpeer_connection* const p = i.get();\n-\t\t\tTORRENT_ASSERT(p);\n-\t\t\ttorrent_peer* pi = p->peer_info_struct();\n-\t\t\tif (!pi) continue;\n-\t\t\tif (pi->web_seed) continue;\n+\t\t\tpending_block block = m_request_queue.front();\n \n-\t\t\tif (pi->optimistically_unchoked)\n-\t\t\t{\n-\t\t\t\tprev_opt_unchoke.push_back(pi);\n-\t\t\t}\n+\t\t\tm_request_queue.erase(m_request_queue.begin());\n+\t\t\tif (m_queued_time_critical) --m_queued_time_critical;\n \n-\t\t\ttorrent const* t = p->associated_torrent().lock().get();\n-\t\t\tif (!t) continue;\n+\t\t\t// if we're a seed, we don't have a piece picker\n+\t\t\t// so we don't have to worry about invariants getting\n+\t\t\t// out of sync with it\n+\t\t\tif (!t->has_picker()) continue;\n \n-
    \t\t\tif (t->is_paused()) continue;\n-
    \n-\t\t\tif (!p->is_connecting()\n-\t\t\t\t&& !p->is_disconnecting()\n-\t\t\t\t&& p->is_peer_interested()\n-\t\t\t\t&& t->free_upload_slots()\n-\t\t\t\t&& (p->is_choked() || pi->optimistically_unchoked)\n-\t\t\t\t&& !p->ignore_unchoke_slots()\n-\t\t\t\t&& t->valid_metadata())\n+\t\t\t// this can happen if a block times out, is re-requested and\n+\t\t\t// then arrives \"unexpectedly\"\n+\t\t\tif (t->picker().is_downloaded(block.block))\n \t\t\t{\n-\t\t\t\topt_unchoke.emplace_back(&i);\n-\t\t\t}\n+
    relevance 3../src/peer_connection.cpp:4730new_piece should be an optional. piece index -1 should not be allowed

    new_piece should be an optional. piece index -1\n+should not be allowed

    ../src/peer_connection.cpp:4730

    \n+\t\t// pieces may be empty if we don't have metadata yet\n+\t\tif (p.pieces.empty())\n+\t\t{\n+\t\t\tp.progress = 0.f;\n+\t\t\tp.progress_ppm = 0;\n \t\t}\n-\n-\t\t// find the peers that has been waiting the longest to be optimistically\n-\t\t// unchoked\n-\n-\t\tint num_opt_unchoke = m_settings.get_int(settings_pack::num_optimistic_unchoke_slots);\n-\t\tint const allowed_unchoke_slots = int(m_stats_counters[counters::num_unchoke_slots]);\n-\t\tif (num_opt_unchoke == 0) num_opt_unchoke = std::max(1, allowed_unchoke_slots / 5);\n-\t\tif (num_opt_unchoke > int(opt_unchoke.size())) num_opt_unchoke =\n-\t\t\tint(opt_unchoke.size());\n-\n-\t\t// find the n best optimistic unchoke candidates\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+\t\telse\n+\t\t{\n+#if TORRENT_NO_FPU\n+\t\t\tp.progress = 0.f;\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-unchoking

    ../src/session_impl.cpp:4424

    \t}\n+\t\t\tp.progress = float(p.pieces.count()) / float(p.pieces.size());\n+#endif\n+\t\t\tp.progress_ppm = int(std::int64_t(p.pieces.count()) * 1000000 / p.pieces.size());\n+\t\t}\n \n-\tvoid session_impl::recalculate_unchoke_slots()\n+\t}\n+\n+#ifndef TORRENT_DISABLE_SUPERSEEDING\n+
    \tvoid peer_connection::superseed_piece(piece_index_t const replace_piece\n+
    \t\t, piece_index_t const new_piece)\n \t{\n \t\tTORRENT_ASSERT(is_single_thread());\n \n-\t\ttime_point const now = aux::time_now();\n-\t\ttime_duration const unchoke_interval = now - m_last_choke;\n-\t\tm_last_choke = now;\n-\n-\t\t// if we unchoke everyone, skip this logic\n-\t\tif (settings().get_int(settings_pack::choking_algorithm) == settings_pack::fixed_slots_choker\n-\t\t\t&& settings().get_int(settings_pack::unchoke_slots_limit) < 0)\n-\t\t{\n-\t\t\tm_stats_counters.set_value(counters::num_unchoke_slots, std::numeric_limits<int>::max());\n-\t\t\treturn;\n-\t\t}\n+\t\tif (is_connecting()) return;\n+\t\tif (in_handshake()) return;\n \n-\t\t// build list of all peers that are\n-\t\t// unchokable.\n-
    \t\tstd::vector<peer_connection*> peers;\n-
    \t\tfor (auto i = m_connections.begin(); i != m_connections.end();)\n+\t\tif (new_piece == piece_index_t(-1))\n \t\t{\n-\t\t\tstd::shared_ptr<peer_connection> p = *i;\n-\t\t\tTORRENT_ASSERT(p);\n-\t\t\t++i;\n-\t\t\ttorrent* const t = p->associated_torrent().lock().get();\n-\t\t\ttorrent_peer* const pi = p->peer_info_struct();\n-\n-\t\t\tif (p->ignore_unchoke_slots() || t == nullptr || pi == nullptr\n-\t\t\t\t|| pi->web_seed || t->is_paused())\n-\t\t\t{\n-\t\t\t\tp->reset_choke_counters();\n-\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-\t\t\t\t// this peer is not unchokable. So, if it's unchoked\n-\t\t\t\t// already, make sure to choke it.\n-\t\t\t\tif (p->is_choked())\n-\t\t\t\t{\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-\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-\t// callback for dht_mutable_get\n-\tvoid session_impl::get_mutable_callback(dht::item const& i\n-\t\t, bool const authoritative)\n-\t{\n-\t\tTORRENT_ASSERT(i.is_mutable());\n-\t\tm_alerts.emplace_alert<dht_mutable_item_alert>(i.pk().bytes\n-\t\t\t, i.sig().bytes, i.seq().value\n-\t\t\t, i.salt(), i.value(), authoritative);\n-\t}\n+\t\t\tif (m_superseed_piece[0] == piece_index_t(-1)) return;\n+\t\t\tm_superseed_piece[0] = piece_index_t(-1);\n+\t\t\tm_superseed_piece[1] = piece_index_t(-1);\n \n-\t// key is a 32-byte binary string, the public key to look up.\n-\t// the salt is optional\n-
    \tvoid session_impl::dht_get_mutable_item(std::array<char, 32> key\n-
    \t\t, std::string salt)\n-\t{\n-\t\tif (!m_dht) return;\n-\t\tm_dht->get_item(dht::public_key(key.data()), std::bind(&session_impl::get_mutable_callback\n-\t\t\t, this, _1, _2), std::move(salt));\n-\t}\n+#ifndef TORRENT_DISABLE_LOGGING\n+\t\t\tpeer_log(peer_log_alert::info, \"SUPER_SEEDING\", \"ending\");\n+#endif\n+\t\t\tstd::shared_ptr<torrent> t = m_torrent.lock();\n+\t\t\tTORRENT_ASSERT(t);\n \n-\tnamespace {\n+\t\t\t// this will either send a full bitfield or\n+\t\t\t// a have-all message, effectively terminating\n+\t\t\t// super-seeding, since the peer may pick any piece\n+\t\t\twrite_bitfield();\n \n-\t\tvoid on_dht_put_immutable_item(aux::alert_manager& alerts, sha1_hash target, int num)\n-\t\t{\n-\t\t\tif (alerts.should_post<dht_put_alert>())\n-\t\t\t\talerts.emplace_alert<dht_put_alert>(target, num);\n+\t\t\treturn;\n \t\t}\n \n-\t\tvoid on_dht_put_mutable_item(aux::alert_manager& alerts, dht::item const& i, int num)\n-\t\t{\n-\t\t\tif (alerts.should_post<dht_put_alert>())\n-\t\t\t{\n-\t\t\t\tdht::signature const sig = i.sig();\n-\t\t\t\tdht::public_key const pk = i.pk();\n-\t\t\t\tdht::sequence_number const seq = i.seq();\n-\t\t\t\tstd::string salt = i.salt();\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+\t\tTORRENT_ASSERT(!has_piece(new_piece));\n \n-\t\tvoid put_mutable_callback(dht::item& i\n-\t\t\t, std::function<void(entry&, std::array<char, 64>&\n+#ifndef TORRENT_DISABLE_LOGGING\n
    relevance 3../src/kademlia/rpc_manager.cpp:71move this into it's own .cpp file

    move this into it's own .cpp file

    ../src/kademlia/rpc_manager.cpp:71

    #include <libtorrent/kademlia/get_item.hpp>\n #include <libtorrent/kademlia/sample_infohashes.hpp>\n #include <libtorrent/aux_/session_settings.hpp>\n \n #include <libtorrent/socket_io.hpp> // for print_endpoint\n #include <libtorrent/aux_/time.hpp> // for aux::time_now\n #include <libtorrent/aux_/aligned_union.hpp>\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/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/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 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@@ -1657,15 +1708,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/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+
    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@@ -1708,114 +1759,15 @@\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/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/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-\t\tstruct file_request_t\n-\t\t{\n-\t\t\tfile_index_t file_index;\n-\t\t\tint length;\n-\t\t\tstd::int64_t start;\n-\t\t};\n-\t\tstd::deque<file_request_t> m_file_requests;\n-\n-\t\tstd::string m_url;\n-\n-\t\tweb_seed_t* m_web;\n-\n-\t\t// this is used for intermediate storage of pieces to be delivered to the\n-\t\t// bittorrent engine\n-
    \t\taux::vector<char> m_piece;\n-
    \n-\t\t// the number of bytes we've forwarded to the incoming_payload() function\n-\t\t// in the current HTTP response. used to know where in the buffer the\n-\t\t// next response starts\n-\t\tint m_received_body;\n-\n-\t\t// this is the offset inside the current receive\n-\t\t// buffer where the next chunk header will be.\n-\t\t// this is updated for each chunk header that's\n-\t\t// parsed. It does not necessarily point to a valid\n-\t\t// offset in the receive buffer, if we haven't received\n-\t\t// it yet. This offset never includes the HTTP header\n-\t\tint m_chunk_pos;\n-\n-\t\t// this is the number of bytes we've already received\n-\t\t// from the next chunk header we're waiting for\n-\t\tint m_partial_chunk_header;\n-\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/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+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@@ -1859,15 +1811,15 @@\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+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@@ -1911,14 +1863,62 @@\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/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+\t\tstruct file_request_t\n+\t\t{\n+\t\t\tfile_index_t file_index;\n+\t\t\tint length;\n+\t\t\tstd::int64_t start;\n+\t\t};\n+\t\tstd::deque<file_request_t> m_file_requests;\n+\n+\t\tstd::string m_url;\n+\n+\t\tweb_seed_t* m_web;\n+\n+\t\t// this is used for intermediate storage of pieces to be delivered to the\n+\t\t// bittorrent engine\n+
    \t\taux::vector<char> m_piece;\n+
    \n+\t\t// the number of bytes we've forwarded to the incoming_payload() function\n+\t\t// in the current HTTP response. used to know where in the buffer the\n+\t\t// next response starts\n+\t\tint m_received_body;\n+\n+\t\t// this is the offset inside the current receive\n+\t\t// buffer where the next chunk header will be.\n+\t\t// this is updated for each chunk header that's\n+\t\t// parsed. It does not necessarily point to a valid\n+\t\t// offset in the receive buffer, if we haven't received\n+\t\t// it yet. This offset never includes the HTTP header\n+\t\tint m_chunk_pos;\n+\n+\t\t// this is the number of bytes we've already received\n+\t\t// from the next chunk header we're waiting for\n+\t\tint m_partial_chunk_header;\n+\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/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@@ -2066,67 +2066,15 @@\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_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_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_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@@ -2169,15 +2117,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@@ -2220,15 +2168,221 @@\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../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+
    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../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+\t\treturn nullptr;\n+\t}\n+\n+\tvoid alert_manager::maybe_notify(alert* a)\n+\t{\n+\t\tif (m_alerts[m_generation].size() == 1)\n+\t\t{\n+\t\t\t// we just posted to an empty queue. If anyone is waiting for\n+\t\t\t// alerts, we need to notify them. Also (potentially) call the\n+\t\t\t// user supplied m_notify callback to let the client wake up its\n+\t\t\t// message loop to poll for alerts.\n+\t\t\tif (m_notify) m_notify();\n+\n+
    \t\t\tm_condition.notify_all();\n+
    \t\t}\n+\n+#ifndef TORRENT_DISABLE_EXTENSIONS\n+\t\tfor (auto& e : m_ses_extensions)\n+\t\t\te->on_alert(a);\n+#else\n+\t\tTORRENT_UNUSED(a);\n+#endif\n+\t}\n+\n+\tvoid alert_manager::set_notify_function(std::function<void()> const& fun)\n+\t{\n+\t\tstd::unique_lock<std::recursive_mutex> lock(m_mutex);\n+\t\tm_notify = fun;\n+\t\tif (!m_alerts[m_generation].empty())\n+\t\t{\n+\t\t\tif (m_notify) m_notify();\n+\t\t}\n+\t}\n+\n+#ifndef TORRENT_DISABLE_EXTENSIONS\n+\tvoid alert_manager::add_extension(std::shared_ptr<plugin> ext)\n+\t{\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/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/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@@ -2271,15 +2425,15 @@\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+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@@ -2323,15 +2477,15 @@\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+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@@ -2378,68 +2532,15 @@\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/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/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+
    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@@ -2482,331 +2583,360 @@\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/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+
    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\tupdate_transaction_id();\n+\t\t(this->*f)(std::forward<Args>(a)...);\n+\t}\n+#ifndef BOOST_NO_EXCEPTIONS\n+\tcatch (system_error const& e) {\n+\t\talerts().emplace_alert<session_error_alert>(e.code(), e.what());\n+\t\tpause();\n+\t} catch (std::exception const& e) {\n+\t\talerts().emplace_alert<session_error_alert>(error_code(), e.what());\n+\t\tpause();\n+\t} catch (...) {\n+\t\talerts().emplace_alert<session_error_alert>(error_code(), \"unknown error\");\n+\t\tpause();\n \t}\n+#endif\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// 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+
    \t{\n+#ifndef TORRENT_DISABLE_LOGGING\n+\t\tsession_log(\"start session\");\n+#endif\n+\n+#if TORRENT_USE_SSL\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+\t\t\twrap(&session_impl::on_lsd_announce, e); } );\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+#ifndef TORRENT_DISABLE_LOGGING\n+\t\tsession_log(\" done starting session\");\n+#endif\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+\t\t// this applies unchoke settings from m_settings\n+\t\trecalculate_unchoke_slots();\n \n-\t\taux::session_settings const& settings = m_man.settings();\n+\t\t// apply all m_settings to this session\n+\t\trun_all_updates(*this);\n+\t\treopen_listen_sockets(false);\n \n-\t\tint const proxy_type = settings.get_int(settings_pack::proxy_type);\n+#if TORRENT_USE_INVARIANT_CHECKS\n+\t\tcheck_invariant();\n+#endif\n+\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+#if TORRENT_ABI_VERSION <= 2\n+
    \tvoid session_impl::save_state(entry* eptr, save_state_flags_t const flags) const\n+
    \t{\n+\t\tTORRENT_ASSERT(is_single_thread());\n+\n+\t\tentry& e = *eptr;\n+\t\t// make it a dict\n+\t\te.dict();\n+\n+\t\tif (flags & session::save_settings)\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\tentry::dictionary_type& sett = e[\"settings\"].dict();\n+\t\t\tsave_settings_to_dict(non_default_settings(m_settings), sett);\n \t\t}\n-\t\telse\n+\n+#ifndef TORRENT_DISABLE_DHT\n+\t\tif (flags & session::save_dht_settings)\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/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\te[\"dht\"] = dht::save_dht_settings(get_dht_settings());\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\tif (m_dht && (flags & session::save_dht_state))\n \t\t{\n-\t\t\tec.clear();\n-\t\t\treturn;\n+\t\t\te[\"dht state\"] = dht::save_dht_state(m_dht->state());\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+\n+#ifndef TORRENT_DISABLE_EXTENSIONS\n+\t\tfor (auto const& ext : m_ses_extensions[plugins_all_idx])\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\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+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+\t\t\t} while (!t && !m_dht_torrents.empty());\n \n-\t\t// fall back to making a copy\n-\n-#endif\n+\t\t\tif (t)\n+\t\t\t{\n+\t\t\t\tt->dht_announce();\n+\t\t\t\treturn;\n+\t\t\t}\n+\t\t}\n+\t\tif (m_torrents.empty()) return;\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\tif (m_next_dht_torrent >= m_torrents.size())\n+\t\t\tm_next_dht_torrent = 0;\n+\t\tm_torrents[m_next_dht_torrent]->dht_announce();\n+
    \t\t++m_next_dht_torrent;\n+
    \t\tif (m_next_dht_torrent >= m_torrents.size())\n+\t\t\tm_next_dht_torrent = 0;\n \t}\n+#endif\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/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+\tvoid session_impl::on_lsd_announce(error_code const& e)\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+\t\tCOMPLETE_ASYNC(\"session_impl::on_lsd_announce\");\n+\t\tm_stats_counters.inc_stats_counter(counters::on_lsd_counter);\n+\t\tTORRENT_ASSERT(is_single_thread());\n+\t\tif (e) return;\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+\t\tif (m_abort) return;\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+\t\tADD_OUTSTANDING_ASYNC(\"session_impl::on_lsd_announce\");\n+\t\t// announce on local network every 5 minutes\n+\t\tint const delay = std::max(m_settings.get_int(settings_pack::local_service_announce_interval)\n+\t\t\t/ std::max(int(m_torrents.size()), 1), 1);\n+\t\tm_lsd_announce_timer.expires_after(seconds(delay));\n+\t\tm_lsd_announce_timer.async_wait([this](error_code const& err) {\n+\t\t\twrap(&session_impl::on_lsd_announce, err); });\n \n-\t\tif (start == end)\n-\t\t\tTORRENT_FAIL_BDECODE(bdecode_errors::unexpected_eof);\n+\t\tif (m_torrents.empty()) return;\n \n-\t\twhile (start <= end)\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+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\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/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+\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+\t\t\tadd_dht_router(n);\n #endif\n+\t}\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-\t\t\t\t++m_num_invalid_requests;\n+\tvoid session_impl::update_count_slow()\n+\t{\n+\t\terror_code ec;\n+\t\tfor (auto const& tp : m_torrents)\n+\t\t{\n+\t\t\ttp->on_inactivity_tick(ec);\n+\t\t}\n+\t}\n \n-\t\t\tif (t->alerts().should_post<invalid_request_alert>())\n-\t\t\t{\n-\t\t\t\t// msvc 12 appears to deduce the rvalue reference template\n-\t\t\t\t// incorrectly for bool temporaries. So, create a dummy instance\n-\t\t\t\tbool const peer_interested = bool(m_peer_interested);\n-\t\t\t\tt->alerts().emplace_alert<invalid_request_alert>(\n-\t\t\t\t\tt->get_handle(), m_remote, m_peer_id, r\n-\t\t\t\t\t, t->user_have_piece(r.piece), peer_interested, false);\n-\t\t\t}\n+
    \tstd::uint16_t session_impl::listen_port() const\n+
    \t{\n+\t\treturn listen_port(nullptr);\n+\t}\n \n-\t\t\t// every ten invalid request, remind the peer that it's choked\n-\t\t\tif (!m_peer_interested && m_num_invalid_requests % 10 == 0 && m_choked)\n-\t\t\t{\n-
    \t\t\t\tif (m_num_invalid_requests > 300 && !m_peer_choked\n-
    \t\t\t\t\t&& can_disconnect(errors::too_many_requests_when_choked))\n-\t\t\t\t{\n-\t\t\t\t\tdisconnect(errors::too_many_requests_when_choked, operation_t::bittorrent, peer_error);\n-\t\t\t\t\treturn;\n-\t\t\t\t}\n-#ifndef TORRENT_DISABLE_LOGGING\n-\t\t\t\tpeer_log(peer_log_alert::outgoing_message, \"CHOKE\");\n-#endif\n-\t\t\t\twrite_choke();\n-\t\t\t}\n+\tstd::uint16_t session_impl::listen_port(listen_socket_t* sock) const\n+\t{\n+\t\tif (m_listen_sockets.empty()) return 0;\n+\t\tif (sock)\n+\t\t{\n+\t\t\t// if we're using a proxy, we won't be able to accept any TCP\n+\t\t\t// connections. Not even uTP connections via the port we know about.\n+\t\t\t// The DHT may use the implied port to make it work, but the port we\n+\t\t\t// announce here has no relevance for that.\n+\t\t\tif (sock->flags & listen_socket_t::proxy)\n+\t\t\t\treturn 0;\n \n-\t\t\treturn;\n-\t\t}\n+\t\t\tif (!(sock->flags & listen_socket_t::accept_incoming))\n+\t\t\t\treturn 0;\n \n-\t\t// if we have choked the client\n-\t\t// ignore the request\n-\t\tint const blocks_per_piece =\n-\t\t\t(ti.piece_length() + t->block_size() - 1) / t->block_size();\n+\t\t\treturn std::uint16_t(sock->tcp_external_port());\n+\t\t}\n \n-\t\t// disconnect peers that downloads more than foo times an allowed\n-\t\t// fast piece\n-\t\tif (m_choked && fast_idx != -1 && m_accept_fast_piece_cnt[fast_idx] >= 3 * blocks_per_piece\n-\t\t\t&& can_disconnect(errors::too_many_requests_when_choked))\n+#ifdef TORRENT_SSL_PEERS\n+\t\tfor (auto const& s : m_listen_sockets)\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\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+more generic case of having multiple ssl ports

    ../src/session_impl.cpp:5555

    \t\t\t\treturn 0;\n \n-\t\tif (m_choked && fast_idx == -1)\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 \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-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+\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+#else\n+\t\tsock = m_listen_sockets.front().get();\n+\t\tif (!(sock->flags & listen_socket_t::accept_incoming)) return 0;\n+\t\treturn std::uint16_t(sock->tcp_external_port());\n #endif\n+\t}\n \n-\t\tauto const i = std::find(m_requests.begin(), m_requests.end(), r);\n+
    \tstd::uint16_t session_impl::ssl_listen_port() const\n+
    \t{\n+\t\treturn ssl_listen_port(nullptr);\n+\t}\n \n-\t\tif (i != m_requests.end())\n+\tstd::uint16_t session_impl::ssl_listen_port(listen_socket_t* sock) const\n+\t{\n+#ifdef TORRENT_SSL_PEERS\n+\t\tif (sock)\n \t\t{\n-\t\t\tm_counters.inc_stats_counter(counters::cancelled_piece_requests);\n-\t\t\tm_requests.erase(i);\n+\t\t\tif (!(sock->flags & listen_socket_t::accept_incoming)) return 0;\n+\t\t\treturn std::uint16_t(sock->tcp_external_port());\n+\t\t}\n \n-\t\t\tif (m_requests.empty())\n-\t\t\t\tm_counters.inc_stats_counter(counters::num_peers_up_requests, -1);\n+\t\tif (m_settings.get_int(settings_pack::proxy_type) != settings_pack::none\n+\t\t\t&& m_settings.get_bool(settings_pack::proxy_peer_connections))\n+\t\t\treturn 0;\n \n-\t\t\twrite_reject_request(r);\n-\t\t}\n-\t\telse\n+\t\tfor (auto const& s : m_listen_sockets)\n \t\t{\n-
    #ifndef TORRENT_DISABLE_LOGGING\n-
    \t\t\tpeer_log(peer_log_alert::info, \"INVALID_CANCEL\", \"got cancel not in the queue\");\n-#endif\n+\t\t\tif (!(s->flags & listen_socket_t::accept_incoming)) continue;\n+\t\t\tif (s->ssl == transport::ssl)\n+\t\t\t\treturn std::uint16_t(s->tcp_external_port());\n \t\t}\n+#else\n+\t\tTORRENT_UNUSED(sock);\n+#endif\n+\t\treturn 0;\n \t}\n \n-\t// -----------------------------\n-\t// --------- DHT PORT ----------\n-\t// -----------------------------\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+code once

    ../src/session_impl.cpp:6390

    \t\treturn upload_rate_limit(m_local_peer_class);\n+\t}\n \n-\tvoid peer_connection::incoming_dht_port(int const listen_port)\n+\tint session_impl::local_download_rate_limit() const\n \t{\n-\t\tTORRENT_ASSERT(is_single_thread());\n-\t\tINVARIANT_CHECK;\n-\n-#ifndef TORRENT_DISABLE_LOGGING\n-\t\tpeer_log(peer_log_alert::incoming_message, \"DHT_PORT\", \"p: %d\", listen_port);\n-#endif\n-#ifndef TORRENT_DISABLE_DHT\n-\t\tm_ses.add_dht_node({m_remote.address(), std::uint16_t(listen_port)});\n-#else\n-\t\tTORRENT_UNUSED(listen_port);\n-#endif\n+\t\treturn download_rate_limit(m_local_peer_class);\n \t}\n \n-\t// -----------------------------\n-\t// --------- HAVE ALL ----------\n-\t// -----------------------------\n+\tint session_impl::upload_rate_limit_depr() const\n+\t{\n+\t\treturn upload_rate_limit(m_global_class);\n+\t}\n \n-\tvoid peer_connection::incoming_have_all()\n+\tint session_impl::download_rate_limit_depr() const\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-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\treturn download_rate_limit(m_global_class);\n+\t}\n+#endif // DEPRECATE\n+\n+\n+
    \tvoid session_impl::update_peer_dscp()\n+
    \t{\n+\t\tint const value = m_settings.get_int(settings_pack::peer_dscp);\n+\t\tfor (auto const& l : m_listen_sockets)\n+\t\t{\n+\t\t\tif (l->sock)\n \t\t\t{\n+\t\t\t\terror_code ec;\n+\t\t\t\tset_traffic_class(*l->sock, value, ec);\n+\n #ifndef TORRENT_DISABLE_LOGGING\n-\t\t\t\tpeer_log(peer_log_alert::info, \"CONNECT_FAILED\", \"waited %d seconds\"\n-\t\t\t\t\t, int(total_seconds(d)));\n+\t\t\t\tif (should_log())\n+\t\t\t\t{\n+\t\t\t\t\tsession_log(\">>> SET_DSCP [ tcp (%s %d) value: %x e: %s ]\"\n+\t\t\t\t\t\t, l->sock->local_endpoint().address().to_string().c_str()\n+\t\t\t\t\t\t, l->sock->local_endpoint().port(), value, ec.message().c_str());\n+\t\t\t\t}\n #endif\n-\t\t\t\tconnect_failed(errors::timed_out);\n-\t\t\t\treturn;\n \t\t\t}\n-\t\t}\n \n-\t\t// if the bw_network flag isn't set, it means we are not even trying to\n-\t\t// read from this peer's socket. Most likely because we're applying a\n-\t\t// rate limit. If the peer is \"slow\" because we are rate limiting it,\n-\t\t// don't enforce timeouts. However, as soon as we *do* read from the\n-\t\t// socket, we expect to receive data, and not have timed out. Then we\n-\t\t// can enforce the timeouts.\n-\t\tbool const reading_socket = bool(m_channel_state[download_channel] & peer_info::bw_network);\n+\t\t\tif (l->udp_sock)\n+\t\t\t{\n+\t\t\t\terror_code ec;\n+\t\t\t\tset_traffic_class(l->udp_sock->sock, value, ec);\n \n-
    \t\tif (reading_socket && d > seconds(timeout()) && !m_connecting && m_reading_bytes == 0\n-
    \t\t\t&& can_disconnect(errors::timed_out_inactivity))\n-\t\t{\n #ifndef TORRENT_DISABLE_LOGGING\n-\t\t\tpeer_log(peer_log_alert::info, \"LAST_ACTIVITY\", \"%d seconds ago\"\n-\t\t\t\t, int(total_seconds(d)));\n-#endif\n-\t\t\tdisconnect(errors::timed_out_inactivity, operation_t::bittorrent);\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/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// do not stall waiting for a handshake\n-\t\tint timeout = m_settings.get_int (settings_pack::handshake_timeout);\n-#if TORRENT_USE_I2P\n-\t\ttimeout *= is_i2p(m_socket) ? 4 : 1;\n+\t\t// fall back to making a copy\n #endif\n-\t\tif (reading_socket\n-\t\t\t&& !m_connecting\n-\t\t\t&& in_handshake()\n-\t\t\t&& d > seconds(timeout))\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-#ifndef TORRENT_DISABLE_LOGGING\n-\t\t\tpeer_log(peer_log_alert::info, \"NO_HANDSHAKE\", \"waited %d seconds\"\n-\t\t\t\t, int(total_seconds(d)));\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\tdisconnect(errors::timed_out_no_handshake, operation_t::bittorrent);\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// 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/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+\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/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@@ -2852,15 +2982,67 @@\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/torrent.cpp:504post alert

    post alert

    ../src/torrent.cpp:504

    \t\tif (m_current_gauge_state != no_gauge_state)\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/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@@ -2903,15 +3085,15 @@\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+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@@ -2955,15 +3137,15 @@\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+
    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@@ -3006,15 +3188,15 @@\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+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@@ -3058,15 +3240,15 @@\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+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@@ -3111,15 +3293,229 @@\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+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/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+\t\t\t\t++m_num_invalid_requests;\n+\n+\t\t\tif (t->alerts().should_post<invalid_request_alert>())\n+\t\t\t{\n+\t\t\t\t// msvc 12 appears to deduce the rvalue reference template\n+\t\t\t\t// incorrectly for bool temporaries. So, create a dummy instance\n+\t\t\t\tbool const peer_interested = bool(m_peer_interested);\n+\t\t\t\tt->alerts().emplace_alert<invalid_request_alert>(\n+\t\t\t\t\tt->get_handle(), m_remote, m_peer_id, r\n+\t\t\t\t\t, t->user_have_piece(r.piece), peer_interested, false);\n+\t\t\t}\n+\n+\t\t\t// every ten invalid request, remind the peer that it's choked\n+\t\t\tif (!m_peer_interested && m_num_invalid_requests % 10 == 0 && m_choked)\n+\t\t\t{\n+
    \t\t\t\tif (m_num_invalid_requests > 300 && !m_peer_choked\n+
    \t\t\t\t\t&& can_disconnect(errors::too_many_requests_when_choked))\n+\t\t\t\t{\n+\t\t\t\t\tdisconnect(errors::too_many_requests_when_choked, operation_t::bittorrent, peer_error);\n+\t\t\t\t\treturn;\n+\t\t\t\t}\n+#ifndef TORRENT_DISABLE_LOGGING\n+\t\t\t\tpeer_log(peer_log_alert::outgoing_message, \"CHOKE\");\n+#endif\n+\t\t\t\twrite_choke();\n+\t\t\t}\n+\n+\t\t\treturn;\n+\t\t}\n+\n+\t\t// if we have choked the client\n+\t\t// ignore the request\n+\t\tint const blocks_per_piece =\n+\t\t\t(ti.piece_length() + t->block_size() - 1) / t->block_size();\n+\n+\t\t// disconnect peers that downloads more than foo times an allowed\n+\t\t// fast piece\n+\t\tif (m_choked && fast_idx != -1 && m_accept_fast_piece_cnt[fast_idx] >= 3 * blocks_per_piece\n+\t\t\t&& can_disconnect(errors::too_many_requests_when_choked))\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+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+#endif\n+\n+\t\tauto const i = std::find(m_requests.begin(), m_requests.end(), r);\n+\n+\t\tif (i != m_requests.end())\n+\t\t{\n+\t\t\tm_counters.inc_stats_counter(counters::cancelled_piece_requests);\n+\t\t\tm_requests.erase(i);\n+\n+\t\t\tif (m_requests.empty())\n+\t\t\t\tm_counters.inc_stats_counter(counters::num_peers_up_requests, -1);\n+\n+\t\t\twrite_reject_request(r);\n+\t\t}\n+\t\telse\n+\t\t{\n+
    #ifndef TORRENT_DISABLE_LOGGING\n+
    \t\t\tpeer_log(peer_log_alert::info, \"INVALID_CANCEL\", \"got cancel not in the queue\");\n+#endif\n+\t\t}\n+\t}\n+\n+\t// -----------------------------\n+\t// --------- DHT PORT ----------\n+\t// -----------------------------\n+\n+\tvoid peer_connection::incoming_dht_port(int const listen_port)\n+\t{\n+\t\tTORRENT_ASSERT(is_single_thread());\n+\t\tINVARIANT_CHECK;\n+\n+#ifndef TORRENT_DISABLE_LOGGING\n+\t\tpeer_log(peer_log_alert::incoming_message, \"DHT_PORT\", \"p: %d\", listen_port);\n+#endif\n+#ifndef TORRENT_DISABLE_DHT\n+\t\tm_ses.add_dht_node({m_remote.address(), std::uint16_t(listen_port)});\n+#else\n+\t\tTORRENT_UNUSED(listen_port);\n+#endif\n+\t}\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+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+\t\t\t\t\t, int(total_seconds(d)));\n+#endif\n+\t\t\t\tconnect_failed(errors::timed_out);\n+\t\t\t\treturn;\n+\t\t\t}\n+\t\t}\n+\n+\t\t// if the bw_network flag isn't set, it means we are not even trying to\n+\t\t// read from this peer's socket. Most likely because we're applying a\n+\t\t// rate limit. If the peer is \"slow\" because we are rate limiting it,\n+\t\t// don't enforce timeouts. However, as soon as we *do* read from the\n+\t\t// socket, we expect to receive data, and not have timed out. Then we\n+\t\t// can enforce the timeouts.\n+\t\tbool const reading_socket = bool(m_channel_state[download_channel] & peer_info::bw_network);\n+\n+
    \t\tif (reading_socket && d > seconds(timeout()) && !m_connecting && m_reading_bytes == 0\n+
    \t\t\t&& can_disconnect(errors::timed_out_inactivity))\n+\t\t{\n+#ifndef TORRENT_DISABLE_LOGGING\n+\t\t\tpeer_log(peer_log_alert::info, \"LAST_ACTIVITY\", \"%d seconds ago\"\n+\t\t\t\t, int(total_seconds(d)));\n+#endif\n+\t\t\tdisconnect(errors::timed_out_inactivity, operation_t::bittorrent);\n+\t\t\treturn;\n+\t\t}\n+\n+\t\t// do not stall waiting for a handshake\n+\t\tint timeout = m_settings.get_int (settings_pack::handshake_timeout);\n+#if TORRENT_USE_I2P\n+\t\ttimeout *= is_i2p(m_socket) ? 4 : 1;\n+#endif\n+\t\tif (reading_socket\n+\t\t\t&& !m_connecting\n+\t\t\t&& in_handshake()\n+\t\t\t&& d > seconds(timeout))\n+\t\t{\n+#ifndef TORRENT_DISABLE_LOGGING\n+\t\t\tpeer_log(peer_log_alert::info, \"NO_HANDSHAKE\", \"waited %d seconds\"\n+\t\t\t\t, int(total_seconds(d)));\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/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@@ -3166,15 +3562,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@@ -3219,169 +3615,119 @@\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/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-\t\treturn nullptr;\n-\t}\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-\tvoid alert_manager::maybe_notify(alert* a)\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\tif (m_alerts[m_generation].size() == 1)\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\t// we just posted to an empty queue. If anyone is waiting for\n-\t\t\t// alerts, we need to notify them. Also (potentially) call the\n-\t\t\t// user supplied m_notify callback to let the client wake up its\n-\t\t\t// message loop to poll for alerts.\n-\t\t\tif (m_notify) m_notify();\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\tm_condition.notify_all();\n-
    \t\t}\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-#ifndef TORRENT_DISABLE_EXTENSIONS\n-\t\tfor (auto& e : m_ses_extensions)\n-\t\t\te->on_alert(a);\n-#else\n-\t\tTORRENT_UNUSED(a);\n-#endif\n-\t}\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-\tvoid alert_manager::set_notify_function(std::function<void()> const& fun)\n-\t{\n-\t\tstd::unique_lock<std::recursive_mutex> lock(m_mutex);\n-\t\tm_notify = fun;\n-\t\tif (!m_alerts[m_generation].empty())\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 (m_notify) m_notify();\n-\t\t}\n-\t}\n+\t\t\tif (start >= end) TORRENT_FAIL_BDECODE(bdecode_errors::unexpected_eof);\n \n-#ifndef TORRENT_DISABLE_EXTENSIONS\n-\tvoid alert_manager::add_extension(std::shared_ptr<plugin> ext)\n-\t{\n-\t\tm_ses_extensions.push_back(std::move(ext));\n-\t}\n-#endif\n+\t\t\tif (sp >= depth_limit)\n+\t\t\t\tTORRENT_FAIL_BDECODE(bdecode_errors::depth_exceeded);\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/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+\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-upnp::rootdevice::rootdevice() = default;\n+\t\t\t// look for a new token\n+\t\t\tchar const t = *start;\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+\t\t\tint const current_frame = sp;\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+\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/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-
    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+\t\tconst int candidate_count = 10;\n+\t\tpeers.reserve(candidate_count);\n \n-void upnp::start()\n-{\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+\t\tint erase_candidate = -1;\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+\t\tif (bool(m_finished) != state->is_finished)\n+\t\t\trecalculate_connect_candidates(state);\n \n-\tvoid convert_path_to_posix(std::string& path)\n-\t{\n-\t\tstd::replace(path.begin(), path.end(), '\\\\', '/');\n-\t}\n+\t\texternal_ip const& external = state->ip;\n+\t\tint external_port = state->port;\n \n-
    \tstd::string read_until(char const*& str, char const delim, char const* end)\n-
    \t{\n-\t\tTORRENT_ASSERT(str <= end);\n+\t\tif (m_round_robin >= int(m_peers.size())) m_round_robin = 0;\n \n-\t\tstd::string ret;\n-\t\twhile (str != end && *str != delim)\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\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+\t\t\t++state->loop_counter;\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+\t\t\tif (m_round_robin >= int(m_peers.size())) m_round_robin = 0;\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+\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\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/tracker_manager.cpp:369implement

    implement

    ../src/tracker_manager.cpp:369

    #ifndef TORRENT_DISABLE_LOGGING\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/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@@ -3424,15 +3770,15 @@\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/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+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@@ -3476,361 +3822,66 @@\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/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-\t\talerts().emplace_alert<session_error_alert>(e.code(), e.what());\n-\t\tpause();\n-\t} catch (std::exception const& e) {\n-\t\talerts().emplace_alert<session_error_alert>(error_code(), e.what());\n-\t\tpause();\n-\t} catch (...) {\n-\t\talerts().emplace_alert<session_error_alert>(error_code(), \"unknown error\");\n-\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-
    \t{\n-#ifndef TORRENT_DISABLE_LOGGING\n-\t\tsession_log(\"start session\");\n-#endif\n-\n-#if TORRENT_USE_SSL\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-\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-\t\trecalculate_unchoke_slots();\n-\n-\t\t// apply all m_settings to this session\n-\t\trun_all_updates(*this);\n-\t\treopen_listen_sockets(false);\n-\n-#if TORRENT_USE_INVARIANT_CHECKS\n-\t\tcheck_invariant();\n-#endif\n-\t}\n-\n-#if TORRENT_ABI_VERSION <= 2\n-
    \tvoid session_impl::save_state(entry* eptr, save_state_flags_t const flags) const\n-
    \t{\n-\t\tTORRENT_ASSERT(is_single_thread());\n-\n-\t\tentry& e = *eptr;\n-\t\t// make it a dict\n-\t\te.dict();\n-\n-\t\tif (flags & session::save_settings)\n-\t\t{\n-\t\t\tentry::dictionary_type& sett = e[\"settings\"].dict();\n-\t\t\tsave_settings_to_dict(non_default_settings(m_settings), sett);\n-\t\t}\n-\n-#ifndef TORRENT_DISABLE_DHT\n-\t\tif (flags & session::save_dht_settings)\n-\t\t{\n-\t\t\te[\"dht\"] = dht::save_dht_settings(get_dht_settings());\n-\t\t}\n-\n-\t\tif (m_dht && (flags & session::save_dht_state))\n-\t\t{\n-\t\t\te[\"dht state\"] = dht::save_dht_state(m_dht->state());\n-\t\t}\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-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-\t\t\t} while (!t && !m_dht_torrents.empty());\n-\n-\t\t\tif (t)\n-\t\t\t{\n-\t\t\t\tt->dht_announce();\n-\t\t\t\treturn;\n-\t\t\t}\n-\t\t}\n-\t\tif (m_torrents.empty()) return;\n-\n-\t\tif (m_next_dht_torrent >= m_torrents.size())\n-\t\t\tm_next_dht_torrent = 0;\n-\t\tm_torrents[m_next_dht_torrent]->dht_announce();\n-
    \t\t++m_next_dht_torrent;\n-
    \t\tif (m_next_dht_torrent >= m_torrents.size())\n-\t\t\tm_next_dht_torrent = 0;\n-\t}\n-#endif\n-\n-\tvoid session_impl::on_lsd_announce(error_code const& e)\n-\t{\n-\t\tCOMPLETE_ASYNC(\"session_impl::on_lsd_announce\");\n-\t\tm_stats_counters.inc_stats_counter(counters::on_lsd_counter);\n-\t\tTORRENT_ASSERT(is_single_thread());\n-\t\tif (e) return;\n-\n-\t\tif (m_abort) return;\n-\n-\t\tADD_OUTSTANDING_ASYNC(\"session_impl::on_lsd_announce\");\n-\t\t// announce on local network every 5 minutes\n-\t\tint const delay = std::max(m_settings.get_int(settings_pack::local_service_announce_interval)\n-\t\t\t/ std::max(int(m_torrents.size()), 1), 1);\n-\t\tm_lsd_announce_timer.expires_after(seconds(delay));\n-\t\tm_lsd_announce_timer.async_wait([this](error_code const& err) {\n-\t\t\twrap(&session_impl::on_lsd_announce, err); });\n-\n-\t\tif (m_torrents.empty()) return;\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-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-\t\t\tadd_dht_router(n);\n-#endif\n-\t}\n-\n-\tvoid session_impl::update_count_slow()\n-\t{\n-\t\terror_code ec;\n-\t\tfor (auto const& tp : m_torrents)\n-\t\t{\n-\t\t\ttp->on_inactivity_tick(ec);\n-\t\t}\n-\t}\n-\n-
    \tstd::uint16_t session_impl::listen_port() const\n-
    \t{\n-\t\treturn listen_port(nullptr);\n-\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-\tstd::uint16_t session_impl::listen_port(listen_socket_t* sock) const\n+\t// internal\n+\tbool operator<(peer_entry const& lhs, peer_entry const& rhs)\n \t{\n-\t\tif (m_listen_sockets.empty()) return 0;\n-\t\tif (sock)\n-\t\t{\n-\t\t\t// if we're using a proxy, we won't be able to accept any TCP\n-\t\t\t// connections. Not even uTP connections via the port we know about.\n-\t\t\t// The DHT may use the implied port to make it work, but the port we\n-\t\t\t// announce here has no relevance for that.\n-\t\t\tif (sock->flags & listen_socket_t::proxy)\n-\t\t\t\treturn 0;\n-\n-\t\t\tif (!(sock->flags & listen_socket_t::accept_incoming))\n-\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-\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-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-\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-#else\n-\t\tsock = m_listen_sockets.front().get();\n-\t\tif (!(sock->flags & listen_socket_t::accept_incoming)) return 0;\n-\t\treturn std::uint16_t(sock->tcp_external_port());\n-#endif\n-\t}\n-\n-
    \tstd::uint16_t session_impl::ssl_listen_port() const\n-
    \t{\n-\t\treturn ssl_listen_port(nullptr);\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-\tstd::uint16_t session_impl::ssl_listen_port(listen_socket_t* sock) const\n+\t// this is a group. It contains a set of group members\n+\tstruct torrent_entry\n \t{\n-#ifdef TORRENT_SSL_PEERS\n-\t\tif (sock)\n-\t\t{\n-\t\t\tif (!(sock->flags & listen_socket_t::accept_incoming)) return 0;\n-\t\t\treturn std::uint16_t(sock->tcp_external_port());\n-\t\t}\n-\n-\t\tif (m_settings.get_int(settings_pack::proxy_type) != settings_pack::none\n-\t\t\t&& m_settings.get_bool(settings_pack::proxy_peer_connections))\n-\t\t\treturn 0;\n-\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::ssl)\n-\t\t\t\treturn std::uint16_t(s->tcp_external_port());\n-\t\t}\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-code once

    ../src/session_impl.cpp:6390

    \t\treturn upload_rate_limit(m_local_peer_class);\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-\tint session_impl::local_download_rate_limit() const\n+
    \tconstexpr time_duration announce_interval = minutes(30);\n+
    \n+\tstruct dht_immutable_item\n \t{\n-\t\treturn download_rate_limit(m_local_peer_class);\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-\tint session_impl::upload_rate_limit_depr() const\n+\tstruct dht_mutable_item : dht_immutable_item\n \t{\n-\t\treturn upload_rate_limit(m_global_class);\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-\tint session_impl::download_rate_limit_depr() const\n+\tvoid set_value(dht_immutable_item& item, span<char const> buf)\n \t{\n-\t\treturn download_rate_limit(m_global_class);\n-\t}\n-#endif // DEPRECATE\n-\n-\n-
    \tvoid session_impl::update_peer_dscp()\n-
    \t{\n-\t\tint const value = m_settings.get_int(settings_pack::peer_dscp);\n-\t\tfor (auto const& l : m_listen_sockets)\n-\t\t{\n-\t\t\tif (l->sock)\n-\t\t\t{\n-\t\t\t\terror_code ec;\n-\t\t\t\tset_traffic_class(*l->sock, value, ec);\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 [ tcp (%s %d) value: %x e: %s ]\"\n-\t\t\t\t\t\t, l->sock->local_endpoint().address().to_string().c_str()\n-\t\t\t\t\t\t, l->sock->local_endpoint().port(), value, ec.message().c_str());\n-\t\t\t\t}\n-#endif\n-\t\t\t}\n-\n-\t\t\tif (l->udp_sock)\n-\t\t\t{\n-\t\t\t\terror_code ec;\n-\t\t\t\tset_traffic_class(l->udp_sock->sock, value, ec);\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/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/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+\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,66 +4055,118 @@\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+
    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-\t// internal\n-\tbool operator<(peer_entry const& lhs, peer_entry const& rhs)\n+\tvoid close(error_code& ec)\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\tm_dst_name.clear();\n+\t\tproxy_base::close(ec);\n \t}\n \n-\t// this is a group. It contains a set of group members\n-\tstruct torrent_entry\n+#ifndef BOOST_NO_EXCEPTIONS\n+\tvoid close()\n \t{\n-\t\tstd::string name;\n-\t\tstd::vector<peer_entry> peers4;\n-\t\tstd::vector<peer_entry> peers6;\n-\t};\n+\t\tm_dst_name.clear();\n+\t\tproxy_base::close();\n+\t}\n+#endif\n \n-
    \tconstexpr time_duration announce_interval = minutes(30);\n-
    \n-\tstruct dht_immutable_item\n+
    \ttemplate <class Handler>\n+
    \tvoid async_connect(endpoint_type const& endpoint, Handler handler)\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+\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-\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+\t\tm_remote_endpoint = endpoint;\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/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// 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/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/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@@ -4104,15 +4207,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@@ -4155,15 +4258,15 @@\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/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@@ -4206,66 +4309,15 @@\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/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/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+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@@ -4309,67 +4361,66 @@\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/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+
    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-\t\tec.clear();\n+#include <deque>\n+#include <vector>\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+#include \"libtorrent/aux_/disable_warnings_push.hpp\"\n+#include <boost/asio/buffer.hpp>\n+#include \"libtorrent/aux_/disable_warnings_pop.hpp\"\n+\n+#ifdef _MSC_VER\n+// visual studio requires the value in a deque to be copyable. C++11\n+// has looser requirements depending on which functions are actually used.\n+#define TORRENT_CPP98_DEQUE 1\n+#else\n+#define TORRENT_CPP98_DEQUE 0\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+namespace libtorrent {\n+namespace aux {\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+
    \tstruct TORRENT_EXTRA_EXPORT chained_buffer : private single_threaded\n+
    \t{\n+\t\tchained_buffer(): m_bytes(0), m_capacity(0)\n+\t\t{\n+\t\t\tthread_started();\n+#if TORRENT_USE_ASSERTS\n+\t\t\tm_destructed = false;\n+#endif\n+\t\t}\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+\tprivate:\n \n-\t\t\tif (!found)\n+\t\t// destructs/frees the holder object\n+\t\tusing destruct_holder_fun = void (*)(void*);\n+\t\tusing move_construct_holder_fun = void (*)(void*, void*);\n+\n+\t\tstruct buffer_t\n+\t\t{\n+\t\t\tbuffer_t() {}\n+#if TORRENT_CPP98_DEQUE\n+\t\t\tbuffer_t(buffer_t&& rhs) noexcept\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\tdestruct_holder = rhs.destruct_holder;\n+\t\t\t\tmove_holder = rhs.move_holder;\n+\t\t\t\tbuf = rhs.buf;\n+\t\t\t\tsize = rhs.size;\n+\t\t\t\tused_size = rhs.used_size;\n+\t\t\t\tmove_holder(&holder, &rhs.holder);\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/aux_/session_interface.hpp:127make this interface a lot smaller. It could be split up into several smaller interfaces. Each subsystem could then limit the size of the mock object to test it.

    make this interface a lot smaller. It could be split up into\n+\t\t\tbuffer_t& operator=(buffer_t&& rhs) & noexcept\n+\t\t\t{\n+relevance 2../include/libtorrent/aux_/session_interface.hpp:127make this interface a lot smaller. It could be split up into several smaller interfaces. Each subsystem could then limit the size of the mock object to test it.

    make this interface a lot smaller. It could be split up into\n several smaller interfaces. Each subsystem could then limit the size\n of the mock object to test it.

    ../include/libtorrent/aux_/session_interface.hpp:127

    \t// a release build with logging disabled (which is the default) will\n \t// not have this class at all\n \tstruct TORRENT_EXTRA_EXPORT session_logger\n \t{\n #ifndef TORRENT_DISABLE_LOGGING\n \t\tvirtual bool should_log() const = 0;\n@@ -4389,15 +4440,15 @@\n \n 
    \tstruct TORRENT_EXTRA_EXPORT session_interface\n
    #if !defined TORRENT_DISABLE_LOGGING || TORRENT_USE_ASSERTS\n \t\t: session_logger\n #endif\n \t{\n \n-
    relevance 2../include/libtorrent/aux_/session_interface.hpp:136the IP voting mechanism should be factored out to its own class, not part of the session and these constants should move too

    the IP voting mechanism should be factored out\n+relevance 2../include/libtorrent/aux_/session_interface.hpp:136the IP voting mechanism should be factored out to its own class, not part of the session and these constants should move too

    the IP voting mechanism should be factored out\n to its own class, not part of the session\n and these constants should move too

    ../include/libtorrent/aux_/session_interface.hpp:136

    \t\tvirtual void session_log(char const* fmt, ...) const TORRENT_FORMAT(2,3) = 0;\n #endif\n \n #if TORRENT_USE_ASSERTS\n \t\tvirtual bool is_single_thread() const = 0;\n \t\tvirtual bool has_peer(peer_connection const* p) const = 0;\n@@ -4442,66 +4493,67 @@\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 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+
    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-#include <deque>\n-#include <vector>\n+\t\tlisten_socket_t* listen_socket = ls.get();\n \n-#include \"libtorrent/aux_/disable_warnings_push.hpp\"\n-#include <boost/asio/buffer.hpp>\n-#include \"libtorrent/aux_/disable_warnings_pop.hpp\"\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-#ifdef _MSC_VER\n-// visual studio requires the value in a deque to be copyable. C++11\n-// has looser requirements depending on which functions are actually used.\n-#define TORRENT_CPP98_DEQUE 1\n-#else\n-#define TORRENT_CPP98_DEQUE 0\n-#endif\n+\t\tif (!listen_socket) return;\n \n-namespace libtorrent {\n-namespace aux {\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-
    \tstruct TORRENT_EXTRA_EXPORT chained_buffer : private single_threaded\n-
    \t{\n-\t\tchained_buffer(): m_bytes(0), m_capacity(0)\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\tthread_started();\n-#if TORRENT_USE_ASSERTS\n-\t\t\tm_destructed = false;\n-#endif\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-\tprivate:\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\t// destructs/frees the holder object\n-\t\tusing destruct_holder_fun = void (*)(void*);\n-\t\tusing move_construct_holder_fun = void (*)(void*, void*);\n+\t\tsession_status s;\n \n-\t\tstruct buffer_t\n-\t\t{\n-\t\t\tbuffer_t() {}\n-#if TORRENT_CPP98_DEQUE\n-\t\t\tbuffer_t(buffer_t&& rhs) noexcept\n-\t\t\t{\n-\t\t\t\tdestruct_holder = rhs.destruct_holder;\n-\t\t\t\tmove_holder = rhs.move_holder;\n-\t\t\t\tbuf = rhs.buf;\n-\t\t\t\tsize = rhs.size;\n-\t\t\t\tused_size = rhs.used_size;\n-\t\t\t\tmove_holder(&holder, &rhs.holder);\n-\t\t\t}\n-\t\t\tbuffer_t& operator=(buffer_t&& rhs) & noexcept\n-\t\t\t{\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+\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 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@@ -4548,15 +4600,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@@ -4601,66 +4653,14 @@\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,371 +4679,142 @@\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_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_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-\t\t\t\t<< \", proto: \" << static_cast<int>(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-\t\t\treturn true;\n-\t\t}\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 \n-\t\tvoid log_portmap(portmap_transport, char const* msg\n-\t\t\t, aux::listen_socket_handle const&) const override\n+\t\tkey_desc_t const desc[] =\n \t\t{\n-\t\t\tstd::cout << \"UPnP: \" << msg << std::endl;\n-
    \t\t}\n-
    \t#endif\n-\t};\n-\n-ip_interface pick_upnp_interface()\n-{\n-\tlt::io_context ios;\n-\terror_code ec;\n-\tstd::vector<ip_route> const routes = enum_routes(ios, ec);\n-\tif (ec)\n-\t{\n-\t\tstd::cerr << \"failed to enumerate routes: \" << ec.message() << '\\n';\n-\t\tTEST_CHECK(false);\n-\t\treturn {};\n-\t}\n-\tstd::vector<ip_interface> const ifs = enum_net_interfaces(ios, ec);\n-\tif (ec)\n-\t{\n-\t\tstd::cerr << \"failed to enumerate network interfaces: \" << ec.message() << '\\n';\n-\t\tTEST_CHECK(false);\n-\t\treturn {};\n-\t}\n-\tint idx = 0;\n-\tfor (auto const& face : ifs)\n-\t{\n-\t\tif (!face.interface_address.is_v4()) continue;\n-\t\tstd::cout << \" - \" << idx\n-\t\t\t<< ' ' << face.interface_address.to_string()\n-\t\t\t<< ' ' << int(static_cast<std::uint8_t>(face.state))\n-\t\t\t<< ' ' << static_cast<std::uint32_t>(face.flags)\n-\t\t\t<< ' ' << face.name << '\\n';\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-\t}\n-\n-\tstd::string certificate = combine_path(\"..\", combine_path(\"ssl\", \"peer_certificate.pem\"));\n-\tstd::string private_key = combine_path(\"..\", combine_path(\"ssl\", \"peer_private_key.pem\"));\n-\tstd::string dh_params = combine_path(\"..\", combine_path(\"ssl\", \"dhparams.pem\"));\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+\t\t};\n \n-\tif (flags & invalid_certificate)\n-\t{\n-\t\tcertificate = combine_path(\"..\", combine_path(\"ssl\", \"invalid_peer_certificate.pem\"));\n-\t\tprivate_key = combine_path(\"..\", combine_path(\"ssl\", \"invalid_peer_private_key.pem\"));\n-\t}\n+\t\tbdecode_node parsed[4];\n+\t\tchar error_string[200];\n \n-
    \n-
    \tif (flags & (valid_certificate | invalid_certificate))\n-\t{\n-\t\tstd::printf(\"set_password_callback\\n\");\n-\t\tctx.set_password_callback(\n-\t\t\t[](std::size_t, context::password_purpose) { return \"test\"; }\n-\t\t\t, ec);\n-\t\tif (ec)\n-\t\t{\n-\t\t\tstd::printf(\"Failed to set certificate passphrase: %s\\n\"\n-\t\t\t\t, ec.message().c_str());\n-\t\t\tTEST_CHECK(!ec);\n-\t\t\treturn false;\n-\t\t}\n-\t\tstd::printf(\"use_certificate_file \\\"%s\\\"\\n\", certificate.c_str());\n-\t\tctx.use_certificate_file(certificate, context::pem, ec);\n-\t\tif (ec)\n+\t\tint ret = verify_message(response, desc, parsed, error_string);\n+\t\tif (ret)\n \t\t{\n-\t\t\tstd::printf(\"Failed to set certificate file: %s\\n\"\n-\t\t\t\t, ec.message().c_str());\n-\t\t\tTEST_CHECK(!ec);\n-\t\t\treturn false;\n+\t\t\titems_num.insert(items_num.begin(), j);\n \t\t}\n-\t\tstd::printf(\"use_private_key_file \\\"%s\\\"\\n\", private_key.c_str());\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-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-\n-\tchar handshake[] = \"\\x13\" \"BitTorrent protocol\\0\\0\\0\\0\\0\\0\\0\\x04\"\n-\t\t\"                    \" // space for info-hash\n-\t\t\"aaaaaaaaaaaaaaaaaaaa\" // peer-id\n-\t\t\"\\0\\0\\0\\x01\\x02\"; // interested\n-\n-\t// fill in the info-hash\n-\tif (flags & valid_bittorrent_hash)\n-\t{\n-\t\tstd::memcpy(handshake + 28, &t->info_hashes().v1[0], 20);\n \t}\n-\telse\n-\t{\n-
    \t\tstd::generate(handshake + 28, handshake + 48, &rand);\n-
    \t}\n \n-\t// fill in the peer-id\n-\tstd::generate(handshake + 48, handshake + 68, &rand);\n+
    \tTEST_EQUAL(items_num.size(), 4);\n+
    }\n \n-\tstd::printf(\"bittorrent handshake\\n\");\n-\tboost::asio::write(ssl_sock, boost::asio::buffer(handshake, (sizeof(handshake) - 1)), ec);\n-\tprint_alerts(ses1, \"ses1\", true, true, &on_alert);\n-\tif (ec)\n-\t{\n-\t\tstd::printf(\"failed to write bittorrent handshake: %s\\n\"\n-\t\t\t, ec.message().c_str());\n-\t\treturn false;\n-\t}\n+int sum_distance_exp(int s, node_entry const& e, node_id const& ref)\n+{\n+\treturn s + distance_exp(e.id, ref);\n+}\n \n-\tchar buf[68];\n-\tstd::printf(\"read bittorrent handshake\\n\");\n-\tboost::asio::read(ssl_sock, boost::asio::buffer(buf, sizeof(buf)), ec);\n-\tprint_alerts(ses1, \"ses1\", true, true, &on_alert);\n-\tif (ec)\n-\t{\n-\t\tstd::printf(\"failed to read bittorrent handshake: %s\\n\"\n-\t\t\t, ec.message().c_str());\n-\t\treturn false;\n-\t}\n+std::vector<tcp::endpoint> g_got_peers;\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+void get_peers_cb(std::vector<tcp::endpoint> const& peers)\n+{\n+\tg_got_peers.insert(g_got_peers.end(), peers.begin(), peers.end());\n+}\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+std::vector<dht::item> g_got_items;\n+dht::item g_put_item;\n+int g_put_count;\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+void get_mutable_item_cb(dht::item const& i, bool a)\n+{\n+\tif (!a) return;\n+\tif (!i.empty())\n+\t\tg_got_items.push_back(i);\n+}\n \n-\tpack.set_bool(settings_pack::allow_multiple_connections_per_ip, false);\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-
    \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+
    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-\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+\tTEST_CHECK(ret);\n+\tTEST_EQUAL(parsed[3].int_value(), 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+\t// should have one node now, which is 4.4.4.4:1234\n+\tTEST_EQUAL(std::get<0>(node.size()), 1);\n+\t// and no replacement nodes\n+\tTEST_EQUAL(std::get<1>(node.size()), 0);\n \n-\tses2.apply_settings(pack);\n+\t// now, disable read_only, try again.\n+\tg_sent_packets.clear();\n+\tsett.set_bool(settings_pack::dht_read_only, false);\n \n-\ttorrent_handle tor1;\n-\ttorrent_handle tor2;\n+\tsend_dht_request(node, \"get\", source, &response);\n+\t// sender should be added to replacement bucket\n+\tTEST_EQUAL(std::get<1>(node.size()), 1);\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+\tg_sent_packets.clear();\n+#if 0\n+
    \ttarget = generate_next();\n+
    \tnode.get_item(target, get_immutable_item_cb);\n \n-\tTEST_CHECK(exists(combine_path(\"tmp1_transfer\", \"temporary\")));\n+\t// since we have 2 nodes, we should have two packets.\n+\tTEST_EQUAL(g_sent_packets.size(), 2);\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+\t// both of them shouldn't have a 'ro' key.\n+\tnode_from_entry(g_sent_packets.front().second, request);\n+\tret = verify_message(request, get_item_desc_ro, parsed, error_string);\n \n-\twait_for_listen(ses1, \"ses1\");\n-\twait_for_listen(ses2, \"ses2\");\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+\tTEST_CHECK(ret);\n+\tTEST_CHECK(!parsed[3]);\n \n-\tstd::uint8_t compare[4] = { 0x16, 0xff, 0x55, 0xaa};\n+\tnode_from_entry(g_sent_packets.back().second, request);\n+\tret = verify_message(request, get_item_desc_ro, parsed, error_string);\n \n-\tbits_out = filter.to_string();\n-\tTEST_EQUAL(memcmp(compare, bits_out.c_str(), 4), 0);\n+\tTEST_CHECK(ret);\n+\tTEST_CHECK(!parsed[3]);\n+#endif\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-
    }\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+#ifndef TORRENT_DISABLE_LOGGING\n+// these tests rely on logging being enabled\n \n-
    \n-
    TORRENT_TEST(parse_hostname_peers)\n+TORRENT_TEST(invalid_error_msg)\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+
    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(parse_peers4)\n+TORRENT_TEST(rate_limit_accrue_limit)\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_merkle_tree.cpp:233use structured bindings in C++17

    use structured bindings in C++17

    ../test/test_merkle_tree.cpp:233

    \t\t\tmask[std::size_t(i)] = true;\n-\t\tt.load_sparse_tree(span<sha256_hash const>(f).subspan(first_piece, num_pieces), mask, empty_verified);\n-\t\tint const end_piece_layer = first_piece + merkle_num_leafs(num_pieces);\n-\t\tfor (int i = 0; i < end_piece_layer; ++i)\n-\t\t{\n-\t\t\tTEST_CHECK(t.has_node(i));\n-\t\t\tTEST_CHECK(t.compare_node(i, f[i]));\n-\t\t}\n-\t\tfor (int i = end_piece_layer; i < num_nodes; ++i)\n+\taux::session_settings sett;\n+\tsett.set_int(settings_pack::dht_upload_rate_limit, std::numeric_limits<int>::max());\n+\n+\ttest_rate_limit(sett, [](lt::dht::socket_manager& sm) {\n+\t\tTEST_CHECK(sm.has_quota());\n+\t\tfor (int i = 0; i < 10; ++i)\n \t\t{\n-\t\t\tTEST_CHECK(!t.has_node(i));\n+\t\t\tstd::this_thread::sleep_for(milliseconds(500));\n+\t\t\tTEST_CHECK(sm.has_quota());\n \t\t}\n-\t}\n+\t});\n }\n \n-namespace {\n-void test_roundtrip(aux::merkle_tree const& t\n-\t, int const block_count\n-\t, int const blocks_per_piece)\n-{\n-
    \taux::vector<bool> mask;\n-
    \tstd::vector<sha256_hash> tree;\n-\tstd::tie(tree, mask) = t.build_sparse_vector();\n-\n-\taux::merkle_tree t2(block_count, blocks_per_piece, f[0].data());\n-\tt2.load_sparse_tree(tree, mask, empty_verified);\n-\n-\tTEST_CHECK(t.build_vector() == t2.build_vector());\n-\tfor (int i = 0; i < int(t.size()); ++i)\n-\t{\n-\t\tTEST_EQUAL(t[i], t2[i]);\n-\t\tTEST_EQUAL(t.has_node(i), t2.has_node(i));\n-\n-\t\tif (!t.has_node(i))\n-\t\t\tTEST_CHECK(t[i].is_all_zeros());\n-\t\tif (!t2.has_node(i))\n-\t\t\tTEST_CHECK(t2[i].is_all_zeros());\n-\n-\t\tTEST_CHECK(t.compare_node(i, t2[i]));\n-\t\tTEST_CHECK(t2.compare_node(i, t[i]));\n-\t}\n-}\n-}\n \n-TORRENT_TEST(roundtrip_empty_tree)\n+
    \n+
    #else\n+TORRENT_TEST(dht)\n {\n-\taux::merkle_tree t(num_blocks, 1, f[0].data());\n-\ttest_roundtrip(t, num_blocks, 1);\n-}\n-\n-TORRENT_TEST(roundtrip_full_tree)\n-
    relevance 0../test/test_merkle_tree.cpp:938add test for load_piece_layer()

    add test for load_piece_layer()

    ../test/test_merkle_tree.cpp:938

    relevance 0../test/test_merkle_tree.cpp:939add test for add_hashes() with an odd number of blocks

    add test for add_hashes() with an odd number of blocks

    ../test/test_merkle_tree.cpp:939

    relevance 0../test/test_merkle_tree.cpp:940add test for set_block() (setting the last block) with an odd number of blocks

    add test for set_block() (setting the last block) with an odd number of blocks

    ../test/test_merkle_tree.cpp:940

    \n-\t\tfor (int i = 0; i < 7; ++i)\n-\t\t\tTEST_EQUAL(t[i], f[i]);\n-\t}\n-\n-\t// use a proof that ties the first piece node 3 (since we don't need it all\n-\t// the way to the root).\n-\tauto const result = t.add_hashes(127, pdiff(1), range(f, 127, 4), build_proof(f, 31, 3));\n-\tTEST_CHECK(result);\n-\n-\tauto const& res = *result;\n-\tTEST_EQUAL(res.passed.size(), 0);\n-\tTEST_EQUAL(res.failed.size(), 0);\n-\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+\t// dummy dht test\n+\tTEST_CHECK(true);\n }\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+#endif\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@@ -5057,15 +4828,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@@ -5079,15 +4850,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@@ -5130,15 +4901,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@@ -5183,15 +4954,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@@ -5236,15 +5007,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_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_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+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_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@@ -5289,18 +5060,18 @@\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+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+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 TORRENT_TEST(flag_sequential_download)\n {\n@@ -5338,164 +5109,242 @@\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_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_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_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+
    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\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-\t\t};\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-\t\tbdecode_node parsed[4];\n-\t\tchar error_string[200];\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-\t\tint ret = verify_message(response, desc, parsed, error_string);\n-\t\tif (ret)\n-\t\t{\n-\t\t\titems_num.insert(items_num.begin(), j);\n-\t\t}\n-\t}\n+\tpack.set_bool(settings_pack::allow_multiple_connections_per_ip, false);\n \n-
    \tTEST_EQUAL(items_num.size(), 4);\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-int sum_distance_exp(int s, node_entry const& e, node_id const& ref)\n-{\n-\treturn s + distance_exp(e.id, ref);\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-std::vector<tcp::endpoint> g_got_peers;\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-void get_peers_cb(std::vector<tcp::endpoint> const& peers)\n-{\n-\tg_got_peers.insert(g_got_peers.end(), peers.begin(), peers.end());\n-}\n+\tses2.apply_settings(pack);\n \n-std::vector<dht::item> g_got_items;\n-dht::item g_put_item;\n-int g_put_count;\n+\ttorrent_handle tor1;\n+\ttorrent_handle tor2;\n \n-void get_mutable_item_cb(dht::item const& i, bool a)\n-{\n-\tif (!a) return;\n-\tif (!i.empty())\n-\t\tg_got_items.push_back(i);\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-void put_mutable_item_data_cb(dht::item& i)\n-{\n-\tif (!i.empty())\n-\t\tg_got_items.push_back(i);\n+\tTEST_CHECK(exists(combine_path(\"tmp1_transfer\", \"temporary\")));\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-be added to the routing table

    ../test/test_dht.cpp:3223

    \tbool ret = verify_message(request, get_item_desc_ro, parsed, error_string);\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-\tTEST_CHECK(ret);\n-\tTEST_EQUAL(parsed[3].int_value(), 1);\n+\twait_for_listen(ses1, \"ses1\");\n+\twait_for_listen(ses2, \"ses2\");\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+\t}\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-\t// and no replacement nodes\n-\tTEST_EQUAL(std::get<1>(node.size()), 0);\n+\tstd::string certificate = combine_path(\"..\", combine_path(\"ssl\", \"peer_certificate.pem\"));\n+\tstd::string private_key = combine_path(\"..\", combine_path(\"ssl\", \"peer_private_key.pem\"));\n+\tstd::string dh_params = combine_path(\"..\", combine_path(\"ssl\", \"dhparams.pem\"));\n \n-\t// now, disable read_only, try again.\n-\tg_sent_packets.clear();\n-\tsett.set_bool(settings_pack::dht_read_only, false);\n+\tif (flags & invalid_certificate)\n+\t{\n+\t\tcertificate = combine_path(\"..\", combine_path(\"ssl\", \"invalid_peer_certificate.pem\"));\n+\t\tprivate_key = combine_path(\"..\", combine_path(\"ssl\", \"invalid_peer_private_key.pem\"));\n+\t}\n \n-\tsend_dht_request(node, \"get\", source, &response);\n-\t// sender should be added to replacement bucket\n-\tTEST_EQUAL(std::get<1>(node.size()), 1);\n+
    \n+
    \tif (flags & (valid_certificate | invalid_certificate))\n+\t{\n+\t\tstd::printf(\"set_password_callback\\n\");\n+\t\tctx.set_password_callback(\n+\t\t\t[](std::size_t, context::password_purpose) { return \"test\"; }\n+\t\t\t, ec);\n+\t\tif (ec)\n+\t\t{\n+\t\t\tstd::printf(\"Failed to set certificate passphrase: %s\\n\"\n+\t\t\t\t, ec.message().c_str());\n+\t\t\tTEST_CHECK(!ec);\n+\t\t\treturn false;\n+\t\t}\n+\t\tstd::printf(\"use_certificate_file \\\"%s\\\"\\n\", certificate.c_str());\n+\t\tctx.use_certificate_file(certificate, context::pem, ec);\n+\t\tif (ec)\n+\t\t{\n+\t\t\tstd::printf(\"Failed to set certificate file: %s\\n\"\n+\t\t\t\t, ec.message().c_str());\n+\t\t\tTEST_CHECK(!ec);\n+\t\t\treturn false;\n+\t\t}\n+\t\tstd::printf(\"use_private_key_file \\\"%s\\\"\\n\", private_key.c_str());\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+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 \n-\tg_sent_packets.clear();\n-#if 0\n-
    \ttarget = generate_next();\n-
    \tnode.get_item(target, get_immutable_item_cb);\n+\tchar handshake[] = \"\\x13\" \"BitTorrent protocol\\0\\0\\0\\0\\0\\0\\0\\x04\"\n+\t\t\" \" // space for info-hash\n+\t\t\"aaaaaaaaaaaaaaaaaaaa\" // peer-id\n+\t\t\"\\0\\0\\0\\x01\\x02\"; // interested\n \n-\t// since we have 2 nodes, we should have two packets.\n-\tTEST_EQUAL(g_sent_packets.size(), 2);\n+\t// fill in the info-hash\n+\tif (flags & valid_bittorrent_hash)\n+\t{\n+\t\tstd::memcpy(handshake + 28, &t->info_hashes().v1[0], 20);\n+\t}\n+\telse\n+\t{\n+
    \t\tstd::generate(handshake + 28, handshake + 48, &rand);\n+
    \t}\n \n-\t// both of them shouldn't have a 'ro' key.\n-\tnode_from_entry(g_sent_packets.front().second, request);\n-\tret = verify_message(request, get_item_desc_ro, parsed, error_string);\n+\t// fill in the peer-id\n+\tstd::generate(handshake + 48, handshake + 68, &rand);\n \n-\tTEST_CHECK(ret);\n-\tTEST_CHECK(!parsed[3]);\n+\tstd::printf(\"bittorrent handshake\\n\");\n+\tboost::asio::write(ssl_sock, boost::asio::buffer(handshake, (sizeof(handshake) - 1)), ec);\n+\tprint_alerts(ses1, \"ses1\", true, true, &on_alert);\n+\tif (ec)\n+\t{\n+\t\tstd::printf(\"failed to write bittorrent handshake: %s\\n\"\n+\t\t\t, ec.message().c_str());\n+\t\treturn false;\n+\t}\n \n-\tnode_from_entry(g_sent_packets.back().second, request);\n-\tret = verify_message(request, get_item_desc_ro, parsed, error_string);\n+\tchar buf[68];\n+\tstd::printf(\"read bittorrent handshake\\n\");\n+\tboost::asio::read(ssl_sock, boost::asio::buffer(buf, sizeof(buf)), ec);\n+\tprint_alerts(ses1, \"ses1\", true, true, &on_alert);\n+\tif (ec)\n+\t{\n+\t\tstd::printf(\"failed to read bittorrent handshake: %s\\n\"\n+\t\t\t, ec.message().c_str());\n+\t\treturn false;\n+\t}\n \n-\tTEST_CHECK(ret);\n-\tTEST_CHECK(!parsed[3]);\n-#endif\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_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+\t\t\t\t<< \", proto: \" << static_cast<int>(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+\t\t\treturn true;\n+\t\t}\n \n-#ifndef TORRENT_DISABLE_LOGGING\n-// these tests rely on logging being enabled\n+\t\tvoid log_portmap(portmap_transport, char const* msg\n+\t\t\t, aux::listen_socket_handle const&) const override\n+\t\t{\n+\t\t\tstd::cout << \"UPnP: \" << msg << std::endl;\n+
    \t\t}\n+
    \t#endif\n+\t};\n \n-TORRENT_TEST(invalid_error_msg)\n+ip_interface pick_upnp_interface()\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-\t});\n-}\n+\tlt::io_context ios;\n+\terror_code ec;\n+\tstd::vector<ip_route> const routes = enum_routes(ios, ec);\n+\tif (ec)\n+\t{\n+\t\tstd::cerr << \"failed to enumerate routes: \" << ec.message() << '\\n';\n+\t\tTEST_CHECK(false);\n+\t\treturn {};\n+\t}\n+\tstd::vector<ip_interface> const ifs = enum_net_interfaces(ios, ec);\n+\tif (ec)\n+\t{\n+\t\tstd::cerr << \"failed to enumerate network interfaces: \" << ec.message() << '\\n';\n+\t\tTEST_CHECK(false);\n+\t\treturn {};\n+\t}\n+\tint idx = 0;\n+\tfor (auto const& face : ifs)\n+\t{\n+\t\tif (!face.interface_address.is_v4()) continue;\n+\t\tstd::cout << \" - \" << idx\n+\t\t\t<< ' ' << face.interface_address.to_string()\n+\t\t\t<< ' ' << int(static_cast<std::uint8_t>(face.state))\n+\t\t\t<< ' ' << static_cast<std::uint32_t>(face.flags)\n+\t\t\t<< ' ' << face.name << '\\n';\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(rate_limit_accrue_limit)\n+TORRENT_TEST(timestamp_history)\n {\n-\taux::session_settings sett;\n-\tsett.set_int(settings_pack::dht_upload_rate_limit, std::numeric_limits<int>::max());\n-\n-\ttest_rate_limit(sett, [](lt::dht::socket_manager& sm) {\n-\t\tTEST_CHECK(sm.has_quota());\n-\t\tfor (int i = 0; i < 10; ++i)\n-\t\t{\n-\t\t\tstd::this_thread::sleep_for(milliseconds(500));\n-\t\t\tTEST_CHECK(sm.has_quota());\n-\t\t}\n-\t});\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-
    \n-
    #else\n-TORRENT_TEST(dht)\n-{\n-\t// dummy dht test\n-\tTEST_CHECK(true);\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-#endif\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+
    }\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_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@@ -5509,15 +5358,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@@ -5561,17 +5410,95 @@\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_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+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_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+\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+
    }\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+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@@ -5614,15 +5541,88 @@\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../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+
    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_merkle_tree.cpp:233use structured bindings in C++17

    use structured bindings in C++17

    ../test/test_merkle_tree.cpp:233

    \t\t\tmask[std::size_t(i)] = true;\n+\t\tt.load_sparse_tree(span<sha256_hash const>(f).subspan(first_piece, num_pieces), mask, empty_verified);\n+\t\tint const end_piece_layer = first_piece + merkle_num_leafs(num_pieces);\n+\t\tfor (int i = 0; i < end_piece_layer; ++i)\n+\t\t{\n+\t\t\tTEST_CHECK(t.has_node(i));\n+\t\t\tTEST_CHECK(t.compare_node(i, f[i]));\n+\t\t}\n+\t\tfor (int i = end_piece_layer; i < num_nodes; ++i)\n+\t\t{\n+\t\t\tTEST_CHECK(!t.has_node(i));\n+\t\t}\n+\t}\n+}\n+\n+namespace {\n+void test_roundtrip(aux::merkle_tree const& t\n+\t, int const block_count\n+\t, int const blocks_per_piece)\n+{\n+
    \taux::vector<bool> mask;\n+
    \tstd::vector<sha256_hash> tree;\n+\tstd::tie(tree, mask) = t.build_sparse_vector();\n+\n+\taux::merkle_tree t2(block_count, blocks_per_piece, f[0].data());\n+\tt2.load_sparse_tree(tree, mask, empty_verified);\n+\n+\tTEST_CHECK(t.build_vector() == t2.build_vector());\n+\tfor (int i = 0; i < int(t.size()); ++i)\n+\t{\n+\t\tTEST_EQUAL(t[i], t2[i]);\n+\t\tTEST_EQUAL(t.has_node(i), t2.has_node(i));\n+\n+\t\tif (!t.has_node(i))\n+\t\t\tTEST_CHECK(t[i].is_all_zeros());\n+\t\tif (!t2.has_node(i))\n+\t\t\tTEST_CHECK(t2[i].is_all_zeros());\n+\n+\t\tTEST_CHECK(t.compare_node(i, t2[i]));\n+\t\tTEST_CHECK(t2.compare_node(i, t[i]));\n+\t}\n+}\n+}\n+\n+TORRENT_TEST(roundtrip_empty_tree)\n+{\n+\taux::merkle_tree t(num_blocks, 1, f[0].data());\n+\ttest_roundtrip(t, num_blocks, 1);\n+}\n+\n+TORRENT_TEST(roundtrip_full_tree)\n+
    relevance 0../test/test_merkle_tree.cpp:938add test for load_piece_layer()

    add test for load_piece_layer()

    ../test/test_merkle_tree.cpp:938

    relevance 0../test/test_merkle_tree.cpp:939add test for add_hashes() with an odd number of blocks

    add test for add_hashes() with an odd number of blocks

    ../test/test_merkle_tree.cpp:939

    relevance 0../test/test_merkle_tree.cpp:940add test for set_block() (setting the last block) with an odd number of blocks

    add test for set_block() (setting the last block) with an odd number of blocks

    ../test/test_merkle_tree.cpp:940

    \n+\t\tfor (int i = 0; i < 7; ++i)\n+\t\t\tTEST_EQUAL(t[i], f[i]);\n+\t}\n+\n+\t// use a proof that ties the first piece node 3 (since we don't need it all\n+\t// the way to the root).\n+\tauto const result = t.add_hashes(127, pdiff(1), range(f, 127, 4), build_proof(f, 31, 3));\n+\tTEST_CHECK(result);\n+\n+\tauto const& res = *result;\n+\tTEST_EQUAL(res.passed.size(), 0);\n+\tTEST_EQUAL(res.failed.size(), 0);\n+\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/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@@ -5665,496 +5665,156 @@\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/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+
    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\tload_verified_bits(verified);\n+\t\t\tint rate_threshold = sett.get_int(settings_pack::rate_choker_initial_threshold);\n \n-\t\toptimize_storage();\n-\t\toptimize_storage_piece_layer();\n-\t}\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-\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\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-namespace {\n+\t\t\t\t// always have at least 1 unchoke slot\n+\t\t\t\tif (rate < rate_threshold) break;\n \n-
    \tstruct identity\n-
    \t{\n-\t\tbool operator()(bool b) const { return b; }\n-\t};\n-}\n+\t\t\t\t++upload_slots;\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\trate_threshold += 2048;\n+
    \t\t\t}\n+\t\t\t++upload_slots;\n+\t\t}\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-\t\t\t\t\tif (m_tree[dst_idx] != tree[src_idx])\n-\t\t\t\t\t{\n-\t\t\t\t\t\t// this must be a block hash because inner nodes are not filled in until\n-\t\t\t\t\t\t// they can be verified. This assert ensures we're at the\n-\t\t\t\t\t\t// leaf layer of the file tree\n-\t\t\t\t\t\tTORRENT_ASSERT(dst_idx >= first_leaf);\n-\n-\t\t\t\t\t\tint const pos = dst_idx - first_leaf;\n-\t\t\t\t\t\tauto const piece = piece_index_t{pos >> m_blocks_per_piece_log} + file_piece_offset;\n-\t\t\t\t\t\tint const block = pos & ((1 << m_blocks_per_piece_log) - 1);\n-\n-\t\t\t\t\t\tTORRENT_ASSERT(pos < m_num_blocks);\n-\t\t\t\t\t\tif (!ret.failed.empty() && ret.failed.back().first == piece)\n-\t\t\t\t\t\t\tret.failed.back().second.push_back(block);\n-\t\t\t\t\t\telse\n-\t\t\t\t\t\t\tret.failed.emplace_back(piece, std::vector<int>{block});\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-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-\t\t\t// try to verify as many child nodes of the received hashes as possible\n-\t\t\tfor (int i = 0; i < int(hashes.size()); ++i)\n-\t\t\t{\n-\t\t\t\tint const piece = dest_start_idx + i;\n-\t\t\t\tif (piece - first_piece_idx >= num_pieces())\n-\t\t\t\t\tbreak;\n-\t\t\t\t// the first block in this piece\n-\t\t\t\tint const block_idx = merkle_get_first_child(piece, base);\n-\n-\t\t\t\tint const block_end_idx = std::min(block_idx + blocks_in_piece, first_leaf + m_num_blocks);\n-\t\t\t\tif (std::any_of(m_tree.begin() + block_idx\n-\t\t\t\t\t, m_tree.begin() + block_end_idx\n-\t\t\t\t\t, [](sha256_hash const& h) { return h.is_all_zeros(); }))\n-\t\t\t\t\tcontinue;\n-\n-
    \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-\n-\t\t\t\t\t// an empty blocks vector indicates that we don't have the\n-\t\t\t\t\t// block hashes, and we can't know which block failed\n-\t\t\t\t\t// this will cause the block hashes to be requested\n-\t\t\t\t\tret.failed.emplace_back(piece_index_t{piece - first_piece_idx} + file_piece_offset\n-\t\t\t\t\t\t, std::vector<int>());\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-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-\n-\t\t\t\t\t// an empty blocks vector indicates that we don't have the\n-\t\t\t\t\t// block hashes, and we can't know which block failed\n-\t\t\t\t\t// this will cause the block hashes to be requested\n-\t\t\t\t\tret.failed.emplace_back(piece_index_t{piece - first_piece_idx} + file_piece_offset\n-\t\t\t\t\t\t, std::vector<int>());\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-
    \t\t\t\t\tfor (int k = leafs_start; k < leafs_end; ++k)\n-
    \t\t\t\t\t\tm_block_verified.set_bit(k);\n-\t\t\t\t}\n-\t\t\t\tTORRENT_ASSERT((piece - first_piece_idx) >= 0);\n-\t\t\t}\n-\t\t}\n-\n-\t\toptimize_storage();\n-\n-\t\treturn ret;\n-\t}\n-\n-\tstd::tuple<merkle_tree::set_block_result, int, int> merkle_tree::set_block(int const block_index\n-\t\t, sha256_hash const& h)\n-\t{\n-#ifdef TORRENT_EXPENSIVE_INVARIANT_CHECKS\n-\t\tINVARIANT_CHECK;\n-#endif\n-\t\tTORRENT_ASSERT(block_index < m_num_blocks);\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\tauto const num_leafs = merkle_num_leafs(m_num_blocks);\n-\t\tauto const first_leaf = merkle_first_leaf(num_leafs);\n-\t\tauto const block_tree_index = first_leaf + block_index;\n+\t\t// we use partial sort here, because we only care about the top\n+\t\t// upload_slots peers.\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-\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-\t\tauto const block_tree_index = first_leaf + block_index;\n+\t\tint const slots = std::min(upload_slots, int(peers.size()));\n \n-\t\tif (blocks_verified(block_index, 1))\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// 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-\t\t}\n-\n-\t\tallocate_full();\n-\n-\t\tm_tree[block_tree_index] = h;\n-\n-\t\t// to avoid wasting a lot of time hashing nodes only to discover they\n-\t\t// cannot be verified, check first to see if the root of the largest\n-\t\t// computable subtree is known\n-\n-
    \t\tint leafs_start;\n-
    \t\tint leafs_size;\n-\t\tint root_index;\n-\t\tstd::tie(leafs_start, leafs_size, root_index) =\n-\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-\t\tsha256_hash const root = m_tree[root_index];\n-\t\tmerkle_fill_tree(m_tree, leafs_size, first_leaf + leafs_start);\n+\t\t\tint const pieces = sett.get_int(settings_pack::seeding_piece_quota);\n \n-\t\tif (root != m_tree[root_index])\n-\t\t{\n-\t\t\t// hash failure, clear all the internal nodes\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\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-\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-\t\tsha256_hash const root = m_tree[root_index];\n-\t\tmerkle_fill_tree(m_tree, leafs_size, first_leaf + leafs_start);\n-\n-\t\tif (root != m_tree[root_index])\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\t// hash failure, clear all the internal nodes\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-
    \t\tint const leafs_end = std::min(m_num_blocks, leafs_start + leafs_size);\n-
    \t\tfor (int i = leafs_start; i < leafs_end; ++i)\n-\t\t\tm_block_verified.set_bit(i);\n-\n-\t\t// attempting to optimize storage is quite costly, only do it if we have\n-\t\t// a reason to believe it might have an effect\n-\t\tif (block_index == m_num_blocks - 1 || !m_tree[block_tree_index + 1].is_all_zeros())\n-\t\t\toptimize_storage();\n-\n-\t\treturn std::make_tuple(set_block_result::ok, leafs_start, leafs_size);\n-\t}\n-\n-\tstd::size_t merkle_tree::size() const\n-\t{\n-\t\treturn static_cast<std::size_t>(merkle_num_nodes(merkle_num_leafs(m_num_blocks)));\n-\t}\n-\n-\tint merkle_tree::num_pieces() const\n-\t{\n-\t\tint const ps = blocks_per_piece();\n-\t\tTORRENT_ASSERT(ps > 0);\n-\t\treturn (m_num_blocks + ps - 1) >> m_blocks_per_piece_log;\n-\t}\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-\t}\n-\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+\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/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-\t\tTORRENT_ASSERT(is_outgoing());\n+\tstatic_assert(std::is_nothrow_move_constructible<add_torrent_params>::value\n+\t\t, \"should be nothrow move constructible\");\n \n-\t\tTORRENT_ASSERT(!m_torrent.lock()->is_upload_only());\n+\tstatic_assert(std::is_nothrow_move_constructible<std::string>::value\n+\t\t, \"should be nothrow move constructible\");\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-\n-\t\tif (m_port == -1 && protocol == \"http\")\n-\t\t\tm_port = 80;\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-#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+\tstatic_assert(std::is_nothrow_move_constructible<add_torrent_params>::value\n+\t\t, \"should be nothrow move constructible\");\n \n-\t\tif (!m_basic_auth.empty())\n-\t\t\tm_basic_auth = base64encode(m_basic_auth);\n+\tstatic_assert(std::is_nothrow_move_constructible<std::string>::value\n+\t\t, \"should be nothrow move constructible\");\n \n-\t\tm_server_string = m_host;\n-\t\taux::verify_encoding(m_server_string);\n-\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-\t}\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+
    namespace aux {\n \n-\tif (m_stalled)\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\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-\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\treturn !atp.have_pieces.empty()\n+\t\t\t|| (atp.flags & torrent_flags::seed_mode);\n \t}\n+}\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-\t// general.\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+}\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/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+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+#else\n+\t\t\tret = file_pointer(::fopen(fn.c_str(), \"wb+\"));\n+#endif\n+\t\t\tif (ret.file() == nullptr)\n+\t\t\t\tec.assign(errno, generic_category());\n \t\t}\n-\t}\n-\tcatch (storage_error const& e)\n-\t{\n-\t\tec = e.ec;\n-\t\treturn {};\n+\t\tif (ec) return {};\n+\t\treturn ret;\n \t}\n \n-\tvoid part_file::free_piece(piece_index_t const piece)\n+\tvoid posix_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+\tvoid posix_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@@ -6168,36 +5828,38 @@\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\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+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+\t\t\t\tf(file_offset, {buf.get(), block_to_copy});\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+\tvoid posix_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+
    \tvoid posix_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@@ -6206,29 +5868,131 @@\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\tauto f = open_file(open_mode::read_write, 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/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+
    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/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+\n+\t\tclose();\n+\t\treturn true;\n+\t}\n+\n+\tbool udp_tracker_connection::on_scrape_response(span<char const> buf)\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+\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\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<std::size_t>(buf.size())).c_str());\n+\t\t\treturn true;\n+\t\t}\n+\n+\t\tif (action != action_t::scrape)\n+\t\t{\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@@ -6271,15 +6035,15 @@\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+

    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@@ -6326,15 +6090,15 @@\n \t\t\tif (num_blocks <= 0) return ret;\n \t\t}\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+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\t\t\tif (!is_piece_free(m_pieces[p], pieces)) continue;\n \n@@ -6378,15 +6142,15 @@\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+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@@ -6425,15 +6189,15 @@\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+
    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 \n@@ -6476,219 +6240,297 @@\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/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/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-\t\t\tint rate_threshold = sett.get_int(settings_pack::rate_choker_initial_threshold);\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-\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+\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-\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+} // anonymous namespace\n \n-\t\t\t\t// always have at least 1 unchoke slot\n-\t\t\t\tif (rate < rate_threshold) break;\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/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\t\t\t++upload_slots;\n+#if defined TORRENT_ANDROID && !defined IFA_F_DADFAILED\n+#define IFA_F_DADFAILED 8\n+#endif\n \n-
    \t\t\t\trate_threshold += 2048;\n-
    \t\t\t}\n-\t\t\t++upload_slots;\n-\t\t}\n+#endif\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+#if TORRENT_USE_IFADDRS\n+#include <ifaddrs.h>\n+#include <net/if.h>\n+#include <sys/ioctl.h>\n+#endif\n \n-\t\t// we use partial sort here, because we only care about the top\n-\t\t// upload_slots peers.\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-\t\tint const slots = std::min(upload_slots, int(peers.size()));\n+#include \"libtorrent/aux_/disable_warnings_pop.hpp\"\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+#if defined(TORRENT_OS2) && !defined(IF_NAMESIZE)\n+#define IF_NAMESIZE IFNAMSIZ\n+#endif\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/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+namespace libtorrent {\n \n-\t\tfor (int i = 0; i < settings_pack::num_int_settings; ++i)\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+#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\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\tint const read_len = int(recv(sock, buf.data(), buf.size(), 0));\n+\t\t\tif (read_len < 0) return -1;\n \n-\t\tfor (int i = 0; i < settings_pack::num_bool_settings; ++i)\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+\t{\n+\t\tstd::array<char, 4096> buf;\n+\t\tfor (;;)\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\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 \t}\n \n-\tsettings_pack default_settings()\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\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\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\tfor (int i = 0; i < settings_pack::num_int_settings; ++i)\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+\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\tret.set_int(settings_pack::int_type_base + i, int_settings[i].default_value);\n+\t\t\t--m_size;\n+\t\t\tif (m_size == 0) m_last = m_first;\n \t\t}\n \n-\t\tfor (int i = 0; i < settings_pack::num_bool_settings; ++i)\n+\t\tif (idx == m_first && m_size != 0)\n \t\t{\n-\t\t\tret.set_bool(settings_pack::bool_type_base + i, bool_settings[i].default_value);\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-\t\treturn ret;\n-\t}\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-\n-\t\tsett.bulk_set([&](aux::session_settings_single_thread& s)\n+\t\tif (((idx + 1) & 0xffff) == m_last && m_size != 0)\n \t\t{\n-\t\t\tapply_pack_impl(pack, s, ses ? &callbacks : nullptr);\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/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-\t\t// call the callbacks once all the settings have been applied, and\n-\t\t// only once per callback\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+\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-#if TORRENT_ABI_VERSION < 3\n-\t\tif (!params.info_hashes.has_v1() && !params.info_hashes.has_v2() && !params.ti)\n-\t\t\tparams.info_hashes.v1 = params.info_hash;\n-#endif\n+\t\tpost(m_ios, [h = std::move(handler)] { h(storage_error{}); });\n+\t\treturn false;\n+\t}\n \n-\t\t// the internal torrent object keeps and mutates state in the\n-\t\t// torrent_info object. We can't let that leak back to the client\n-\t\tif (params.ti)\n-\t\t\tparams.ti = std::make_shared<torrent_info>(*params.ti);\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-\t\t// we cannot capture a unique_ptr into a lambda in c++11, so we use a raw\n-\t\t// pointer for now. async_call uses a lambda expression to post the call\n-\t\t// to the main thread\n-
    \t\tauto* p = new add_torrent_params(std::move(params));\n-
    \t\tauto guard = aux::scope_end([p]{ delete p; });\n-\t\tp->save_path = complete(p->save_path);\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-#if TORRENT_ABI_VERSION == 1\n-\t\thandle_backwards_compatible_resume_data(*p);\n-#endif\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-\t\tasync_call(&session_impl::async_add_torrent, p);\n-\t\tguard.disarm();\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-#ifndef BOOST_NO_EXCEPTIONS\n-#if TORRENT_ABI_VERSION == 1\n-\t// if the torrent already exists, this will throw duplicate_torrent\n-\ttorrent_handle session_handle::add_torrent(\n-\t\ttorrent_info const& ti\n-\t\t, std::string const& save_path\n-\t\t, entry const& resume_data\n-\t\t, storage_mode_t storage_mode\n-\t\t, bool const add_paused)\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\tadd_torrent_params p;\n-\t\tp.ti = std::make_shared<torrent_info>(ti);\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/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\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/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\tif (m_files.pad_file_at(f))\n \t\t\treturn { set_block_hash_result::result::success, 0, 0 };\n \n@@ -6731,449 +6573,1007 @@\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 \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+
    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+\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+\t}\n+\n+\tstd::array<char, 96> export_key(key_t const& k)\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 #endif\n-\t\t, is_v6_addr(false)\n-#if TORRENT_USE_I2P\n-\t\t, is_i2p_addr(false)\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, 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\t\tstd::memset(begin, 0, aux::numeric_cast<std::size_t>(96 - len));\n+\t\t}\n+\t\treturn ret;\n+\t}\n \n-\tstd::uint32_t torrent_peer::rank(external_ip const& external, int external_port) const\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 \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\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+\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/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+\t{\n #ifndef TORRENT_DISABLE_LOGGING\n-\tstd::string torrent_peer::to_string() const\n+\t\tsession_log(\"start session\");\n+#endif\n+\n+#if TORRENT_USE_SSL\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+
    \t\tX509_STORE* store = X509_STORE_new();\n+
    \t\tif (store)\n+\t\t{\n+\t\t\tHCERTSTORE system_store = CertOpenSystemStoreA(0, \"ROOT\");\n+\t\t\t// this is best effort\n+\t\t\tif (system_store)\n+\t\t\t{\n+\t\t\t\tCERT_CONTEXT const* ctx = nullptr;\n+\t\t\t\twhile ((ctx = CertEnumCertificatesInStore(system_store, ctx)) != nullptr)\n+\t\t\t\t{\n+\t\t\t\t\tunsigned char const* cert_ptr = reinterpret_cast<unsigned char const*>(ctx->pbCertEncoded);\n+\t\t\t\t\tX509* x509 = d2i_X509(nullptr, &cert_ptr, ctx->cbCertEncoded);\n+\t\t\t\t\t// this is best effort\n+\t\t\t\t\tif (!x509) continue;\n+\t\t\t\t\tX509_STORE_add_cert(store, x509);\n+\t\t\t\t\tX509_free(x509);\n+\t\t\t\t}\n+\t\t\t\tCertFreeCertificateContext(ctx);\n+\t\t\t\tCertCloseStore(system_store, 0);\n+\t\t\t}\n+\t\t}\n+\n+\t\tSSL_CTX* ssl_ctx = m_ssl_ctx.native_handle();\n+\t\tSSL_CTX_set_cert_store(ssl_ctx, store);\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+\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+\t}\n+\n+\t// session_impl is responsible for deleting 'pack'\n+\tvoid session_impl::apply_settings_pack(std::shared_ptr<settings_pack> pack)\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\tINVARIANT_CHECK;\n+\t\tapply_settings_pack_impl(*pack);\n \t}\n-#endif\n \n-\tstd::int64_t torrent_peer::total_download() const\n+\tsettings_pack session_impl::get_settings() const\n \t{\n-\t\tTORRENT_ASSERT(in_use);\n-\t\tif (connection != nullptr)\n+\t\tsettings_pack ret;\n+
    \t\tfor (int i = settings_pack::string_type_base;\n+
    \t\t\ti < settings_pack::max_string_setting_internal; ++i)\n \t\t{\n-\t\t\tTORRENT_ASSERT(prev_amount_download == 0);\n-\t\t\treturn connection->statistics().total_payload_download();\n+\t\t\tret.set_str(i, m_settings.get_str(i));\n \t\t}\n-\t\telse\n+\t\tfor (int i = settings_pack::int_type_base;\n+\t\t\ti < settings_pack::max_int_setting_internal; ++i)\n \t\t{\n-\t\t\treturn std::int64_t(prev_amount_download) << 10;\n+\t\t\tret.set_int(i, m_settings.get_int(i));\n+\t\t}\n+\t\tfor (int i = settings_pack::bool_type_base;\n+\t\t\ti < settings_pack::max_bool_setting_internal; ++i)\n+\t\t{\n+\t\t\tret.set_bool(i, m_settings.get_bool(i));\n \t\t}\n+\t\treturn ret;\n \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+\n+namespace {\n+\ttemplate <typename Pack>\n+\tint get_setting_impl(Pack const& p, int name, int*)\n+\t{ return p.get_int(name); }\n+\n+\ttemplate <typename Pack>\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+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+\tvoid session_impl::on_ip_change(error_code const& ec)\n+\t{\n+#ifndef TORRENT_DISABLE_LOGGING\n+\t\tif (!ec)\n+\t\t\tsession_log(\"received ip change from internal ip_notifier\");\n+\t\telse\n+\t\t\tsession_log(\"received error on_ip_change: %d, %s\", ec.value(), ec.message().c_str());\n #endif\n+\t\tif (ec || m_abort || !m_ip_notifier) return;\n+\t\tm_ip_notifier->async_wait([this] (error_code const& e)\n+\t\t\t{ wrap(&session_impl::on_ip_change, e); });\n+\t\treopen_network_sockets({});\n+\t}\n+\n+
    \tvoid interface_to_endpoints(listen_interface_t const& iface\n+
    \t\t, listen_socket_flags_t flags\n+\t\t, span<ip_interface const> const ifs\n+\t\t, std::vector<listen_endpoint_t>& eps)\n+\t{\n+\t\tflags |= iface.local ? listen_socket_t::local_network : listen_socket_flags_t{};\n+\t\ttransport const ssl = iface.ssl ? transport::ssl : transport::plaintext;\n+\n+\t\t// First, check to see if it's an IP address\n+\t\terror_code err;\n+\t\taddress const adr = make_address(iface.device.c_str(), err);\n+\t\tif (!err)\n+\t\t{\n+\t\t\teps.emplace_back(adr, iface.port, std::string{}, ssl, flags);\n+\t\t}\n+\t\telse\n+\t\t{\n+\t\t\tflags |= listen_socket_t::was_expanded;\n+\n+\t\t\t// this is the case where device names a network device. We need to\n+\t\t\t// enumerate all IPs associated with this device\n+\t\t\tfor (auto const& ipface : 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 (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+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+\t\telse\n+\t\t{\n+\t\t\t// new sockets need to map ports even if the caller did not request\n+\t\t\t// re-mapping\n+\t\t\tfor (auto const& s : new_sockets)\n+\t\t\t\tremap_ports(remap_natpmp_and_upnp, *s);\n+\t\t}\n+\n+\t\tupdate_lsd();\n+\n+#if TORRENT_USE_I2P\n+\t\topen_new_incoming_i2p_connection();\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+\t\t// trackers that were not reachable, may have become reachable now.\n+\t\t// so clear the \"disabled\" flags to let them be tried one more time\n+
    \t\tfor (auto& t : m_torrents)\n+
    \t\t\tt->enable_all_trackers();\n+\t}\n+\n+\tvoid session_impl::reopen_network_sockets(reopen_network_flags_t const options)\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\treopen_listen_sockets(bool(options & session_handle::reopen_map_ports));\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+\tnamespace {\n+\t\ttemplate <typename MapProtocol, typename ProtoType, typename EndpointType>\n+\t\tvoid map_port(MapProtocol& m, ProtoType protocol, EndpointType const& ep\n+\t\t\t, port_mapping_t& map_handle, std::string const& device)\n+\t\t{\n+\t\t\tif (map_handle != port_mapping_t{-1}) m.delete_mapping(map_handle);\n+\t\t\tmap_handle = port_mapping_t{-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+\t\t\taddress const addr = ep.address();\n+\t\t\t// with IPv4 the interface might be behind NAT so we can't skip them\n+\t\t\t// based on the scope of the local address\n+\t\t\tif (addr.is_v6() && is_local(addr))\n+\t\t\t\treturn;\n \n-void socks5::on_connect_timeout(error_code const& e)\n-{\n-\tCOMPLETE_ASYNC(\"socks5::on_connect_timeout\");\n+\t\t\t// only update this mapping if we actually have a socket listening\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-\tif (e == boost::asio::error::operation_aborted) return;\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+\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+\t\t}();\n \n-\tif (m_abort) return;\n+#ifdef TORRENT_SSL_PEERS\n+\t\tTORRENT_ASSERT((ssl == transport::ssl) == is_ssl(c));\n+#endif\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+#ifdef TORRENT_SSL_PEERS\n+\t\tif (ssl == transport::ssl)\n+\t\t{\n+\t\t\tTORRENT_ASSERT(is_ssl(c));\n \n-\terror_code ignore;\n-\tm_socks5_sock.close(ignore);\n+\t\t\t// save the socket so we can cancel the handshake\n+
    \t\t\tauto iter = m_incoming_sockets.emplace(std::make_unique<socket_type>(std::move(c))).first;\n+
    \n+\t\t\tauto sock = iter->get();\n+\t\t\t// for SSL connections, incoming_connection() is called\n+\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+\t\t\tincoming_connection(std::move(c));\n+\t\t}\n+\t}\n \n-\t++m_failures;\n-\tretry_connection();\n-}\n+#ifdef TORRENT_SSL_PEERS\n \n-void socks5::on_connected(error_code const& e)\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+\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+\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-\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\tincoming_connection(std::move(c));\n \t\t}\n+\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+#ifdef TORRENT_SSL_PEERS\n \n-\t\tcb->tracker_response(tracker_req(), m_target.address(), ip_list, resp);\n+\tvoid session_impl::on_incoming_utp_ssl(socket_type s)\n+\t{\n+\t\tTORRENT_ASSERT(is_ssl(s));\n \n-\t\tclose();\n-\t\treturn true;\n+\t\t// save the socket so we can cancel the handshake\n+\n+
    \t\tauto iter = m_incoming_sockets.emplace(std::make_unique<socket_type>(std::move(s))).first;\n+
    \t\tauto sock = iter->get();\n+\n+\t\t// for SSL connections, incoming_connection() is called\n+\t\t// after the handshake is done\n+\t\tADD_OUTSTANDING_ASYNC(\"session_impl::ssl_handshake\");\n+\t\tboost::get<ssl_stream<utp_stream>>(**iter).async_accept_handshake(\n+\t\t\t[this, sock] (error_code const& err) { ssl_handshake(err, sock); });\n \t}\n \n-\tbool udp_tracker_connection::on_scrape_response(span<char const> buf)\n+\t// to test SSL connections, one can use this openssl command template:\n+\t//\n+\t// openssl s_client -cert <client-cert>.pem -key <client-private-key>.pem\n+\t// -CAfile <torrent-cert>.pem -debug -connect 127.0.0.1:4433 -tls1\n+\t// -servername <hex-encoded-info-hash>\n+\n+\tvoid session_impl::ssl_handshake(error_code const& ec, socket_type* sock)\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\tCOMPLETE_ASYNC(\"session_impl::ssl_handshake\");\n \n-\t\tif (transaction != m_transaction_id)\n+\t\tauto iter = m_incoming_sockets.find(sock);\n+\n+\t\t// this happens if the SSL connection is aborted because we're shutting\n+\t\t// down\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+\t\tif (!m_paused) m_auto_manage_time_scaler--;\n+\t\tif (m_auto_manage_time_scaler < 0)\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\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-\t\tif (action == action_t::error)\n+\t\t// --------------------------------------------------------------\n+\t\t// check for incoming connections that might have timed out\n+\t\t// --------------------------------------------------------------\n+\n+\t\tfor (auto i = m_connections.begin(); i != m_connections.end();)\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\tpeer_connection* p = (*i).get();\n+\t\t\t++i;\n+\t\t\t// ignore connections that already have a torrent, since they\n+\t\t\t// are ticked through the torrents' second_tick\n+\t\t\tif (!p->associated_torrent().expired()) continue;\n+\n+
    \t\t\tint timeout = m_settings.get_int(settings_pack::handshake_timeout);\n+
    #if TORRENT_USE_I2P\n+\t\t\ttimeout *= is_i2p(p->get_socket()) ? 4 : 1;\n+#endif\n+\t\t\tif (m_last_tick - p->connected_time () > seconds(timeout))\n+\t\t\t\tp->disconnect(errors::timed_out, operation_t::bittorrent);\n \t\t}\n \n-\t\tif (action != action_t::scrape)\n+\t\t// --------------------------------------------------------------\n+\t\t// second_tick every torrent (that wants it)\n+\t\t// --------------------------------------------------------------\n+\n+#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-
    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\ttorrent& t = *want_tick[i];\n+\t\t\tTORRENT_ASSERT(t.want_tick());\n+\t\t\tTORRENT_ASSERT(!t.is_aborted());\n+\n+\t\t\tt.second_tick(tick_interval_ms);\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+\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+\t\t\tTORRENT_ASSERT(t.want_tick());\n+\t\t\tTORRENT_ASSERT(!t.is_aborted());\n+\n+\t\t\tt.second_tick(tick_interval_ms);\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+\n+
    \t\tif (m_settings.get_bool(settings_pack::rate_limit_ip_overhead))\n+
    \t\t{\n+\t\t\tint const up_limit = upload_rate_limit(m_global_class);\n+\t\t\tint const down_limit = download_rate_limit(m_global_class);\n+\n+\t\t\tif (down_limit > 0\n+\t\t\t\t&& m_stat.download_ip_overhead() >= down_limit\n+\t\t\t\t&& m_alerts.should_post<performance_alert>())\n+\t\t\t{\n+\t\t\t\tm_alerts.emplace_alert<performance_alert>(torrent_handle()\n+\t\t\t\t\t, performance_alert::download_limit_too_low);\n+\t\t\t}\n+\n+\t\t\tif (up_limit > 0\n+\t\t\t\t&& m_stat.upload_ip_overhead() >= up_limit\n+\t\t\t\t&& m_alerts.should_post<performance_alert>())\n+\t\t\t{\n+\t\t\t\tm_alerts.emplace_alert<performance_alert>(torrent_handle()\n+\t\t\t\t\t, performance_alert::upload_limit_too_low);\n+\t\t\t}\n+\t\t}\n+\n+#if TORRENT_ABI_VERSION == 1\n+\t\tm_peak_up_rate = std::max(m_stat.upload_rate(), m_peak_up_rate);\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+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+\t\t\tif (m_boost_connections > max_connections)\n+\t\t\t{\n+\t\t\t\tm_boost_connections -= max_connections;\n+\t\t\t\tmax_connections = 0;\n+\t\t\t}\n+\t\t\telse\n+\t\t\t{\n+\t\t\t\tmax_connections -= m_boost_connections;\n+\t\t\t\tm_boost_connections = 0;\n+\t\t\t}\n+\t\t}\n+\n+\t\t// zero connections speeds are allowed, we just won't make any connections\n+\t\tif (max_connections <= 0) return;\n+\n+
    \t\tint const limit = std::min(m_settings.get_int(settings_pack::connections_limit)\n+
    \t\t\t- num_connections(), std::numeric_limits<int>::max() - 1);\n+\n+\t\t// this logic is here to smooth out the number of new connection\n+\t\t// attempts over time, to prevent connecting a large number of\n+\t\t// sockets, wait 10 seconds, and then try again\n+\t\tif (m_settings.get_bool(settings_pack::smooth_connects) && max_connections > (limit+1) / 2)\n+\t\t\tmax_connections = (limit + 1) / 2;\n+\n+\t\taux::vector<torrent*>& want_peers_download = m_torrent_lists[torrent_want_peers_download];\n+\t\taux::vector<torrent*>& want_peers_finished = m_torrent_lists[torrent_want_peers_finished];\n+\n+\t\t// if no torrent want any peers, just return\n+\t\tif (want_peers_download.empty() && want_peers_finished.empty()) return;\n+\n+\t\t// if we don't have any connection attempt quota, return\n+\t\tif (max_connections <= 0) return;\n+\n+\t\tint steps_since_last_connect = 0;\n+\t\tint const num_torrents = int(want_peers_finished.size() + want_peers_download.size());\n+\t\tfor (;;)\n+\t\t{\n+\t\t\tif (m_next_downloading_connect_torrent >= int(want_peers_download.size()))\n+\t\t\t\tm_next_downloading_connect_torrent = 0;\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+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+\t\t\t\t// this peer is not unchokable. So, if it's unchoked\n+\t\t\t\t// already, make sure to choke it.\n+\t\t\t\tif (p->is_choked())\n \t\t\t\t{\n-\t\t\t\t\tmask[std::size_t(i)] = true;\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+\t\t\t\t\t// force a new optimistic unchoke\n+\t\t\t\t\tm_optimistic_unchoke_time_scaler = 0;\n+
    \t\t\t\t}\n+
    \t\t\t\tt->choke_peer(*p);\n+\t\t\t\tp->reset_choke_counters();\n+\t\t\t\tcontinue;\n \t\t\t}\n-\t\t\tti->free_piece_layers();\n+\n+\t\t\tpeers.push_back(p.get());\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+\t\tint const allowed_upload_slots = unchoke_sort(peers\n+\t\t\t, unchoke_interval, m_settings);\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+\t\tif (m_settings.get_int(settings_pack::choking_algorithm) == settings_pack::fixed_slots_choker)\n+\t\t{\n+\t\t\tint const upload_slots = get_int_setting(settings_pack::unchoke_slots_limit);\n+\t\t\tm_stats_counters.set_value(counters::num_unchoke_slots, upload_slots);\n+\t\t}\n+\t\telse\n+\t\t{\n+\t\t\tm_stats_counters.set_value(counters::num_unchoke_slots\n+\t\t\t\t, allowed_upload_slots);\n+\t\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+#ifndef TORRENT_DISABLE_LOGGING\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+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 \n-\tadd_torrent_params load_torrent_parsed(bdecode_node const& torrent_file, load_torrent_limits const& cfg)\n+\tvoid session_impl::post_torrent_updates(status_flags_t const flags)\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\tINVARIANT_CHECK;\n \n-}\n+\t\tTORRENT_ASSERT(is_single_thread());\n \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+\t\tstd::vector<torrent*>& state_updates\n+\t\t\t= m_torrent_lists[aux::session_impl::torrent_state_updates];\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+#if TORRENT_USE_ASSERTS\n+\t\tm_posting_torrent_updates = true;\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+\t\tstd::vector<torrent_status> status;\n+\t\tstatus.reserve(state_updates.size());\n+\n+
    \t\tfor (auto& t : state_updates)\n+
    \t\t{\n+\t\t\tTORRENT_ASSERT(t->m_links[aux::session_impl::torrent_state_updates].in_list());\n+\t\t\tstatus.emplace_back();\n+\t\t\t// querying accurate download counters may require\n+\t\t\t// the torrent to be loaded. Loading a torrent, and evicting another\n+\t\t\t// one will lead to calling state_updated(), which screws with\n+\t\t\t// this list while we're working on it, and break things\n+\t\t\tt->status(&status.back(), flags);\n+\t\t\tt->clear_in_state_update();\n+\t\t}\n+\t\tstate_updates.clear();\n+\n+#if TORRENT_USE_ASSERTS\n+\t\tm_posting_torrent_updates = false;\n #endif\n+\n+\t\tm_alerts.emplace_alert<state_update_alert>(std::move(status));\n \t}\n \n-} // anonymous namespace\n+\tvoid session_impl::post_session_stats()\n+\t{\n+\t\tif (!m_posted_stats_header)\n+\t\t{\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-\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/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+#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+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+\t\t\t// ignore errors because the underlying socket may not\n+\t\t\t// be opened yet. This happens when we're routing through\n+\t\t\t// a proxy. In that case, we don't yet know the address of\n+\t\t\t// the proxy server, and more importantly, we don't know\n+\t\t\t// the address family of its address. This means we can't\n+\t\t\t// open the socket yet. The socks abstraction layer defers\n+\t\t\t// opening it.\n+\t\t\tec.clear();\n+\t\t\tbind_ep.port(std::uint16_t(next_port()));\n \t\t}\n \n-\t\tvoid crypto_random_bytes(span<char> buffer)\n+\t\tif (is_utp(s))\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+
    \t\t\tutp_socket_impl* impl = nullptr;\n+\t\t\ttransport ssl = transport::plaintext;\n+#if TORRENT_USE_SSL\n+\t\t\tif (boost::get<ssl_stream<utp_stream>>(&s) != nullptr)\n+\t\t\t{\n+\t\t\t\timpl = boost::get<ssl_stream<utp_stream>>(s).next_layer().get_impl();\n+\t\t\t\tssl = transport::ssl;\n+\t\t\t}\n+\t\t\telse\n+#endif\n+\t\t\t\timpl = boost::get<utp_stream>(s).get_impl();\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+\t\t\tstd::vector<std::shared_ptr<listen_socket_t>> with_gateways;\n+\t\t\tstd::shared_ptr<listen_socket_t> match;\n+\t\t\tfor (auto& ls : m_listen_sockets)\n+\t\t\t{\n+\t\t\t\t// this is almost, but not quite, like can_route()\n+\t\t\t\tif (!(ls->flags & listen_socket_t::proxy)\n+\t\t\t\t\t&& is_v4(ls->local_endpoint) != remote_address.is_v4())\n+\t\t\t\t\tcontinue;\n+\t\t\t\tif (ls->ssl != ssl) continue;\n+\t\t\t\tif (!(ls->flags & listen_socket_t::local_network))\n+\t\t\t\t\twith_gateways.push_back(ls);\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+\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+\t\t{\n+#ifndef TORRENT_DISABLE_LOGGING\n+\t\t\tsession_log(\"not starting DHT, aborting\");\n #endif\n+\t\t\treturn;\n+\t\t}\n \n+#ifndef TORRENT_DISABLE_LOGGING\n+\t\tsession_log(\"starting DHT, running: %s, router lookups: %d\"\n+\t\t\t, m_dht ? \"true\" : \"false\", m_outstanding_router_lookups);\n #endif\n+\n+
    \t\tm_dht_storage = m_dht_storage_constructor(m_settings);\n+
    \t\tm_dht = std::make_shared<dht::dht_tracker>(\n+\t\t\tstatic_cast<dht::dht_observer*>(this)\n+\t\t\t, m_io_context\n+\t\t\t, [this](aux::listen_socket_handle const& sock\n+\t\t\t\t, udp::endpoint const& ep\n+\t\t\t\t, span<char const> p\n+\t\t\t\t, error_code& ec\n+\t\t\t\t, udp_send_flags_t const flags)\n+\t\t\t\t{ send_udp_packet_listen(sock, ep, p, ec, flags); }\n+\t\t\t, m_settings\n+\t\t\t, m_stats_counters\n+\t\t\t, *m_dht_storage\n+\t\t\t, std::move(m_dht_state));\n+\n+\t\tfor (auto& s : m_listen_sockets)\n+\t\t{\n+\t\t\tif (s->ssl != transport::ssl\n+\t\t\t\t&& !(s->flags & listen_socket_t::local_network))\n+\t\t\t{\n+\t\t\t\tm_dht->new_socket(s);\n+\t\t\t}\n \t\t}\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\tfor (auto const& n : m_dht_router_nodes)\n \t\t{\n-\t\t\trate = m_download_rate_peak;\n+\t\t\tm_dht->add_router_node(n);\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+\n+\t\tfor (auto const& n : m_dht_nodes)\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+
    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-\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+#endif\n \n-
    \t\t\trate = t->statistics().transfer_rate(stat::download_payload) / peers_with_requests;\n-
    \t\t}\n-\t\telse\n+\tbool session_impl::is_listening() const\n+\t{\n+\t\treturn !m_listen_sockets.empty();\n+\t}\n+\n+\tsession_impl::~session_impl()\n+\t{\n+\t\t// since we're destructing the session, no more alerts will make it out to\n+\t\t// the user. So stop posting them now\n+\t\tm_alerts.set_alert_mask({});\n+\t\tm_alerts.set_notify_function({});\n+\n+\t\t// this is not allowed to be the network thread!\n+//\t\tTORRENT_ASSERT(is_not_thread());\n+
    \n+
    \t\t// this can happen if we end the io_context run loop with an exception\n+\t\tm_connections.clear();\n+\t\tfor (auto& t : m_torrents)\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\tt->panic();\n+\t\t\tt->abort();\n \t\t}\n+\t\tm_torrents.clear();\n \n-\t\t// avoid division by zero\n-\t\tif (rate < 50) rate = 50;\n+\t\t// this has probably been called already, but in case of sudden\n+\t\t// termination through an exception, it may not have been done\n+\t\tabort_stage2();\n \n-\t\t// average of current rate and peak\n-//\t\trate = (rate + m_download_rate_peak) / 2;\n+#if defined TORRENT_ASIO_DEBUGGING\n+\t\tFILE* f = fopen(\"wakeups.log\", \"w+\");\n+\t\tif (f != nullptr)\n+\t\t{\n+\t\t\ttime_point m = min_time();\n+\t\t\tif (!_wakeups.empty()) m = _wakeups[0].timestamp;\n+\t\t\ttime_point prev = m;\n+\t\t\tstd::uint64_t prev_csw = 0;\n+\t\t\tif (!_wakeups.empty()) prev_csw = _wakeups[0].context_switches;\n+\t\t\tstd::fprintf(f, \"abs. time\\trel. time\\tctx switch\\tidle-wakeup\\toperation\\n\");\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/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\treturn milliseconds((m_outstanding_bytes + extra_bytes\n-\t\t\t+ m_queued_time_critical * t->block_size() * 1000) / rate);\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-\tvoid peer_connection::add_stat(std::int64_t const downloaded, std::int64_t const uploaded)\n+\tfile_index_t file_storage::file_index_at_piece(piece_index_t const piece) const\n \t{\n-\t\tTORRENT_ASSERT(is_single_thread());\n-\t\tm_statistics.add_stat(downloaded, uploaded);\n+\t\treturn file_index_at_offset(static_cast<int>(piece) * std::int64_t(piece_length()));\n \t}\n \n-\tsha1_hash peer_connection::associated_info_hash() const\n+\tfile_index_t file_storage::file_index_for_root(sha256_hash const& root_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\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-\tstd::vector<piece_index_t> const& peer_connection::allowed_fast()\n+\tpiece_index_t file_storage::piece_index_at_file(file_index_t f) const\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+\t\treturn piece_index_t{aux::numeric_cast<int>(file_offset(f) / piece_length())};\n+\t}\n \n-
    \t\treturn m_allowed_fast;\n-
    \t}\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-\tbool peer_connection::can_request_time_critical() const\n+\tint file_storage::file_name_len(file_index_t const index) 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+\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-\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+\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-\tbool peer_connection::make_time_critical(piece_block const& block)\n+\tvoid file_storage::sanitize_symlinks()\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/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\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/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/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-#else\n-\t\t\tret = file_pointer(::fopen(fn.c_str(), \"wb+\"));\n-#endif\n-\t\t\tif (ret.file() == nullptr)\n-\t\t\t\tec.assign(errno, generic_category());\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\tif (ec) return {};\n-\t\treturn ret;\n+\t}\n+\tcatch (storage_error const& e)\n+\t{\n+\t\tec = e.ec;\n+\t\treturn {};\n \t}\n \n-\tvoid posix_part_file::free_piece(piece_index_t const piece)\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 posix_part_file::move_partfile(std::string const& path, error_code& ec)\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@@ -7187,38 +7587,36 @@\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-\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-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-\t\t\t\tf(file_offset, {buf.get(), block_to_copy});\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 posix_part_file::flush_metadata(error_code& ec)\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 posix_part_file::flush_metadata_impl(error_code& ec)\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@@ -7227,111 +7625,127 @@\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(open_mode::read_write, ec);\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/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+
    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-\tnamespace mp = boost::multiprecision;\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-\tnamespace {\n-
    \t\tkey_t const dh_prime\n-
    \t\t\t(\"0xFFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A63A36210000000000090563\");\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-\tstd::array<char, 96> export_key(key_t const& k)\n+\tadd_torrent_params load_torrent_buffer(span<char const> buffer, load_torrent_limits const& cfg)\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+\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-
    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+\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-namespace libtorrent {\n+}\n \n-\tnamespace mp = boost::multiprecision;\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-\tnamespace {\n-\t\tkey_t const dh_prime\n-\t\t\t(\"0xFFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A63A36210000000000090563\");\n-\t}\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-\tstd::array<char, 96> export_key(key_t const& k)\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+\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 (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\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-\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+\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// 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+\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// create local key (random)\n-\t\tmp::import_bits(m_dh_local_secret, random_key.begin(), random_key.end());\n+\t\t\tif (!m_pc.packet_finished()) return true;\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/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\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/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@@ -7374,15 +7788,67 @@\n \t\t}\n \t\tasync_call(&torrent::prioritize_files, file_prio);\n \t}\n \n \tstd::vector<int> torrent_handle::file_priorities() const\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+
    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+\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+\t// general.\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@@ -7425,118 +7891,117 @@\n \n \t\t// #error send reset\n \n \t\treturn false;\n \t}\n \n \tvoid utp_socket_manager::subscribe_writable(utp_socket_impl* s)\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+
    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-\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+#if TORRENT_ABI_VERSION < 3\n+\t\tif (!params.info_hashes.has_v1() && !params.info_hashes.has_v2() && !params.ti)\n+\t\t\tparams.info_hashes.v1 = params.info_hash;\n+#endif\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+\t\t// the internal torrent object keeps and mutates state in the\n+\t\t// torrent_info object. We can't let that leak back to the client\n+\t\tif (params.ti)\n+\t\t\tparams.ti = std::make_shared<torrent_info>(*params.ti);\n \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+\t\t// we cannot capture a unique_ptr into a lambda in c++11, so we use a raw\n+\t\t// pointer for now. async_call uses a lambda expression to post the call\n+\t\t// to the main thread\n+
    \t\tauto* p = new add_torrent_params(std::move(params));\n+
    \t\tauto guard = aux::scope_end([p]{ delete p; });\n+\t\tp->save_path = complete(p->save_path);\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+#if TORRENT_ABI_VERSION == 1\n+\t\thandle_backwards_compatible_resume_data(*p);\n+#endif\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+\t\tasync_call(&session_impl::async_add_torrent, p);\n+\t\tguard.disarm();\n+\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+#ifndef BOOST_NO_EXCEPTIONS\n+#if TORRENT_ABI_VERSION == 1\n+\t// if the torrent already exists, this will throw duplicate_torrent\n+\ttorrent_handle session_handle::add_torrent(\n+\t\ttorrent_info const& ti\n+\t\t, std::string const& save_path\n+\t\t, entry const& resume_data\n+\t\t, storage_mode_t storage_mode\n+\t\t, bool const add_paused)\n+\t{\n+\t\tadd_torrent_params p;\n+\t\tp.ti = std::make_shared<torrent_info>(ti);\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/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\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+\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-\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+\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\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/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+\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\treturn std::int64_t(prev_amount_download) << 10;\n+\t\t}\n+\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@@ -7560,15 +8025,15 @@\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+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@@ -7612,15 +8077,15 @@\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+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@@ -7665,15 +8130,15 @@\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+
    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@@ -7716,15 +8181,15 @@\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+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@@ -7769,15 +8234,15 @@\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+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@@ -7821,15 +8286,15 @@\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+
    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@@ -7857,15 +8322,15 @@\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+
    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@@ -7908,15 +8373,15 @@\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+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@@ -7960,308 +8425,303 @@\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+
    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-\tstatic_assert(std::is_nothrow_move_constructible<add_torrent_params>::value\n-\t\t, \"should be nothrow move constructible\");\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-\tstatic_assert(std::is_nothrow_move_constructible<std::string>::value\n-\t\t, \"should be nothrow move constructible\");\n+*/\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+#include \"libtorrent/aux_/ip_notifier.hpp\"\n+#include \"libtorrent/assert.hpp\"\n \n-\tstatic_assert(std::is_nothrow_move_constructible<add_torrent_params>::value\n-\t\t, \"should be nothrow move constructible\");\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-\tstatic_assert(std::is_nothrow_move_constructible<std::string>::value\n-\t\t, \"should be nothrow move constructible\");\n+#include \"libtorrent/aux_/netlink_utils.hpp\"\n \n+namespace libtorrent { namespace aux {\n \n-
    \n-
    namespace aux {\n+namespace {\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+#if (TORRENT_USE_SYSTEMCONFIGURATION || TORRENT_USE_SC_NETWORK_REACHABILITY) && \\\n+\t!defined TORRENT_BUILD_SIMULATOR\n \n-}\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+// 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\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-\t\t\t\t, static_cast<int>(j->piece), j->d.io.offset\n-\t\t\t\t, j->storage ? j->storage->num_outstanding_jobs() : -1);\n-\t\t}\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 \n-\t\tstd::shared_ptr<mmap_storage> storage = j->storage;\n-\n-\t\tTORRENT_ASSERT(static_cast<int>(j->action) < int(job_functions.size()));\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}\n \n-\t\tm_stats_counters.inc_stats_counter(counters::num_running_disk_jobs, 1);\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// call disk function\n-
    \t\tstatus_t ret = status_t::no_error;\n-
    \t\ttry\n-\t\t{\n-\t\t\tint const idx = static_cast<int>(j->action);\n-\t\t\tret = (this->*(job_functions[static_cast<std::size_t>(idx)]))(j);\n-\t\t}\n-\t\tcatch (boost::system::system_error const& err)\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\tret = status_t::fatal_disk_error;\n-\t\t\tj->error.ec = err.code();\n-\t\t\tj->error.operation = operation_t::exception;\n+\t\t\trate = m_download_rate_peak;\n \t\t}\n-\t\tcatch (std::bad_alloc const&)\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\tret = status_t::fatal_disk_error;\n-\t\t\tj->error.ec = errors::no_memory;\n-\t\t\tj->error.operation = operation_t::exception;\n-\t\t}\n-\t\tcatch (std::exception const&)\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\tret = status_t::fatal_disk_error;\n-\t\t\tj->error.ec = boost::asio::error::fault;\n-\t\t\tj->error.operation = operation_t::exception;\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// 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+\t\t// avoid division by zero\n+\t\tif (rate < 50) rate = 50;\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-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+\t\t// average of current rate and peak\n+//\t\trate = (rate + m_download_rate_peak) / 2;\n \n-\t\tadd_fence_job(j);\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 mmap_disk_io::async_clear_piece(storage_index_t const storage\n-\t\t, piece_index_t const index, std::function<void(piece_index_t)> handler)\n+\tvoid peer_connection::add_stat(std::int64_t const downloaded, std::int64_t const uploaded)\n \t{\n-\t\taux::mmap_disk_job* j = m_job_pool.allocate_job(aux::job_action_t::clear_piece);\n-\t\tj->storage = m_torrents[storage]->shared_from_this();\n-\t\tj->piece = index;\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-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\tTORRENT_ASSERT(is_single_thread());\n+\t\tm_statistics.add_stat(downloaded, uploaded);\n \t}\n \n-\tvoid mmap_disk_io::async_clear_piece(storage_index_t const storage\n-\t\t, piece_index_t const index, std::function<void(piece_index_t)> handler)\n+\tsha1_hash peer_connection::associated_info_hash() const\n \t{\n-\t\taux::mmap_disk_job* j = m_job_pool.allocate_job(aux::job_action_t::clear_piece);\n-\t\tj->storage = m_torrents[storage]->shared_from_this();\n-\t\tj->piece = index;\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+\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\tadd_fence_job(j);\n+
    \t\treturn m_allowed_fast;\n
    \t}\n \n-\tstatus_t mmap_disk_io::do_hash(aux::mmap_disk_job* j)\n+\tbool peer_connection::can_request_time_critical() const\n \t{\n-\t\t// we're not using a cache. This is the simple path\n-\t\t// just read straight from the file\n-\t\tTORRENT_ASSERT(m_magic == 0x1337);\n-\n-\t\tbool const v1 = bool(j->flags & disk_interface::v1_hash);\n-\t\tbool const v2 = !j->d.h.block_hashes.empty();\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\tint const piece_size = v1 ? j->storage->files().piece_size(j->piece) : 0;\n-\t\tint const piece_size2 = v2 ? j->storage->files().piece_size2(j->piece) : 0;\n-\t\tint const blocks_in_piece = v1 ? (piece_size + default_block_size - 1) / default_block_size : 0;\n-\t\tint const blocks_in_piece2 = v2 ? j->storage->files().blocks_in_piece2(j->piece) : 0;\n-\t\taux::open_mode_t const file_mode = file_mode_for_job(j);\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\tTORRENT_ASSERT(!v2 || int(j->d.h.block_hashes.size()) >= blocks_in_piece2);\n-\t\tTORRENT_ASSERT(v1 || v2);\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/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\thasher h;\n-\t\tint ret = 0;\n-\t\tint offset = 0;\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\tvoid crypto_random_bytes(span<char> buffer)\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/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+#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\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+#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\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+#endif\n+\t\t}\n+}\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+\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\t\t// we only received the header, no data\n-\t\t\tif (recv_buffer.empty()) break;\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\t\tif (recv_buffer.size() < front_request.length) break;\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\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/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+void socks5::on_connect_timeout(error_code const& e)\n+{\n+\tCOMPLETE_ASYNC(\"socks5::on_connect_timeout\");\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+\tif (e == boost::asio::error::operation_aborted) return;\n \n-\t\t\tcopy_on_write();\n-\t\t\tm_files.rename_file(i, filename);\n-\t\t}\n-\t}\n+\tif (m_abort) return;\n \n-\tvoid torrent_info::remap_files(file_storage const& f)\n-\t{\n-\t\tINVARIANT_CHECK;\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-\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+\terror_code ignore;\n+\tm_socks5_sock.close(ignore);\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+\t++m_failures;\n+\tretry_connection();\n+}\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/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+void socks5::on_connected(error_code const& e)\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@@ -8306,15 +8766,15 @@\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+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@@ -8359,47 +8819,350 @@\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/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+
    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\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+\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/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-\t\t\tm_thread->join();\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/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\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+\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}\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+\tsettings_pack default_settings()\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+\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\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+\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+\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+\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+\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/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+\t\t\t\t, static_cast<int>(j->piece), j->d.io.offset\n+\t\t\t\t, j->storage ? j->storage->num_outstanding_jobs() : -1);\n+\t\t}\n #endif\n+\n+\t\tstd::shared_ptr<mmap_storage> storage = j->storage;\n+\n+\t\tTORRENT_ASSERT(static_cast<int>(j->action) < int(job_functions.size()));\n+\n+\t\tm_stats_counters.inc_stats_counter(counters::num_running_disk_jobs, 1);\n+\n+\t\t// call disk function\n+
    \t\tstatus_t ret = status_t::no_error;\n+
    \t\ttry\n+\t\t{\n+\t\t\tint const idx = static_cast<int>(j->action);\n+\t\t\tret = (this->*(job_functions[static_cast<std::size_t>(idx)]))(j);\n+\t\t}\n+\t\tcatch (boost::system::system_error const& err)\n+\t\t{\n+\t\t\tret = status_t::fatal_disk_error;\n+\t\t\tj->error.ec = err.code();\n+\t\t\tj->error.operation = operation_t::exception;\n+\t\t}\n+\t\tcatch (std::bad_alloc const&)\n+\t\t{\n+\t\t\tret = status_t::fatal_disk_error;\n+\t\t\tj->error.ec = errors::no_memory;\n+\t\t\tj->error.operation = operation_t::exception;\n+\t\t}\n+\t\tcatch (std::exception const&)\n+\t\t{\n+\t\t\tret = status_t::fatal_disk_error;\n+\t\t\tj->error.ec = boost::asio::error::fault;\n+\t\t\tj->error.operation = operation_t::exception;\n+\t\t}\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+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+\t\tadd_fence_job(j);\n \t}\n \n-}\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+\tvoid mmap_disk_io::async_clear_piece(storage_index_t const storage\n+\t\t, piece_index_t const index, std::function<void(piece_index_t)> handler)\n+\t{\n+\t\taux::mmap_disk_job* j = m_job_pool.allocate_job(aux::job_action_t::clear_piece);\n+\t\tj->storage = m_torrents[storage]->shared_from_this();\n+\t\tj->piece = index;\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+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+\n+\tvoid mmap_disk_io::async_clear_piece(storage_index_t const storage\n+\t\t, piece_index_t const index, std::function<void(piece_index_t)> handler)\n+\t{\n+\t\taux::mmap_disk_job* j = m_job_pool.allocate_job(aux::job_action_t::clear_piece);\n+\t\tj->storage = m_torrents[storage]->shared_from_this();\n+\t\tj->piece = index;\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+
    \t\tadd_fence_job(j);\n+
    \t}\n+\n+\tstatus_t mmap_disk_io::do_hash(aux::mmap_disk_job* j)\n+\t{\n+\t\t// we're not using a cache. This is the simple path\n+\t\t// just read straight from the file\n+\t\tTORRENT_ASSERT(m_magic == 0x1337);\n+\n+\t\tbool const v1 = bool(j->flags & disk_interface::v1_hash);\n+\t\tbool const v2 = !j->d.h.block_hashes.empty();\n+\n+\t\tint const piece_size = v1 ? j->storage->files().piece_size(j->piece) : 0;\n+\t\tint const piece_size2 = v2 ? j->storage->files().piece_size2(j->piece) : 0;\n+\t\tint const blocks_in_piece = v1 ? (piece_size + default_block_size - 1) / default_block_size : 0;\n+\t\tint const blocks_in_piece2 = v2 ? j->storage->files().blocks_in_piece2(j->piece) : 0;\n+\t\taux::open_mode_t const file_mode = file_mode_for_job(j);\n+\n+\t\tTORRENT_ASSERT(!v2 || int(j->d.h.block_hashes.size()) >= blocks_in_piece2);\n+\t\tTORRENT_ASSERT(v1 || v2);\n+\n+\t\thasher h;\n+\t\tint ret = 0;\n+\t\tint offset = 0;\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/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@@ -8442,400 +9205,361 @@\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/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+
    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\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+\t\tmerkle_validate_copy(t, m_tree, root(), m_block_verified);\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+\t\tload_verified_bits(verified);\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\toptimize_storage();\n+\t\toptimize_storage_piece_layer();\n \t}\n \n-#if TORRENT_ABI_VERSION <= 2\n-\tchar const* file_storage::file_name_ptr(file_index_t const index) const\n+\tvoid merkle_tree::clear()\n \t{\n-\t\treturn m_files[index].name;\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-\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+namespace {\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+
    \tstruct identity\n+
    \t{\n+\t\tbool operator()(bool b) const { return b; }\n+\t};\n+}\n \n-\tvoid file_storage::canonicalize_impl(bool const backwards_compatible)\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\tTORRENT_ASSERT(piece_length() >= 16 * 1024);\n+\t\tINVARIANT_CHECK;\n+\t\tTORRENT_ASSERT(mask.size() == size());\n+\t\tif (size() != mask.size()) return;\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+\t\tint const first_block = block_layer_start();\n+\t\tint const end_block = first_block + m_num_blocks;\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+\t\tTORRENT_ASSERT(first_block < int(mask.size()));\n+\t\tTORRENT_ASSERT(end_block <= int(mask.size()));\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// 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// 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+\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\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+\t\t\t// discrepancy\n+\t\t\tif (t.size() < block_index + m_num_blocks)\n+\t\t\t\treturn clear();\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+
    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// re-compute offsets and insert pad files as necessary\n-\t\tstd::int64_t off = 0;\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-
    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// 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\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+\t\tallocate_full();\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+
    \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\tfor (auto const i : file_range())\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\tif (!(file_flags(i) & file_storage::flag_symlink)) continue;\n-\n-\t\t\tif (!file_map_initialized)\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\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\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\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/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+\t\tmerkle_fill_tree(tree, leaf_count);\n \n-\t\tpost(m_ios, [h = std::move(handler)] { h(storage_error{}); });\n-\t\treturn false;\n-\t}\n+\t\tint const base_num_layers = merkle_num_layers(leaf_count);\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+\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-\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+\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-\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+\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-\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+\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-\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+\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-\tvoid async_check_files(storage_index_t\n-\t\t, add_torrent_params const*\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+\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-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+
    \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+\t\t\t\t\tif (m_tree[dst_idx] != tree[src_idx])\n+\t\t\t\t\t{\n+\t\t\t\t\t\t// this must be a block hash because inner nodes are not filled in until\n+\t\t\t\t\t\t// they can be verified. This assert ensures we're at the\n+\t\t\t\t\t\t// leaf layer of the file tree\n+\t\t\t\t\t\tTORRENT_ASSERT(dst_idx >= first_leaf);\n \n-*/\n+\t\t\t\t\t\tint const pos = dst_idx - first_leaf;\n+\t\t\t\t\t\tauto const piece = piece_index_t{pos >> m_blocks_per_piece_log} + file_piece_offset;\n+\t\t\t\t\t\tint const block = pos & ((1 << m_blocks_per_piece_log) - 1);\n \n-#include \"libtorrent/aux_/ip_notifier.hpp\"\n-#include \"libtorrent/assert.hpp\"\n+\t\t\t\t\t\tTORRENT_ASSERT(pos < m_num_blocks);\n+\t\t\t\t\t\tif (!ret.failed.empty() && ret.failed.back().first == piece)\n+\t\t\t\t\t\t\tret.failed.back().second.push_back(block);\n+\t\t\t\t\t\telse\n+\t\t\t\t\t\t\tret.failed.emplace_back(piece, std::vector<int>{block});\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+\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+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-#include \"libtorrent/aux_/netlink_utils.hpp\"\n+\t\t\t// it may now be possible to verify the hashes of previously received blocks\n+\t\t\t// try to verify as many child nodes of the received hashes as possible\n+\t\t\tfor (int i = 0; i < int(hashes.size()); ++i)\n+\t\t\t{\n+\t\t\t\tint const piece = dest_start_idx + i;\n+\t\t\t\tif (piece - first_piece_idx >= num_pieces())\n+\t\t\t\t\tbreak;\n+\t\t\t\t// the first block in this piece\n+\t\t\t\tint const block_idx = merkle_get_first_child(piece, base);\n \n-namespace libtorrent { namespace aux {\n+\t\t\t\tint const block_end_idx = std::min(block_idx + blocks_in_piece, first_leaf + m_num_blocks);\n+\t\t\t\tif (std::any_of(m_tree.begin() + block_idx\n+\t\t\t\t\t, m_tree.begin() + block_end_idx\n+\t\t\t\t\t, [](sha256_hash const& h) { return h.is_all_zeros(); }))\n+\t\t\t\t\tcontinue;\n \n-namespace {\n+
    \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 \n-#if (TORRENT_USE_SYSTEMCONFIGURATION || TORRENT_USE_SC_NETWORK_REACHABILITY) && \\\n-\t!defined TORRENT_BUILD_SIMULATOR\n+\t\t\t\t\t// an empty blocks vector indicates that we don't have the\n+\t\t\t\t\t// block hashes, and we can't know which block failed\n+\t\t\t\t\t// this will cause the block hashes to be requested\n+\t\t\t\t\tret.failed.emplace_back(piece_index_t{piece - first_piece_idx} + file_piece_offset\n+\t\t\t\t\t\t, std::vector<int>());\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+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 \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+\t\t\t\t\t// an empty blocks vector indicates that we don't have the\n+\t\t\t\t\t// block hashes, and we can't know which block failed\n+\t\t\t\t\t// this will cause the block hashes to be requested\n+\t\t\t\t\tret.failed.emplace_back(piece_index_t{piece - first_piece_idx} + file_piece_offset\n+\t\t\t\t\t\t, std::vector<int>());\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+
    \t\t\t\t\tfor (int k = leafs_start; k < leafs_end; ++k)\n+
    \t\t\t\t\t\tm_block_verified.set_bit(k);\n+\t\t\t\t}\n+\t\t\t\tTORRENT_ASSERT((piece - first_piece_idx) >= 0);\n+\t\t\t}\n+\t\t}\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+\t\toptimize_storage();\n \n-#if defined TORRENT_ANDROID && !defined IFA_F_DADFAILED\n-#define IFA_F_DADFAILED 8\n-#endif\n+\t\treturn ret;\n+\t}\n \n+\tstd::tuple<merkle_tree::set_block_result, int, int> merkle_tree::set_block(int const block_index\n+\t\t, sha256_hash const& h)\n+\t{\n+#ifdef TORRENT_EXPENSIVE_INVARIANT_CHECKS\n+\t\tINVARIANT_CHECK;\n #endif\n+\t\tTORRENT_ASSERT(block_index < m_num_blocks);\n \n-#if TORRENT_USE_IFADDRS\n-#include <ifaddrs.h>\n-#include <net/if.h>\n-#include <sys/ioctl.h>\n-#endif\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\tauto const block_tree_index = first_leaf + block_index;\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+\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+\t\tauto const block_tree_index = first_leaf + block_index;\n \n-#include \"libtorrent/aux_/disable_warnings_pop.hpp\"\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+\t\t}\n \n-#if defined(TORRENT_OS2) && !defined(IF_NAMESIZE)\n-#define IF_NAMESIZE IFNAMSIZ\n-#endif\n+\t\tallocate_full();\n \n-namespace libtorrent {\n+\t\tm_tree[block_tree_index] = h;\n \n-namespace {\n+\t\t// to avoid wasting a lot of time hashing nodes only to discover they\n+\t\t// cannot be verified, check first to see if the root of the largest\n+\t\t// computable subtree is known\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\tint leafs_start;\n+
    \t\tint leafs_size;\n+\t\tint root_index;\n+\t\tstd::tie(leafs_start, leafs_size, root_index) =\n+\t\t\tmerkle_find_known_subtree(m_tree, block_index, m_num_blocks);\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+\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-#if TORRENT_USE_NETLINK\n+\t\t// save the root hash because merkle_fill_tree will overwrite it\n+\t\tsha256_hash const root = m_tree[root_index];\n+\t\tmerkle_fill_tree(m_tree, leafs_size, first_leaf + leafs_start);\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\tif (root != m_tree[root_index])\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\t\t// hash failure, clear all the internal nodes\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-\t\t\tauto const* nl_hdr = reinterpret_cast<nlmsghdr const*>(buf.data());\n-\t\t\tint len = read_len;\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\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+\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-\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+\t\t// save the root hash because merkle_fill_tree will overwrite it\n+\t\tsha256_hash const root = m_tree[root_index];\n+\t\tmerkle_fill_tree(m_tree, leafs_size, first_leaf + leafs_start);\n \n-\t\t\tauto const* nl_hdr = reinterpret_cast<nlmsghdr const*>(buf.data());\n-\t\t\tint len = read_len;\n+\t\tif (root != m_tree[root_index])\n+\t\t{\n+\t\t\t// hash failure, clear all the internal nodes\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-\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+
    \t\tint const leafs_end = std::min(m_num_blocks, leafs_start + leafs_size);\n+
    \t\tfor (int i = leafs_start; i < leafs_end; ++i)\n+\t\t\tm_block_verified.set_bit(i);\n \n-\t\t\t\tif (nl_hdr->nlmsg_type == NLMSG_DONE) return 0;\n+\t\t// attempting to optimize storage is quite costly, only do it if we have\n+\t\t// a reason to believe it might have an effect\n+\t\tif (block_index == m_num_blocks - 1 || !m_tree[block_tree_index + 1].is_all_zeros())\n+\t\t\toptimize_storage();\n \n-\t\t\t\ton_msg(nl_hdr);\n+\t\treturn std::make_tuple(set_block_result::ok, leafs_start, leafs_size);\n+\t}\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+\tstd::size_t merkle_tree::size() const\n+\t{\n+\t\treturn static_cast<std::size_t>(merkle_num_nodes(merkle_num_leafs(m_num_blocks)));\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+\tint merkle_tree::num_pieces() const\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+\t\tint const ps = blocks_per_piece();\n+\t\tTORRENT_ASSERT(ps > 0);\n+\t\treturn (m_num_blocks + ps - 1) >> m_blocks_per_piece_log;\n+\t}\n \n-\t\tif (::send(sock, request_msg, request_msg->nlmsg_len, 0) < 0)\n-\t\t\treturn -1;\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-\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+
    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@@ -8878,15 +9602,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@@ -8923,15 +9647,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@@ -8971,15 +9695,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@@ -9022,15 +9746,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@@ -9073,15 +9797,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@@ -9124,790 +9848,216 @@\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/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+
    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-#ifndef TORRENT_DISABLE_LOGGING\n-\t\tsession_log(\"start session\");\n-#endif\n-\n-#if TORRENT_USE_SSL\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-
    \t\tX509_STORE* store = X509_STORE_new();\n-
    \t\tif (store)\n-\t\t{\n-\t\t\tHCERTSTORE system_store = CertOpenSystemStoreA(0, \"ROOT\");\n-\t\t\t// this is best effort\n-\t\t\tif (system_store)\n-\t\t\t{\n-\t\t\t\tCERT_CONTEXT const* ctx = nullptr;\n-\t\t\t\twhile ((ctx = CertEnumCertificatesInStore(system_store, ctx)) != nullptr)\n-\t\t\t\t{\n-\t\t\t\t\tunsigned char const* cert_ptr = reinterpret_cast<unsigned char const*>(ctx->pbCertEncoded);\n-\t\t\t\t\tX509* x509 = d2i_X509(nullptr, &cert_ptr, ctx->cbCertEncoded);\n-\t\t\t\t\t// this is best effort\n-\t\t\t\t\tif (!x509) continue;\n-\t\t\t\t\tX509_STORE_add_cert(store, x509);\n-\t\t\t\t\tX509_free(x509);\n-\t\t\t\t}\n-\t\t\t\tCertFreeCertificateContext(ctx);\n-\t\t\t\tCertCloseStore(system_store, 0);\n-\t\t\t}\n-\t\t}\n-\n-\t\tSSL_CTX* ssl_ctx = m_ssl_ctx.native_handle();\n-\t\tSSL_CTX_set_cert_store(ssl_ctx, store);\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-\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-\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// session_impl is responsible for deleting 'pack'\n-\tvoid session_impl::apply_settings_pack(std::shared_ptr<settings_pack> pack)\n-\t{\n \t\tINVARIANT_CHECK;\n-\t\tapply_settings_pack_impl(*pack);\n-\t}\n-\n-\tsettings_pack session_impl::get_settings() const\n-\t{\n-\t\tsettings_pack ret;\n-
    \t\tfor (int i = settings_pack::string_type_base;\n-
    \t\t\ti < settings_pack::max_string_setting_internal; ++i)\n-\t\t{\n-\t\t\tret.set_str(i, m_settings.get_str(i));\n-\t\t}\n-\t\tfor (int i = settings_pack::int_type_base;\n-\t\t\ti < settings_pack::max_int_setting_internal; ++i)\n-\t\t{\n-\t\t\tret.set_int(i, m_settings.get_int(i));\n-\t\t}\n-\t\tfor (int i = settings_pack::bool_type_base;\n-\t\t\ti < settings_pack::max_bool_setting_internal; ++i)\n-\t\t{\n-\t\t\tret.set_bool(i, m_settings.get_bool(i));\n-\t\t}\n-\t\treturn ret;\n-\t}\n-\n-namespace {\n-\ttemplate <typename Pack>\n-\tint get_setting_impl(Pack const& p, int name, int*)\n-\t{ return p.get_int(name); }\n-\n-\ttemplate <typename Pack>\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-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-\tvoid session_impl::on_ip_change(error_code const& ec)\n-\t{\n-#ifndef TORRENT_DISABLE_LOGGING\n-\t\tif (!ec)\n-\t\t\tsession_log(\"received ip change from internal ip_notifier\");\n-\t\telse\n-\t\t\tsession_log(\"received error on_ip_change: %d, %s\", ec.value(), ec.message().c_str());\n-#endif\n-\t\tif (ec || m_abort || !m_ip_notifier) return;\n-\t\tm_ip_notifier->async_wait([this] (error_code const& e)\n-\t\t\t{ wrap(&session_impl::on_ip_change, e); });\n-\t\treopen_network_sockets({});\n-\t}\n \n-
    \tvoid interface_to_endpoints(listen_interface_t const& iface\n-
    \t\t, listen_socket_flags_t flags\n-\t\t, span<ip_interface const> const ifs\n-\t\t, std::vector<listen_endpoint_t>& eps)\n-\t{\n-\t\tflags |= iface.local ? listen_socket_t::local_network : listen_socket_flags_t{};\n-\t\ttransport const ssl = iface.ssl ? transport::ssl : transport::plaintext;\n-\n-\t\t// First, check to see if it's an IP address\n-\t\terror_code err;\n-\t\taddress const adr = make_address(iface.device.c_str(), err);\n-\t\tif (!err)\n-\t\t{\n-\t\t\teps.emplace_back(adr, iface.port, std::string{}, ssl, flags);\n-\t\t}\n-\t\telse\n-\t\t{\n-\t\t\tflags |= listen_socket_t::was_expanded;\n-\n-\t\t\t// this is the case where device names a network device. We need to\n-\t\t\t// enumerate all IPs associated with this device\n-\t\t\tfor (auto const& ipface : 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 (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-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-\t\telse\n-\t\t{\n-\t\t\t// new sockets need to map ports even if the caller did not request\n-\t\t\t// re-mapping\n-\t\t\tfor (auto const& s : new_sockets)\n-\t\t\t\tremap_ports(remap_natpmp_and_upnp, *s);\n-\t\t}\n-\n-\t\tupdate_lsd();\n-\n-#if TORRENT_USE_I2P\n-\t\topen_new_incoming_i2p_connection();\n-#endif\n-\n-\t\t// trackers that were not reachable, may have become reachable now.\n-\t\t// so clear the \"disabled\" flags to let them be tried one more time\n-
    \t\tfor (auto& t : m_torrents)\n-
    \t\t\tt->enable_all_trackers();\n-\t}\n-\n-\tvoid session_impl::reopen_network_sockets(reopen_network_flags_t const options)\n-\t{\n-\t\treopen_listen_sockets(bool(options & session_handle::reopen_map_ports));\n-\t}\n-\n-\tnamespace {\n-\t\ttemplate <typename MapProtocol, typename ProtoType, typename EndpointType>\n-\t\tvoid map_port(MapProtocol& m, ProtoType protocol, EndpointType const& ep\n-\t\t\t, port_mapping_t& map_handle, std::string const& device)\n-\t\t{\n-\t\t\tif (map_handle != port_mapping_t{-1}) m.delete_mapping(map_handle);\n-\t\t\tmap_handle = port_mapping_t{-1};\n-\n-\t\t\taddress const addr = ep.address();\n-\t\t\t// with IPv4 the interface might be behind NAT so we can't skip them\n-\t\t\t// based on the scope of the local address\n-\t\t\tif (addr.is_v6() && is_local(addr))\n-\t\t\t\treturn;\n+\t\tTORRENT_ASSERT(is_outgoing());\n \n-\t\t\t// only update this mapping if we actually have a socket listening\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+\t\tTORRENT_ASSERT(!m_torrent.lock()->is_upload_only());\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-\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-\t\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-#ifdef TORRENT_SSL_PEERS\n-\t\tTORRENT_ASSERT((ssl == transport::ssl) == is_ssl(c));\n-#endif\n+\t\tif (m_port == -1 && protocol == \"http\")\n+\t\t\tm_port = 80;\n \n-#ifdef TORRENT_SSL_PEERS\n-\t\tif (ssl == transport::ssl)\n+#if TORRENT_USE_SSL\n+\t\tif (protocol == \"https\")\n \t\t{\n-\t\t\tTORRENT_ASSERT(is_ssl(c));\n-\n-\t\t\t// save the socket so we can cancel the handshake\n-
    \t\t\tauto iter = m_incoming_sockets.emplace(std::make_unique<socket_type>(std::move(c))).first;\n-
    \n-\t\t\tauto sock = iter->get();\n-\t\t\t// for SSL connections, incoming_connection() is called\n-\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\tm_ssl = true;\n+\t\t\tif (m_port == -1) m_port = 443;\n \t\t}\n-\t\telse\n #endif\n-\t\t{\n-\t\t\tincoming_connection(std::move(c));\n-\t\t}\n-\t}\n-\n-#ifdef TORRENT_SSL_PEERS\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+\t\tif (!m_basic_auth.empty())\n+\t\t\tm_basic_auth = base64encode(m_basic_auth);\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-\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-\t\t\tincoming_connection(std::move(c));\n-\t\t}\n+\t\tm_server_string = m_host;\n+\t\taux::verify_encoding(m_server_string);\n \t}\n \n-#ifdef TORRENT_SSL_PEERS\n-\n-\tvoid session_impl::on_incoming_utp_ssl(socket_type s)\n+\tint web_connection_base::timeout() const\n \t{\n-\t\tTORRENT_ASSERT(is_ssl(s));\n-\n-\t\t// save the socket so we can cancel the handshake\n-\n-
    \t\tauto iter = m_incoming_sockets.emplace(std::make_unique<socket_type>(std::move(s))).first;\n-
    \t\tauto sock = iter->get();\n-\n-\t\t// for SSL connections, incoming_connection() is called\n-\t\t// after the handshake is done\n-\t\tADD_OUTSTANDING_ASYNC(\"session_impl::ssl_handshake\");\n-\t\tboost::get<ssl_stream<utp_stream>>(**iter).async_accept_handshake(\n-\t\t\t[this, sock] (error_code const& err) { ssl_handshake(err, sock); });\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/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-\t// to test SSL connections, one can use this openssl command template:\n-\t//\n-\t// openssl s_client -cert <client-cert>.pem -key <client-private-key>.pem\n-\t//   -CAfile <torrent-cert>.pem  -debug -connect 127.0.0.1:4433 -tls1\n-\t//   -servername <hex-encoded-info-hash>\n-\n-\tvoid session_impl::ssl_handshake(error_code const& ec, socket_type* sock)\n-\t{\n-\t\tCOMPLETE_ASYNC(\"session_impl::ssl_handshake\");\n-\n-\t\tauto iter = m_incoming_sockets.find(sock);\n-\n-\t\t// this happens if the SSL connection is aborted because we're shutting\n-\t\t// down\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-\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-\t\t// --------------------------------------------------------------\n-\t\t// check for incoming connections that might have timed out\n-\t\t// --------------------------------------------------------------\n-\n-\t\tfor (auto i = m_connections.begin(); i != m_connections.end();)\n-\t\t{\n-\t\t\tpeer_connection* p = (*i).get();\n-\t\t\t++i;\n-\t\t\t// ignore connections that already have a torrent, since they\n-\t\t\t// are ticked through the torrents' second_tick\n-\t\t\tif (!p->associated_torrent().expired()) continue;\n-\n-
    \t\t\tint timeout = m_settings.get_int(settings_pack::handshake_timeout);\n-
    #if TORRENT_USE_I2P\n-\t\t\ttimeout *= is_i2p(p->get_socket()) ? 4 : 1;\n-#endif\n-\t\t\tif (m_last_tick - p->connected_time () > seconds(timeout))\n-\t\t\t\tp->disconnect(errors::timed_out, operation_t::bittorrent);\n-\t\t}\n-\n-\t\t// --------------------------------------------------------------\n-\t\t// second_tick every torrent (that wants it)\n-\t\t// --------------------------------------------------------------\n-\n-#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-\t\t\tTORRENT_ASSERT(t.want_tick());\n-\t\t\tTORRENT_ASSERT(!t.is_aborted());\n-\n-\t\t\tt.second_tick(tick_interval_ms);\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-\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-\t\t\tTORRENT_ASSERT(t.want_tick());\n-\t\t\tTORRENT_ASSERT(!t.is_aborted());\n-\n-\t\t\tt.second_tick(tick_interval_ms);\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-\n-
    \t\tif (m_settings.get_bool(settings_pack::rate_limit_ip_overhead))\n-
    \t\t{\n-\t\t\tint const up_limit = upload_rate_limit(m_global_class);\n-\t\t\tint const down_limit = download_rate_limit(m_global_class);\n-\n-\t\t\tif (down_limit > 0\n-\t\t\t\t&& m_stat.download_ip_overhead() >= down_limit\n-\t\t\t\t&& m_alerts.should_post<performance_alert>())\n-\t\t\t{\n-\t\t\t\tm_alerts.emplace_alert<performance_alert>(torrent_handle()\n-\t\t\t\t\t, performance_alert::download_limit_too_low);\n-\t\t\t}\n-\n-\t\t\tif (up_limit > 0\n-\t\t\t\t&& m_stat.upload_ip_overhead() >= up_limit\n-\t\t\t\t&& m_alerts.should_post<performance_alert>())\n-\t\t\t{\n-\t\t\t\tm_alerts.emplace_alert<performance_alert>(torrent_handle()\n-\t\t\t\t\t, performance_alert::upload_limit_too_low);\n-\t\t\t}\n-\t\t}\n-\n-#if TORRENT_ABI_VERSION == 1\n-\t\tm_peak_up_rate = std::max(m_stat.upload_rate(), m_peak_up_rate);\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-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-\t\t\tif (m_boost_connections > max_connections)\n-\t\t\t{\n-\t\t\t\tm_boost_connections -= max_connections;\n-\t\t\t\tmax_connections = 0;\n-\t\t\t}\n-\t\t\telse\n-\t\t\t{\n-\t\t\t\tmax_connections -= m_boost_connections;\n-\t\t\t\tm_boost_connections = 0;\n-\t\t\t}\n-\t\t}\n-\n-\t\t// zero connections speeds are allowed, we just won't make any connections\n-\t\tif (max_connections <= 0) return;\n-\n-
    \t\tint const limit = std::min(m_settings.get_int(settings_pack::connections_limit)\n-
    \t\t\t- num_connections(), std::numeric_limits<int>::max() - 1);\n-\n-\t\t// this logic is here to smooth out the number of new connection\n-\t\t// attempts over time, to prevent connecting a large number of\n-\t\t// sockets, wait 10 seconds, and then try again\n-\t\tif (m_settings.get_bool(settings_pack::smooth_connects) && max_connections > (limit+1) / 2)\n-\t\t\tmax_connections = (limit + 1) / 2;\n-\n-\t\taux::vector<torrent*>& want_peers_download = m_torrent_lists[torrent_want_peers_download];\n-\t\taux::vector<torrent*>& want_peers_finished = m_torrent_lists[torrent_want_peers_finished];\n-\n-\t\t// if no torrent want any peers, just return\n-\t\tif (want_peers_download.empty() && want_peers_finished.empty()) return;\n+\treturn ed25519_sign({str, len}, pk, sk);\n+}\n \n-\t\t// if we don't have any connection attempt quota, return\n-\t\tif (max_connections <= 0) return;\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-\t\tint steps_since_last_connect = 0;\n-\t\tint const num_torrents = int(want_peers_finished.size() + want_peers_download.size());\n-\t\tfor (;;)\n-\t\t{\n-\t\t\tif (m_next_downloading_connect_torrent >= int(want_peers_download.size()))\n-\t\t\t\tm_next_downloading_connect_torrent = 0;\n+item::item(entry v)\n+\t: m_value(std::move(v))\n+{}\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+item::item(bdecode_node const& v)\n+{\n+
    \tm_value = v;\n+
    }\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-immediately instead of waiting for the next tick

    ../src/session_impl.cpp:4459

    \t\t\t\tcontinue;\n-\t\t\t}\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-\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-\t\t\t\t// this peer is not unchokable. So, if it's unchoked\n-\t\t\t\t// already, make sure to choke it.\n-\t\t\t\tif (p->is_choked())\n-\t\t\t\t{\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-\t\t\t\t\t// force a new optimistic unchoke\n-\t\t\t\t\tm_optimistic_unchoke_time_scaler = 0;\n-
    \t\t\t\t}\n-
    \t\t\t\tt->choke_peer(*p);\n-\t\t\t\tp->reset_choke_counters();\n-\t\t\t\tcontinue;\n-\t\t\t}\n+void item::assign(entry v)\n+{\n+\tm_mutable = false;\n+\tm_value = std::move(v);\n+}\n \n-\t\t\tpeers.push_back(p.get());\n-\t\t}\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-\t\tint const allowed_upload_slots = unchoke_sort(peers\n-\t\t\t, unchoke_interval, m_settings);\n+void item::assign(bdecode_node const& v)\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-\t\tif (m_settings.get_int(settings_pack::choking_algorithm) == settings_pack::fixed_slots_choker)\n-\t\t{\n-\t\t\tint const upload_slots = get_int_setting(settings_pack::unchoke_slots_limit);\n-\t\t\tm_stats_counters.set_value(counters::num_unchoke_slots, upload_slots);\n-\t\t}\n-\t\telse\n-\t\t{\n-\t\t\tm_stats_counters.set_value(counters::num_unchoke_slots\n-\t\t\t\t, allowed_upload_slots);\n-\t\t}\n+void put_data::done()\n+{\n+\tm_done = true;\n \n #ifndef TORRENT_DISABLE_LOGGING\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-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-\n-\tvoid session_impl::post_torrent_updates(status_flags_t const flags)\n-\t{\n-\t\tINVARIANT_CHECK;\n-\n-\t\tTORRENT_ASSERT(is_single_thread());\n-\n-\t\tstd::vector<torrent*>& state_updates\n-\t\t\t= m_torrent_lists[aux::session_impl::torrent_state_updates];\n-\n-#if TORRENT_USE_ASSERTS\n-\t\tm_posting_torrent_updates = true;\n+\tget_node().observer()->log(dht_logger::traversal, \"[%u] %s DONE, response %d, timeout %d\"\n+\t\t, id(), name(), num_responses(), num_timeouts());\n #endif\n \n-\t\tstd::vector<torrent_status> status;\n-\t\tstatus.reserve(state_updates.size());\n-\n-
    \t\tfor (auto& t : state_updates)\n-
    \t\t{\n-\t\t\tTORRENT_ASSERT(t->m_links[aux::session_impl::torrent_state_updates].in_list());\n-\t\t\tstatus.emplace_back();\n-\t\t\t// querying accurate download counters may require\n-\t\t\t// the torrent to be loaded. Loading a torrent, and evicting another\n-\t\t\t// one will lead to calling state_updated(), which screws with\n-\t\t\t// this list while we're working on it, and break things\n-\t\t\tt->status(&status.back(), flags);\n-\t\t\tt->clear_in_state_update();\n-\t\t}\n-\t\tstate_updates.clear();\n-\n-#if TORRENT_USE_ASSERTS\n-\t\tm_posting_torrent_updates = false;\n-#endif\n+\tm_put_callback(m_data, num_responses());\n+\ttraversal_algorithm::done();\n+}\n \n-\t\tm_alerts.emplace_alert<state_update_alert>(std::move(status));\n-\t}\n+bool put_data::invoke(observer_ptr o)\n+{\n+\tif (m_done) return false;\n \n-\tvoid session_impl::post_session_stats()\n+
    \tauto* po = static_cast<put_data_observer*>(o.get());\n+
    \n+\tentry e;\n+\te[\"y\"] = \"q\";\n+\te[\"q\"] = \"put\";\n+\tentry& a = e[\"a\"];\n+\ta[\"v\"] = m_data.value();\n+\ta[\"token\"] = po->m_token;\n+\tif (m_data.is_mutable())\n \t{\n-\t\tif (!m_posted_stats_header)\n-\t\t{\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-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-\t\t\t// ignore errors because the underlying socket may not\n-\t\t\t// be opened yet. This happens when we're routing through\n-\t\t\t// a proxy. In that case, we don't yet know the address of\n-\t\t\t// the proxy server, and more importantly, we don't know\n-\t\t\t// the address family of its address. This means we can't\n-\t\t\t// open the socket yet. The socks abstraction layer defers\n-\t\t\t// opening it.\n-\t\t\tec.clear();\n-\t\t\tbind_ep.port(std::uint16_t(next_port()));\n-\t\t}\n-\n-\t\tif (is_utp(s))\n-\t\t{\n-
    \n-
    \t\t\tutp_socket_impl* impl = nullptr;\n-\t\t\ttransport ssl = transport::plaintext;\n-#if TORRENT_USE_SSL\n-\t\t\tif (boost::get<ssl_stream<utp_stream>>(&s) != nullptr)\n-\t\t\t{\n-\t\t\t\timpl = boost::get<ssl_stream<utp_stream>>(s).next_layer().get_impl();\n-\t\t\t\tssl = transport::ssl;\n-\t\t\t}\n-\t\t\telse\n-#endif\n-\t\t\t\timpl = boost::get<utp_stream>(s).get_impl();\n-\n-\t\t\tstd::vector<std::shared_ptr<listen_socket_t>> with_gateways;\n-\t\t\tstd::shared_ptr<listen_socket_t> match;\n-\t\t\tfor (auto& ls : m_listen_sockets)\n-\t\t\t{\n-\t\t\t\t// this is almost, but not quite, like can_route()\n-\t\t\t\tif (!(ls->flags & listen_socket_t::proxy)\n-\t\t\t\t\t&& is_v4(ls->local_endpoint) != remote_address.is_v4())\n-\t\t\t\t\tcontinue;\n-\t\t\t\tif (ls->ssl != ssl) continue;\n-\t\t\t\tif (!(ls->flags & listen_socket_t::local_network))\n-\t\t\t\t\twith_gateways.push_back(ls);\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-\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+\t\ta[\"k\"] = m_data.pk().bytes;\n+\t\ta[\"seq\"] = m_data.seq().value;\n+\t\ta[\"sig\"] = m_data.sig().bytes;\n+\t\tif (!m_data.salt().empty())\n \t\t{\n-#ifndef TORRENT_DISABLE_LOGGING\n-\t\t\tsession_log(\"not starting DHT, aborting\");\n-#endif\n-\t\t\treturn;\n+\t\t\ta[\"salt\"] = m_data.salt();\n \t\t}\n+\t}\n \n-#ifndef TORRENT_DISABLE_LOGGING\n-\t\tsession_log(\"starting DHT, running: %s, router lookups: %d\"\n-\t\t\t, m_dht ? \"true\" : \"false\", m_outstanding_router_lookups);\n-#endif\n+\tm_node.stats_counters().inc_stats_counter(counters::dht_put_out);\n \n-
    \t\tm_dht_storage = m_dht_storage_constructor(m_settings);\n-
    \t\tm_dht = std::make_shared<dht::dht_tracker>(\n-\t\t\tstatic_cast<dht::dht_observer*>(this)\n-\t\t\t, m_io_context\n-\t\t\t, [this](aux::listen_socket_handle const& sock\n-\t\t\t\t, udp::endpoint const& ep\n-\t\t\t\t, span<char const> p\n-\t\t\t\t, error_code& ec\n-\t\t\t\t, udp_send_flags_t const flags)\n-\t\t\t\t{ send_udp_packet_listen(sock, ep, p, ec, flags); }\n-\t\t\t, m_settings\n-\t\t\t, m_stats_counters\n-\t\t\t, *m_dht_storage\n-\t\t\t, std::move(m_dht_state));\n+\treturn m_node.m_rpc.invoke(e, o->target_ep(), o);\n+}\n \n-\t\tfor (auto& s : m_listen_sockets)\n-\t\t{\n-\t\t\tif (s->ssl != transport::ssl\n-\t\t\t\t&& !(s->flags & listen_socket_t::local_network))\n-\t\t\t{\n-\t\t\t\tm_dht->new_socket(s);\n-\t\t\t}\n-\t\t}\n+} } // namespace libtorrent::dht\n+
    relevance 0../src/kademlia/node_id.cpp:66it's a little bit weird to return 159 - leading zeroes. It should probably be 160 - leading zeroes, but all other code in here is tuned to this expectation now, and it doesn't really matter (other than complexity)

    it's a little bit weird to return 159 - leading zeroes. It should\n+probably be 160 - leading zeroes, but all other code in here is tuned to\n+this expectation now, and it doesn't really matter (other than complexity)

    ../src/kademlia/node_id.cpp:66

    \n+// returns the distance between the two nodes\n+// using the kademlia XOR-metric\n+node_id distance(node_id const& n1, node_id const& n2)\n+{\n+\treturn n1 ^ n2;\n+}\n \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+// returns true if: distance(n1, ref) < distance(n2, ref)\n+bool compare_ref(node_id const& n1, node_id const& n2, node_id const& ref)\n+{\n+\tnode_id const lhs = n1 ^ ref;\n+\tnode_id const rhs = n2 ^ ref;\n+\treturn lhs < rhs;\n+}\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-\t\tm_dht->direct_request(ep, e, std::bind(&on_direct_response, std::ref(m_alerts), userdata, _1));\n-\t}\n+// returns n in: 2^n <= distance(n1, n2) < 2^(n+1)\n+// useful for finding out which bucket a node belongs to\n+int distance_exp(node_id const& n1, node_id const& n2)\n+{\n+
    \treturn std::max(159 - distance(n1, n2).count_leading_zeroes(), 0);\n+
    }\n \n-#endif\n+int min_distance_exp(node_id const& n1, std::vector<node_id> const& ids)\n+{\n+\tTORRENT_ASSERT(ids.size() > 0);\n \n-\tbool session_impl::is_listening() const\n+\tint min = 160; // see distance_exp for the why of this constant\n+\tfor (auto const& node_id : ids)\n \t{\n-\t\treturn !m_listen_sockets.empty();\n+\t\tmin = std::min(min, distance_exp(n1, node_id));\n \t}\n \n-\tsession_impl::~session_impl()\n-\t{\n-\t\t// since we're destructing the session, no more alerts will make it out to\n-\t\t// the user. So stop posting them now\n-\t\tm_alerts.set_alert_mask({});\n-\t\tm_alerts.set_notify_function({});\n-\n-\t\t// this is not allowed to be the network thread!\n-//\t\tTORRENT_ASSERT(is_not_thread());\n-
    \n-
    \t\t// this can happen if we end the io_context run loop with an exception\n-\t\tm_connections.clear();\n-\t\tfor (auto& t : m_torrents)\n-\t\t{\n-\t\t\tt->panic();\n-\t\t\tt->abort();\n-\t\t}\n-\t\tm_torrents.clear();\n-\n-\t\t// this has probably been called already, but in case of sudden\n-\t\t// termination through an exception, it may not have been done\n-\t\tabort_stage2();\n-\n-#if defined TORRENT_ASIO_DEBUGGING\n-\t\tFILE* f = fopen(\"wakeups.log\", \"w+\");\n-\t\tif (f != nullptr)\n-\t\t{\n-\t\t\ttime_point m = min_time();\n-\t\t\tif (!_wakeups.empty()) m = _wakeups[0].timestamp;\n-\t\t\ttime_point prev = m;\n-\t\t\tstd::uint64_t prev_csw = 0;\n-\t\t\tif (!_wakeups.empty()) prev_csw = _wakeups[0].context_switches;\n-\t\t\tstd::fprintf(f, \"abs. time\\trel. time\\tctx switch\\tidle-wakeup\\toperation\\n\");\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/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+\treturn min;\n+}\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+node_id generate_id_impl(address const& ip_, std::uint32_t r)\n+{\n+\tstd::uint8_t* ip = nullptr;\n \n-\t\tm_storage = std::move(new_storage);\n-\t\tm_capacity = new_size;\n-\t}\n+\tstatic std::uint8_t const v4mask[] = { 0x03, 0x0f, 0x3f, 0xff };\n+\tstatic std::uint8_t const v6mask[] = { 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f, 0xff };\n+\tstd::uint8_t const* mask = nullptr;\n+\tint num_octets = 0;\n \n-\tpacket_ptr packet_buffer::remove(index_type idx)\n+\taddress_v4::bytes_type b4{};\n+\taddress_v6::bytes_type b6{};\n+\tif (ip_.is_v6())\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-\t\t}\n-\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/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+\t\tb6 = ip_.to_v6().to_bytes();\n+\t\tip = b6.data();\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 \t\t\t{\"want\", bdecode_node::list_t, 0, key_desc_t::optional},\n@@ -9946,15 +10096,15 @@\n \n \t\tsha1_hash const target(target_ent.string_ptr());\n \t\t// always return nodes as well as peers\n \t\twrite_nodes_entries(target, arg_ent.dict_find_list(\"want\"), reply);\n \t}\n }\n \n-
    relevance 0../src/kademlia/node.cpp:1205limit number of entries in the result

    limit number of entries in the result

    ../src/kademlia/node.cpp:1205

    \t\t// if we don't recognize the message but there's a\n+
    relevance 0../src/kademlia/node.cpp:1205limit number of entries in the result

    limit number of entries in the result

    ../src/kademlia/node.cpp:1205

    \t\t// if we don't recognize the message but there's a\n \t\t// 'target' or 'info_hash' in the arguments, treat it\n \t\t// as find_node to be future compatible\n \t\tbdecode_node target_ent = arg_ent.dict_find_string(\"target\");\n \t\tif (!target_ent || target_ent.string_length() != 20)\n \t\t{\n \t\t\ttarget_ent = arg_ent.dict_find_string(\"info_hash\");\n \t\t\tif (!target_ent || target_ent.string_length() != 20)\n@@ -9997,68 +10147,66 @@\n \t\tstd::vector<node_entry> const n = wanted_node->m_table.find_node(info_hash, {});\n \t\tr[wanted_node->protocol_nodes_key()] = write_nodes_entry(n);\n \t}\n }\n \n node::protocol_descriptor const& node::map_protocol_to_descriptor(udp const protocol)\n {\n-
    relevance 0../src/kademlia/node_id.cpp:66it's a little bit weird to return 159 - leading zeroes. It should probably be 160 - leading zeroes, but all other code in here is tuned to this expectation now, and it doesn't really matter (other than complexity)

    it's a little bit weird to return 159 - leading zeroes. It should\n-probably be 160 - leading zeroes, but all other code in here is tuned to\n-this expectation now, and it doesn't really matter (other than complexity)

    ../src/kademlia/node_id.cpp:66

    \n-// returns the distance between the two nodes\n-// using the kademlia XOR-metric\n-node_id distance(node_id const& n1, node_id const& n2)\n-{\n-\treturn n1 ^ n2;\n-}\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-// returns true if: distance(n1, ref) < distance(n2, ref)\n-bool compare_ref(node_id const& n1, node_id const& n2, node_id const& ref)\n-{\n-\tnode_id const lhs = n1 ^ ref;\n-\tnode_id const rhs = n2 ^ ref;\n-\treturn lhs < rhs;\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-// returns n in: 2^n <= distance(n1, n2) < 2^(n+1)\n-// useful for finding out which bucket a node belongs to\n-int distance_exp(node_id const& n1, node_id const& n2)\n-{\n-
    \treturn std::max(159 - distance(n1, n2).count_leading_zeroes(), 0);\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-int min_distance_exp(node_id const& n1, std::vector<node_id> const& ids)\n-{\n-\tTORRENT_ASSERT(ids.size() > 0);\n+\t\treturn nullptr;\n+\t}\n \n-\tint min = 160; // see distance_exp for the why of this constant\n-\tfor (auto const& node_id : ids)\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\tmin = std::min(min, distance_exp(n1, node_id));\n+\t\tfor (auto& n : m_nodes)\n+\t\t\tn.second.dht.get_peers(ih, f, {}, {});\n \t}\n \n-\treturn min;\n-}\n-\n-node_id generate_id_impl(address const& ip_, std::uint32_t r)\n-{\n-\tstd::uint8_t* ip = nullptr;\n-\n-\tstatic std::uint8_t const v4mask[] = { 0x03, 0x0f, 0x3f, 0xff };\n-\tstatic std::uint8_t const v6mask[] = { 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f, 0xff };\n-\tstd::uint8_t const* mask = nullptr;\n-\tint num_octets = 0;\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-\taddress_v4::bytes_type b4{};\n-\taddress_v6::bytes_type b6{};\n-\tif (ip_.is_v6())\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\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+\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/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 +10233,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 +10288,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,321 +10340,40 @@\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/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+
    relevance 0../include/libtorrent/socket_type.hpp:60move to aux

    move to aux

    ../include/libtorrent/socket_type.hpp:60

    namespace libtorrent {\n \n-void put_data::done()\n-{\n-\tm_done = true;\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-#ifndef TORRENT_DISABLE_LOGGING\n-\tget_node().observer()->log(dht_logger::traversal, \"[%u] %s DONE, response %d, timeout %d\"\n-\t\t, id(), name(), num_responses(), num_timeouts());\n+#if TORRENT_ABI_VERSION <= 2\n+\tudp TORRENT_DEPRECATED_ENUM = utp,\n #endif\n+};\n \n-\tm_put_callback(m_data, num_responses());\n-\ttraversal_algorithm::done();\n-}\n-\n-bool put_data::invoke(observer_ptr o)\n-{\n-\tif (m_done) return false;\n-\n-
    \tauto* po = static_cast<put_data_observer*>(o.get());\n+// return a short human readable name for types of socket\n+
    char const* socket_type_name(socket_type_t);\n
    \n-\tentry e;\n-\te[\"y\"] = \"q\";\n-\te[\"q\"] = \"put\";\n-\tentry& a = e[\"a\"];\n-\ta[\"v\"] = m_data.value();\n-\ta[\"token\"] = po->m_token;\n-\tif (m_data.is_mutable())\n-\t{\n-\t\ta[\"k\"] = m_data.pk().bytes;\n-\t\ta[\"seq\"] = m_data.seq().value;\n-\t\ta[\"sig\"] = m_data.sig().bytes;\n-\t\tif (!m_data.salt().empty())\n-\t\t{\n-\t\t\ta[\"salt\"] = m_data.salt();\n-\t\t}\n-\t}\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../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../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/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/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+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@@ -10550,192 +10417,221 @@\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/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+
    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_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+#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// the following vectors are mutable because they sometimes may\n-\t\t// be updated lazily, triggered by const functions\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 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+\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// 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+\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// 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+\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 number of bytes of pad file set in this piece picker\n-\t\tstd::int64_t m_num_pad_bytes = 0;\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// the number of pad blocks that we already have\n-\t\tstd::int64_t m_have_pad_bytes = 0;\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 number of pad blocks part of filtered pieces we don't have\n-\t\tstd::int64_t m_filtered_pad_bytes = 0;\n+\t\t// the hash(es) that identify this torrent\n+\t\tinfo_hash_t m_info_hash;\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+\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 seeds. These are not added to\n-\t\t// the availability counters of the pieces\n-\t\tint m_seeds = 0;\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 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+\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/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\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+\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\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+\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-\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+
    \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-\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+\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-\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+private:\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+\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\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+\t\tif (ec)\n+\t\t{\n+\t\t\th(ec);\n+\t\t\treturn;\n+\t\t}\n \n-\t\tenum { max_pieces = (std::numeric_limits<int>::max)() - 1 };\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/peer_connection_interface.hpp:51make this interface smaller!

    make this interface smaller!

    ../include/libtorrent/peer_connection_interface.hpp:51

    \n+*/\n \n-\t};\n-}\n+#ifndef TORRENT_PEER_CONNECTION_INTERFACE_HPP\n+#define TORRENT_PEER_CONNECTION_INTERFACE_HPP\n \n-#endif // TORRENT_PIECE_PICKER_HPP_INCLUDED\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+#include \"libtorrent/fwd.hpp\"\n+#include \"libtorrent/socket.hpp\"\n+#include \"libtorrent/error_code.hpp\"\n+#include \"libtorrent/alert_types.hpp\"\n+#include \"libtorrent/operations.hpp\" // for operation_t enum\n+#include \"libtorrent/units.hpp\"\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+namespace libtorrent {\n \n-TORRENT_EXTRA_EXPORT void find_control_url(int type, string_view, parse_state& state);\n+\tstruct torrent_peer;\n+\tclass stat;\n \n-TORRENT_EXTRA_EXPORT void find_error_code(int type, string_view string\n-\t, error_code_parse_state& state);\n+\tusing disconnect_severity_t = aux::strong_typedef<std::uint8_t, struct disconnect_severity_tag>;\n \n-TORRENT_EXTRA_EXPORT void find_ip_address(int type, string_view string\n-\t, ip_address_parse_state& state);\n+
    \tstruct TORRENT_EXTRA_EXPORT peer_connection_interface\n+
    \t{\n+\t\tstatic constexpr disconnect_severity_t normal{0};\n+\t\tstatic constexpr disconnect_severity_t failure{1};\n+\t\tstatic constexpr disconnect_severity_t peer_error{2};\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+#if TORRENT_USE_I2P\n+\t\tvirtual std::string const& destination() const = 0;\n+\t\tvirtual std::string const& local_i2p_endpoint() const = 0;\n+#endif\n+\t\tvirtual tcp::endpoint const& remote() const = 0;\n+\t\tvirtual tcp::endpoint local_endpoint() const = 0;\n+\t\tvirtual void disconnect(error_code const& ec\n+\t\t\t, operation_t op, disconnect_severity_t = peer_connection_interface::normal) = 0;\n+\t\tvirtual peer_id const& pid() const = 0;\n+\t\tvirtual peer_id our_pid() const = 0;\n+\t\tvirtual void set_holepunch_mode() = 0;\n+\t\tvirtual torrent_peer* peer_info_struct() const = 0;\n+\t\tvirtual void set_peer_info(torrent_peer* pi) = 0;\n+\t\tvirtual bool is_outgoing() const = 0;\n+\t\tvirtual void add_stat(std::int64_t downloaded, std::int64_t uploaded) = 0;\n+\t\tvirtual bool fast_reconnect() const = 0;\n+\t\tvirtual bool is_choked() const = 0;\n+\t\tvirtual bool failed() const = 0;\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/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-\tvoid start();\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-\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/socket_type.hpp:60move to aux

    move to aux

    ../include/libtorrent/socket_type.hpp:60

    namespace libtorrent {\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-// 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+\t\thash_request pick_hashes(typed_bitfield<piece_index_t> const& pieces);\n \n-#if TORRENT_ABI_VERSION <= 2\n-\tudp TORRENT_DEPRECATED_ENUM = utp,\n-#endif\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-// return a short human readable name for types of socket\n-
    char const* socket_type_name(socket_type_t);\n-
    \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-#endif\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+\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/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@@ -10778,117 +10674,170 @@\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/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+
    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+#define TORRENT_IDENTIFY_CLIENT_HPP_INCLUDED\n+\n+#include \"libtorrent/config.hpp\"\n+\n+#if TORRENT_ABI_VERSION == 1\n+#include \"libtorrent/aux_/disable_warnings_push.hpp\"\n+#include <boost/optional.hpp>\n+#include \"libtorrent/aux_/disable_warnings_pop.hpp\"\n+#endif\n+\n+#include \"libtorrent/peer_id.hpp\"\n+#include \"libtorrent/fingerprint.hpp\"\n+\n+
    namespace libtorrent {\n+
    \n+namespace aux {\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+\tstd::string identify_client_impl(const peer_id& p);\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+\t// these functions don't really need to be public. This mechanism of\n+\t// advertising client software and version is also out-dated.\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+\t// This function can can be used to extract a string describing a client\n+\t// version from its peer-id. It will recognize most clients that have this\n+\t// kind of identification in the peer-id.\n+\tTORRENT_DEPRECATED_EXPORT\n+\tstd::string identify_client(const peer_id& p);\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+#if TORRENT_ABI_VERSION == 1\n \n-\t\tint piece_layer() const { return m_piece_layer; }\n+#include \"libtorrent/aux_/disable_deprecation_warnings_push.hpp\"\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+\t// Returns an optional fingerprint if any can be identified from the peer\n+\t// id. This can be used to automate the identification of clients. It will\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-\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+#include \"libtorrent/aux_/disable_warnings_pop.hpp\"\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-\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/peer_connection_interface.hpp:51make this interface smaller!

    make this interface smaller!

    ../include/libtorrent/peer_connection_interface.hpp:51

    \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-#ifndef TORRENT_PEER_CONNECTION_INTERFACE_HPP\n-#define TORRENT_PEER_CONNECTION_INTERFACE_HPP\n+TORRENT_EXTRA_EXPORT void find_control_url(int type, string_view, parse_state& state);\n \n-#include \"libtorrent/fwd.hpp\"\n-#include \"libtorrent/socket.hpp\"\n-#include \"libtorrent/error_code.hpp\"\n-#include \"libtorrent/alert_types.hpp\"\n-#include \"libtorrent/operations.hpp\" // for operation_t enum\n-#include \"libtorrent/units.hpp\"\n+TORRENT_EXTRA_EXPORT void find_error_code(int type, string_view string\n+\t, error_code_parse_state& state);\n \n-namespace libtorrent {\n+TORRENT_EXTRA_EXPORT void find_ip_address(int type, string_view string\n+\t, ip_address_parse_state& state);\n \n-\tstruct torrent_peer;\n-\tclass stat;\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-\tusing disconnect_severity_t = aux::strong_typedef<std::uint8_t, struct disconnect_severity_tag>;\n+\tvoid start();\n \n-
    \tstruct TORRENT_EXTRA_EXPORT peer_connection_interface\n-
    \t{\n-\t\tstatic constexpr disconnect_severity_t normal{0};\n-\t\tstatic constexpr disconnect_severity_t failure{1};\n-\t\tstatic constexpr disconnect_severity_t peer_error{2};\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/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-#if TORRENT_USE_I2P\n-\t\tvirtual std::string const& destination() const = 0;\n-\t\tvirtual std::string const& local_i2p_endpoint() const = 0;\n-#endif\n-\t\tvirtual tcp::endpoint const& remote() const = 0;\n-\t\tvirtual tcp::endpoint local_endpoint() const = 0;\n-\t\tvirtual void disconnect(error_code const& ec\n-\t\t\t, operation_t op, disconnect_severity_t = peer_connection_interface::normal) = 0;\n-\t\tvirtual peer_id const& pid() const = 0;\n-\t\tvirtual peer_id our_pid() const = 0;\n-\t\tvirtual void set_holepunch_mode() = 0;\n-\t\tvirtual torrent_peer* peer_info_struct() const = 0;\n-\t\tvirtual void set_peer_info(torrent_peer* pi) = 0;\n-\t\tvirtual bool is_outgoing() const = 0;\n-\t\tvirtual void add_stat(std::int64_t downloaded, std::int64_t uploaded) = 0;\n-\t\tvirtual bool fast_reconnect() const = 0;\n-\t\tvirtual bool is_choked() const = 0;\n-\t\tvirtual bool failed() const = 0;\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/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+\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+
    \t\t// 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+\t\tbool complete_sent : 1;\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@@ -10932,15 +10881,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@@ -10984,15 +10933,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@@ -11036,15 +10985,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@@ -11087,15 +11036,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@@ -11138,119 +11087,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/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-#define TORRENT_IDENTIFY_CLIENT_HPP_INCLUDED\n-\n-#include \"libtorrent/config.hpp\"\n-\n-#if TORRENT_ABI_VERSION == 1\n-#include \"libtorrent/aux_/disable_warnings_push.hpp\"\n-#include <boost/optional.hpp>\n-#include \"libtorrent/aux_/disable_warnings_pop.hpp\"\n-#endif\n-\n-#include \"libtorrent/peer_id.hpp\"\n-#include \"libtorrent/fingerprint.hpp\"\n-\n-
    namespace libtorrent {\n-
    \n-namespace aux {\n-\n-\tTORRENT_EXTRA_EXPORT\n-\tstd::string identify_client_impl(const peer_id& p);\n-\n-}\n-\n-\t// these functions don't really need to be public. This mechanism of\n-\t// advertising client software and version is also out-dated.\n-\n-\t// This function can can be used to extract a string describing a client\n-\t// version from its peer-id. It will recognize most clients that have this\n-\t// kind of identification in the peer-id.\n-\tTORRENT_DEPRECATED_EXPORT\n-\tstd::string identify_client(const peer_id& p);\n-\n-#if TORRENT_ABI_VERSION == 1\n-\n-#include \"libtorrent/aux_/disable_deprecation_warnings_push.hpp\"\n-\n-\t// Returns an optional fingerprint if any can be identified from the peer\n-\t// id. This can be used to automate the identification of clients. It will\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/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-\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-
    \t\t// 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-\t\tbool complete_sent : 1;\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+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@@ -11276,118 +11121,273 @@\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/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+
    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\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+\t\t// explicitly disallow assignment, to silence msvc warning\n+\t\tpeer_connection_hot_members& operator=(peer_connection_hot_members const&) = delete;\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+\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/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-\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+\tvoid cancel(error_code& ec)\n+\t{\n+\t\tTORRENT_ASSERT(m_magic == 0x1337);\n+\t\tm_sock.cancel(ec);\n+\t}\n \n-\ttemplate <typename Handler>\n-\tvoid async_name_lookup(char const* name, Handler handler)\n+\tvoid bind(endpoint_type const& /* endpoint */, error_code& /* ec */)\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\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-private:\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-\ttemplate <typename Handler>\n-\tvoid on_sam_connect(error_code const& ec, std::shared_ptr<i2p_stream>, Handler h)\n+#ifndef BOOST_NO_EXCEPTIONS\n+\tvoid close()\n \t{\n-\t\tCOMPLETE_ASYNC(\"i2p_stream::on_sam_connect\");\n-\t\tm_state = sam_idle;\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-\t\tif (ec)\n-\t\t{\n-\t\t\th(ec);\n-\t\t\treturn;\n-\t\t}\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-\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/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+\tprivate:\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+#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// 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+\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 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+\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// 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+\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// an optional string naming the software used\n-\t\t// to create the torrent file\n-\t\tstd::string m_created_by;\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 info section parsed. points into m_info_section\n-\t\t// parsed lazily\n-\t\tmutable bdecode_node m_info_dict;\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// 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+\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 hash(es) that identify this torrent\n-\t\tinfo_hash_t m_info_hash;\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// 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+\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 bytes in m_info_section\n-\t\tstd::int32_t m_info_section_size = 0;\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 is used when creating a torrent. If there's\n-\t\t// only one file there are cases where it's impossible\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@@ -11468,107 +11468,15 @@\n \treturn verify_message_impl(msg, desc, ret, error);\n }\n \n }\n }\n \n #endif\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-
    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+
    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@@ -11611,66 +11519,50 @@\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_/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+
    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-\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 \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+#ifndef TORRENT_POOL_HPP\n+#define TORRENT_POOL_HPP\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+#include \"libtorrent/aux_/disable_warnings_push.hpp\"\n+#include <boost/pool/pool.hpp>\n+#include <boost/pool/object_pool.hpp>\n+#include \"libtorrent/aux_/disable_warnings_pop.hpp\"\n \n-\t\tvirtual void prioritize_connections(std::weak_ptr<torrent> t) = 0;\n+namespace libtorrent {\n+namespace aux {\n \n-\t\tvirtual void trigger_auto_manage() = 0;\n+struct allocator_new_delete\n+{\n+\tusing size_type = std::size_t;\n+\tusing difference_type = std::ptrdiff_t;\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+
    \tstatic char* malloc(size_type const bytes)\n+
    \t{ return new char[bytes]; }\n+\tstatic void free(char* const block)\n+\t{ delete [] block; }\n+};\n \n-\t\tvirtual void queue_tracker_request(tracker_request req\n-\t\t\t, std::weak_ptr<request_callback> c) = 0;\n+using pool = boost::pool<allocator_new_delete>;\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+template <typename T>\n+using object_pool = boost::object_pool<T, allocator_new_delete>;\n \n-\t\tvirtual bandwidth_manager* get_bandwidth_manager(int channel) = 0;\n+}\n+}\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_/session_impl.hpp:265make these direct members and generate shared_ptrs to them which alias the listen_socket_t shared_ptr

    make these direct members and generate shared_ptrs to them\n+#endif\n+relevance 0../include/libtorrent/aux_/session_impl.hpp:265make these direct members and generate shared_ptrs to them which alias the listen_socket_t shared_ptr

    make these direct members and generate shared_ptrs to them\n which alias the listen_socket_t shared_ptr

    ../include/libtorrent/aux_/session_impl.hpp:265

    \t\t\tif (udp_sock) return udp_sock->sock.local_port();\n \t\t\treturn 0;\n \t\t}\n \n \t\t// 0 is natpmp 1 is upnp\n \t\t// the order of these arrays determines the priority in\n \t\t// which their ports will be announced to peers\n@@ -11714,15 +11606,15 @@\n \t\t\t{\n \t\t\t\treturn addr == o.addr\n \t\t\t\t\t&& port == o.port\n \t\t\t\t\t&& device == o.device\n \t\t\t\t\t&& ssl == o.ssl\n \t\t\t\t\t&& flags == o.flags;\n \t\t\t}\n-
    relevance 0../include/libtorrent/aux_/session_impl.hpp:1068replace this by a proper asio timer

    replace this by a proper asio timer

    ../include/libtorrent/aux_/session_impl.hpp:1068

    #ifdef TORRENT_SSL_PEERS\n+
    relevance 0../include/libtorrent/aux_/session_impl.hpp:1068replace this by a proper asio timer

    replace this by a proper asio timer

    ../include/libtorrent/aux_/session_impl.hpp:1068

    #ifdef TORRENT_SSL_PEERS\n \t\t\tvoid on_incoming_utp_ssl(socket_type s);\n \t\t\tvoid ssl_handshake(error_code const& ec, socket_type* s);\n #endif\n \n \t\t\t// round-robin index into m_outgoing_interfaces\n \t\t\tmutable std::uint8_t m_interface_index = 0;\n \n@@ -11738,15 +11630,15 @@\n \t\t\t// when it reaches zero, it is reset to the\n \t\t\t// unchoke_interval and the unchoke set is\n \t\t\t// recomputed.\n 
    \t\t\tint m_unchoke_time_scaler = 0;\n
    \n \t\t\t// this is used to decide when to recalculate which\n \t\t\t// torrents to keep queued and which to activate\n-
    relevance 0../include/libtorrent/aux_/session_impl.hpp:1073replace this by a proper asio timer

    replace this by a proper asio timer

    ../include/libtorrent/aux_/session_impl.hpp:1073

    \n+
    relevance 0../include/libtorrent/aux_/session_impl.hpp:1073replace this by a proper asio timer

    replace this by a proper asio timer

    ../include/libtorrent/aux_/session_impl.hpp:1073

    \n \t\t\t// round-robin index into m_outgoing_interfaces\n \t\t\tmutable std::uint8_t m_interface_index = 0;\n \n \t\t\tstd::shared_ptr<listen_socket_t> setup_listener(\n \t\t\t\tlisten_endpoint_t const& lep, error_code& ec);\n \n #ifndef TORRENT_DISABLE_DHT\n@@ -11764,15 +11656,15 @@\n \t\t\t// torrents to keep queued and which to activate\n 
    \t\t\tint m_auto_manage_time_scaler = 0;\n
    \n \t\t\t// works like unchoke_time_scaler but it\n \t\t\t// is only decreased when the unchoke set\n \t\t\t// is recomputed, and when it reaches zero,\n \t\t\t// the optimistic unchoke is moved to another peer.\n-
    relevance 0../include/libtorrent/aux_/session_impl.hpp:1080replace this by a proper asio timer

    replace this by a proper asio timer

    ../include/libtorrent/aux_/session_impl.hpp:1080

    \n+
    relevance 0../include/libtorrent/aux_/session_impl.hpp:1080replace this by a proper asio timer

    replace this by a proper asio timer

    ../include/libtorrent/aux_/session_impl.hpp:1080

    \n #ifndef TORRENT_DISABLE_DHT\n \t\t\tdht::dht_state m_dht_state;\n #endif\n \n \t\t\t// this is initialized to the unchoke_interval\n \t\t\t// session_setting and decreased every second.\n \t\t\t// when it reaches zero, it is reset to the\n@@ -11815,102 +11707,15 @@\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_/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-\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-
    \t\t// 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-\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-\n-*/\n-\n-#ifndef TORRENT_POOL_HPP\n-#define TORRENT_POOL_HPP\n-\n-#include \"libtorrent/aux_/disable_warnings_push.hpp\"\n-#include <boost/pool/pool.hpp>\n-#include <boost/pool/object_pool.hpp>\n-#include \"libtorrent/aux_/disable_warnings_pop.hpp\"\n-\n-namespace libtorrent {\n-namespace aux {\n-\n-struct allocator_new_delete\n-{\n-\tusing size_type = std::size_t;\n-\tusing difference_type = std::ptrdiff_t;\n-\n-
    \tstatic char* malloc(size_type const bytes)\n-
    \t{ return new char[bytes]; }\n-\tstatic void free(char* const block)\n-\t{ delete [] block; }\n-};\n-\n-using pool = boost::pool<allocator_new_delete>;\n-\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_/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@@ -11955,15 +11760,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@@ -12006,8 +11811,203 @@\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_/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+
    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+\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+
    \t\t// 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+\t\tbool complete_sent : 1;\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
    \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -454,14 +454,413 @@\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/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bi_\bm_\bp_\bl_\b._\bc_\bp_\bp_\b:_\b1_\b1_\b4_\b2_\b _\b _\b|_\bc_\bl_\bo_\bs_\bi_\bn_\bg_\b _\bt_\bh_\be_\b _\bu_\bd_\bp_\b _\bs_\bo_\bc_\bk_\be_\bt_\bs_\b _\bh_\be_\br_\be_\b _\bm_\be_\ba_\bn_\bs_\b _\bt_\bh_\ba_\bt_\b _\bt_\bh_\be_\b _\bu_\bT_\bP_\b _\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\bs_\b _\bc_\ba_\bn_\bn_\bo_\bt_\b _\bb_\be_\b _\bc_\bl_\bo_\bs_\be_\bd_\b _\bg_\br_\ba_\bc_\be_\bf_\bu_\bl_\bl_\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 |\n+|*\b**\b**\b**\b**\b* c\bcl\blo\bos\bsi\bin\bng\bg t\bth\bhe\be u\bud\bdp\bp s\bso\boc\bck\bke\bet\bts\bs h\bhe\ber\bre\be m\bme\bea\ban\bns\bs t\bth\bha\bat\bt t\bth\bhe\be u\buT\bTP\bP c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bns\bs c\bca\ban\bnn\bno\bot\bt b\bbe\be c\bcl\blo\bos\bse\bed\bd g\bgr\bra\bac\bce\bef\bfu\bul\bll\bly\by *\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:1\b11\b14\b42\b2 *\b**\b**\b* |\n+|#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+|\t\t\t++i; |\n+|\t\t\tp->disconnect(errors::stopping_torrent, operation_t::bittorrent); |\n+|\t\t} |\n+| |\n+|\t\t// close the listen sockets |\n+|\t\tfor (auto const& l : m_listen_sockets) |\n+|\t\t{ |\n+|\t\t\tif (l->sock) |\n+|\t\t\t{ |\n+|\t\t\t\tl->sock->close(ec); |\n+|\t\t\t\tTORRENT_ASSERT(!ec); |\n+|\t\t\t} |\n+| |\n+|if (l->udp_sock) |\n+|{ |\n+|\t\t\t\tl->udp_sock->sock.close(); |\n+|\t\t\t} |\n+|\t\t} |\n+| |\n+|\t\t// we need to give all the sockets an opportunity to actually have their handlers |\n+|\t\t// called and cancelled before we continue the shutdown. This is a bit |\n+|\t\t// complicated, if there are no \"undead\" peers, it's safe to resume the |\n+|\t\t// shutdown, but if there are, we have to wait for them to be cleared out |\n+|\t\t// first. In session_impl::on_tick() we check them periodically. If we're |\n+|\t\t// shutting down and we remove the last one, we'll initiate |\n+|\t\t// shutdown_stage2 from there. |\n+|\t\tif (m_undead_peers.empty()) |\n+|\t\t{ |\n+|\t\t\tpost(m_io_context, make_handler([this] { abort_stage2(); } |\n+|\t\t\t\t, m_abort_handler_storage, *this)); |\n+|\t\t} |\n+|\t} |\n+| |\n+|\tvoid session_impl::abort_stage2() noexcept |\n+|\t{ |\n+|\t\tm_download_rate.close(); |\n+|\t\tm_upload_rate.close(); |\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+|_\b\t_\b\t_\b/_\b/_\b _\bn_\bo_\bw_\b _\bi_\bt_\b'_\bs_\b _\bO_\bK_\b _\bf_\bo_\br_\b _\bt_\bh_\be_\b _\bn_\be_\bt_\bw_\bo_\br_\bk_\b _\bt_\bh_\br_\be_\ba_\bd_\b _\bt_\bo_\b _\be_\bx_\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 |\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__\bi_\bm_\bp_\bl_\b._\bc_\bp_\bp_\b:_\b1_\b6_\b3_\b8_\b _\b _\b|_\bt_\bh_\be_\b _\bl_\bo_\bg_\bi_\bc_\b _\bi_\bn_\b _\bt_\bh_\bi_\bs_\b _\bi_\bf_\b-_\bb_\bl_\bo_\bc_\bk_\b _\bs_\bh_\bo_\bu_\bl_\bd_\b _\bb_\be_\b _\bf_\ba_\bc_\bt_\bo_\br_\be_\bd_\b _\bo_\bu_\bt_\b _\bi_\bn_\bt_\bo_\b _\ba_\b _\bs_\be_\bp_\ba_\br_\ba_\bt_\be_\b _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn_\b._\b _\bA_\bt_\b _\bl_\be_\ba_\bs_\bt_\b _\bm_\bo_\bs_\bt_\b _\bo_\bf_\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 |\n+|*\b**\b**\b**\b**\b* t\bth\bhe\be l\blo\bog\bgi\bic\bc i\bin\bn t\bth\bhi\bis\bs i\bif\bf-\b-b\bbl\blo\boc\bck\bk s\bsh\bho\bou\bul\bld\bd b\bbe\be f\bfa\bac\bct\bto\bor\bre\bed\bd o\bou\but\bt i\bin\bnt\bto\bo a\ba s\bse\bep\bpa\bar\bra\bat\bte\be f\bfu\bun\bnc\bct\bti\bio\bon\bn.\b. A\bAt\bt l\ble\bea\bas\bst\bt m\bmo\bos\bst\bt o\bof\bf i\bit\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_i\bim\bmp\bpl\bl.\b.c\bcp\bpp\bp:\b:1\b16\b63\b38\b8 *\b**\b**\b* |\n+|, (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+|\t\tauto ret = std::make_shared(); |\n+|\t\tret->ssl = lep.ssl; |\n+|\t\tret->original_port = bind_ep.port(); |\n+|\t\tret->flags = lep.flags; |\n+|\t\tret->netmask = lep.netmask; |\n+|\t\toperation_t last_op = operation_t::unknown; |\n+|\t\tsocket_type_t const sock_type |\n+|\t\t\t= (lep.ssl == transport::ssl) |\n+|\t\t\t? socket_type_t::tcp_ssl |\n+|\t\t\t: socket_type_t::tcp; |\n+| |\n+|\t\t// if we're in force-proxy mode, don't open TCP listen sockets. We cannot |\n+|\t\t// accept connections on our local machine in this case. |\n+|if (ret->flags & listen_socket_t::accept_incoming) |\n+|{ |\n+|\t\t\tret->sock = std::make_shared(m_io_context); |\n+|\t\t\tret->sock->open(bind_ep.protocol(), ec); |\n+|\t\t\tlast_op = operation_t::sock_open; |\n+|\t\t\tif (ec) |\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\tsession_log(\"failed to open socket: %s\" |\n+|\t\t\t\t\t\t, ec.message().c_str()); |\n+|\t\t\t\t} |\n+|#endif |\n+| |\n+|\t\t\t\tif (m_alerts.should_post()) |\n+|\t\t\t\t\tm_alerts.emplace_alert(lep.device, bind_ep, last_op |\n+|\t\t\t\t\t\t, ec, sock_type); |\n+|\t\t\t\treturn ret; |\n+|\t\t\t} |\n+| |\n+|#ifdef TORRENT_WINDOWS |\n+|\t\t\t{ |\n+|\t\t\t\t// this is best-effort. ignore errors |\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+|_\b\t_\b\t_\b\t_\b\t_\b\t_\b\t_\b,_\b _\be_\br_\br_\b._\bm_\be_\bs_\bs_\ba_\bg_\be_\b(_\b)_\b._\bc_\b__\bs_\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 _\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__\bi_\bm_\bp_\bl_\b._\bc_\bp_\bp_\b:_\b2_\b6_\b0_\b6_\b _\b _\b|_\bi_\bt_\b _\bw_\bo_\bu_\bl_\bd_\b _\bb_\be_\b _\bn_\be_\ba_\bt_\b _\bi_\bf_\b _\bt_\bh_\be_\b _\bu_\bt_\bp_\b _\bs_\bo_\bc_\bk_\be_\bt_\b _\bm_\ba_\bn_\ba_\bg_\be_\br_\b _\bw_\bo_\bu_\bl_\bd_\b _\bh_\ba_\bn_\bd_\bl_\be_\b _\bI_\bC_\bM_\bP_\b _\be_\br_\br_\bo_\br_\bs_\b _\bt_\bo_\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 |\n+|*\b**\b**\b**\b**\b* i\bit\bt w\bwo\bou\bul\bld\bd b\bbe\be n\bne\bea\bat\bt i\bif\bf t\bth\bhe\be u\but\btp\bp s\bso\boc\bck\bke\bet\bt m\bma\ban\bna\bag\bge\ber\br w\bwo\bou\bul\bld\bd h\bha\ban\bnd\bdl\ble\be I\bIC\bCM\bMP\bP e\ber\brr\bro\bor\brs\bs t\bto\boo\bo *\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:2\b26\b60\b06\b6 *\b**\b**\b* |\n+|\t\tstd::shared_ptr 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+|#endif |\n+|\t\t\tm_utp_socket_manager; |\n+| |\n+|\t\tfor (;;) |\n+|\t\t{ |\n+|\t\t\taux::array p; |\n+|\t\t\terror_code err; |\n+|\t\t\tint const num_packets = s->sock.read(p, err); |\n+| |\n+|\t\t\tfor (udp_socket::packet& packet : span(p).first(num_packets)) |\n+|\t\t\t{ |\n+|\t\t\t\tif (packet.error) |\n+|\t\t\t\t{ |\n+| |\n+|#ifndef TORRENT_DISABLE_DHT |\n+|\t\t\t\t\tif (m_dht) |\n+|\t\t\t\t\t\tm_dht->incoming_error(packet.error, packet.from); |\n+|#endif |\n+| |\n+|\t\t\t\t\tm_tracker_manager.incoming_error(packet.error, packet.from); |\n+|\t\t\t\t\tcontinue; |\n+|\t\t\t\t} |\n+| |\n+|\t\t\t\tspan const buf = packet.data; |\n+|\t\t\t\tif (!packet.hostname.empty()) |\n+|\t\t\t\t{ |\n+|\t\t\t\t\t// only the tracker manager supports receiving UDP packets |\n+|\t\t\t\t\t// from hostnames. If it won't handle it, no one else will |\n+|\t\t\t\t\t// either |\n+|\t\t\t\t\tm_tracker_manager.incoming_packet(packet.hostname, buf); |\n+|\t\t\t\t\tcontinue; |\n+|\t\t\t\t} |\n+| |\n+|\t\t\t\t// give the uTP socket manager first dibs on the packet. Presumably |\n+|\t\t\t\t// the majority of packets are uTP packets. |\n+|\t\t\t\tif (!mgr.incoming_packet(ls, packet.from, buf)) |\n+|\t\t\t\t{ |\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+|_\b\t_\b\t_\b\t_\b\t_\b\t_\b\t_\b&_\b&_\b _\bb_\bu_\bf_\b._\bf_\br_\bo_\bn_\bt_\b(_\b)_\b _\b=_\b=_\b _\b'_\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 |\n+| | |it would probably make sense to have a separate list of peers that are eligible for optimistic unchoke, similar to the torrents |\n+|relevance\u00a03|_\b._\b._\b/_\bs_\br_\bc_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bi_\bm_\bp_\bl_\b._\bc_\bp_\bp_\b:_\b4_\b1_\b5_\b5 |perhaps this could even iterate over the pool allocators of 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 even more sense, just pick the next peer in the queue for |\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_\bn_\bc_\bh_\bo_\bk_\bi_\bn_\bg_\b._\b _\bI_\bt_\b _\bw_\bo_\bu_\bl_\bd_\b _\bb_\be_\b _\bO_\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 |\n+|*\b**\b**\b**\b**\b* i\bit\bt w\bwo\bou\bul\bld\bd p\bpr\bro\bob\bba\bab\bbl\bly\by m\bma\bak\bke\be s\bse\ben\bns\bse\be t\bto\bo h\bha\bav\bve\be a\ba s\bse\bep\bpa\bar\bra\bat\bte\be l\bli\bis\bst\bt o\bof\bf p\bpe\bee\ber\brs\bs t\bth\bha\bat\bt a\bar\bre\be e\bel\bli\big\bgi\bib\bbl\ble\be f\bfo\bor\br o\bop\bpt\bti\bim\bmi\bis\bst\bti\bic\bc u\bun\bnc\bch\bho\bok\bke\be,\b, s\bsi\bim\bmi\bil\bla\bar\br t\bto\bo t\bth\bhe\be t\bto\bor\brr\bre\ben\bnt\bts\bs p\bpe\ber\brh\bha\bap\bps\bs t\bth\bhi\bis\bs c\bco\bou\bul\bld\bd e\bev\bve\ben\bn i\bit\bte\ber\bra\bat\bte\be o\bov\bve\ber\br t\bth\bhe\be |\n+|p\bpo\boo\bol\bl a\bal\bll\blo\boc\bca\bat\bto\bor\brs\bs o\bof\bf t\bto\bor\brr\bre\ben\bnt\bt_\b_p\bpe\bee\ber\br o\bob\bbj\bje\bec\bct\bts\bs.\b. I\bIt\bt c\bco\bou\bul\bld\bd p\bpr\bro\bob\bba\bab\bbl\bly\by b\bbe\be d\bdo\bon\bne\be i\bin\bn a\ba s\bsi\bin\bng\bgl\ble\be p\bpa\bas\bss\bs a\ban\bnd\bd c\bco\bol\bll\ble\bec\bct\bt t\bth\bhe\be n\bn b\bbe\bes\bst\bt c\bca\ban\bnd\bdi\bid\bda\bat\bte\bes\bs.\b. m\bma\bay\byb\bbe\be j\bju\bus\bst\bt a\ba q\bqu\bue\beu\bue\be o\bof\bf p\bpe\bee\ber\brs\bs w\bwo\bou\bul\bld\bd m\bma\bak\bke\be e\bev\bve\ben\bn m\bmo\bor\bre\be s\bse\ben\bns\bse\be,\b, |\n+|j\bju\bus\bst\bt p\bpi\bic\bck\bk t\bth\bhe\be n\bne\bex\bxt\bt p\bpe\bee\ber\br i\bin\bn t\bth\bhe\be q\bqu\bue\beu\bue\be f\bfo\bor\br u\bun\bnc\bch\bho\bok\bki\bin\bng\bg.\b. I\bIt\bt w\bwo\bou\bul\bld\bd b\bbe\be O\bO(\b(1\b1)\b).\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:4\b41\b15\b55\b5 *\b**\b**\b* |\n+|} |\n+| |\n+|\tvoid session_impl::recalculate_optimistic_unchoke_slots() |\n+|\t{ |\n+|\t\tINVARIANT_CHECK; |\n+| |\n+|\t\tTORRENT_ASSERT(is_single_thread()); |\n+|\t\tif (m_stats_counters[counters::num_unchoke_slots] == 0) return; |\n+| |\n+|\t\t// if we unchoke everyone, skip this logic |\n+|\t\tif (settings().get_int(settings_pack::choking_algorithm) == settings_pack::fixed_slots_choker |\n+|\t\t\t&& settings().get_int(settings_pack::unchoke_slots_limit) < 0) |\n+|\t\t\treturn; |\n+| |\n+|\t\tstd::vector opt_unchoke; |\n+| |\n+|\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 prev_opt_unchoke; |\n+| |\n+|for (auto& i : m_connections) |\n+|{ |\n+|\t\t\tpeer_connection* const p = i.get(); |\n+|\t\t\tTORRENT_ASSERT(p); |\n+|\t\t\ttorrent_peer* pi = p->peer_info_struct(); |\n+|\t\t\tif (!pi) continue; |\n+|\t\t\tif (pi->web_seed) continue; |\n+| |\n+|\t\t\tif (pi->optimistically_unchoked) |\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+|_\b\t_\b\t_\b\t_\bi_\bf_\b _\b(_\b!_\bt_\b)_\b _\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 |\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__\bi_\bm_\bp_\bl_\b._\bc_\bp_\bp_\b:_\b4_\b1_\b7_\b8_\b _\b _\b|_\bp_\be_\be_\br_\bs_\b _\bs_\bh_\bo_\bu_\bl_\bd_\b _\bk_\bn_\bo_\bw_\b _\bw_\bh_\be_\bt_\bh_\be_\br_\b _\bt_\bh_\be_\bi_\br_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\b _\bi_\bs_\b _\bp_\ba_\bu_\bs_\be_\bd_\b _\bo_\br_\b _\bn_\bo_\bt_\b,_\b _\bi_\bn_\bs_\bt_\be_\ba_\bd_\b _\bo_\bf_\b _\bh_\ba_\bv_\bi_\bn_\bg_\b _\bt_\bo_\b _\ba_\bs_\bk_\b _\bi_\bt_\b _\bo_\bv_\be_\br_\b _\ba_\bn_\bd_\b _\bo_\bv_\be_\br_\b _\ba_\bg_\ba_\bi_\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 |\n+|*\b**\b**\b**\b**\b* p\bpe\bee\ber\brs\bs s\bsh\bho\bou\bul\bld\bd k\bkn\bno\bow\bw w\bwh\bhe\bet\bth\bhe\ber\br t\bth\bhe\bei\bir\br t\bto\bor\brr\bre\ben\bnt\bt i\bis\bs p\bpa\bau\bus\bse\bed\bd o\bor\br n\bno\bot\bt,\b, i\bin\bns\bst\bte\bea\bad\bd o\bof\bf h\bha\bav\bvi\bin\bng\bg t\bto\bo a\bas\bsk\bk i\bit\bt o\bov\bve\ber\br a\ban\bnd\bd o\bov\bve\ber\br a\bag\bga\bai\bin\bn *\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:4\b41\b17\b78\b8 *\b**\b**\b* |\n+|// 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 prev_opt_unchoke; |\n+| |\n+|\t\tfor (auto& i : m_connections) |\n+|\t\t{ |\n+|\t\t\tpeer_connection* const p = i.get(); |\n+|\t\t\tTORRENT_ASSERT(p); |\n+|\t\t\ttorrent_peer* pi = p->peer_info_struct(); |\n+|\t\t\tif (!pi) continue; |\n+|\t\t\tif (pi->web_seed) continue; |\n+| |\n+|\t\t\tif (pi->optimistically_unchoked) |\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+|if (t->is_paused()) continue; |\n+| |\n+|\t\t\tif (!p->is_connecting() |\n+|\t\t\t\t&& !p->is_disconnecting() |\n+|\t\t\t\t&& p->is_peer_interested() |\n+|\t\t\t\t&& t->free_upload_slots() |\n+|\t\t\t\t&& (p->is_choked() || pi->optimistically_unchoked) |\n+|\t\t\t\t&& !p->ignore_unchoke_slots() |\n+|\t\t\t\t&& t->valid_metadata()) |\n+|\t\t\t{ |\n+|\t\t\t\topt_unchoke.emplace_back(&i); |\n+|\t\t\t} |\n+|\t\t} |\n+| |\n+|\t\t// find the peers that has been waiting the longest to be optimistically |\n+|\t\t// unchoked |\n+| |\n+|\t\tint num_opt_unchoke = m_settings.get_int(settings_pack::num_optimistic_unchoke_slots); |\n+|\t\tint const allowed_unchoke_slots = int(m_stats_counters[counters::num_unchoke_slots]); |\n+|\t\tif (num_opt_unchoke == 0) num_opt_unchoke = std::max(1, allowed_unchoke_slots / 5); |\n+|\t\tif (num_opt_unchoke > int(opt_unchoke.size())) num_opt_unchoke = |\n+|\t\t\tint(opt_unchoke.size()); |\n+| |\n+|\t\t// find the n best optimistic unchoke candidates |\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+|_\b\t_\b\t_\b\t_\b,_\b _\bl_\ba_\bs_\bt_\b__\bo_\bp_\bt_\bi_\bm_\bi_\bs_\bt_\bi_\bc_\b__\bu_\bn_\bc_\bh_\bo_\bk_\be_\b__\bc_\bm_\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 |\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__\bi_\bm_\bp_\bl_\b._\bc_\bp_\bp_\b:_\b4_\b4_\b2_\b4_\b _\b _\b|_\bt_\bh_\be_\br_\be_\b _\bs_\bh_\bo_\bu_\bl_\bd_\b _\bb_\be_\b _\ba_\b _\bp_\br_\be_\b-_\bc_\ba_\bl_\bc_\bu_\bl_\ba_\bt_\be_\bd_\b _\bl_\bi_\bs_\bt_\b _\bo_\bf_\b _\ba_\bl_\bl_\b _\bp_\be_\be_\br_\bs_\b _\be_\bl_\bi_\bg_\bi_\bb_\bl_\be_\b _\bf_\bo_\br_\b _\bu_\bn_\bc_\bh_\bo_\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 |\n+|*\b**\b**\b**\b**\b* t\bth\bhe\ber\bre\be s\bsh\bho\bou\bul\bld\bd b\bbe\be a\ba p\bpr\bre\be-\b-c\bca\bal\blc\bcu\bul\bla\bat\bte\bed\bd l\bli\bis\bst\bt o\bof\bf a\bal\bll\bl p\bpe\bee\ber\brs\bs e\bel\bli\big\bgi\bib\bbl\ble\be f\bfo\bor\br u\bun\bnc\bch\bho\bok\bki\bin\bng\bg *\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:4\b44\b42\b24\b4 *\b**\b**\b* |\n+|} |\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+|\t\ttime_duration const unchoke_interval = now - m_last_choke; |\n+|\t\tm_last_choke = now; |\n+| |\n+|\t\t// if we unchoke everyone, skip this logic |\n+|\t\tif (settings().get_int(settings_pack::choking_algorithm) == settings_pack::fixed_slots_choker |\n+|\t\t\t&& settings().get_int(settings_pack::unchoke_slots_limit) < 0) |\n+|\t\t{ |\n+|\t\t\tm_stats_counters.set_value(counters::num_unchoke_slots, std::numeric_limits::max()); |\n+|\t\t\treturn; |\n+|\t\t} |\n+| |\n+|\t\t// build list of all peers that are |\n+|\t\t// unchokable. |\n+|std::vector peers; |\n+|for (auto i = m_connections.begin(); i != m_connections.end();) |\n+|\t\t{ |\n+|\t\t\tstd::shared_ptr p = *i; |\n+|\t\t\tTORRENT_ASSERT(p); |\n+|\t\t\t++i; |\n+|\t\t\ttorrent* const t = p->associated_torrent().lock().get(); |\n+|\t\t\ttorrent_peer* const pi = p->peer_info_struct(); |\n+| |\n+|\t\t\tif (p->ignore_unchoke_slots() || t == nullptr || pi == nullptr |\n+|\t\t\t\t|| pi->web_seed || t->is_paused()) |\n+|\t\t\t{ |\n+|\t\t\t\tp->reset_choke_counters(); |\n+|\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+|\t\t\t\t// this peer is not unchokable. So, if it's unchoked |\n+|\t\t\t\t// already, make sure to choke it. |\n+|\t\t\t\tif (p->is_choked()) |\n+|\t\t\t\t{ |\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+|_\b\t_\b\t_\b\t_\b\t_\b\t_\bp_\bi_\b-_\b>_\bo_\bp_\bt_\bi_\bm_\bi_\bs_\bt_\bi_\bc_\ba_\bl_\bl_\by_\b__\bu_\bn_\bc_\bh_\bo_\bk_\be_\bd_\b _\b=_\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 |\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__\bi_\bm_\bp_\bl_\b._\bc_\bp_\bp_\b:_\b6_\b1_\b3_\b6_\b _\b _\b|_\bu_\bs_\be_\b _\bp_\bu_\bb_\bl_\bi_\bc_\b__\bk_\be_\by_\b _\bh_\be_\br_\be_\b _\bi_\bn_\bs_\bt_\be_\ba_\bd_\b _\bo_\bf_\b _\bs_\bt_\bd_\b:_\b:_\ba_\br_\br_\ba_\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 |\n+|*\b**\b**\b**\b**\b* u\bus\bse\be p\bpu\bub\bbl\bli\bic\bc_\b_k\bke\bey\by h\bhe\ber\bre\be i\bin\bns\bst\bte\bea\bad\bd o\bof\bf s\bst\btd\bd:\b::\b:a\bar\brr\bra\bay\by *\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\b13\b36\b6 *\b**\b**\b* |\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+|\t// callback for dht_mutable_get |\n+|\tvoid session_impl::get_mutable_callback(dht::item const& i |\n+|\t\t, bool const authoritative) |\n+|\t{ |\n+|\t\tTORRENT_ASSERT(i.is_mutable()); |\n+|\t\tm_alerts.emplace_alert(i.pk().bytes |\n+|\t\t\t, i.sig().bytes, i.seq().value |\n+|\t\t\t, i.salt(), i.value(), authoritative); |\n+|\t} |\n+| |\n+|\t// key is a 32-byte binary string, the public key to look up. |\n+|\t// the salt is optional |\n+|void session_impl::dht_get_mutable_item(std::array key |\n+|, std::string salt) |\n+|\t{ |\n+|\t\tif (!m_dht) return; |\n+|\t\tm_dht->get_item(dht::public_key(key.data()), std::bind(&session_impl::get_mutable_callback |\n+|\t\t\t, this, _1, _2), std::move(salt)); |\n+|\t} |\n+| |\n+|\tnamespace { |\n+| |\n+|\t\tvoid on_dht_put_immutable_item(aux::alert_manager& alerts, sha1_hash target, int num) |\n+|\t\t{ |\n+|\t\t\tif (alerts.should_post()) |\n+|\t\t\t\talerts.emplace_alert(target, num); |\n+|\t\t} |\n+| |\n+|\t\tvoid on_dht_put_mutable_item(aux::alert_manager& alerts, dht::item const& i, int num) |\n+|\t\t{ |\n+|\t\t\tif (alerts.should_post()) |\n+|\t\t\t{ |\n+|\t\t\t\tdht::signature const sig = i.sig(); |\n+|\t\t\t\tdht::public_key const pk = i.pk(); |\n+|\t\t\t\tdht::sequence_number const seq = i.seq(); |\n+|\t\t\t\tstd::string salt = i.salt(); |\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/_\bu_\bt_\b__\bm_\be_\bt_\ba_\bd_\ba_\bt_\ba_\b._\bc_\bp_\bp_\b:_\b2_\b6_\b8_\b _\b _\b _\b _\b|_\bu_\bs_\be_\b _\bt_\bh_\be_\b _\ba_\bu_\bx_\b:_\b:_\bw_\br_\bi_\bt_\be_\b__\b*_\b _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn_\bs_\b _\ba_\bn_\bd_\b _\bt_\bh_\be_\b _\bs_\bp_\ba_\bn_\b _\bh_\be_\br_\be_\b _\bi_\bn_\bs_\bt_\be_\ba_\bd_\b,_\b _\bi_\bt_\b _\bw_\bi_\bl_\bl_\b _\bf_\bi_\bt_\b _\bb_\be_\bt_\bt_\be_\br_\b _\bw_\bi_\bt_\bh_\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 _\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 a\bau\bux\bx:\b::\b:w\bwr\bri\bit\bte\be_\b_*\b* f\bfu\bun\bnc\bct\bti\bio\bon\bns\bs a\ban\bnd\bd t\bth\bhe\be s\bsp\bpa\ban\bn h\bhe\ber\bre\be i\bin\bns\bst\bte\bea\bad\bd,\b, i\bit\bt w\bwi\bil\bll\bl f\bfi\bit\bt b\bbe\bet\btt\bte\ber\br w\bwi\bit\bth\bh s\bse\ben\bnd\bd_\b_b\bbu\buf\bff\bfe\ber\br(\b()\b) *\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\b26\b68\b8 *\b**\b**\b* |\n+|int metadata_piece_size = 0; |\n+| |\n+|\t\t\tif (m_torrent.valid_metadata()) |\n+|\t\t\t\te[\"total_size\"] = m_tp.metadata().size(); |\n+| |\n+|\t\t\tif (type == msg_t::piece) |\n+|\t\t\t{ |\n+|\t\t\t\tTORRENT_ASSERT(piece >= 0 && piece < (m_tp.metadata().size() + 16 * 1024 - 1) / (16 * 1024)); |\n+|\t\t\t\tTORRENT_ASSERT(m_pc.associated_torrent().lock()->valid_metadata()); |\n+|\t\t\t\tTORRENT_ASSERT(m_torrent.valid_metadata()); |\n+| |\n+|\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+|char msg[200]; |\n+|char* 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+|_\b\t_\b\t_\b\t_\bm_\b__\bp_\bc_\b._\bs_\be_\bn_\bd_\b__\bb_\bu_\bf_\bf_\be_\br_\b(_\b{_\bm_\bs_\bg_\b,_\b _\bl_\be_\bn_\b _\b+_\b _\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 |_\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@@ -508,179 +907,14 @@\n |\t} |\n | |\n |\tvoid session_handle::dht_get_peers(sha1_hash const& info_hash) |\n |\t{ |\n |#ifndef TORRENT_DISABLE_DHT |\n |\t\tasync_call(&session_impl::dht_get_peers, info_hash); |\n |_\b#_\be_\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 _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-| |_\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: |instead of having to ask the torrent whether it's in graceful pause mode or not, the peers should keep that state (and the torrent |\n-|relevance\u00a03|_\b3_\b1_\b3_\b3 |should update them when it enters graceful pause). When a peer enters graceful pause mode, it should cancel all outstanding requests|\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|_\ba_\bn_\bd_\b _\bc_\bl_\be_\ba_\br_\b _\bi_\bt_\bs_\b _\br_\be_\bq_\bu_\be_\bs_\bt_\b _\bq_\bu_\be_\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 |\n-|*\b**\b**\b**\b**\b* i\bin\bns\bst\bte\bea\bad\bd o\bof\bf h\bha\bav\bvi\bin\bng\bg t\bto\bo a\bas\bsk\bk t\bth\bhe\be t\bto\bor\brr\bre\ben\bnt\bt w\bwh\bhe\bet\bth\bhe\ber\br i\bit\bt'\b's\bs i\bin\bn g\bgr\bra\bac\bce\bef\bfu\bul\bl p\bpa\bau\bus\bse\be m\bmo\bod\bde\be o\bor\br n\bno\bot\bt,\b, t\bth\bhe\be p\bpe\bee\ber\brs\bs s\bsh\bho\bou\bul\bld\bd k\bke\bee\bep\bp t\bth\bha\bat\bt s\bst\bta\bat\bte\be (\b(a\ban\bnd\bd t\bth\bhe\be t\bto\bor\brr\bre\ben\bnt\bt s\bsh\bho\bou\bul\bld\bd u\bup\bpd\bda\bat\bte\be t\bth\bhe\bem\bm w\bwh\bhe\ben\bn i\bit\bt e\ben\bnt\bte\ber\brs\bs |\n-|g\bgr\bra\bac\bce\bef\bfu\bul\bl p\bpa\bau\bus\bse\be)\b).\b. W\bWh\bhe\ben\bn a\ba p\bpe\bee\ber\br e\ben\bnt\bte\ber\brs\bs g\bgr\bra\bac\bce\bef\bfu\bul\bl p\bpa\bau\bus\bse\be m\bmo\bod\bde\be,\b, i\bit\bt s\bsh\bho\bou\bul\bld\bd c\bca\ban\bnc\bce\bel\bl a\bal\bll\bl o\bou\but\bts\bst\bta\ban\bnd\bdi\bin\bng\bg r\bre\beq\bqu\bue\bes\bst\bts\bs a\ban\bnd\bd c\bcl\ble\bea\bar\br i\bit\bts\bs r\bre\beq\bqu\bue\bes\bst\bt q\bqu\bue\beu\bue\be.\b. *\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\b31\b13\b33\b3 *\b**\b**\b* |\n-|// to disk or are in the disk write cache |\n-|\t\tif (picker.is_piece_finished(p.piece) && !was_finished) |\n-|\t\t{ |\n-|#if TORRENT_USE_INVARIANT_CHECKS |\n-|\t\t\tcheck_postcondition post_checker2_(t, false); |\n-|#endif |\n-|\t\t\tt->verify_piece(p.piece); |\n-|\t\t} |\n-| |\n-|\t\tcheck_graceful_pause(); |\n-| |\n-|\t\tif (is_disconnecting()) return; |\n-| |\n-|\t\tif (request_a_block(*t, *this)) |\n-|\t\t\tm_counters.inc_stats_counter(counters::incoming_piece_picks); |\n-|\t\tsend_block_requests(); |\n-|\t} |\n-| |\n-|\tvoid peer_connection::check_graceful_pause() |\n-|\t{ |\n-|std::shared_ptr t = m_torrent.lock(); |\n-|if (!t || !t->graceful_pause()) return; |\n-| |\n-|\t\tif (m_outstanding_bytes > 0) return; |\n-| |\n-|#ifndef TORRENT_DISABLE_LOGGING |\n-|\t\tpeer_log(peer_log_alert::info, \"GRACEFUL_PAUSE\", \"NO MORE DOWNLOAD\"); |\n-|#endif |\n-|\t\tdisconnect(errors::torrent_paused, operation_t::bittorrent); |\n-|\t} |\n-| |\n-|\tvoid peer_connection::on_disk_write_complete(storage_error const& error |\n-|\t\t, peer_request const& p, std::shared_ptr t) |\n-|\t{ |\n-|\t\tTORRENT_ASSERT(is_single_thread()); |\n-|#ifndef TORRENT_DISABLE_LOGGING |\n-|\t\tif (should_log(peer_log_alert::info)) |\n-|\t\t{ |\n-|\t\t\tpeer_log(peer_log_alert::info, \"FILE_ASYNC_WRITE_COMPLETE\", \"piece: %d s: %x l: %x e: %s\" |\n-|\t\t\t\t, static_cast(p.piece), p.start, p.length, error.ec.message().c_str()); |\n-|\t\t} |\n-|#endif |\n-| |\n-|\t\tm_counters.inc_stats_counter(counters::queued_write_bytes, -p.length); |\n-|\t\tm_outstanding_writing_bytes -= p.length; |\n-| |\n-|\t\tTORRENT_ASSERT(m_outstanding_writing_bytes >= 0); |\n-| |\n-|\t\t// every peer is entitled to allocate a disk buffer if it has no writes outstanding |\n-|\t\t// see the comment in incoming_piece |\n-|_\b\t_\b\t_\bi_\bf_\b _\b(_\bm_\b__\bo_\bu_\bt_\bs_\bt_\ba_\bn_\bd_\bi_\bn_\bg_\b__\bw_\br_\bi_\bt_\bi_\bn_\bg_\b__\bb_\by_\bt_\be_\bs_\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 _\b |\n-|relevance\u00a03|_\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: |once peers are properly put in graceful pause mode, they can cancel all outstanding requests and this test can be removed. |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b4_\b0_\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* o\bon\bnc\bce\be p\bpe\bee\ber\brs\bs a\bar\bre\be p\bpr\bro\bop\bpe\ber\brl\bly\by p\bpu\but\bt i\bin\bn g\bgr\bra\bac\bce\bef\bfu\bul\bl p\bpa\bau\bus\bse\be m\bmo\bod\bde\be,\b, t\bth\bhe\bey\by c\bca\ban\bn c\bca\ban\bnc\bce\bel\bl a\bal\bll\bl o\bou\but\bts\bst\bta\ban\bnd\bdi\bin\bng\bg r\bre\beq\bqu\bue\bes\bst\bts\bs a\ban\bnd\bd t\bth\bhi\bis\bs t\bte\bes\bst\bt c\bca\ban\bn b\bbe\be r\bre\bem\bmo\bov\bve\bed\bd.\b. *\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:4\b40\b04\b44\b4 *\b**\b**\b* |\n-|\t\t\tif (!p->m_deferred_send_block_requests) |\n-|\t\t\t\treturn; |\n-| |\n-|\t\t\tp->m_deferred_send_block_requests = false; |\n-|\t\t\tp->send_block_requests_impl(); |\n-|\t\t}); |\n-|\t\tm_deferred_send_block_requests = true; |\n-|\t} |\n-| |\n-|\tvoid peer_connection::send_block_requests_impl() |\n-|\t{ |\n-|\t\tTORRENT_ASSERT(is_single_thread()); |\n-|\t\tINVARIANT_CHECK; |\n-| |\n-|\t\tstd::shared_ptr t = m_torrent.lock(); |\n-|\t\tif (!t) return; |\n-| |\n-|\t\tif (m_disconnecting) return; |\n-| |\n-|if (t->graceful_pause()) return; |\n-| |\n-|\t\t// we can't download pieces in these states |\n-|\t\tif (t->state() == torrent_status::checking_files |\n-|\t\t\t|| t->state() == torrent_status::checking_resume_data |\n-|\t\t\t|| t->state() == torrent_status::downloading_metadata) |\n-|\t\t\treturn; |\n-| |\n-|\t\tif (int(m_download_queue.size()) >= m_desired_queue_size |\n-|\t\t\t|| t->upload_mode()) return; |\n-| |\n-|\t\tbool const empty_download_queue = m_download_queue.empty(); |\n-| |\n-|\t\twhile (!m_request_queue.empty() |\n-|\t\t\t&& (int(m_download_queue.size()) < m_desired_queue_size |\n-|\t\t\t\t|| m_queued_time_critical > 0)) |\n-|\t\t{ |\n-|\t\t\tpending_block block = m_request_queue.front(); |\n-| |\n-|\t\t\tm_request_queue.erase(m_request_queue.begin()); |\n-|\t\t\tif (m_queued_time_critical) --m_queued_time_critical; |\n-| |\n-|\t\t\t// if we're a seed, we don't have a piece picker |\n-|\t\t\t// so we don't have to worry about invariants getting |\n-|\t\t\t// out of sync with it |\n-|\t\t\tif (!t->has_picker()) continue; |\n-| |\n-|\t\t\t// this can happen if a block times out, is re-requested and |\n-|\t\t\t// then arrives \"unexpectedly\" |\n-|\t\t\tif (t->picker().is_downloaded(block.block)) |\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\u00a03|_\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: |new_piece should be an optional. piece index -1 should not be allowed |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b4_\b7_\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 _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* n\bne\bew\bw_\b_p\bpi\bie\bec\bce\be 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/p\bpe\bee\ber\br_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn.\b.c\bcp\bpp\bp:\b:4\b47\b73\b30\b0 *\b**\b**\b* |\n-|\t\t// pieces may be empty if we don't have metadata yet |\n-|\t\tif (p.pieces.empty()) |\n-|\t\t{ |\n-|\t\t\tp.progress = 0.f; |\n-|\t\t\tp.progress_ppm = 0; |\n-|\t\t} |\n-|\t\telse |\n-|\t\t{ |\n-|#if TORRENT_NO_FPU |\n-|\t\t\tp.progress = 0.f; |\n-|#else |\n-|\t\t\tp.progress = float(p.pieces.count()) / float(p.pieces.size()); |\n-|#endif |\n-|\t\t\tp.progress_ppm = int(std::int64_t(p.pieces.count()) * 1000000 / p.pieces.size()); |\n-|\t\t} |\n-| |\n-|\t} |\n-| |\n-|#ifndef TORRENT_DISABLE_SUPERSEEDING |\n-|void peer_connection::superseed_piece(piece_index_t const replace_piece |\n-|, piece_index_t const new_piece) |\n-|\t{ |\n-|\t\tTORRENT_ASSERT(is_single_thread()); |\n-| |\n-|\t\tif (is_connecting()) return; |\n-|\t\tif (in_handshake()) return; |\n-| |\n-|\t\tif (new_piece == piece_index_t(-1)) |\n-|\t\t{ |\n-|\t\t\tif (m_superseed_piece[0] == piece_index_t(-1)) return; |\n-|\t\t\tm_superseed_piece[0] = piece_index_t(-1); |\n-|\t\t\tm_superseed_piece[1] = piece_index_t(-1); |\n-| |\n-|#ifndef TORRENT_DISABLE_LOGGING |\n-|\t\t\tpeer_log(peer_log_alert::info, \"SUPER_SEEDING\", \"ending\"); |\n-|#endif |\n-|\t\t\tstd::shared_ptr t = m_torrent.lock(); |\n-|\t\t\tTORRENT_ASSERT(t); |\n-| |\n-|\t\t\t// this will either send a full bitfield or |\n-|\t\t\t// a have-all message, effectively terminating |\n-|\t\t\t// super-seeding, since the peer may pick any piece |\n-|\t\t\twrite_bitfield(); |\n-| |\n-|\t\t\treturn; |\n-|\t\t} |\n-| |\n-|\t\tTORRENT_ASSERT(!has_piece(new_piece)); |\n-| |\n-|_\b#_\bi_\bf_\bn_\bd_\be_\bf_\b _\bT_\bO_\bR_\bR_\bE_\bN_\bT_\b__\bD_\bI_\bS_\bA_\bB_\bL_\bE_\b__\bL_\bO_\bG_\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 _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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@@ -892,48 +1126,14 @@\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 |_\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/_\bu_\bt_\b__\bm_\be_\bt_\ba_\bd_\ba_\bt_\ba_\b._\bc_\bp_\bp_\b:_\b2_\b6_\b8_\b _\b _\b _\b _\b|_\bu_\bs_\be_\b _\bt_\bh_\be_\b _\ba_\bu_\bx_\b:_\b:_\bw_\br_\bi_\bt_\be_\b__\b*_\b _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn_\bs_\b _\ba_\bn_\bd_\b _\bt_\bh_\be_\b _\bs_\bp_\ba_\bn_\b _\bh_\be_\br_\be_\b _\bi_\bn_\bs_\bt_\be_\ba_\bd_\b,_\b _\bi_\bt_\b _\bw_\bi_\bl_\bl_\b _\bf_\bi_\bt_\b _\bb_\be_\bt_\bt_\be_\br_\b _\bw_\bi_\bt_\bh_\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 _\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 a\bau\bux\bx:\b::\b:w\bwr\bri\bit\bte\be_\b_*\b* f\bfu\bun\bnc\bct\bti\bio\bon\bns\bs a\ban\bnd\bd t\bth\bhe\be s\bsp\bpa\ban\bn h\bhe\ber\bre\be i\bin\bns\bst\bte\bea\bad\bd,\b, i\bit\bt w\bwi\bil\bll\bl f\bfi\bit\bt b\bbe\bet\btt\bte\ber\br w\bwi\bit\bth\bh s\bse\ben\bnd\bd_\b_b\bbu\buf\bff\bfe\ber\br(\b()\b) *\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\b26\b68\b8 *\b**\b**\b* |\n-|int metadata_piece_size = 0; |\n-| |\n-|\t\t\tif (m_torrent.valid_metadata()) |\n-|\t\t\t\te[\"total_size\"] = m_tp.metadata().size(); |\n-| |\n-|\t\t\tif (type == msg_t::piece) |\n-|\t\t\t{ |\n-|\t\t\t\tTORRENT_ASSERT(piece >= 0 && piece < (m_tp.metadata().size() + 16 * 1024 - 1) / (16 * 1024)); |\n-|\t\t\t\tTORRENT_ASSERT(m_pc.associated_torrent().lock()->valid_metadata()); |\n-|\t\t\t\tTORRENT_ASSERT(m_torrent.valid_metadata()); |\n-| |\n-|\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-|char msg[200]; |\n-|char* 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-|_\b\t_\b\t_\b\t_\bm_\b__\bp_\bc_\b._\bs_\be_\bn_\bd_\b__\bb_\bu_\bf_\bf_\be_\br_\b(_\b{_\bm_\bs_\bg_\b,_\b _\bl_\be_\bn_\b _\b+_\b _\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 |_\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@@ -1230,379 +1430,179 @@\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__\bi_\bm_\bp_\bl_\b._\bc_\bp_\bp_\b:_\b1_\b1_\b4_\b2_\b _\b _\b|_\bc_\bl_\bo_\bs_\bi_\bn_\bg_\b _\bt_\bh_\be_\b _\bu_\bd_\bp_\b _\bs_\bo_\bc_\bk_\be_\bt_\bs_\b _\bh_\be_\br_\be_\b _\bm_\be_\ba_\bn_\bs_\b _\bt_\bh_\ba_\bt_\b _\bt_\bh_\be_\b _\bu_\bT_\bP_\b _\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\bs_\b _\bc_\ba_\bn_\bn_\bo_\bt_\b _\bb_\be_\b _\bc_\bl_\bo_\bs_\be_\bd_\b _\bg_\br_\ba_\bc_\be_\bf_\bu_\bl_\bl_\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 |\n-|*\b**\b**\b**\b**\b* c\bcl\blo\bos\bsi\bin\bng\bg t\bth\bhe\be u\bud\bdp\bp s\bso\boc\bck\bke\bet\bts\bs h\bhe\ber\bre\be m\bme\bea\ban\bns\bs t\bth\bha\bat\bt t\bth\bhe\be u\buT\bTP\bP c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bns\bs c\bca\ban\bnn\bno\bot\bt b\bbe\be c\bcl\blo\bos\bse\bed\bd g\bgr\bra\bac\bce\bef\bfu\bul\bll\bly\by *\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:1\b11\b14\b42\b2 *\b**\b**\b* |\n-|#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+| |_\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: |instead of having to ask the torrent whether it's in graceful pause mode or not, the peers should keep that state (and the torrent |\n+|relevance\u00a03|_\b3_\b1_\b3_\b3 |should update them when it enters graceful pause). When a peer enters graceful pause mode, it should cancel all outstanding requests|\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|_\ba_\bn_\bd_\b _\bc_\bl_\be_\ba_\br_\b _\bi_\bt_\bs_\b _\br_\be_\bq_\bu_\be_\bs_\bt_\b _\bq_\bu_\be_\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 |\n+|*\b**\b**\b**\b**\b* i\bin\bns\bst\bte\bea\bad\bd o\bof\bf h\bha\bav\bvi\bin\bng\bg t\bto\bo a\bas\bsk\bk t\bth\bhe\be t\bto\bor\brr\bre\ben\bnt\bt w\bwh\bhe\bet\bth\bhe\ber\br i\bit\bt'\b's\bs i\bin\bn g\bgr\bra\bac\bce\bef\bfu\bul\bl p\bpa\bau\bus\bse\be m\bmo\bod\bde\be o\bor\br n\bno\bot\bt,\b, t\bth\bhe\be p\bpe\bee\ber\brs\bs s\bsh\bho\bou\bul\bld\bd k\bke\bee\bep\bp t\bth\bha\bat\bt s\bst\bta\bat\bte\be (\b(a\ban\bnd\bd t\bth\bhe\be t\bto\bor\brr\bre\ben\bnt\bt s\bsh\bho\bou\bul\bld\bd u\bup\bpd\bda\bat\bte\be t\bth\bhe\bem\bm w\bwh\bhe\ben\bn i\bit\bt e\ben\bnt\bte\ber\brs\bs |\n+|g\bgr\bra\bac\bce\bef\bfu\bul\bl p\bpa\bau\bus\bse\be)\b).\b. W\bWh\bhe\ben\bn a\ba p\bpe\bee\ber\br e\ben\bnt\bte\ber\brs\bs g\bgr\bra\bac\bce\bef\bfu\bul\bl p\bpa\bau\bus\bse\be m\bmo\bod\bde\be,\b, i\bit\bt s\bsh\bho\bou\bul\bld\bd c\bca\ban\bnc\bce\bel\bl a\bal\bll\bl o\bou\but\bts\bst\bta\ban\bnd\bdi\bin\bng\bg r\bre\beq\bqu\bue\bes\bst\bts\bs a\ban\bnd\bd c\bcl\ble\bea\bar\br i\bit\bts\bs r\bre\beq\bqu\bue\bes\bst\bt q\bqu\bue\beu\bue\be.\b. *\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\b31\b13\b33\b3 *\b**\b**\b* |\n+|// to disk or are in the disk write cache |\n+|\t\tif (picker.is_piece_finished(p.piece) && !was_finished) |\n |\t\t{ |\n-|\t\t\tpeer_connection* p = (*i).get(); |\n-|\t\t\t++i; |\n-|\t\t\tp->disconnect(errors::stopping_torrent, operation_t::bittorrent); |\n+|#if TORRENT_USE_INVARIANT_CHECKS |\n+|\t\t\tcheck_postcondition post_checker2_(t, false); |\n+|#endif |\n+|\t\t\tt->verify_piece(p.piece); |\n |\t\t} |\n | |\n-|\t\t// close the listen sockets |\n-|\t\tfor (auto const& l : m_listen_sockets) |\n-|\t\t{ |\n-|\t\t\tif (l->sock) |\n-|\t\t\t{ |\n-|\t\t\t\tl->sock->close(ec); |\n-|\t\t\t\tTORRENT_ASSERT(!ec); |\n-|\t\t\t} |\n+|\t\tcheck_graceful_pause(); |\n | |\n-|if (l->udp_sock) |\n-|{ |\n-|\t\t\t\tl->udp_sock->sock.close(); |\n-|\t\t\t} |\n-|\t\t} |\n+|\t\tif (is_disconnecting()) return; |\n | |\n-|\t\t// we need to give all the sockets an opportunity to actually have their handlers |\n-|\t\t// called and cancelled before we continue the shutdown. This is a bit |\n-|\t\t// complicated, if there are no \"undead\" peers, it's safe to resume the |\n-|\t\t// shutdown, but if there are, we have to wait for them to be cleared out |\n-|\t\t// first. In session_impl::on_tick() we check them periodically. If we're |\n-|\t\t// shutting down and we remove the last one, we'll initiate |\n-|\t\t// shutdown_stage2 from there. |\n-|\t\tif (m_undead_peers.empty()) |\n-|\t\t{ |\n-|\t\t\tpost(m_io_context, make_handler([this] { abort_stage2(); } |\n-|\t\t\t\t, m_abort_handler_storage, *this)); |\n-|\t\t} |\n+|\t\tif (request_a_block(*t, *this)) |\n+|\t\t\tm_counters.inc_stats_counter(counters::incoming_piece_picks); |\n+|\t\tsend_block_requests(); |\n |\t} |\n | |\n-|\tvoid session_impl::abort_stage2() noexcept |\n+|\tvoid peer_connection::check_graceful_pause() |\n |\t{ |\n-|\t\tm_download_rate.close(); |\n-|\t\tm_upload_rate.close(); |\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-|_\b\t_\b\t_\b/_\b/_\b _\bn_\bo_\bw_\b _\bi_\bt_\b'_\bs_\b _\bO_\bK_\b _\bf_\bo_\br_\b _\bt_\bh_\be_\b _\bn_\be_\bt_\bw_\bo_\br_\bk_\b _\bt_\bh_\br_\be_\ba_\bd_\b _\bt_\bo_\b _\be_\bx_\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 |\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__\bi_\bm_\bp_\bl_\b._\bc_\bp_\bp_\b:_\b1_\b6_\b3_\b8_\b _\b _\b|_\bt_\bh_\be_\b _\bl_\bo_\bg_\bi_\bc_\b _\bi_\bn_\b _\bt_\bh_\bi_\bs_\b _\bi_\bf_\b-_\bb_\bl_\bo_\bc_\bk_\b _\bs_\bh_\bo_\bu_\bl_\bd_\b _\bb_\be_\b _\bf_\ba_\bc_\bt_\bo_\br_\be_\bd_\b _\bo_\bu_\bt_\b _\bi_\bn_\bt_\bo_\b _\ba_\b _\bs_\be_\bp_\ba_\br_\ba_\bt_\be_\b _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn_\b._\b _\bA_\bt_\b _\bl_\be_\ba_\bs_\bt_\b _\bm_\bo_\bs_\bt_\b _\bo_\bf_\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 |\n-|*\b**\b**\b**\b**\b* t\bth\bhe\be l\blo\bog\bgi\bic\bc i\bin\bn t\bth\bhi\bis\bs i\bif\bf-\b-b\bbl\blo\boc\bck\bk s\bsh\bho\bou\bul\bld\bd b\bbe\be f\bfa\bac\bct\bto\bor\bre\bed\bd o\bou\but\bt i\bin\bnt\bto\bo a\ba s\bse\bep\bpa\bar\bra\bat\bte\be f\bfu\bun\bnc\bct\bti\bio\bon\bn.\b. A\bAt\bt l\ble\bea\bas\bst\bt m\bmo\bos\bst\bt o\bof\bf i\bit\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_i\bim\bmp\bpl\bl.\b.c\bcp\bpp\bp:\b:1\b16\b63\b38\b8 *\b**\b**\b* |\n-|, (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+|std::shared_ptr t = m_torrent.lock(); |\n+|if (!t || !t->graceful_pause()) return; |\n | |\n-|\t\tauto ret = std::make_shared(); |\n-|\t\tret->ssl = lep.ssl; |\n-|\t\tret->original_port = bind_ep.port(); |\n-|\t\tret->flags = lep.flags; |\n-|\t\tret->netmask = lep.netmask; |\n-|\t\toperation_t last_op = operation_t::unknown; |\n-|\t\tsocket_type_t const sock_type |\n-|\t\t\t= (lep.ssl == transport::ssl) |\n-|\t\t\t? socket_type_t::tcp_ssl |\n-|\t\t\t: socket_type_t::tcp; |\n+|\t\tif (m_outstanding_bytes > 0) return; |\n | |\n-|\t\t// if we're in force-proxy mode, don't open TCP listen sockets. We cannot |\n-|\t\t// accept connections on our local machine in this case. |\n-|if (ret->flags & listen_socket_t::accept_incoming) |\n-|{ |\n-|\t\t\tret->sock = std::make_shared(m_io_context); |\n-|\t\t\tret->sock->open(bind_ep.protocol(), ec); |\n-|\t\t\tlast_op = operation_t::sock_open; |\n-|\t\t\tif (ec) |\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\tsession_log(\"failed to open socket: %s\" |\n-|\t\t\t\t\t\t, ec.message().c_str()); |\n-|\t\t\t\t} |\n+|\t\tpeer_log(peer_log_alert::info, \"GRACEFUL_PAUSE\", \"NO MORE DOWNLOAD\"); |\n |#endif |\n+|\t\tdisconnect(errors::torrent_paused, operation_t::bittorrent); |\n+|\t} |\n | |\n-|\t\t\t\tif (m_alerts.should_post()) |\n-|\t\t\t\t\tm_alerts.emplace_alert(lep.device, bind_ep, last_op |\n-|\t\t\t\t\t\t, ec, sock_type); |\n-|\t\t\t\treturn ret; |\n-|\t\t\t} |\n-| |\n-|#ifdef TORRENT_WINDOWS |\n-|\t\t\t{ |\n-|\t\t\t\t// this is best-effort. ignore errors |\n-|\t\t\t\terror_code err; |\n-|\t\t\t\tret->sock->set_option(exclusive_address_use(true), err); |\n+|\tvoid peer_connection::on_disk_write_complete(storage_error const& error |\n+|\t\t, peer_request const& p, std::shared_ptr t) |\n+|\t{ |\n+|\t\tTORRENT_ASSERT(is_single_thread()); |\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-|_\b\t_\b\t_\b\t_\b\t_\b\t_\b\t_\b,_\b _\be_\br_\br_\b._\bm_\be_\bs_\bs_\ba_\bg_\be_\b(_\b)_\b._\bc_\b__\bs_\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 _\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__\bi_\bm_\bp_\bl_\b._\bc_\bp_\bp_\b:_\b2_\b6_\b0_\b6_\b _\b _\b|_\bi_\bt_\b _\bw_\bo_\bu_\bl_\bd_\b _\bb_\be_\b _\bn_\be_\ba_\bt_\b _\bi_\bf_\b _\bt_\bh_\be_\b _\bu_\bt_\bp_\b _\bs_\bo_\bc_\bk_\be_\bt_\b _\bm_\ba_\bn_\ba_\bg_\be_\br_\b _\bw_\bo_\bu_\bl_\bd_\b _\bh_\ba_\bn_\bd_\bl_\be_\b _\bI_\bC_\bM_\bP_\b _\be_\br_\br_\bo_\br_\bs_\b _\bt_\bo_\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 |\n-|*\b**\b**\b**\b**\b* i\bit\bt w\bwo\bou\bul\bld\bd b\bbe\be n\bne\bea\bat\bt i\bif\bf t\bth\bhe\be u\but\btp\bp s\bso\boc\bck\bke\bet\bt m\bma\ban\bna\bag\bge\ber\br w\bwo\bou\bul\bld\bd h\bha\ban\bnd\bdl\ble\be I\bIC\bCM\bMP\bP e\ber\brr\bro\bor\brs\bs t\bto\boo\bo *\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:2\b26\b60\b06\b6 *\b**\b**\b* |\n-|\t\tstd::shared_ptr 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-|#endif |\n-|\t\t\tm_utp_socket_manager; |\n-| |\n-|\t\tfor (;;) |\n+|\t\tif (should_log(peer_log_alert::info)) |\n |\t\t{ |\n-|\t\t\taux::array p; |\n-|\t\t\terror_code err; |\n-|\t\t\tint const num_packets = s->sock.read(p, err); |\n-| |\n-|\t\t\tfor (udp_socket::packet& packet : span(p).first(num_packets)) |\n-|\t\t\t{ |\n-|\t\t\t\tif (packet.error) |\n-|\t\t\t\t{ |\n-| |\n-|#ifndef TORRENT_DISABLE_DHT |\n-|\t\t\t\t\tif (m_dht) |\n-|\t\t\t\t\t\tm_dht->incoming_error(packet.error, packet.from); |\n+|\t\t\tpeer_log(peer_log_alert::info, \"FILE_ASYNC_WRITE_COMPLETE\", \"piece: %d s: %x l: %x e: %s\" |\n+|\t\t\t\t, static_cast(p.piece), p.start, p.length, error.ec.message().c_str()); |\n+|\t\t} |\n |#endif |\n | |\n-|\t\t\t\t\tm_tracker_manager.incoming_error(packet.error, packet.from); |\n-|\t\t\t\t\tcontinue; |\n-|\t\t\t\t} |\n+|\t\tm_counters.inc_stats_counter(counters::queued_write_bytes, -p.length); |\n+|\t\tm_outstanding_writing_bytes -= p.length; |\n | |\n-|\t\t\t\tspan const buf = packet.data; |\n-|\t\t\t\tif (!packet.hostname.empty()) |\n-|\t\t\t\t{ |\n-|\t\t\t\t\t// only the tracker manager supports receiving UDP packets |\n-|\t\t\t\t\t// from hostnames. If it won't handle it, no one else will |\n-|\t\t\t\t\t// either |\n-|\t\t\t\t\tm_tracker_manager.incoming_packet(packet.hostname, buf); |\n-|\t\t\t\t\tcontinue; |\n-|\t\t\t\t} |\n+|\t\tTORRENT_ASSERT(m_outstanding_writing_bytes >= 0); |\n | |\n-|\t\t\t\t// give the uTP socket manager first dibs on the packet. Presumably |\n-|\t\t\t\t// the majority of packets are uTP packets. |\n-|\t\t\t\tif (!mgr.incoming_packet(ls, packet.from, buf)) |\n-|\t\t\t\t{ |\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-|_\b\t_\b\t_\b\t_\b\t_\b\t_\b\t_\b&_\b&_\b _\bb_\bu_\bf_\b._\bf_\br_\bo_\bn_\bt_\b(_\b)_\b _\b=_\b=_\b _\b'_\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 |\n-| | |it would probably make sense to have a separate list of peers that are eligible for optimistic unchoke, similar to the torrents |\n-|relevance\u00a03|_\b._\b._\b/_\bs_\br_\bc_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bi_\bm_\bp_\bl_\b._\bc_\bp_\bp_\b:_\b4_\b1_\b5_\b5 |perhaps this could even iterate over the pool allocators of 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 even more sense, just pick the next peer in the queue for |\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_\bn_\bc_\bh_\bo_\bk_\bi_\bn_\bg_\b._\b _\bI_\bt_\b _\bw_\bo_\bu_\bl_\bd_\b _\bb_\be_\b _\bO_\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 |\n-|*\b**\b**\b**\b**\b* i\bit\bt w\bwo\bou\bul\bld\bd p\bpr\bro\bob\bba\bab\bbl\bly\by m\bma\bak\bke\be s\bse\ben\bns\bse\be t\bto\bo h\bha\bav\bve\be a\ba s\bse\bep\bpa\bar\bra\bat\bte\be l\bli\bis\bst\bt o\bof\bf p\bpe\bee\ber\brs\bs t\bth\bha\bat\bt a\bar\bre\be e\bel\bli\big\bgi\bib\bbl\ble\be f\bfo\bor\br o\bop\bpt\bti\bim\bmi\bis\bst\bti\bic\bc u\bun\bnc\bch\bho\bok\bke\be,\b, s\bsi\bim\bmi\bil\bla\bar\br t\bto\bo t\bth\bhe\be t\bto\bor\brr\bre\ben\bnt\bts\bs p\bpe\ber\brh\bha\bap\bps\bs t\bth\bhi\bis\bs c\bco\bou\bul\bld\bd e\bev\bve\ben\bn i\bit\bte\ber\bra\bat\bte\be o\bov\bve\ber\br t\bth\bhe\be |\n-|p\bpo\boo\bol\bl a\bal\bll\blo\boc\bca\bat\bto\bor\brs\bs o\bof\bf t\bto\bor\brr\bre\ben\bnt\bt_\b_p\bpe\bee\ber\br o\bob\bbj\bje\bec\bct\bts\bs.\b. I\bIt\bt c\bco\bou\bul\bld\bd p\bpr\bro\bob\bba\bab\bbl\bly\by b\bbe\be d\bdo\bon\bne\be i\bin\bn a\ba s\bsi\bin\bng\bgl\ble\be p\bpa\bas\bss\bs a\ban\bnd\bd c\bco\bol\bll\ble\bec\bct\bt t\bth\bhe\be n\bn b\bbe\bes\bst\bt c\bca\ban\bnd\bdi\bid\bda\bat\bte\bes\bs.\b. m\bma\bay\byb\bbe\be j\bju\bus\bst\bt a\ba q\bqu\bue\beu\bue\be o\bof\bf p\bpe\bee\ber\brs\bs w\bwo\bou\bul\bld\bd m\bma\bak\bke\be e\bev\bve\ben\bn m\bmo\bor\bre\be s\bse\ben\bns\bse\be,\b, |\n-|j\bju\bus\bst\bt p\bpi\bic\bck\bk t\bth\bhe\be n\bne\bex\bxt\bt p\bpe\bee\ber\br i\bin\bn t\bth\bhe\be q\bqu\bue\beu\bue\be f\bfo\bor\br u\bun\bnc\bch\bho\bok\bki\bin\bng\bg.\b. I\bIt\bt w\bwo\bou\bul\bld\bd b\bbe\be O\bO(\b(1\b1)\b).\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:4\b41\b15\b55\b5 *\b**\b**\b* |\n-|} |\n+|\t\t// every peer is entitled to allocate a disk buffer if it has no writes outstanding |\n+|\t\t// see the comment in incoming_piece |\n+|_\b\t_\b\t_\bi_\bf_\b _\b(_\bm_\b__\bo_\bu_\bt_\bs_\bt_\ba_\bn_\bd_\bi_\bn_\bg_\b__\bw_\br_\bi_\bt_\bi_\bn_\bg_\b__\bb_\by_\bt_\be_\bs_\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 _\b |\n+|relevance\u00a03|_\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: |once peers are properly put in graceful pause mode, they can cancel all outstanding requests and this test can be removed. |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b4_\b0_\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* o\bon\bnc\bce\be p\bpe\bee\ber\brs\bs a\bar\bre\be p\bpr\bro\bop\bpe\ber\brl\bly\by p\bpu\but\bt i\bin\bn g\bgr\bra\bac\bce\bef\bfu\bul\bl p\bpa\bau\bus\bse\be m\bmo\bod\bde\be,\b, t\bth\bhe\bey\by c\bca\ban\bn c\bca\ban\bnc\bce\bel\bl a\bal\bll\bl o\bou\but\bts\bst\bta\ban\bnd\bdi\bin\bng\bg r\bre\beq\bqu\bue\bes\bst\bts\bs a\ban\bnd\bd t\bth\bhi\bis\bs t\bte\bes\bst\bt c\bca\ban\bn b\bbe\be r\bre\bem\bmo\bov\bve\bed\bd.\b. *\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:4\b40\b04\b44\b4 *\b**\b**\b* |\n+|\t\t\tif (!p->m_deferred_send_block_requests) |\n+|\t\t\t\treturn; |\n | |\n-|\tvoid session_impl::recalculate_optimistic_unchoke_slots() |\n-|\t{ |\n-|\t\tINVARIANT_CHECK; |\n+|\t\t\tp->m_deferred_send_block_requests = false; |\n+|\t\t\tp->send_block_requests_impl(); |\n+|\t\t}); |\n+|\t\tm_deferred_send_block_requests = true; |\n+|\t} |\n | |\n+|\tvoid peer_connection::send_block_requests_impl() |\n+|\t{ |\n |\t\tTORRENT_ASSERT(is_single_thread()); |\n-|\t\tif (m_stats_counters[counters::num_unchoke_slots] == 0) return; |\n+|\t\tINVARIANT_CHECK; |\n | |\n-|\t\t// if we unchoke everyone, skip this logic |\n-|\t\tif (settings().get_int(settings_pack::choking_algorithm) == settings_pack::fixed_slots_choker |\n-|\t\t\t&& settings().get_int(settings_pack::unchoke_slots_limit) < 0) |\n-|\t\t\treturn; |\n+|\t\tstd::shared_ptr t = m_torrent.lock(); |\n+|\t\tif (!t) return; |\n | |\n-|\t\tstd::vector opt_unchoke; |\n+|\t\tif (m_disconnecting) return; |\n | |\n-|\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 prev_opt_unchoke; |\n+|if (t->graceful_pause()) return; |\n | |\n-|for (auto& i : m_connections) |\n-|{ |\n-|\t\t\tpeer_connection* const p = i.get(); |\n-|\t\t\tTORRENT_ASSERT(p); |\n-|\t\t\ttorrent_peer* pi = p->peer_info_struct(); |\n-|\t\t\tif (!pi) continue; |\n-|\t\t\tif (pi->web_seed) continue; |\n+|\t\t// we can't download pieces in these states |\n+|\t\tif (t->state() == torrent_status::checking_files |\n+|\t\t\t|| t->state() == torrent_status::checking_resume_data |\n+|\t\t\t|| t->state() == torrent_status::downloading_metadata) |\n+|\t\t\treturn; |\n | |\n-|\t\t\tif (pi->optimistically_unchoked) |\n-|\t\t\t{ |\n-|\t\t\t\tprev_opt_unchoke.push_back(pi); |\n-|\t\t\t} |\n+|\t\tif (int(m_download_queue.size()) >= m_desired_queue_size |\n+|\t\t\t|| t->upload_mode()) return; |\n | |\n-|\t\t\ttorrent const* t = p->associated_torrent().lock().get(); |\n-|_\b\t_\b\t_\b\t_\bi_\bf_\b _\b(_\b!_\bt_\b)_\b _\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 |\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__\bi_\bm_\bp_\bl_\b._\bc_\bp_\bp_\b:_\b4_\b1_\b7_\b8_\b _\b _\b|_\bp_\be_\be_\br_\bs_\b _\bs_\bh_\bo_\bu_\bl_\bd_\b _\bk_\bn_\bo_\bw_\b _\bw_\bh_\be_\bt_\bh_\be_\br_\b _\bt_\bh_\be_\bi_\br_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\b _\bi_\bs_\b _\bp_\ba_\bu_\bs_\be_\bd_\b _\bo_\br_\b _\bn_\bo_\bt_\b,_\b _\bi_\bn_\bs_\bt_\be_\ba_\bd_\b _\bo_\bf_\b _\bh_\ba_\bv_\bi_\bn_\bg_\b _\bt_\bo_\b _\ba_\bs_\bk_\b _\bi_\bt_\b _\bo_\bv_\be_\br_\b _\ba_\bn_\bd_\b _\bo_\bv_\be_\br_\b _\ba_\bg_\ba_\bi_\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 |\n-|*\b**\b**\b**\b**\b* p\bpe\bee\ber\brs\bs s\bsh\bho\bou\bul\bld\bd k\bkn\bno\bow\bw w\bwh\bhe\bet\bth\bhe\ber\br t\bth\bhe\bei\bir\br t\bto\bor\brr\bre\ben\bnt\bt i\bis\bs p\bpa\bau\bus\bse\bed\bd o\bor\br n\bno\bot\bt,\b, i\bin\bns\bst\bte\bea\bad\bd o\bof\bf h\bha\bav\bvi\bin\bng\bg t\bto\bo a\bas\bsk\bk i\bit\bt o\bov\bve\ber\br a\ban\bnd\bd o\bov\bve\ber\br a\bag\bga\bai\bin\bn *\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:4\b41\b17\b78\b8 *\b**\b**\b* |\n-|// 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 prev_opt_unchoke; |\n+|\t\tbool const empty_download_queue = m_download_queue.empty(); |\n | |\n-|\t\tfor (auto& i : m_connections) |\n+|\t\twhile (!m_request_queue.empty() |\n+|\t\t\t&& (int(m_download_queue.size()) < m_desired_queue_size |\n+|\t\t\t\t|| m_queued_time_critical > 0)) |\n |\t\t{ |\n-|\t\t\tpeer_connection* const p = i.get(); |\n-|\t\t\tTORRENT_ASSERT(p); |\n-|\t\t\ttorrent_peer* pi = p->peer_info_struct(); |\n-|\t\t\tif (!pi) continue; |\n-|\t\t\tif (pi->web_seed) continue; |\n-| |\n-|\t\t\tif (pi->optimistically_unchoked) |\n-|\t\t\t{ |\n-|\t\t\t\tprev_opt_unchoke.push_back(pi); |\n-|\t\t\t} |\n+|\t\t\tpending_block block = m_request_queue.front(); |\n | |\n-|\t\t\ttorrent const* t = p->associated_torrent().lock().get(); |\n-|\t\t\tif (!t) continue; |\n+|\t\t\tm_request_queue.erase(m_request_queue.begin()); |\n+|\t\t\tif (m_queued_time_critical) --m_queued_time_critical; |\n | |\n-|if (t->is_paused()) continue; |\n+|\t\t\t// if we're a seed, we don't have a piece picker |\n+|\t\t\t// so we don't have to worry about invariants getting |\n+|\t\t\t// out of sync with it |\n+|\t\t\tif (!t->has_picker()) continue; |\n | |\n-|\t\t\tif (!p->is_connecting() |\n-|\t\t\t\t&& !p->is_disconnecting() |\n-|\t\t\t\t&& p->is_peer_interested() |\n-|\t\t\t\t&& t->free_upload_slots() |\n-|\t\t\t\t&& (p->is_choked() || pi->optimistically_unchoked) |\n-|\t\t\t\t&& !p->ignore_unchoke_slots() |\n-|\t\t\t\t&& t->valid_metadata()) |\n-|\t\t\t{ |\n-|\t\t\t\topt_unchoke.emplace_back(&i); |\n-|\t\t\t} |\n+|\t\t\t// this can happen if a block times out, is re-requested and |\n+|\t\t\t// then arrives \"unexpectedly\" |\n+|\t\t\tif (t->picker().is_downloaded(block.block)) |\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\u00a03|_\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: |new_piece should be an optional. piece index -1 should not be allowed |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b4_\b7_\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 _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* n\bne\bew\bw_\b_p\bpi\bie\bec\bce\be 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/p\bpe\bee\ber\br_\b_c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn.\b.c\bcp\bpp\bp:\b:4\b47\b73\b30\b0 *\b**\b**\b* |\n+|\t\t// pieces may be empty if we don't have metadata yet |\n+|\t\tif (p.pieces.empty()) |\n+|\t\t{ |\n+|\t\t\tp.progress = 0.f; |\n+|\t\t\tp.progress_ppm = 0; |\n |\t\t} |\n-| |\n-|\t\t// find the peers that has been waiting the longest to be optimistically |\n-|\t\t// unchoked |\n-| |\n-|\t\tint num_opt_unchoke = m_settings.get_int(settings_pack::num_optimistic_unchoke_slots); |\n-|\t\tint const allowed_unchoke_slots = int(m_stats_counters[counters::num_unchoke_slots]); |\n-|\t\tif (num_opt_unchoke == 0) num_opt_unchoke = std::max(1, allowed_unchoke_slots / 5); |\n-|\t\tif (num_opt_unchoke > int(opt_unchoke.size())) num_opt_unchoke = |\n-|\t\t\tint(opt_unchoke.size()); |\n-| |\n-|\t\t// find the n best optimistic unchoke candidates |\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+|\t\telse |\n+|\t\t{ |\n+|#if TORRENT_NO_FPU |\n+|\t\t\tp.progress = 0.f; |\n |#else |\n-|_\b\t_\b\t_\b\t_\b,_\b _\bl_\ba_\bs_\bt_\b__\bo_\bp_\bt_\bi_\bm_\bi_\bs_\bt_\bi_\bc_\b__\bu_\bn_\bc_\bh_\bo_\bk_\be_\b__\bc_\bm_\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 |\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__\bi_\bm_\bp_\bl_\b._\bc_\bp_\bp_\b:_\b4_\b4_\b2_\b4_\b _\b _\b|_\bt_\bh_\be_\br_\be_\b _\bs_\bh_\bo_\bu_\bl_\bd_\b _\bb_\be_\b _\ba_\b _\bp_\br_\be_\b-_\bc_\ba_\bl_\bc_\bu_\bl_\ba_\bt_\be_\bd_\b _\bl_\bi_\bs_\bt_\b _\bo_\bf_\b _\ba_\bl_\bl_\b _\bp_\be_\be_\br_\bs_\b _\be_\bl_\bi_\bg_\bi_\bb_\bl_\be_\b _\bf_\bo_\br_\b _\bu_\bn_\bc_\bh_\bo_\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 |\n-|*\b**\b**\b**\b**\b* t\bth\bhe\ber\bre\be s\bsh\bho\bou\bul\bld\bd b\bbe\be a\ba p\bpr\bre\be-\b-c\bca\bal\blc\bcu\bul\bla\bat\bte\bed\bd l\bli\bis\bst\bt o\bof\bf a\bal\bll\bl p\bpe\bee\ber\brs\bs e\bel\bli\big\bgi\bib\bbl\ble\be f\bfo\bor\br u\bun\bnc\bch\bho\bok\bki\bin\bng\bg *\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:4\b44\b42\b24\b4 *\b**\b**\b* |\n-|} |\n+|\t\t\tp.progress = float(p.pieces.count()) / float(p.pieces.size()); |\n+|#endif |\n+|\t\t\tp.progress_ppm = int(std::int64_t(p.pieces.count()) * 1000000 / p.pieces.size()); |\n+|\t\t} |\n | |\n-|\tvoid session_impl::recalculate_unchoke_slots() |\n+|\t} |\n+| |\n+|#ifndef TORRENT_DISABLE_SUPERSEEDING |\n+|void peer_connection::superseed_piece(piece_index_t const replace_piece |\n+|, piece_index_t const new_piece) |\n |\t{ |\n |\t\tTORRENT_ASSERT(is_single_thread()); |\n | |\n-|\t\ttime_point const now = aux::time_now(); |\n-|\t\ttime_duration const unchoke_interval = now - m_last_choke; |\n-|\t\tm_last_choke = now; |\n-| |\n-|\t\t// if we unchoke everyone, skip this logic |\n-|\t\tif (settings().get_int(settings_pack::choking_algorithm) == settings_pack::fixed_slots_choker |\n-|\t\t\t&& settings().get_int(settings_pack::unchoke_slots_limit) < 0) |\n-|\t\t{ |\n-|\t\t\tm_stats_counters.set_value(counters::num_unchoke_slots, std::numeric_limits::max()); |\n-|\t\t\treturn; |\n-|\t\t} |\n+|\t\tif (is_connecting()) return; |\n+|\t\tif (in_handshake()) return; |\n | |\n-|\t\t// build list of all peers that are |\n-|\t\t// unchokable. |\n-|std::vector peers; |\n-|for (auto i = m_connections.begin(); i != m_connections.end();) |\n+|\t\tif (new_piece == piece_index_t(-1)) |\n |\t\t{ |\n-|\t\t\tstd::shared_ptr p = *i; |\n-|\t\t\tTORRENT_ASSERT(p); |\n-|\t\t\t++i; |\n-|\t\t\ttorrent* const t = p->associated_torrent().lock().get(); |\n-|\t\t\ttorrent_peer* const pi = p->peer_info_struct(); |\n-| |\n-|\t\t\tif (p->ignore_unchoke_slots() || t == nullptr || pi == nullptr |\n-|\t\t\t\t|| pi->web_seed || t->is_paused()) |\n-|\t\t\t{ |\n-|\t\t\t\tp->reset_choke_counters(); |\n-|\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-|\t\t\t\t// this peer is not unchokable. So, if it's unchoked |\n-|\t\t\t\t// already, make sure to choke it. |\n-|\t\t\t\tif (p->is_choked()) |\n-|\t\t\t\t{ |\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-|_\b\t_\b\t_\b\t_\b\t_\b\t_\bp_\bi_\b-_\b>_\bo_\bp_\bt_\bi_\bm_\bi_\bs_\bt_\bi_\bc_\ba_\bl_\bl_\by_\b__\bu_\bn_\bc_\bh_\bo_\bk_\be_\bd_\b _\b=_\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 |\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__\bi_\bm_\bp_\bl_\b._\bc_\bp_\bp_\b:_\b6_\b1_\b3_\b6_\b _\b _\b|_\bu_\bs_\be_\b _\bp_\bu_\bb_\bl_\bi_\bc_\b__\bk_\be_\by_\b _\bh_\be_\br_\be_\b _\bi_\bn_\bs_\bt_\be_\ba_\bd_\b _\bo_\bf_\b _\bs_\bt_\bd_\b:_\b:_\ba_\br_\br_\ba_\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 |\n-|*\b**\b**\b**\b**\b* u\bus\bse\be p\bpu\bub\bbl\bli\bic\bc_\b_k\bke\bey\by h\bhe\ber\bre\be i\bin\bns\bst\bte\bea\bad\bd o\bof\bf s\bst\btd\bd:\b::\b:a\bar\brr\bra\bay\by *\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\b13\b36\b6 *\b**\b**\b* |\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-|\t// callback for dht_mutable_get |\n-|\tvoid session_impl::get_mutable_callback(dht::item const& i |\n-|\t\t, bool const authoritative) |\n-|\t{ |\n-|\t\tTORRENT_ASSERT(i.is_mutable()); |\n-|\t\tm_alerts.emplace_alert(i.pk().bytes |\n-|\t\t\t, i.sig().bytes, i.seq().value |\n-|\t\t\t, i.salt(), i.value(), authoritative); |\n-|\t} |\n+|\t\t\tif (m_superseed_piece[0] == piece_index_t(-1)) return; |\n+|\t\t\tm_superseed_piece[0] = piece_index_t(-1); |\n+|\t\t\tm_superseed_piece[1] = piece_index_t(-1); |\n | |\n-|\t// key is a 32-byte binary string, the public key to look up. |\n-|\t// the salt is optional |\n-|void session_impl::dht_get_mutable_item(std::array key |\n-|, std::string salt) |\n-|\t{ |\n-|\t\tif (!m_dht) return; |\n-|\t\tm_dht->get_item(dht::public_key(key.data()), std::bind(&session_impl::get_mutable_callback |\n-|\t\t\t, this, _1, _2), std::move(salt)); |\n-|\t} |\n+|#ifndef TORRENT_DISABLE_LOGGING |\n+|\t\t\tpeer_log(peer_log_alert::info, \"SUPER_SEEDING\", \"ending\"); |\n+|#endif |\n+|\t\t\tstd::shared_ptr t = m_torrent.lock(); |\n+|\t\t\tTORRENT_ASSERT(t); |\n | |\n-|\tnamespace { |\n+|\t\t\t// this will either send a full bitfield or |\n+|\t\t\t// a have-all message, effectively terminating |\n+|\t\t\t// super-seeding, since the peer may pick any piece |\n+|\t\t\twrite_bitfield(); |\n | |\n-|\t\tvoid on_dht_put_immutable_item(aux::alert_manager& alerts, sha1_hash target, int num) |\n-|\t\t{ |\n-|\t\t\tif (alerts.should_post()) |\n-|\t\t\t\talerts.emplace_alert(target, num); |\n+|\t\t\treturn; |\n |\t\t} |\n | |\n-|\t\tvoid on_dht_put_mutable_item(aux::alert_manager& alerts, dht::item const& i, int num) |\n-|\t\t{ |\n-|\t\t\tif (alerts.should_post()) |\n-|\t\t\t{ |\n-|\t\t\t\tdht::signature const sig = i.sig(); |\n-|\t\t\t\tdht::public_key const pk = i.pk(); |\n-|\t\t\t\tdht::sequence_number const seq = i.seq(); |\n-|\t\t\t\tstd::string salt = i.salt(); |\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+|\t\tTORRENT_ASSERT(!has_piece(new_piece)); |\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+|_\b#_\bi_\bf_\bn_\bd_\be_\bf_\b _\bT_\bO_\bR_\bR_\bE_\bN_\bT_\b__\bD_\bI_\bS_\bA_\bB_\bL_\bE_\b__\bL_\bO_\bG_\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 _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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/_\bk_\ba_\bd_\be_\bm_\bl_\bi_\ba_\b/ |move this into it's own .cpp file |\n |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\br_\bp_\bc_\b__\bm_\ba_\bn_\ba_\bg_\be_\br_\b._\bc_\bp_\bp_\b:_\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 |\n |*\b**\b**\b**\b**\b* m\bmo\bov\bve\be t\bth\bhi\bis\bs i\bin\bnt\bto\bo i\bit\bt'\b's\bs o\bow\bwn\bn .\b.c\bcp\bpp\bp f\bfi\bil\ble\be *\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\brp\bpc\bc_\b_m\bma\ban\bna\bag\bge\ber\br.\b.c\bcp\bpp\bp:\b:7\b71\b1 *\b**\b**\b* |\n |#include |\n |#include |\n |#include |\n@@ -1650,14 +1650,69 @@\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/ |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@@ -1759,119 +1814,14 @@\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/ |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/ |if we make this be a disk_buffer_holder instead we would save a copy use allocate_disk_receive_buffer and |\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._\bh_\bp_\bp_\b:_\b1_\b1_\b9_\b _\b _\b _\b|_\br_\be_\bl_\be_\ba_\bs_\be_\b__\bd_\bi_\bs_\bk_\b__\br_\be_\bc_\be_\bi_\bv_\be_\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 |\n-|*\b**\b**\b**\b**\b* i\bif\bf w\bwe\be m\bma\bak\bke\be t\bth\bhi\bis\bs b\bbe\be a\ba d\bdi\bis\bsk\bk_\b_b\bbu\buf\bff\bfe\ber\br_\b_h\bho\bol\bld\bde\ber\br i\bin\bns\bst\bte\bea\bad\bd w\bwe\be w\bwo\bou\bul\bld\bd s\bsa\bav\bve\be a\ba c\bco\bop\bpy\by u\bus\bse\be a\bal\bll\blo\boc\bca\bat\bte\be_\b_d\bdi\bis\bsk\bk_\b_r\bre\bec\bce\bei\biv\bve\be_\b_b\bbu\buf\bff\bfe\ber\br a\ban\bnd\bd r\bre\bel\ble\bea\bas\bse\be_\b_d\bdi\bis\bsk\bk_\b_r\bre\bec\bce\bei\biv\bve\be_\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/w\bwe\beb\bb_\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\b11\b19\b9 *\b**\b**\b* |\n-|piece_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-|\t\tstruct file_request_t |\n-|\t\t{ |\n-|\t\t\tfile_index_t file_index; |\n-|\t\t\tint length; |\n-|\t\t\tstd::int64_t start; |\n-|\t\t}; |\n-|\t\tstd::deque m_file_requests; |\n-| |\n-|\t\tstd::string m_url; |\n-| |\n-|\t\tweb_seed_t* m_web; |\n-| |\n-|\t\t// this is used for intermediate storage of pieces to be delivered to the |\n-|\t\t// bittorrent engine |\n-|aux::vector m_piece; |\n-| |\n-|\t\t// the number of bytes we've forwarded to the incoming_payload() function |\n-|\t\t// in the current HTTP response. used to know where in the buffer the |\n-|\t\t// next response starts |\n-|\t\tint m_received_body; |\n-| |\n-|\t\t// this is the offset inside the current receive |\n-|\t\t// buffer where the next chunk header will be. |\n-|\t\t// this is updated for each chunk header that's |\n-|\t\t// parsed. It does not necessarily point to a valid |\n-|\t\t// offset in the receive buffer, if we haven't received |\n-|\t\t// it yet. This offset never includes the HTTP header |\n-|\t\tint m_chunk_pos; |\n-| |\n-|\t\t// this is the number of bytes we've already received |\n-|\t\t// from the next chunk header we're waiting for |\n-|\t\tint m_partial_chunk_header; |\n-| |\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/ |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@@ -1973,14 +1923,64 @@\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/ |if we make this be a disk_buffer_holder instead we would save a copy use allocate_disk_receive_buffer and |\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._\bh_\bp_\bp_\b:_\b1_\b1_\b9_\b _\b _\b _\b|_\br_\be_\bl_\be_\ba_\bs_\be_\b__\bd_\bi_\bs_\bk_\b__\br_\be_\bc_\be_\bi_\bv_\be_\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 |\n+|*\b**\b**\b**\b**\b* i\bif\bf w\bwe\be m\bma\bak\bke\be t\bth\bhi\bis\bs b\bbe\be a\ba d\bdi\bis\bsk\bk_\b_b\bbu\buf\bff\bfe\ber\br_\b_h\bho\bol\bld\bde\ber\br i\bin\bns\bst\bte\bea\bad\bd w\bwe\be w\bwo\bou\bul\bld\bd s\bsa\bav\bve\be a\ba c\bco\bop\bpy\by u\bus\bse\be a\bal\bll\blo\boc\bca\bat\bte\be_\b_d\bdi\bis\bsk\bk_\b_r\bre\bec\bce\bei\biv\bve\be_\b_b\bbu\buf\bff\bfe\ber\br a\ban\bnd\bd r\bre\bel\ble\bea\bas\bse\be_\b_d\bdi\bis\bsk\bk_\b_r\bre\bec\bce\bei\biv\bve\be_\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/w\bwe\beb\bb_\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\b11\b19\b9 *\b**\b**\b* |\n+|piece_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+|\t\tstruct file_request_t |\n+|\t\t{ |\n+|\t\t\tfile_index_t file_index; |\n+|\t\t\tint length; |\n+|\t\t\tstd::int64_t start; |\n+|\t\t}; |\n+|\t\tstd::deque m_file_requests; |\n+| |\n+|\t\tstd::string m_url; |\n+| |\n+|\t\tweb_seed_t* m_web; |\n+| |\n+|\t\t// this is used for intermediate storage of pieces to be delivered to the |\n+|\t\t// bittorrent engine |\n+|aux::vector m_piece; |\n+| |\n+|\t\t// the number of bytes we've forwarded to the incoming_payload() function |\n+|\t\t// in the current HTTP response. used to know where in the buffer the |\n+|\t\t// next response starts |\n+|\t\tint m_received_body; |\n+| |\n+|\t\t// this is the offset inside the current receive |\n+|\t\t// buffer where the next chunk header will be. |\n+|\t\t// this is updated for each chunk header that's |\n+|\t\t// parsed. It does not necessarily point to a valid |\n+|\t\t// offset in the receive buffer, if we haven't received |\n+|\t\t// it yet. This offset never includes the HTTP header |\n+|\t\tint m_chunk_pos; |\n+| |\n+|\t\t// this is the number of bytes we've already received |\n+|\t\t// from the next chunk header we're waiting for |\n+|\t\tint m_partial_chunk_header; |\n+| |\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/ |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@@ -2136,72 +2136,14 @@\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-|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__\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 |_\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 |_\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_\b3_\b _\b _\b _\b _\b _\b|_\bt_\be_\bs_\bt_\b _\bn_\be_\be_\bd_\b__\br_\be_\bf_\br_\be_\bs_\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 |\n |*\b**\b**\b**\b**\b* t\bte\bes\bst\bt n\bne\bee\bed\bd_\b_r\bre\bef\bfr\bre\bes\bsh\bh *\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:1\b16\b64\b43\b3 *\b**\b**\b* |\n |\ts.set_bool(settings_pack::dht_restrict_routing_ips, false); |\n@@ -2302,14 +2244,235 @@\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+| |\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/_\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+|\t\tif (!m_alerts[m_generation].empty()) |\n+|\t\t\treturn m_alerts[m_generation].front(); |\n+| |\n+|\t\treturn nullptr; |\n+|\t} |\n+| |\n+|\tvoid alert_manager::maybe_notify(alert* a) |\n+|\t{ |\n+|\t\tif (m_alerts[m_generation].size() == 1) |\n+|\t\t{ |\n+|\t\t\t// we just posted to an empty queue. If anyone is waiting for |\n+|\t\t\t// alerts, we need to notify them. Also (potentially) call the |\n+|\t\t\t// user supplied m_notify callback to let the client wake up its |\n+|\t\t\t// message loop to poll for alerts. |\n+|\t\t\tif (m_notify) m_notify(); |\n+| |\n+|m_condition.notify_all(); |\n+|} |\n+| |\n+|#ifndef TORRENT_DISABLE_EXTENSIONS |\n+|\t\tfor (auto& e : m_ses_extensions) |\n+|\t\t\te->on_alert(a); |\n+|#else |\n+|\t\tTORRENT_UNUSED(a); |\n+|#endif |\n+|\t} |\n+| |\n+|\tvoid alert_manager::set_notify_function(std::function const& fun) |\n+|\t{ |\n+|\t\tstd::unique_lock lock(m_mutex); |\n+|\t\tm_notify = fun; |\n+|\t\tif (!m_alerts[m_generation].empty()) |\n+|\t\t{ |\n+|\t\t\tif (m_notify) m_notify(); |\n+|\t\t} |\n+|\t} |\n+| |\n+|#ifndef TORRENT_DISABLE_EXTENSIONS |\n+|\tvoid alert_manager::add_extension(std::shared_ptr ext) |\n+|\t{ |\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+|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+|_\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@@ -2465,70 +2628,14 @@\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/_\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/ |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@@ -2576,345 +2683,376 @@\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-|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+|_\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\tupdate_transaction_id(); |\n+|\t\t(this->*f)(std::forward(a)...); |\n+|\t} |\n+|#ifndef BOOST_NO_EXCEPTIONS |\n+|\tcatch (system_error const& e) { |\n+|\t\talerts().emplace_alert(e.code(), e.what()); |\n+|\t\tpause(); |\n+|\t} catch (std::exception const& e) { |\n+|\t\talerts().emplace_alert(error_code(), e.what()); |\n+|\t\tpause(); |\n+|\t} catch (...) { |\n+|\t\talerts().emplace_alert(error_code(), \"unknown error\"); |\n+|\t\tpause(); |\n |\t} |\n+|#endif |\n | |\n-|\tvoid udp_tracker_connection::start() |\n-|\t{ |\n-|std::string hostname; |\n-|std::string protocol; |\n-|\t\tint port; |\n+|\t// This function is called by the creating thread, not in the message loop's |\n+|\t// io_context thread. |\n+|void session_impl::start_session() |\n+|{ |\n+|#ifndef TORRENT_DISABLE_LOGGING |\n+|\t\tsession_log(\"start session\"); |\n+|#endif |\n+| |\n+|#if TORRENT_USE_SSL |\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+|_\b#_\bi_\bf_\b _\bd_\be_\bf_\bi_\bn_\be_\bd_\b _\bT_\bO_\bR_\bR_\bE_\bN_\bT_\b__\bW_\bI_\bN_\bD_\bO_\bW_\bS_\b _\b&_\b&_\b _\bd_\be_\bf_\bi_\bn_\be_\bd_\b _\bT_\bO_\bR_\bR_\bE_\bN_\bT_\b__\bU_\bS_\bE_\b__\bO_\bP_\bE_\bN_\bS_\bS_\bL_\b _\b&_\b&_\b _\b!_\bd_\be_\bf_\bi_\bn_\be_\bd_\b _\bT_\bO_\bR_\bR_\bE_\bN_\bT_\b__\bW_\bI_\bN_\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 |\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:_\b7_\b6_\b1_\b _\b _\b _\b|_\bt_\bh_\be_\b _\bi_\bp_\b _\bf_\bi_\bl_\bt_\be_\br_\b _\bs_\bh_\bo_\bu_\bl_\bd_\b _\bp_\br_\bo_\bb_\ba_\bb_\bl_\by_\b _\bb_\be_\b _\bs_\ba_\bv_\be_\bd_\b _\bh_\be_\br_\be_\b _\bt_\bo_\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 |\n+|*\b**\b**\b**\b**\b* t\bth\bhe\be i\bip\bp f\bfi\bil\blt\bte\ber\br s\bsh\bho\bou\bul\bld\bd p\bpr\bro\bob\bba\bab\bbl\bly\by b\bbe\be s\bsa\bav\bve\bed\bd h\bhe\ber\bre\be t\bto\boo\bo *\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:7\b76\b61\b1 *\b**\b**\b* |\n+|m_lsd_announce_timer.async_wait([this](error_code const& e) { |\n+|\t\t\twrap(&session_impl::on_lsd_announce, e); } ); |\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+|#ifndef TORRENT_DISABLE_LOGGING |\n+|\t\tsession_log(\" done starting session\"); |\n+|#endif |\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+|\t\t// this applies unchoke settings from m_settings |\n+|\t\trecalculate_unchoke_slots(); |\n | |\n-|\t\taux::session_settings const& settings = m_man.settings(); |\n+|\t\t// apply all m_settings to this session |\n+|\t\trun_all_updates(*this); |\n+|\t\treopen_listen_sockets(false); |\n | |\n-|\t\tint const proxy_type = settings.get_int(settings_pack::proxy_type); |\n+|#if TORRENT_USE_INVARIANT_CHECKS |\n+|\t\tcheck_invariant(); |\n+|#endif |\n+|\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{ |\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+|#if TORRENT_ABI_VERSION <= 2 |\n+|void session_impl::save_state(entry* eptr, save_state_flags_t const flags) const |\n+|{ |\n+|\t\tTORRENT_ASSERT(is_single_thread()); |\n+| |\n+|\t\tentry& e = *eptr; |\n+|\t\t// make it a dict |\n+|\t\te.dict(); |\n+| |\n+|\t\tif (flags & session::save_settings) |\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-|_\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\tentry::dictionary_type& sett = e[\"settings\"].dict(); |\n+|\t\t\tsave_settings_to_dict(non_default_settings(m_settings), sett); |\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+|#ifndef TORRENT_DISABLE_DHT |\n+|\t\tif (flags & session::save_dht_settings) |\n |\t\t{ |\n-|\t\t\tec.clear(); |\n-|\t\t\treturn; |\n+|\t\t\te[\"dht\"] = dht::save_dht_settings(get_dht_settings()); |\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\tif (m_dht && (flags & session::save_dht_state)) |\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\te[\"dht state\"] = dht::save_dht_state(m_dht->state()); |\n |\t\t} |\n+|#endif |\n | |\n-|\t\t// fall back to making a copy |\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+|_\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/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bi_\bm_\bp_\bl_\b._\bc_\bp_\bp_\b:_\b3_\b8_\b8_\b2 |make 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|\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_\ba_\bn_\bt_\b _\bt_\bo_\b _\ba_\bn_\bn_\bo_\bu_\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 _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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 a\ba l\bli\bis\bst\bt f\bfo\bor\br t\bto\bor\brr\bre\ben\bnt\bts\bs t\bth\bha\bat\bt w\bwa\ban\bnt\bt t\bto\bo b\bbe\be a\ban\bnn\bno\bou\bun\bnc\bce\bed\bd o\bon\bn t\bth\bhe\be D\bDH\bHT\bT s\bso\bo w\bwe\be d\bdo\bon\bn'\b't\bt h\bha\bav\bve\be t\bto\bo l\blo\boo\bop\bp o\bov\bve\ber\br a\bal\bll\bl t\bto\bor\brr\bre\ben\bnt\bts\bs,\b, j\bju\bus\bst\bt t\bto\bo f\bfi\bin\bnd\bd t\bth\bhe\be o\bon\bne\bes\bs t\bth\bha\bat\bt w\bwa\ban\bnt\bt t\bto\bo a\ban\bnn\bno\bou\bun\bnc\bce\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:3\b38\b88\b82\b2 *\b**\b**\b* |\n+|if (!m_dht_torrents.empty()) |\n+|\t\t{ |\n+|\t\t\tstd::shared_ptr 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+|\t\t\t} while (!t && !m_dht_torrents.empty()); |\n | |\n-|#endif |\n+|\t\t\tif (t) |\n+|\t\t\t{ |\n+|\t\t\t\tt->dht_announce(); |\n+|\t\t\t\treturn; |\n+|\t\t\t} |\n+|\t\t} |\n+|\t\tif (m_torrents.empty()) return; |\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\tif (m_next_dht_torrent >= m_torrents.size()) |\n+|\t\t\tm_next_dht_torrent = 0; |\n+|\t\tm_torrents[m_next_dht_torrent]->dht_announce(); |\n+|++m_next_dht_torrent; |\n+|if (m_next_dht_torrent >= m_torrents.size()) |\n+|\t\t\tm_next_dht_torrent = 0; |\n |\t} |\n+|#endif |\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/_\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+|\tvoid session_impl::on_lsd_announce(error_code const& e) |\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+|\t\tCOMPLETE_ASYNC(\"session_impl::on_lsd_announce\"); |\n+|\t\tm_stats_counters.inc_stats_counter(counters::on_lsd_counter); |\n+|\t\tTORRENT_ASSERT(is_single_thread()); |\n+|\t\tif (e) return; |\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+|\t\tif (m_abort) return; |\n | |\n-|char const* start = buffer.data(); |\n-|char const* end = start + buffer.size(); |\n-|\t\tchar const* const orig_start = start; |\n+|\t\tADD_OUTSTANDING_ASYNC(\"session_impl::on_lsd_announce\"); |\n+|\t\t// announce on local network every 5 minutes |\n+|\t\tint const delay = std::max(m_settings.get_int(settings_pack::local_service_announce_interval) |\n+|\t\t\t/ std::max(int(m_torrents.size()), 1), 1); |\n+|\t\tm_lsd_announce_timer.expires_after(seconds(delay)); |\n+|\t\tm_lsd_announce_timer.async_wait([this](error_code const& err) { |\n+|\t\t\twrap(&session_impl::on_lsd_announce, err); }); |\n | |\n-|\t\tif (start == end) |\n-|\t\t\tTORRENT_FAIL_BDECODE(bdecode_errors::unexpected_eof); |\n+|\t\tif (m_torrents.empty()) return; |\n | |\n-|\t\twhile (start <= end) |\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+|_\b\t_\b\t_\b\t_\bm_\b__\bn_\be_\bx_\bt_\b__\bl_\bs_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\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 |\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_\b5_\b1_\b5_\b _\b _\b|_\bt_\bh_\bi_\bs_\b _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn_\b _\bs_\bh_\bo_\bu_\bl_\bd_\b _\bb_\be_\b _\br_\be_\bm_\bo_\bv_\be_\bd_\b _\ba_\bn_\bd_\b _\bu_\bs_\be_\br_\bs_\b _\bn_\be_\be_\bd_\b _\bt_\bo_\b _\bd_\be_\ba_\bl_\b _\bw_\bi_\bt_\bh_\b _\bt_\bh_\be_\b _\bm_\bo_\br_\be_\b _\bg_\be_\bn_\be_\br_\bi_\bc_\b _\bc_\ba_\bs_\be_\b _\bo_\bf_\b _\bh_\ba_\bv_\bi_\bn_\bg_\b _\bm_\bu_\bl_\bt_\bi_\bp_\bl_\be_\b _\bl_\bi_\bs_\bt_\be_\bn_\b _\bp_\bo_\br_\bt_\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\bth\bhi\bis\bs f\bfu\bun\bnc\bct\bti\bio\bon\bn s\bsh\bho\bou\bul\bld\bd b\bbe\be r\bre\bem\bmo\bov\bve\bed\bd a\ban\bnd\bd u\bus\bse\ber\brs\bs n\bne\bee\bed\bd t\bto\bo d\bde\bea\bal\bl w\bwi\bit\bth\bh t\bth\bhe\be m\bmo\bor\bre\be g\bge\ben\bne\ber\bri\bic\bc c\bca\bas\bse\be o\bof\bf h\bha\bav\bvi\bin\bng\bg m\bmu\bul\blt\bti\bip\bpl\ble\be l\bli\bis\bst\bte\ben\bn p\bpo\bor\brt\bts\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\b55\b51\b15\b5 *\b**\b**\b* |\n+|#ifndef TORRENT_DISABLE_LOGGING |\n+|\t\tif (!node_list.empty() && nodes.empty()) |\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+|\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+|\t\t\tadd_dht_router(n); |\n+|#endif |\n+|\t} |\n | |\n-|\t\t\tint const current_frame = sp; |\n+|\tvoid session_impl::update_count_slow() |\n+|\t{ |\n+|\t\terror_code ec; |\n+|\t\tfor (auto const& tp : m_torrents) |\n+|\t\t{ |\n+|\t\t\ttp->on_inactivity_tick(ec); |\n+|\t\t} |\n+|\t} |\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-|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+|std::uint16_t session_impl::listen_port() const |\n+|{ |\n+|\t\treturn listen_port(nullptr); |\n+|\t} |\n | |\n-|\t\t\twrite_reject_request(r); |\n-|\t\t\tif (m_num_invalid_requests < std::numeric_limits::max()) |\n-|\t\t\t\t++m_num_invalid_requests; |\n+|\tstd::uint16_t session_impl::listen_port(listen_socket_t* sock) const |\n+|\t{ |\n+|\t\tif (m_listen_sockets.empty()) return 0; |\n+|\t\tif (sock) |\n+|\t\t{ |\n+|\t\t\t// if we're using a proxy, we won't be able to accept any TCP |\n+|\t\t\t// connections. Not even uTP connections via the port we know about. |\n+|\t\t\t// The DHT may use the implied port to make it work, but the port we |\n+|\t\t\t// announce here has no relevance for that. |\n+|\t\t\tif (sock->flags & listen_socket_t::proxy) |\n+|\t\t\t\treturn 0; |\n | |\n-|\t\t\tif (t->alerts().should_post()) |\n-|\t\t\t{ |\n-|\t\t\t\t// msvc 12 appears to deduce the rvalue reference template |\n-|\t\t\t\t// incorrectly for bool temporaries. So, create a dummy instance |\n-|\t\t\t\tbool const peer_interested = bool(m_peer_interested); |\n-|\t\t\t\tt->alerts().emplace_alert( |\n-|\t\t\t\t\tt->get_handle(), m_remote, m_peer_id, r |\n-|\t\t\t\t\t, t->user_have_piece(r.piece), peer_interested, false); |\n-|\t\t\t} |\n+|\t\t\tif (!(sock->flags & listen_socket_t::accept_incoming)) |\n+|\t\t\t\treturn 0; |\n | |\n-|\t\t\t// every ten invalid request, remind the peer that it's choked |\n-|\t\t\tif (!m_peer_interested && m_num_invalid_requests % 10 == 0 && m_choked) |\n-|\t\t\t{ |\n-|if (m_num_invalid_requests > 300 && !m_peer_choked |\n-|&& can_disconnect(errors::too_many_requests_when_choked)) |\n-|\t\t\t\t{ |\n-|\t\t\t\t\tdisconnect(errors::too_many_requests_when_choked, operation_t::bittorrent, peer_error); |\n-|\t\t\t\t\treturn; |\n-|\t\t\t\t} |\n-|#ifndef TORRENT_DISABLE_LOGGING |\n-|\t\t\t\tpeer_log(peer_log_alert::outgoing_message, \"CHOKE\"); |\n-|#endif |\n-|\t\t\t\twrite_choke(); |\n-|\t\t\t} |\n+|\t\t\treturn std::uint16_t(sock->tcp_external_port()); |\n+|\t\t} |\n | |\n-|\t\t\treturn; |\n+|#ifdef TORRENT_SSL_PEERS |\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+|_\b\t_\b\t_\br_\be_\bt_\bu_\br_\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 _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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_\b5_\b5_\b5_\b _\b _\b|_\bt_\bh_\bi_\bs_\b _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn_\b _\bs_\bh_\bo_\bu_\bl_\bd_\b _\bb_\be_\b _\br_\be_\bm_\bo_\bv_\be_\bd_\b _\ba_\bn_\bd_\b _\bu_\bs_\be_\br_\bs_\b _\bn_\be_\be_\bd_\b _\bt_\bo_\b _\bd_\be_\ba_\bl_\b _\bw_\bi_\bt_\bh_\b _\bt_\bh_\be_\b _\bm_\bo_\br_\be_\b _\bg_\be_\bn_\be_\br_\bi_\bc_\b _\bc_\ba_\bs_\be_\b _\bo_\bf_\b _\bh_\ba_\bv_\bi_\bn_\bg_\b _\bm_\bu_\bl_\bt_\bi_\bp_\bl_\be_\b _\bs_\bs_\bl_\b _\bp_\bo_\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 |\n+|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs f\bfu\bun\bnc\bct\bti\bio\bon\bn s\bsh\bho\bou\bul\bld\bd b\bbe\be r\bre\bem\bmo\bov\bve\bed\bd a\ban\bnd\bd u\bus\bse\ber\brs\bs n\bne\bee\bed\bd t\bto\bo d\bde\bea\bal\bl w\bwi\bit\bth\bh t\bth\bhe\be m\bmo\bor\bre\be g\bge\ben\bne\ber\bri\bic\bc c\bca\bas\bse\be o\bof\bf h\bha\bav\bvi\bin\bng\bg m\bmu\bul\blt\bti\bip\bpl\ble\be s\bss\bsl\bl p\bpo\bor\brt\bts\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\b55\b55\b55\b5 *\b**\b**\b* |\n+|return 0; |\n | |\n-|\t\t// if we have choked the client |\n-|\t\t// ignore the request |\n-|\t\tint const blocks_per_piece = |\n-|\t\t\t(ti.piece_length() + t->block_size() - 1) / t->block_size(); |\n+|\t\t\treturn std::uint16_t(sock->tcp_external_port()); |\n+|\t\t} |\n | |\n-|\t\t// disconnect peers that downloads more than foo times an allowed |\n-|\t\t// fast piece |\n-|\t\tif (m_choked && fast_idx != -1 && m_accept_fast_piece_cnt[fast_idx] >= 3 * blocks_per_piece |\n-|\t\t\t&& can_disconnect(errors::too_many_requests_when_choked)) |\n+|#ifdef TORRENT_SSL_PEERS |\n+|\t\tfor (auto const& s : m_listen_sockets) |\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\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-| |\n-|\t\tif (m_choked && fast_idx == -1) |\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-| |_\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: |since we throw away the queue entry once we issue the disk job, this may happen. Instead, we should keep the queue entry around, |\n-|relevance\u00a02|_\b3_\b3_\b0_\b9 |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|\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|_\bt_\bo_\b _\bc_\ba_\bn_\bc_\be_\bl_\b _\bd_\bi_\bs_\bk_\b _\bj_\bo_\bb_\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 |\n-|*\b**\b**\b**\b**\b* s\bsi\bin\bnc\bce\be w\bwe\be t\bth\bhr\bro\bow\bw a\baw\bwa\bay\by t\bth\bhe\be q\bqu\bue\beu\bue\be e\ben\bnt\btr\bry\by o\bon\bnc\bce\be w\bwe\be i\bis\bss\bsu\bue\be t\bth\bhe\be d\bdi\bis\bsk\bk j\bjo\bob\bb,\b, t\bth\bhi\bis\bs m\bma\bay\by h\bha\bap\bpp\bpe\ben\bn.\b. I\bIn\bns\bst\bte\bea\bad\bd,\b, w\bwe\be s\bsh\bho\bou\bul\bld\bd k\bke\bee\bep\bp t\bth\bhe\be q\bqu\bue\beu\bue\be e\ben\bnt\btr\bry\by a\bar\bro\bou\bun\bnd\bd,\b, m\bma\bar\brk\bk i\bit\bt a\bas\bs h\bha\bav\bvi\bin\bng\bg b\bbe\bee\ben\bn r\bre\beq\bqu\bue\bes\bst\bte\bed\bd f\bfr\bro\bom\bm |\n-|d\bdi\bis\bsk\bk a\ban\bnd\bd o\bon\bnc\bce\be t\bth\bhe\be d\bdi\bis\bsk\bk j\bjo\bob\bb c\bco\bom\bme\bes\bs b\bba\bac\bck\bk,\b, d\bdi\bis\bsc\bca\bar\brd\bd i\bit\bt i\bif\bf i\bit\bt h\bha\bas\bs b\bbe\bee\ben\bn c\bca\ban\bnc\bce\bel\bll\ble\bed\bd.\b. M\bMa\bay\byb\bbe\be e\bev\bve\ben\bn b\bbe\be a\bab\bbl\ble\be t\bto\bo c\bca\ban\bnc\bce\bel\bl d\bdi\bis\bsk\bk j\bjo\bob\bbs\bs?\b? *\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\b33\b30\b09\b9 *\b**\b**\b* |\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(r.piece), r.start, r.length); |\n+|\t\treturn 0; |\n+|#else |\n+|\t\tsock = m_listen_sockets.front().get(); |\n+|\t\tif (!(sock->flags & listen_socket_t::accept_incoming)) return 0; |\n+|\t\treturn std::uint16_t(sock->tcp_external_port()); |\n |#endif |\n+|\t} |\n | |\n-|\t\tauto const i = std::find(m_requests.begin(), m_requests.end(), r); |\n+|std::uint16_t session_impl::ssl_listen_port() const |\n+|{ |\n+|\t\treturn ssl_listen_port(nullptr); |\n+|\t} |\n | |\n-|\t\tif (i != m_requests.end()) |\n+|\tstd::uint16_t session_impl::ssl_listen_port(listen_socket_t* sock) const |\n+|\t{ |\n+|#ifdef TORRENT_SSL_PEERS |\n+|\t\tif (sock) |\n |\t\t{ |\n-|\t\t\tm_counters.inc_stats_counter(counters::cancelled_piece_requests); |\n-|\t\t\tm_requests.erase(i); |\n+|\t\t\tif (!(sock->flags & listen_socket_t::accept_incoming)) return 0; |\n+|\t\t\treturn std::uint16_t(sock->tcp_external_port()); |\n+|\t\t} |\n | |\n-|\t\t\tif (m_requests.empty()) |\n-|\t\t\t\tm_counters.inc_stats_counter(counters::num_peers_up_requests, -1); |\n+|\t\tif (m_settings.get_int(settings_pack::proxy_type) != settings_pack::none |\n+|\t\t\t&& m_settings.get_bool(settings_pack::proxy_peer_connections)) |\n+|\t\t\treturn 0; |\n | |\n-|\t\t\twrite_reject_request(r); |\n-|\t\t} |\n-|\t\telse |\n+|\t\tfor (auto const& s : m_listen_sockets) |\n |\t\t{ |\n-|#ifndef TORRENT_DISABLE_LOGGING |\n-|peer_log(peer_log_alert::info, \"INVALID_CANCEL\", \"got cancel not in the queue\"); |\n-|#endif |\n+|\t\t\tif (!(s->flags & listen_socket_t::accept_incoming)) continue; |\n+|\t\t\tif (s->ssl == transport::ssl) |\n+|\t\t\t\treturn std::uint16_t(s->tcp_external_port()); |\n |\t\t} |\n+|#else |\n+|\t\tTORRENT_UNUSED(sock); |\n+|#endif |\n+|\t\treturn 0; |\n |\t} |\n | |\n-|\t// ----------------------------- |\n-|\t// --------- DHT PORT ---------- |\n-|\t// ----------------------------- |\n+|_\b\t_\bi_\bn_\bt_\b _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bi_\bm_\bp_\bl_\b:_\b:_\bg_\be_\bt_\b__\bl_\bi_\bs_\bt_\be_\bn_\b__\bp_\bo_\br_\bt_\b(_\bt_\br_\ba_\bn_\bs_\bp_\bo_\br_\bt_\b _\bc_\bo_\bn_\bs_\bt_\b _\bs_\bs_\bl_\b,_\b _\ba_\bu_\bx_\b:_\b:_\bl_\bi_\bs_\bt_\be_\bn_\b__\bs_\bo_\bc_\bk_\be_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be_\b _\bc_\bo_\bn_\bs_\bt_\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 |\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:_\b6_\b3_\b9_\b0_\b _\b _\b|_\bt_\bh_\bi_\bs_\b _\bs_\bh_\bo_\bu_\bl_\bd_\b _\bb_\be_\b _\bf_\ba_\bc_\bt_\bo_\br_\be_\bd_\b _\bi_\bn_\bt_\bo_\b _\bt_\bh_\be_\b _\bu_\bd_\bp_\b _\bs_\bo_\bc_\bk_\be_\bt_\b,_\b _\bs_\bo_\b _\bw_\be_\b _\bo_\bn_\bl_\by_\b _\bh_\ba_\bv_\be_\b _\bt_\bh_\be_\b _\bc_\bo_\bd_\be_\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 |\n+|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs s\bsh\bho\bou\bul\bld\bd b\bbe\be f\bfa\bac\bct\bto\bor\bre\bed\bd i\bin\bnt\bto\bo t\bth\bhe\be u\bud\bdp\bp s\bso\boc\bck\bke\bet\bt,\b, s\bso\bo w\bwe\be o\bon\bnl\bly\by h\bha\bav\bve\be t\bth\bhe\be c\bco\bod\bde\be o\bon\bnc\bce\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\b63\b39\b90\b0 *\b**\b**\b* |\n+|return upload_rate_limit(m_local_peer_class); |\n+|\t} |\n | |\n-|\tvoid peer_connection::incoming_dht_port(int const listen_port) |\n+|\tint session_impl::local_download_rate_limit() const |\n |\t{ |\n-|\t\tTORRENT_ASSERT(is_single_thread()); |\n-|\t\tINVARIANT_CHECK; |\n+|\t\treturn download_rate_limit(m_local_peer_class); |\n+|\t} |\n | |\n-|#ifndef TORRENT_DISABLE_LOGGING |\n-|\t\tpeer_log(peer_log_alert::incoming_message, \"DHT_PORT\", \"p: %d\", listen_port); |\n-|#endif |\n-|#ifndef TORRENT_DISABLE_DHT |\n-|\t\tm_ses.add_dht_node({m_remote.address(), std::uint16_t(listen_port)}); |\n-|#else |\n-|\t\tTORRENT_UNUSED(listen_port); |\n-|#endif |\n+|\tint session_impl::upload_rate_limit_depr() const |\n+|\t{ |\n+|\t\treturn upload_rate_limit(m_global_class); |\n |\t} |\n | |\n-|\t// ----------------------------- |\n-|\t// --------- HAVE ALL ---------- |\n-|\t// ----------------------------- |\n+|\tint session_impl::download_rate_limit_depr() const |\n+|\t{ |\n+|\t\treturn download_rate_limit(m_global_class); |\n+|\t} |\n+|#endif // DEPRECATE |\n | |\n-|\tvoid peer_connection::incoming_have_all() |\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\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: |use a deadline_timer for timeouts. Don't rely on second_tick()! Hook this up to connect timeout as well. This would improve |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b4_\b9_\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|_\bp_\be_\br_\bf_\bo_\br_\bm_\ba_\bn_\bc_\be_\b _\bb_\be_\bc_\ba_\bu_\bs_\be_\b _\bo_\bf_\b _\bl_\be_\bs_\bs_\b _\bw_\bo_\br_\bk_\b _\bi_\bn_\b _\bs_\be_\bc_\bo_\bn_\bd_\b__\bt_\bi_\bc_\bk_\b(_\b)_\b,_\b _\ba_\bn_\bd_\b _\bm_\bi_\bg_\bh_\bt_\b _\bl_\be_\bt_\b _\bu_\bs_\be_\b _\br_\be_\bm_\bo_\bv_\be_\b _\bt_\bi_\bc_\bk_\bi_\bn_\bg_\b _\be_\bn_\bt_\bi_\br_\be_\bl_\by_\b _\be_\bv_\be_\bn_\bt_\bu_\ba_\bl_\bl_\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 |\n-|*\b**\b**\b**\b**\b* u\bus\bse\be a\ba d\bde\bea\bad\bdl\bli\bin\bne\be_\b_t\bti\bim\bme\ber\br f\bfo\bor\br t\bti\bim\bme\beo\bou\but\bts\bs.\b. D\bDo\bon\bn'\b't\bt r\bre\bel\bly\by o\bon\bn s\bse\bec\bco\bon\bnd\bd_\b_t\bti\bic\bck\bk(\b()\b)!\b! H\bHo\boo\bok\bk t\bth\bhi\bis\bs u\bup\bp t\bto\bo c\bco\bon\bnn\bne\bec\bct\bt t\bti\bim\bme\beo\bou\but\bt a\bas\bs w\bwe\bel\bll\bl.\b. T\bTh\bhi\bis\bs w\bwo\bou\bul\bld\bd i\bim\bmp\bpr\bro\bov\bve\be p\bpe\ber\brf\bfo\bor\brm\bma\ban\bnc\bce\be b\bbe\bec\bca\bau\bus\bse\be o\bof\bf l\ble\bes\bss\bs w\bwo\bor\brk\bk i\bin\bn |\n-|s\bse\bec\bco\bon\bnd\bd_\b_t\bti\bic\bck\bk(\b()\b),\b, a\ban\bnd\bd m\bmi\big\bgh\bht\bt l\ble\bet\bt u\bus\bse\be r\bre\bem\bmo\bov\bve\be t\bti\bic\bck\bki\bin\bng\bg e\ben\bnt\bti\bir\bre\bel\bly\by e\bev\bve\ben\bnt\btu\bua\bal\bll\bly\by *\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:4\b49\b97\b75\b5 *\b**\b**\b* |\n-|if (d > seconds(connect_timeout) |\n-|\t\t\t\t&& can_disconnect(errors::timed_out)) |\n+| |\n+|void session_impl::update_peer_dscp() |\n+|{ |\n+|\t\tint const value = m_settings.get_int(settings_pack::peer_dscp); |\n+|\t\tfor (auto const& l : m_listen_sockets) |\n+|\t\t{ |\n+|\t\t\tif (l->sock) |\n |\t\t\t{ |\n+|\t\t\t\terror_code ec; |\n+|\t\t\t\tset_traffic_class(*l->sock, value, ec); |\n+| |\n |#ifndef TORRENT_DISABLE_LOGGING |\n-|\t\t\t\tpeer_log(peer_log_alert::info, \"CONNECT_FAILED\", \"waited %d seconds\" |\n-|\t\t\t\t\t, int(total_seconds(d))); |\n+|\t\t\t\tif (should_log()) |\n+|\t\t\t\t{ |\n+|\t\t\t\t\tsession_log(\">>> SET_DSCP [ tcp (%s %d) value: %x e: %s ]\" |\n+|\t\t\t\t\t\t, l->sock->local_endpoint().address().to_string().c_str() |\n+|\t\t\t\t\t\t, l->sock->local_endpoint().port(), value, ec.message().c_str()); |\n+|\t\t\t\t} |\n |#endif |\n-|\t\t\t\tconnect_failed(errors::timed_out); |\n-|\t\t\t\treturn; |\n |\t\t\t} |\n-|\t\t} |\n | |\n-|\t\t// if the bw_network flag isn't set, it means we are not even trying to |\n-|\t\t// read from this peer's socket. Most likely because we're applying a |\n-|\t\t// rate limit. If the peer is \"slow\" because we are rate limiting it, |\n-|\t\t// don't enforce timeouts. However, as soon as we *do* read from the |\n-|\t\t// socket, we expect to receive data, and not have timed out. Then we |\n-|\t\t// can enforce the timeouts. |\n-|\t\tbool const reading_socket = bool(m_channel_state[download_channel] & peer_info::bw_network); |\n+|\t\t\tif (l->udp_sock) |\n+|\t\t\t{ |\n+|\t\t\t\terror_code ec; |\n+|\t\t\t\tset_traffic_class(l->udp_sock->sock, value, ec); |\n | |\n-|if (reading_socket && d > seconds(timeout()) && !m_connecting && m_reading_bytes == 0 |\n-|&& can_disconnect(errors::timed_out_inactivity)) |\n-|\t\t{ |\n |#ifndef TORRENT_DISABLE_LOGGING |\n-|\t\t\tpeer_log(peer_log_alert::info, \"LAST_ACTIVITY\", \"%d seconds ago\" |\n-|\t\t\t\t, int(total_seconds(d))); |\n-|#endif |\n-|\t\t\tdisconnect(errors::timed_out_inactivity, operation_t::bittorrent); |\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/_\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// do not stall waiting for a handshake |\n-|\t\tint timeout = m_settings.get_int (settings_pack::handshake_timeout); |\n-|#if TORRENT_USE_I2P |\n-|\t\ttimeout *= is_i2p(m_socket) ? 4 : 1; |\n+|\t\t// fall back to making a copy |\n |#endif |\n-|\t\tif (reading_socket |\n-|\t\t\t&& !m_connecting |\n-|\t\t\t&& in_handshake() |\n-|\t\t\t&& d > seconds(timeout)) |\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-|#ifndef TORRENT_DISABLE_LOGGING |\n-|\t\t\tpeer_log(peer_log_alert::info, \"NO_HANDSHAKE\", \"waited %d seconds\" |\n-|\t\t\t\t, int(total_seconds(d))); |\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\tdisconnect(errors::timed_out_no_handshake, operation_t::bittorrent); |\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// 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+|\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 |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@@ -2962,14 +3100,70 @@\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/_\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@@ -3232,14 +3426,235 @@\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/_\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/_\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+| |\n+|\t\t\twrite_reject_request(r); |\n+|\t\t\tif (m_num_invalid_requests < std::numeric_limits::max()) |\n+|\t\t\t\t++m_num_invalid_requests; |\n+| |\n+|\t\t\tif (t->alerts().should_post()) |\n+|\t\t\t{ |\n+|\t\t\t\t// msvc 12 appears to deduce the rvalue reference template |\n+|\t\t\t\t// incorrectly for bool temporaries. So, create a dummy instance |\n+|\t\t\t\tbool const peer_interested = bool(m_peer_interested); |\n+|\t\t\t\tt->alerts().emplace_alert( |\n+|\t\t\t\t\tt->get_handle(), m_remote, m_peer_id, r |\n+|\t\t\t\t\t, t->user_have_piece(r.piece), peer_interested, false); |\n+|\t\t\t} |\n+| |\n+|\t\t\t// every ten invalid request, remind the peer that it's choked |\n+|\t\t\tif (!m_peer_interested && m_num_invalid_requests % 10 == 0 && m_choked) |\n+|\t\t\t{ |\n+|if (m_num_invalid_requests > 300 && !m_peer_choked |\n+|&& can_disconnect(errors::too_many_requests_when_choked)) |\n+|\t\t\t\t{ |\n+|\t\t\t\t\tdisconnect(errors::too_many_requests_when_choked, operation_t::bittorrent, peer_error); |\n+|\t\t\t\t\treturn; |\n+|\t\t\t\t} |\n+|#ifndef TORRENT_DISABLE_LOGGING |\n+|\t\t\t\tpeer_log(peer_log_alert::outgoing_message, \"CHOKE\"); |\n+|#endif |\n+|\t\t\t\twrite_choke(); |\n+|\t\t\t} |\n+| |\n+|\t\t\treturn; |\n+|\t\t} |\n+| |\n+|\t\t// if we have choked the client |\n+|\t\t// ignore the request |\n+|\t\tint const blocks_per_piece = |\n+|\t\t\t(ti.piece_length() + t->block_size() - 1) / t->block_size(); |\n+| |\n+|\t\t// disconnect peers that downloads more than foo times an allowed |\n+|\t\t// fast piece |\n+|\t\tif (m_choked && fast_idx != -1 && m_accept_fast_piece_cnt[fast_idx] >= 3 * blocks_per_piece |\n+|\t\t\t&& can_disconnect(errors::too_many_requests_when_choked)) |\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+|_\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+| |_\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: |since we throw away the queue entry once we issue the disk job, this may happen. Instead, we should keep the queue entry around, |\n+|relevance\u00a02|_\b3_\b3_\b0_\b9 |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|\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|_\bt_\bo_\b _\bc_\ba_\bn_\bc_\be_\bl_\b _\bd_\bi_\bs_\bk_\b _\bj_\bo_\bb_\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 |\n+|*\b**\b**\b**\b**\b* s\bsi\bin\bnc\bce\be w\bwe\be t\bth\bhr\bro\bow\bw a\baw\bwa\bay\by t\bth\bhe\be q\bqu\bue\beu\bue\be e\ben\bnt\btr\bry\by o\bon\bnc\bce\be w\bwe\be i\bis\bss\bsu\bue\be t\bth\bhe\be d\bdi\bis\bsk\bk j\bjo\bob\bb,\b, t\bth\bhi\bis\bs m\bma\bay\by h\bha\bap\bpp\bpe\ben\bn.\b. I\bIn\bns\bst\bte\bea\bad\bd,\b, w\bwe\be s\bsh\bho\bou\bul\bld\bd k\bke\bee\bep\bp t\bth\bhe\be q\bqu\bue\beu\bue\be e\ben\bnt\btr\bry\by a\bar\bro\bou\bun\bnd\bd,\b, m\bma\bar\brk\bk i\bit\bt a\bas\bs h\bha\bav\bvi\bin\bng\bg b\bbe\bee\ben\bn r\bre\beq\bqu\bue\bes\bst\bte\bed\bd f\bfr\bro\bom\bm |\n+|d\bdi\bis\bsk\bk a\ban\bnd\bd o\bon\bnc\bce\be t\bth\bhe\be d\bdi\bis\bsk\bk j\bjo\bob\bb c\bco\bom\bme\bes\bs b\bba\bac\bck\bk,\b, d\bdi\bis\bsc\bca\bar\brd\bd i\bit\bt i\bif\bf i\bit\bt h\bha\bas\bs b\bbe\bee\ben\bn c\bca\ban\bnc\bce\bel\bll\ble\bed\bd.\b. M\bMa\bay\byb\bbe\be e\bev\bve\ben\bn b\bbe\be a\bab\bbl\ble\be t\bto\bo c\bca\ban\bnc\bce\bel\bl d\bdi\bis\bsk\bk j\bjo\bob\bbs\bs?\b? *\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\b33\b30\b09\b9 *\b**\b**\b* |\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(r.piece), r.start, r.length); |\n+|#endif |\n+| |\n+|\t\tauto const i = std::find(m_requests.begin(), m_requests.end(), r); |\n+| |\n+|\t\tif (i != m_requests.end()) |\n+|\t\t{ |\n+|\t\t\tm_counters.inc_stats_counter(counters::cancelled_piece_requests); |\n+|\t\t\tm_requests.erase(i); |\n+| |\n+|\t\t\tif (m_requests.empty()) |\n+|\t\t\t\tm_counters.inc_stats_counter(counters::num_peers_up_requests, -1); |\n+| |\n+|\t\t\twrite_reject_request(r); |\n+|\t\t} |\n+|\t\telse |\n+|\t\t{ |\n+|#ifndef TORRENT_DISABLE_LOGGING |\n+|peer_log(peer_log_alert::info, \"INVALID_CANCEL\", \"got cancel not in the queue\"); |\n+|#endif |\n+|\t\t} |\n+|\t} |\n+| |\n+|\t// ----------------------------- |\n+|\t// --------- DHT PORT ---------- |\n+|\t// ----------------------------- |\n+| |\n+|\tvoid peer_connection::incoming_dht_port(int const listen_port) |\n+|\t{ |\n+|\t\tTORRENT_ASSERT(is_single_thread()); |\n+|\t\tINVARIANT_CHECK; |\n+| |\n+|#ifndef TORRENT_DISABLE_LOGGING |\n+|\t\tpeer_log(peer_log_alert::incoming_message, \"DHT_PORT\", \"p: %d\", listen_port); |\n+|#endif |\n+|#ifndef TORRENT_DISABLE_DHT |\n+|\t\tm_ses.add_dht_node({m_remote.address(), std::uint16_t(listen_port)}); |\n+|#else |\n+|\t\tTORRENT_UNUSED(listen_port); |\n+|#endif |\n+|\t} |\n+| |\n+|\t// ----------------------------- |\n+|\t// --------- HAVE ALL ---------- |\n+|\t// ----------------------------- |\n+| |\n+|\tvoid peer_connection::incoming_have_all() |\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\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: |use a deadline_timer for timeouts. Don't rely on second_tick()! Hook this up to connect timeout as well. This would improve |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b4_\b9_\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|_\bp_\be_\br_\bf_\bo_\br_\bm_\ba_\bn_\bc_\be_\b _\bb_\be_\bc_\ba_\bu_\bs_\be_\b _\bo_\bf_\b _\bl_\be_\bs_\bs_\b _\bw_\bo_\br_\bk_\b _\bi_\bn_\b _\bs_\be_\bc_\bo_\bn_\bd_\b__\bt_\bi_\bc_\bk_\b(_\b)_\b,_\b _\ba_\bn_\bd_\b _\bm_\bi_\bg_\bh_\bt_\b _\bl_\be_\bt_\b _\bu_\bs_\be_\b _\br_\be_\bm_\bo_\bv_\be_\b _\bt_\bi_\bc_\bk_\bi_\bn_\bg_\b _\be_\bn_\bt_\bi_\br_\be_\bl_\by_\b _\be_\bv_\be_\bn_\bt_\bu_\ba_\bl_\bl_\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 |\n+|*\b**\b**\b**\b**\b* u\bus\bse\be a\ba d\bde\bea\bad\bdl\bli\bin\bne\be_\b_t\bti\bim\bme\ber\br f\bfo\bor\br t\bti\bim\bme\beo\bou\but\bts\bs.\b. D\bDo\bon\bn'\b't\bt r\bre\bel\bly\by o\bon\bn s\bse\bec\bco\bon\bnd\bd_\b_t\bti\bic\bck\bk(\b()\b)!\b! H\bHo\boo\bok\bk t\bth\bhi\bis\bs u\bup\bp t\bto\bo c\bco\bon\bnn\bne\bec\bct\bt t\bti\bim\bme\beo\bou\but\bt a\bas\bs w\bwe\bel\bll\bl.\b. T\bTh\bhi\bis\bs w\bwo\bou\bul\bld\bd i\bim\bmp\bpr\bro\bov\bve\be p\bpe\ber\brf\bfo\bor\brm\bma\ban\bnc\bce\be b\bbe\bec\bca\bau\bus\bse\be o\bof\bf l\ble\bes\bss\bs w\bwo\bor\brk\bk i\bin\bn |\n+|s\bse\bec\bco\bon\bnd\bd_\b_t\bti\bic\bck\bk(\b()\b),\b, a\ban\bnd\bd m\bmi\big\bgh\bht\bt l\ble\bet\bt u\bus\bse\be r\bre\bem\bmo\bov\bve\be t\bti\bic\bck\bki\bin\bng\bg e\ben\bnt\bti\bir\bre\bel\bly\by e\bev\bve\ben\bnt\btu\bua\bal\bll\bly\by *\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:4\b49\b97\b75\b5 *\b**\b**\b* |\n+|if (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+|\t\t\t\t\t, int(total_seconds(d))); |\n+|#endif |\n+|\t\t\t\tconnect_failed(errors::timed_out); |\n+|\t\t\t\treturn; |\n+|\t\t\t} |\n+|\t\t} |\n+| |\n+|\t\t// if the bw_network flag isn't set, it means we are not even trying to |\n+|\t\t// read from this peer's socket. Most likely because we're applying a |\n+|\t\t// rate limit. If the peer is \"slow\" because we are rate limiting it, |\n+|\t\t// don't enforce timeouts. However, as soon as we *do* read from the |\n+|\t\t// socket, we expect to receive data, and not have timed out. Then we |\n+|\t\t// can enforce the timeouts. |\n+|\t\tbool const reading_socket = bool(m_channel_state[download_channel] & peer_info::bw_network); |\n+| |\n+|if (reading_socket && d > seconds(timeout()) && !m_connecting && m_reading_bytes == 0 |\n+|&& can_disconnect(errors::timed_out_inactivity)) |\n+|\t\t{ |\n+|#ifndef TORRENT_DISABLE_LOGGING |\n+|\t\t\tpeer_log(peer_log_alert::info, \"LAST_ACTIVITY\", \"%d seconds ago\" |\n+|\t\t\t\t, int(total_seconds(d))); |\n+|#endif |\n+|\t\t\tdisconnect(errors::timed_out_inactivity, operation_t::bittorrent); |\n+|\t\t\treturn; |\n+|\t\t} |\n+| |\n+|\t\t// do not stall waiting for a handshake |\n+|\t\tint timeout = m_settings.get_int (settings_pack::handshake_timeout); |\n+|#if TORRENT_USE_I2P |\n+|\t\ttimeout *= is_i2p(m_socket) ? 4 : 1; |\n+|#endif |\n+|\t\tif (reading_socket |\n+|\t\t\t&& !m_connecting |\n+|\t\t\t&& in_handshake() |\n+|\t\t\t&& d > seconds(timeout)) |\n+|\t\t{ |\n+|#ifndef TORRENT_DISABLE_LOGGING |\n+|\t\t\tpeer_log(peer_log_alert::info, \"NO_HANDSHAKE\", \"waited %d seconds\" |\n+|\t\t\t\t, int(total_seconds(d))); |\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 | | |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@@ -3343,175 +3758,124 @@\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/_\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-|\t\tif (!m_alerts[m_generation].empty()) |\n-|\t\t\treturn m_alerts[m_generation].front(); |\n-| |\n-|\t\treturn nullptr; |\n-|\t} |\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-|\tvoid alert_manager::maybe_notify(alert* a) |\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\tif (m_alerts[m_generation].size() == 1) |\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\t// we just posted to an empty queue. If anyone is waiting for |\n-|\t\t\t// alerts, we need to notify them. Also (potentially) call the |\n-|\t\t\t// user supplied m_notify callback to let the client wake up its |\n-|\t\t\t// message loop to poll for alerts. |\n-|\t\t\tif (m_notify) m_notify(); |\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-|m_condition.notify_all(); |\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-|#ifndef TORRENT_DISABLE_EXTENSIONS |\n-|\t\tfor (auto& e : m_ses_extensions) |\n-|\t\t\te->on_alert(a); |\n-|#else |\n-|\t\tTORRENT_UNUSED(a); |\n-|#endif |\n-|\t} |\n+|char const* start = buffer.data(); |\n+|char const* end = start + buffer.size(); |\n+|\t\tchar const* const orig_start = start; |\n | |\n-|\tvoid alert_manager::set_notify_function(std::function const& fun) |\n-|\t{ |\n-|\t\tstd::unique_lock lock(m_mutex); |\n-|\t\tm_notify = fun; |\n-|\t\tif (!m_alerts[m_generation].empty()) |\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 (m_notify) m_notify(); |\n-|\t\t} |\n-|\t} |\n+|\t\t\tif (start >= end) TORRENT_FAIL_BDECODE(bdecode_errors::unexpected_eof); |\n | |\n-|#ifndef TORRENT_DISABLE_EXTENSIONS |\n-|\tvoid alert_manager::add_extension(std::shared_ptr ext) |\n-|\t{ |\n-|\t\tm_ses_extensions.push_back(std::move(ext)); |\n-|\t} |\n-|#endif |\n+|\t\t\tif (sp >= depth_limit) |\n+|\t\t\t\tTORRENT_FAIL_BDECODE(bdecode_errors::depth_exceeded); |\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/_\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+|\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-|upnp::rootdevice::rootdevice() = default; |\n+|\t\t\t// look for a new token |\n+|\t\t\tchar const t = *start; |\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+|\t\t\tint const current_frame = sp; |\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+|\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+|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-|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+|\t\tconst int candidate_count = 10; |\n+|\t\tpeers.reserve(candidate_count); |\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-|_\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+|\t\tint erase_candidate = -1; |\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+|\t\tif (bool(m_finished) != state->is_finished) |\n+|\t\t\trecalculate_connect_candidates(state); |\n | |\n-|\tvoid convert_path_to_posix(std::string& path) |\n-|\t{ |\n-|\t\tstd::replace(path.begin(), path.end(), '\\\\', '/'); |\n-|\t} |\n+|\t\texternal_ip const& external = state->ip; |\n+|\t\tint external_port = state->port; |\n | |\n-|std::string read_until(char const*& str, char const delim, char const* end) |\n-|{ |\n-|\t\tTORRENT_ASSERT(str <= end); |\n+|\t\tif (m_round_robin >= int(m_peers.size())) m_round_robin = 0; |\n | |\n-|\t\tstd::string ret; |\n-|\t\twhile (str != end && *str != delim) |\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\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+|\t\t\t++state->loop_counter; |\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+|\t\t\tif (m_round_robin >= int(m_peers.size())) m_round_robin = 0; |\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+|\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\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+|\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 |_\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@@ -3612,378 +3976,69 @@\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-|_\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-|\t} |\n-|#ifndef BOOST_NO_EXCEPTIONS |\n-|\tcatch (system_error const& e) { |\n-|\t\talerts().emplace_alert(e.code(), e.what()); |\n-|\t\tpause(); |\n-|\t} catch (std::exception const& e) { |\n-|\t\talerts().emplace_alert(error_code(), e.what()); |\n-|\t\tpause(); |\n-|\t} catch (...) { |\n-|\t\talerts().emplace_alert(error_code(), \"unknown error\"); |\n-|\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-|void session_impl::start_session() |\n-|{ |\n-|#ifndef TORRENT_DISABLE_LOGGING |\n-|\t\tsession_log(\"start session\"); |\n-|#endif |\n-| |\n-|#if TORRENT_USE_SSL |\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-|_\b#_\bi_\bf_\b _\bd_\be_\bf_\bi_\bn_\be_\bd_\b _\bT_\bO_\bR_\bR_\bE_\bN_\bT_\b__\bW_\bI_\bN_\bD_\bO_\bW_\bS_\b _\b&_\b&_\b _\bd_\be_\bf_\bi_\bn_\be_\bd_\b _\bT_\bO_\bR_\bR_\bE_\bN_\bT_\b__\bU_\bS_\bE_\b__\bO_\bP_\bE_\bN_\bS_\bS_\bL_\b _\b&_\b&_\b _\b!_\bd_\be_\bf_\bi_\bn_\be_\bd_\b _\bT_\bO_\bR_\bR_\bE_\bN_\bT_\b__\bW_\bI_\bN_\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 |\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:_\b7_\b6_\b1_\b _\b _\b _\b|_\bt_\bh_\be_\b _\bi_\bp_\b _\bf_\bi_\bl_\bt_\be_\br_\b _\bs_\bh_\bo_\bu_\bl_\bd_\b _\bp_\br_\bo_\bb_\ba_\bb_\bl_\by_\b _\bb_\be_\b _\bs_\ba_\bv_\be_\bd_\b _\bh_\be_\br_\be_\b _\bt_\bo_\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 |\n-|*\b**\b**\b**\b**\b* t\bth\bhe\be i\bip\bp f\bfi\bil\blt\bte\ber\br s\bsh\bho\bou\bul\bld\bd p\bpr\bro\bob\bba\bab\bbl\bly\by b\bbe\be s\bsa\bav\bve\bed\bd h\bhe\ber\bre\be t\bto\boo\bo *\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:7\b76\b61\b1 *\b**\b**\b* |\n-|m_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-|\t\trecalculate_unchoke_slots(); |\n-| |\n-|\t\t// apply all m_settings to this session |\n-|\t\trun_all_updates(*this); |\n-|\t\treopen_listen_sockets(false); |\n-| |\n-|#if TORRENT_USE_INVARIANT_CHECKS |\n-|\t\tcheck_invariant(); |\n-|#endif |\n-|\t} |\n-| |\n-|#if TORRENT_ABI_VERSION <= 2 |\n-|void session_impl::save_state(entry* eptr, save_state_flags_t const flags) const |\n-|{ |\n-|\t\tTORRENT_ASSERT(is_single_thread()); |\n-| |\n-|\t\tentry& e = *eptr; |\n-|\t\t// make it a dict |\n-|\t\te.dict(); |\n-| |\n-|\t\tif (flags & session::save_settings) |\n-|\t\t{ |\n-|\t\t\tentry::dictionary_type& sett = e[\"settings\"].dict(); |\n-|\t\t\tsave_settings_to_dict(non_default_settings(m_settings), sett); |\n-|\t\t} |\n-| |\n-|#ifndef TORRENT_DISABLE_DHT |\n-|\t\tif (flags & session::save_dht_settings) |\n-|\t\t{ |\n-|\t\t\te[\"dht\"] = dht::save_dht_settings(get_dht_settings()); |\n-|\t\t} |\n-| |\n-|\t\tif (m_dht && (flags & session::save_dht_state)) |\n-|\t\t{ |\n-|\t\t\te[\"dht state\"] = dht::save_dht_state(m_dht->state()); |\n-|\t\t} |\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-|_\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/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bi_\bm_\bp_\bl_\b._\bc_\bp_\bp_\b:_\b3_\b8_\b8_\b2 |make 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|\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_\ba_\bn_\bt_\b _\bt_\bo_\b _\ba_\bn_\bn_\bo_\bu_\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 _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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 a\ba l\bli\bis\bst\bt f\bfo\bor\br t\bto\bor\brr\bre\ben\bnt\bts\bs t\bth\bha\bat\bt w\bwa\ban\bnt\bt t\bto\bo b\bbe\be a\ban\bnn\bno\bou\bun\bnc\bce\bed\bd o\bon\bn t\bth\bhe\be D\bDH\bHT\bT s\bso\bo w\bwe\be d\bdo\bon\bn'\b't\bt h\bha\bav\bve\be t\bto\bo l\blo\boo\bop\bp o\bov\bve\ber\br a\bal\bll\bl t\bto\bor\brr\bre\ben\bnt\bts\bs,\b, j\bju\bus\bst\bt t\bto\bo f\bfi\bin\bnd\bd t\bth\bhe\be o\bon\bne\bes\bs t\bth\bha\bat\bt w\bwa\ban\bnt\bt t\bto\bo a\ban\bnn\bno\bou\bun\bnc\bce\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:3\b38\b88\b82\b2 *\b**\b**\b* |\n-|if (!m_dht_torrents.empty()) |\n-|\t\t{ |\n-|\t\t\tstd::shared_ptr 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-|\t\t\t} while (!t && !m_dht_torrents.empty()); |\n-| |\n-|\t\t\tif (t) |\n-|\t\t\t{ |\n-|\t\t\t\tt->dht_announce(); |\n-|\t\t\t\treturn; |\n-|\t\t\t} |\n-|\t\t} |\n-|\t\tif (m_torrents.empty()) return; |\n-| |\n-|\t\tif (m_next_dht_torrent >= m_torrents.size()) |\n-|\t\t\tm_next_dht_torrent = 0; |\n-|\t\tm_torrents[m_next_dht_torrent]->dht_announce(); |\n-|++m_next_dht_torrent; |\n-|if (m_next_dht_torrent >= m_torrents.size()) |\n-|\t\t\tm_next_dht_torrent = 0; |\n-|\t} |\n-|#endif |\n-| |\n-|\tvoid session_impl::on_lsd_announce(error_code const& e) |\n-|\t{ |\n-|\t\tCOMPLETE_ASYNC(\"session_impl::on_lsd_announce\"); |\n-|\t\tm_stats_counters.inc_stats_counter(counters::on_lsd_counter); |\n-|\t\tTORRENT_ASSERT(is_single_thread()); |\n-|\t\tif (e) return; |\n-| |\n-|\t\tif (m_abort) return; |\n-| |\n-|\t\tADD_OUTSTANDING_ASYNC(\"session_impl::on_lsd_announce\"); |\n-|\t\t// announce on local network every 5 minutes |\n-|\t\tint const delay = std::max(m_settings.get_int(settings_pack::local_service_announce_interval) |\n-|\t\t\t/ std::max(int(m_torrents.size()), 1), 1); |\n-|\t\tm_lsd_announce_timer.expires_after(seconds(delay)); |\n-|\t\tm_lsd_announce_timer.async_wait([this](error_code const& err) { |\n-|\t\t\twrap(&session_impl::on_lsd_announce, err); }); |\n-| |\n-|\t\tif (m_torrents.empty()) return; |\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-|_\b\t_\b\t_\b\t_\bm_\b__\bn_\be_\bx_\bt_\b__\bl_\bs_\bd_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\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 |\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_\b5_\b1_\b5_\b _\b _\b|_\bt_\bh_\bi_\bs_\b _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn_\b _\bs_\bh_\bo_\bu_\bl_\bd_\b _\bb_\be_\b _\br_\be_\bm_\bo_\bv_\be_\bd_\b _\ba_\bn_\bd_\b _\bu_\bs_\be_\br_\bs_\b _\bn_\be_\be_\bd_\b _\bt_\bo_\b _\bd_\be_\ba_\bl_\b _\bw_\bi_\bt_\bh_\b _\bt_\bh_\be_\b _\bm_\bo_\br_\be_\b _\bg_\be_\bn_\be_\br_\bi_\bc_\b _\bc_\ba_\bs_\be_\b _\bo_\bf_\b _\bh_\ba_\bv_\bi_\bn_\bg_\b _\bm_\bu_\bl_\bt_\bi_\bp_\bl_\be_\b _\bl_\bi_\bs_\bt_\be_\bn_\b _\bp_\bo_\br_\bt_\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\bth\bhi\bis\bs f\bfu\bun\bnc\bct\bti\bio\bon\bn s\bsh\bho\bou\bul\bld\bd b\bbe\be r\bre\bem\bmo\bov\bve\bed\bd a\ban\bnd\bd u\bus\bse\ber\brs\bs n\bne\bee\bed\bd t\bto\bo d\bde\bea\bal\bl w\bwi\bit\bth\bh t\bth\bhe\be m\bmo\bor\bre\be g\bge\ben\bne\ber\bri\bic\bc c\bca\bas\bse\be o\bof\bf h\bha\bav\bvi\bin\bng\bg m\bmu\bul\blt\bti\bip\bpl\ble\be l\bli\bis\bst\bte\ben\bn p\bpo\bor\brt\bts\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\b55\b51\b15\b5 *\b**\b**\b* |\n-|#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-|\t\t\tadd_dht_router(n); |\n-|#endif |\n-|\t} |\n-| |\n-|\tvoid session_impl::update_count_slow() |\n-|\t{ |\n-|\t\terror_code ec; |\n-|\t\tfor (auto const& tp : m_torrents) |\n-|\t\t{ |\n-|\t\t\ttp->on_inactivity_tick(ec); |\n-|\t\t} |\n-|\t} |\n-| |\n-|std::uint16_t session_impl::listen_port() const |\n-|{ |\n-|\t\treturn listen_port(nullptr); |\n-|\t} |\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-|\tstd::uint16_t session_impl::listen_port(listen_socket_t* sock) const |\n+|\t// internal |\n+|\tbool operator<(peer_entry const& lhs, peer_entry const& rhs) |\n |\t{ |\n-|\t\tif (m_listen_sockets.empty()) return 0; |\n-|\t\tif (sock) |\n-|\t\t{ |\n-|\t\t\t// if we're using a proxy, we won't be able to accept any TCP |\n-|\t\t\t// connections. Not even uTP connections via the port we know about. |\n-|\t\t\t// The DHT may use the implied port to make it work, but the port we |\n-|\t\t\t// announce here has no relevance for that. |\n-|\t\t\tif (sock->flags & listen_socket_t::proxy) |\n-|\t\t\t\treturn 0; |\n-| |\n-|\t\t\tif (!(sock->flags & listen_socket_t::accept_incoming)) |\n-|\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-|\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-|_\b\t_\b\t_\br_\be_\bt_\bu_\br_\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 _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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_\b5_\b5_\b5_\b _\b _\b|_\bt_\bh_\bi_\bs_\b _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn_\b _\bs_\bh_\bo_\bu_\bl_\bd_\b _\bb_\be_\b _\br_\be_\bm_\bo_\bv_\be_\bd_\b _\ba_\bn_\bd_\b _\bu_\bs_\be_\br_\bs_\b _\bn_\be_\be_\bd_\b _\bt_\bo_\b _\bd_\be_\ba_\bl_\b _\bw_\bi_\bt_\bh_\b _\bt_\bh_\be_\b _\bm_\bo_\br_\be_\b _\bg_\be_\bn_\be_\br_\bi_\bc_\b _\bc_\ba_\bs_\be_\b _\bo_\bf_\b _\bh_\ba_\bv_\bi_\bn_\bg_\b _\bm_\bu_\bl_\bt_\bi_\bp_\bl_\be_\b _\bs_\bs_\bl_\b _\bp_\bo_\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 |\n-|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs f\bfu\bun\bnc\bct\bti\bio\bon\bn s\bsh\bho\bou\bul\bld\bd b\bbe\be r\bre\bem\bmo\bov\bve\bed\bd a\ban\bnd\bd u\bus\bse\ber\brs\bs n\bne\bee\bed\bd t\bto\bo d\bde\bea\bal\bl w\bwi\bit\bth\bh t\bth\bhe\be m\bmo\bor\bre\be g\bge\ben\bne\ber\bri\bic\bc c\bca\bas\bse\be o\bof\bf h\bha\bav\bvi\bin\bng\bg m\bmu\bul\blt\bti\bip\bpl\ble\be s\bss\bsl\bl p\bpo\bor\brt\bts\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\b55\b55\b55\b5 *\b**\b**\b* |\n-|return 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-|\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-|#else |\n-|\t\tsock = m_listen_sockets.front().get(); |\n-|\t\tif (!(sock->flags & listen_socket_t::accept_incoming)) return 0; |\n-|\t\treturn std::uint16_t(sock->tcp_external_port()); |\n-|#endif |\n-|\t} |\n-| |\n-|std::uint16_t session_impl::ssl_listen_port() const |\n-|{ |\n-|\t\treturn ssl_listen_port(nullptr); |\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-|\tstd::uint16_t session_impl::ssl_listen_port(listen_socket_t* sock) const |\n+|\t// this is a group. It contains a set of group members |\n+|\tstruct torrent_entry |\n |\t{ |\n-|#ifdef TORRENT_SSL_PEERS |\n-|\t\tif (sock) |\n-|\t\t{ |\n-|\t\t\tif (!(sock->flags & listen_socket_t::accept_incoming)) return 0; |\n-|\t\t\treturn std::uint16_t(sock->tcp_external_port()); |\n-|\t\t} |\n-| |\n-|\t\tif (m_settings.get_int(settings_pack::proxy_type) != settings_pack::none |\n-|\t\t\t&& m_settings.get_bool(settings_pack::proxy_peer_connections)) |\n-|\t\t\treturn 0; |\n-| |\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::ssl) |\n-|\t\t\t\treturn std::uint16_t(s->tcp_external_port()); |\n-|\t\t} |\n-|#else |\n-|\t\tTORRENT_UNUSED(sock); |\n-|#endif |\n-|\t\treturn 0; |\n-|\t} |\n+|\t\tstd::string name; |\n+|\t\tstd::vector peers4; |\n+|\t\tstd::vector peers6; |\n+|\t}; |\n | |\n-|_\b\t_\bi_\bn_\bt_\b _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bi_\bm_\bp_\bl_\b:_\b:_\bg_\be_\bt_\b__\bl_\bi_\bs_\bt_\be_\bn_\b__\bp_\bo_\br_\bt_\b(_\bt_\br_\ba_\bn_\bs_\bp_\bo_\br_\bt_\b _\bc_\bo_\bn_\bs_\bt_\b _\bs_\bs_\bl_\b,_\b _\ba_\bu_\bx_\b:_\b:_\bl_\bi_\bs_\bt_\be_\bn_\b__\bs_\bo_\bc_\bk_\be_\bt_\b__\bh_\ba_\bn_\bd_\bl_\be_\b _\bc_\bo_\bn_\bs_\bt_\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 |\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:_\b6_\b3_\b9_\b0_\b _\b _\b|_\bt_\bh_\bi_\bs_\b _\bs_\bh_\bo_\bu_\bl_\bd_\b _\bb_\be_\b _\bf_\ba_\bc_\bt_\bo_\br_\be_\bd_\b _\bi_\bn_\bt_\bo_\b _\bt_\bh_\be_\b _\bu_\bd_\bp_\b _\bs_\bo_\bc_\bk_\be_\bt_\b,_\b _\bs_\bo_\b _\bw_\be_\b _\bo_\bn_\bl_\by_\b _\bh_\ba_\bv_\be_\b _\bt_\bh_\be_\b _\bc_\bo_\bd_\be_\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 |\n-|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs s\bsh\bho\bou\bul\bld\bd b\bbe\be f\bfa\bac\bct\bto\bor\bre\bed\bd i\bin\bnt\bto\bo t\bth\bhe\be u\bud\bdp\bp s\bso\boc\bck\bke\bet\bt,\b, s\bso\bo w\bwe\be o\bon\bnl\bly\by h\bha\bav\bve\be t\bth\bhe\be c\bco\bod\bde\be o\bon\bnc\bce\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\b63\b39\b90\b0 *\b**\b**\b* |\n-|return upload_rate_limit(m_local_peer_class); |\n-|\t} |\n+|constexpr time_duration announce_interval = minutes(30); |\n | |\n-|\tint session_impl::local_download_rate_limit() const |\n+|\tstruct dht_immutable_item |\n |\t{ |\n-|\t\treturn download_rate_limit(m_local_peer_class); |\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-|\tint session_impl::upload_rate_limit_depr() const |\n+|\tstruct dht_mutable_item : dht_immutable_item |\n |\t{ |\n-|\t\treturn upload_rate_limit(m_global_class); |\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-|\tint session_impl::download_rate_limit_depr() const |\n+|\tvoid set_value(dht_immutable_item& item, span buf) |\n |\t{ |\n-|\t\treturn download_rate_limit(m_global_class); |\n-|\t} |\n-|#endif // DEPRECATE |\n-| |\n-| |\n-|void session_impl::update_peer_dscp() |\n-|{ |\n-|\t\tint const value = m_settings.get_int(settings_pack::peer_dscp); |\n-|\t\tfor (auto const& l : m_listen_sockets) |\n-|\t\t{ |\n-|\t\t\tif (l->sock) |\n-|\t\t\t{ |\n-|\t\t\t\terror_code ec; |\n-|\t\t\t\tset_traffic_class(*l->sock, value, ec); |\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 [ tcp (%s %d) value: %x e: %s ]\" |\n-|\t\t\t\t\t\t, l->sock->local_endpoint().address().to_string().c_str() |\n-|\t\t\t\t\t\t, l->sock->local_endpoint().port(), value, ec.message().c_str()); |\n-|\t\t\t\t} |\n-|#endif |\n-|\t\t\t} |\n-| |\n-|\t\t\tif (l->udp_sock) |\n-|\t\t\t{ |\n-|\t\t\t\terror_code ec; |\n-|\t\t\t\tset_traffic_class(l->udp_sock->sock, value, ec); |\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-| |_\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+|_\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,69 +4226,124 @@\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+|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-|\t// internal |\n-|\tbool operator<(peer_entry const& lhs, peer_entry const& rhs) |\n+|\tvoid close(error_code& ec) |\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\tm_dst_name.clear(); |\n+|\t\tproxy_base::close(ec); |\n |\t} |\n | |\n-|\t// this is a group. It contains a set of group members |\n-|\tstruct torrent_entry |\n+|#ifndef BOOST_NO_EXCEPTIONS |\n+|\tvoid close() |\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+|\t\tm_dst_name.clear(); |\n+|\t\tproxy_base::close(); |\n+|\t} |\n+|#endif |\n | |\n-|\tstruct dht_immutable_item |\n+|template |\n+|void async_connect(endpoint_type const& endpoint, Handler handler) |\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+|\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-|\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+|\t\tm_remote_endpoint = endpoint; |\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+|\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 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/ |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@@ -4387,69 +4497,14 @@\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/ |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/ |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@@ -4497,69 +4552,69 @@\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/ |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+|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-|\t\tec.clear(); |\n+|#include |\n+|#include |\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+|#include \"libtorrent/aux_/disable_warnings_push.hpp\" |\n+|#include |\n+|#include \"libtorrent/aux_/disable_warnings_pop.hpp\" |\n+| |\n+|#ifdef _MSC_VER |\n+|// visual studio requires the value in a deque to be copyable. C++11 |\n+|// has looser requirements depending on which functions are actually used. |\n+|#define TORRENT_CPP98_DEQUE 1 |\n+|#else |\n+|#define TORRENT_CPP98_DEQUE 0 |\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+|namespace libtorrent { |\n+|namespace aux { |\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+|struct TORRENT_EXTRA_EXPORT chained_buffer : private single_threaded |\n+|{ |\n+|\t\tchained_buffer(): m_bytes(0), m_capacity(0) |\n+|\t\t{ |\n+|\t\t\tthread_started(); |\n+|#if TORRENT_USE_ASSERTS |\n+|\t\t\tm_destructed = false; |\n+|#endif |\n+|\t\t} |\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+|\tprivate: |\n | |\n-|\t\t\tif (!found) |\n+|\t\t// destructs/frees the holder object |\n+|\t\tusing destruct_holder_fun = void (*)(void*); |\n+|\t\tusing move_construct_holder_fun = void (*)(void*, void*); |\n+| |\n+|\t\tstruct buffer_t |\n+|\t\t{ |\n+|\t\t\tbuffer_t() {} |\n+|#if TORRENT_CPP98_DEQUE |\n+|\t\t\tbuffer_t(buffer_t&& rhs) noexcept |\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\tdestruct_holder = rhs.destruct_holder; |\n+|\t\t\t\tmove_holder = rhs.move_holder; |\n+|\t\t\t\tbuf = rhs.buf; |\n+|\t\t\t\tsize = rhs.size; |\n+|\t\t\t\tused_size = rhs.used_size; |\n+|\t\t\t\tmove_holder(&holder, &rhs.holder); |\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+|\t\t\tbuffer_t& operator=(buffer_t&& rhs) & noexcept |\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\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/ |make this interface a lot smaller. It could be split up into several smaller interfaces. Each subsystem could then limit the size of|\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:_\b1_\b2_\b7_\b _\b _\b _\b _\b _\b|_\bt_\bh_\be_\b _\bm_\bo_\bc_\bk_\b _\bo_\bb_\bj_\be_\bc_\bt_\b _\bt_\bo_\b _\bt_\be_\bs_\bt_\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 |\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 a\ba l\blo\bot\bt s\bsm\bma\bal\bll\ble\ber\br.\b. I\bIt\bt c\bco\bou\bul\bld\bd b\bbe\be s\bsp\bpl\bli\bit\bt u\bup\bp i\bin\bnt\bto\bo s\bse\bev\bve\ber\bra\bal\bl s\bsm\bma\bal\bll\ble\ber\br i\bin\bnt\bte\ber\brf\bfa\bac\bce\bes\bs.\b. E\bEa\bac\bch\bh s\bsu\bub\bbs\bsy\bys\bst\bte\bem\bm c\bco\bou\bul\bld\bd t\bth\bhe\ben\bn l\bli\bim\bmi\bit\bt t\bth\bhe\be s\bsi\biz\bze\be o\bof\bf t\bth\bhe\be m\bmo\boc\bck\bk o\bob\bbj\bje\bec\bct\bt t\bto\bo t\bte\bes\bst\bt i\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/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:1\b12\b27\b7 *\b**\b**\b* |\n |// a release build with logging disabled (which is the default) will |\n |\t// not have this class at all |\n |\tstruct TORRENT_EXTRA_EXPORT session_logger |\n@@ -4635,69 +4690,68 @@\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-|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+|_\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-|#include |\n-|#include |\n+|\t\tlisten_socket_t* listen_socket = ls.get(); |\n | |\n-|#include \"libtorrent/aux_/disable_warnings_push.hpp\" |\n-|#include |\n-|#include \"libtorrent/aux_/disable_warnings_pop.hpp\" |\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-|#ifdef _MSC_VER |\n-|// visual studio requires the value in a deque to be copyable. C++11 |\n-|// has looser requirements depending on which functions are actually used. |\n-|#define TORRENT_CPP98_DEQUE 1 |\n-|#else |\n-|#define TORRENT_CPP98_DEQUE 0 |\n-|#endif |\n+|\t\tif (!listen_socket) return; |\n | |\n-|namespace libtorrent { |\n-|namespace aux { |\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-|struct TORRENT_EXTRA_EXPORT chained_buffer : private single_threaded |\n-|{ |\n-|\t\tchained_buffer(): m_bytes(0), m_capacity(0) |\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\tthread_started(); |\n-|#if TORRENT_USE_ASSERTS |\n-|\t\t\tm_destructed = false; |\n-|#endif |\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-|\tprivate: |\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\t// destructs/frees the holder object |\n-|\t\tusing destruct_holder_fun = void (*)(void*); |\n-|\t\tusing move_construct_holder_fun = void (*)(void*, void*); |\n+|\t\tsession_status s; |\n | |\n-|\t\tstruct buffer_t |\n-|\t\t{ |\n-|\t\t\tbuffer_t() {} |\n-|#if TORRENT_CPP98_DEQUE |\n-|\t\t\tbuffer_t(buffer_t&& rhs) noexcept |\n-|\t\t\t{ |\n-|\t\t\t\tdestruct_holder = rhs.destruct_holder; |\n-|\t\t\t\tmove_holder = rhs.move_holder; |\n-|\t\t\t\tbuf = rhs.buf; |\n-|\t\t\t\tsize = rhs.size; |\n-|\t\t\t\tused_size = rhs.used_size; |\n-|\t\t\t\tmove_holder(&holder, &rhs.holder); |\n-|\t\t\t} |\n-|\t\t\tbuffer_t& operator=(buffer_t&& rhs) & noexcept |\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+|\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@@ -4799,68 +4853,14 @@\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,418 +4883,148 @@\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/ |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__\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-|\t\t\treturn true; |\n-|\t\t} |\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\tvoid log_portmap(portmap_transport, char const* msg |\n-|\t\t\t, aux::listen_socket_handle const&) const override |\n+|\t\tkey_desc_t const desc[] = |\n |\t\t{ |\n-|\t\t\tstd::cout << \"UPnP: \" << msg << std::endl; |\n-|} |\n-|#endif |\n-|\t}; |\n-| |\n-|ip_interface pick_upnp_interface() |\n-|{ |\n-|\tlt::io_context ios; |\n-|\terror_code ec; |\n-|\tstd::vector const routes = enum_routes(ios, ec); |\n-|\tif (ec) |\n-|\t{ |\n-|\t\tstd::cerr << \"failed to enumerate routes: \" << ec.message() << '\\n'; |\n-|\t\tTEST_CHECK(false); |\n-|\t\treturn {}; |\n-|\t} |\n-|\tstd::vector const ifs = enum_net_interfaces(ios, ec); |\n-|\tif (ec) |\n-|\t{ |\n-|\t\tstd::cerr << \"failed to enumerate network interfaces: \" << ec.message() << '\\n'; |\n-|\t\tTEST_CHECK(false); |\n-|\t\treturn {}; |\n-|\t} |\n-|\tint idx = 0; |\n-|\tfor (auto const& face : ifs) |\n-|\t{ |\n-|\t\tif (!face.interface_address.is_v4()) continue; |\n-|\t\tstd::cout << \" - \" << idx |\n-|\t\t\t<< ' ' << face.interface_address.to_string() |\n-|\t\t\t<< ' ' << int(static_cast(face.state)) |\n-|\t\t\t<< ' ' << static_cast(face.flags) |\n-|_\b\t_\b\t_\b\t_\b<_\b<_\b _\b'_\b _\b'_\b _\b<_\b<_\b _\bf_\ba_\bc_\be_\b._\bn_\ba_\bm_\be_\b _\b<_\b<_\b _\b'_\b\\_\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 |\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-|\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-|\t} |\n-| |\n-|\tstd::string certificate = combine_path(\"..\", combine_path(\"ssl\", \"peer_certificate.pem\")); |\n-|\tstd::string private_key = combine_path(\"..\", combine_path(\"ssl\", \"peer_private_key.pem\")); |\n-|\tstd::string dh_params = combine_path(\"..\", combine_path(\"ssl\", \"dhparams.pem\")); |\n-| |\n-|\tif (flags & invalid_certificate) |\n-|\t{ |\n-|\t\tcertificate = combine_path(\"..\", combine_path(\"ssl\", \"invalid_peer_certificate.pem\")); |\n-|\t\tprivate_key = combine_path(\"..\", combine_path(\"ssl\", \"invalid_peer_private_key.pem\")); |\n-|\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+|\t\t}; |\n | |\n+|\t\tbdecode_node parsed[4]; |\n+|\t\tchar error_string[200]; |\n | |\n-|if (flags & (valid_certificate | invalid_certificate)) |\n-|\t{ |\n-|\t\tstd::printf(\"set_password_callback\\n\"); |\n-|\t\tctx.set_password_callback( |\n-|\t\t\t[](std::size_t, context::password_purpose) { return \"test\"; } |\n-|\t\t\t, ec); |\n-|\t\tif (ec) |\n-|\t\t{ |\n-|\t\t\tstd::printf(\"Failed to set certificate passphrase: %s\\n\" |\n-|\t\t\t\t, ec.message().c_str()); |\n-|\t\t\tTEST_CHECK(!ec); |\n-|\t\t\treturn false; |\n-|\t\t} |\n-|\t\tstd::printf(\"use_certificate_file \\\"%s\\\"\\n\", certificate.c_str()); |\n-|\t\tctx.use_certificate_file(certificate, context::pem, ec); |\n-|\t\tif (ec) |\n+|\t\tint ret = verify_message(response, desc, parsed, error_string); |\n+|\t\tif (ret) |\n |\t\t{ |\n-|\t\t\tstd::printf(\"Failed to set certificate file: %s\\n\" |\n-|\t\t\t\t, ec.message().c_str()); |\n-|\t\t\tTEST_CHECK(!ec); |\n-|\t\t\treturn false; |\n+|\t\t\titems_num.insert(items_num.begin(), j); |\n |\t\t} |\n-|\t\tstd::printf(\"use_private_key_file \\\"%s\\\"\\n\", private_key.c_str()); |\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-|_\b\t_\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 |\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:_\b5_\b0_\b9_\b _\b _\b _\b _\b _\b _\b|_\ba_\bl_\bs_\bo_\b _\bt_\be_\bs_\bt_\b _\bu_\bs_\bi_\bn_\bg_\b _\ba_\b _\bh_\ba_\bs_\bh_\b _\bt_\bh_\ba_\bt_\b _\br_\be_\bf_\be_\br_\bs_\b _\bt_\bo_\b _\ba_\b _\bv_\ba_\bl_\bi_\bd_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\b _\bb_\bu_\bt_\b _\bt_\bh_\ba_\bt_\b _\bd_\bi_\bf_\bf_\be_\br_\bs_\b _\bf_\br_\bo_\bm_\b _\bt_\bh_\be_\b _\bS_\bN_\bI_\b _\bh_\ba_\bs_\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 |\n-|*\b**\b**\b**\b**\b* a\bal\bls\bso\bo t\bte\bes\bst\bt u\bus\bsi\bin\bng\bg a\ba h\bha\bas\bsh\bh t\bth\bha\bat\bt r\bre\bef\bfe\ber\brs\bs t\bto\bo a\ba v\bva\bal\bli\bid\bd t\bto\bor\brr\bre\ben\bnt\bt b\bbu\but\bt t\bth\bha\bat\bt d\bdi\bif\bff\bfe\ber\brs\bs f\bfr\bro\bom\bm t\bth\bhe\be S\bSN\bNI\bI h\bha\bas\bsh\bh *\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:5\b50\b09\b9 *\b**\b**\b* |\n-|print_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 | |\n-|\tchar handshake[] = \"\\x13\" \"BitTorrent protocol\\0\\0\\0\\0\\0\\0\\0\\x04\" |\n-|\t\t\" \" // space for info-hash |\n-|\t\t\"aaaaaaaaaaaaaaaaaaaa\" // peer-id |\n-|\t\t\"\\0\\0\\0\\x01\\x02\"; // interested |\n-| |\n-|\t// fill in the info-hash |\n-|\tif (flags & valid_bittorrent_hash) |\n-|\t{ |\n-|\t\tstd::memcpy(handshake + 28, &t->info_hashes().v1[0], 20); |\n-|\t} |\n-|\telse |\n-|\t{ |\n-|std::generate(handshake + 28, handshake + 48, &rand); |\n+|TEST_EQUAL(items_num.size(), 4); |\n |} |\n | |\n-|\t// fill in the peer-id |\n-|\tstd::generate(handshake + 48, handshake + 68, &rand); |\n-| |\n-|\tstd::printf(\"bittorrent handshake\\n\"); |\n-|\tboost::asio::write(ssl_sock, boost::asio::buffer(handshake, (sizeof(handshake) - 1)), ec); |\n-|\tprint_alerts(ses1, \"ses1\", true, true, &on_alert); |\n-|\tif (ec) |\n-|\t{ |\n-|\t\tstd::printf(\"failed to write bittorrent handshake: %s\\n\" |\n-|\t\t\t, ec.message().c_str()); |\n-|\t\treturn false; |\n-|\t} |\n-| |\n-|\tchar buf[68]; |\n-|\tstd::printf(\"read bittorrent handshake\\n\"); |\n-|\tboost::asio::read(ssl_sock, boost::asio::buffer(buf, sizeof(buf)), ec); |\n-|\tprint_alerts(ses1, \"ses1\", true, true, &on_alert); |\n-|\tif (ec) |\n-|\t{ |\n-|\t\tstd::printf(\"failed to read bittorrent handshake: %s\\n\" |\n-|\t\t\t, ec.message().c_str()); |\n-|\t\treturn false; |\n-|\t} |\n+|int sum_distance_exp(int s, node_entry const& e, node_id const& ref) |\n+|{ |\n+|\treturn s + distance_exp(e.id, ref); |\n+|} |\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+|std::vector g_got_peers; |\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+|void get_peers_cb(std::vector const& peers) |\n+|{ |\n+|\tg_got_peers.insert(g_got_peers.end(), peers.begin(), peers.end()); |\n+|} |\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+|std::vector g_got_items; |\n+|dht::item g_put_item; |\n+|int g_put_count; |\n | |\n-|\tpack.set_bool(settings_pack::allow_multiple_connections_per_ip, false); |\n+|void get_mutable_item_cb(dht::item const& i, bool a) |\n+|{ |\n+|\tif (!a) return; |\n+|\tif (!i.empty()) |\n+|\t\tg_got_items.push_back(i); |\n+|} |\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+|void put_mutable_item_data_cb(dht::item& i) |\n+|{ |\n+|\tif (!i.empty()) |\n+|_\b\t_\b\t_\bg_\b__\bg_\bo_\bt_\b__\bi_\bt_\be_\bm_\bs_\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_\b0_\b|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bd_\bh_\bt_\b._\bc_\bp_\bp_\b:_\b3_\b2_\b2_\b3_\b _\b _\b _\b _\b _\b|_\bt_\bh_\bi_\bs_\b _\bw_\bo_\bn_\b'_\bt_\b _\bw_\bo_\br_\bk_\b _\bb_\be_\bc_\ba_\bu_\bs_\be_\b _\bt_\bh_\be_\b _\bs_\be_\bc_\bo_\bn_\bd_\b _\bn_\bo_\bd_\be_\b _\bi_\bs_\bn_\b'_\bt_\b _\bp_\bi_\bn_\bg_\be_\bd_\b _\bs_\bo_\b _\bi_\bt_\b _\bw_\bo_\bn_\bt_\b _\bb_\be_\b _\ba_\bd_\bd_\be_\bd_\b _\bt_\bo_\b _\bt_\bh_\be_\b _\br_\bo_\bu_\bt_\bi_\bn_\bg_\b _\bt_\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 |\n+|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs w\bwo\bon\bn'\b't\bt w\bwo\bor\brk\bk b\bbe\bec\bca\bau\bus\bse\be t\bth\bhe\be s\bse\bec\bco\bon\bnd\bd n\bno\bod\bde\be i\bis\bsn\bn'\b't\bt p\bpi\bin\bng\bge\bed\bd s\bso\bo i\bit\bt w\bwo\bon\bnt\bt b\bbe\be a\bad\bdd\bde\bed\bd t\bto\bo t\bth\bhe\be r\bro\bou\but\bti\bin\bng\bg t\bta\bab\bbl\ble\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_d\bdh\bht\bt.\b.c\bcp\bpp\bp:\b:3\b32\b22\b23\b3 *\b**\b**\b* |\n+|bool ret = verify_message(request, get_item_desc_ro, parsed, error_string); |\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+|\tTEST_CHECK(ret); |\n+|\tTEST_EQUAL(parsed[3].int_value(), 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+|\t// should have one node now, which is 4.4.4.4:1234 |\n+|\tTEST_EQUAL(std::get<0>(node.size()), 1); |\n+|\t// and no replacement nodes |\n+|\tTEST_EQUAL(std::get<1>(node.size()), 0); |\n | |\n-|\tses2.apply_settings(pack); |\n+|\t// now, disable read_only, try again. |\n+|\tg_sent_packets.clear(); |\n+|\tsett.set_bool(settings_pack::dht_read_only, false); |\n | |\n-|\ttorrent_handle tor1; |\n-|\ttorrent_handle tor2; |\n+|\tsend_dht_request(node, \"get\", source, &response); |\n+|\t// sender should be added to replacement bucket |\n+|\tTEST_EQUAL(std::get<1>(node.size()), 1); |\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+|\tg_sent_packets.clear(); |\n+|#if 0 |\n+|target = generate_next(); |\n+|node.get_item(target, get_immutable_item_cb); |\n | |\n-|\tTEST_CHECK(exists(combine_path(\"tmp1_transfer\", \"temporary\"))); |\n+|\t// since we have 2 nodes, we should have two packets. |\n+|\tTEST_EQUAL(g_sent_packets.size(), 2); |\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+|\t// both of them shouldn't have a 'ro' key. |\n+|\tnode_from_entry(g_sent_packets.front().second, request); |\n+|\tret = verify_message(request, get_item_desc_ro, parsed, error_string); |\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/_\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+|\tTEST_CHECK(ret); |\n+|\tTEST_CHECK(!parsed[3]); |\n | |\n-|\tstd::uint8_t compare[4] = { 0x16, 0xff, 0x55, 0xaa}; |\n+|\tnode_from_entry(g_sent_packets.back().second, request); |\n+|\tret = verify_message(request, get_item_desc_ro, parsed, error_string); |\n | |\n-|\tbits_out = filter.to_string(); |\n-|\tTEST_EQUAL(memcmp(compare, bits_out.c_str(), 4), 0); |\n+|\tTEST_CHECK(ret); |\n+|\tTEST_CHECK(!parsed[3]); |\n+|#endif |\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-|_\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+|#ifndef TORRENT_DISABLE_LOGGING |\n+|// these tests rely on logging being enabled |\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+|TORRENT_TEST(invalid_error_msg) |\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__\bd_\bh_\bt_\b._\bc_\bp_\bp_\b:_\b4_\b0_\b8_\b1_\b _\b _\b _\b _\b _\b|_\bt_\be_\bs_\bt_\b _\bo_\bb_\bf_\bu_\bs_\bc_\ba_\bt_\be_\bd_\b__\bg_\be_\bt_\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 _\b |\n+|*\b**\b**\b**\b**\b* t\bte\bes\bst\bt o\bob\bbf\bfu\bus\bsc\bca\bat\bte\bed\bd_\b_g\bge\bet\bt_\b_p\bpe\bee\ber\brs\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_d\bdh\bht\bt.\b.c\bcp\bpp\bp:\b:4\b40\b08\b81\b1 *\b**\b**\b* |\n+|TEST_CHECK(sm.has_quota()); |\n+|\t}); |\n |} |\n | |\n-|TORRENT_TEST(parse_peers4) |\n+|TORRENT_TEST(rate_limit_accrue_limit) |\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/_\bt_\be_\bs_\bt_\b__\bm_\be_\br_\bk_\bl_\be_\b__\bt_\br_\be_\be_\b._\bc_\bp_\bp_\b: |use structured bindings in C++17 |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b2_\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 _\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/t\bte\bes\bst\bt/\b/t\bte\bes\bst\bt_\b_m\bme\ber\brk\bkl\ble\be_\b_t\btr\bre\bee\be.\b.c\bcp\bpp\bp:\b:2\b23\b33\b3 *\b**\b**\b* |\n-|mask[std::size_t(i)] = true; |\n-|\t\tt.load_sparse_tree(span(f).subspan(first_piece, num_pieces), mask, empty_verified); |\n-|\t\tint const end_piece_layer = first_piece + merkle_num_leafs(num_pieces); |\n-|\t\tfor (int i = 0; i < end_piece_layer; ++i) |\n-|\t\t{ |\n-|\t\t\tTEST_CHECK(t.has_node(i)); |\n-|\t\t\tTEST_CHECK(t.compare_node(i, f[i])); |\n-|\t\t} |\n-|\t\tfor (int i = end_piece_layer; i < num_nodes; ++i) |\n+|\taux::session_settings sett; |\n+|\tsett.set_int(settings_pack::dht_upload_rate_limit, std::numeric_limits::max()); |\n+| |\n+|\ttest_rate_limit(sett, [](lt::dht::socket_manager& sm) { |\n+|\t\tTEST_CHECK(sm.has_quota()); |\n+|\t\tfor (int i = 0; i < 10; ++i) |\n |\t\t{ |\n-|\t\t\tTEST_CHECK(!t.has_node(i)); |\n+|\t\t\tstd::this_thread::sleep_for(milliseconds(500)); |\n+|\t\t\tTEST_CHECK(sm.has_quota()); |\n |\t\t} |\n-|\t} |\n+|\t}); |\n |} |\n | |\n-|namespace { |\n-|void test_roundtrip(aux::merkle_tree const& t |\n-|\t, int const block_count |\n-|\t, int const blocks_per_piece) |\n-|{ |\n-|aux::vector mask; |\n-|std::vector tree; |\n-|\tstd::tie(tree, mask) = t.build_sparse_vector(); |\n-| |\n-|\taux::merkle_tree t2(block_count, blocks_per_piece, f[0].data()); |\n-|\tt2.load_sparse_tree(tree, mask, empty_verified); |\n-| |\n-|\tTEST_CHECK(t.build_vector() == t2.build_vector()); |\n-|\tfor (int i = 0; i < int(t.size()); ++i) |\n-|\t{ |\n-|\t\tTEST_EQUAL(t[i], t2[i]); |\n-|\t\tTEST_EQUAL(t.has_node(i), t2.has_node(i)); |\n-| |\n-|\t\tif (!t.has_node(i)) |\n-|\t\t\tTEST_CHECK(t[i].is_all_zeros()); |\n-|\t\tif (!t2.has_node(i)) |\n-|\t\t\tTEST_CHECK(t2[i].is_all_zeros()); |\n | |\n-|\t\tTEST_CHECK(t.compare_node(i, t2[i])); |\n-|\t\tTEST_CHECK(t2.compare_node(i, t[i])); |\n-|\t} |\n-|} |\n-|} |\n | |\n-|TORRENT_TEST(roundtrip_empty_tree) |\n+|#else |\n+|TORRENT_TEST(dht) |\n |{ |\n-|\taux::merkle_tree t(num_blocks, 1, f[0].data()); |\n-|\ttest_roundtrip(t, num_blocks, 1); |\n-|} |\n-| |\n-|_\bT_\bO_\bR_\bR_\bE_\bN_\bT_\b__\bT_\bE_\bS_\bT_\b(_\br_\bo_\bu_\bn_\bd_\bt_\br_\bi_\bp_\b__\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 |\n-|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bm_\be_\br_\bk_\bl_\be_\b__\bt_\br_\be_\be_\b._\bc_\bp_\bp_\b: |add test for load_piece_layer() |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b9_\b3_\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* a\bad\bdd\bd t\bte\bes\bst\bt f\bfo\bor\br l\blo\boa\bad\bd_\b_p\bpi\bie\bec\bce\be_\b_l\bla\bay\bye\ber\br(\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__\bm\bm_\be\be_\br\br_\bk\bk_\bl\bl_\be\be_\b_\b__\bt\bt_\br\br_\be\be_\be\be_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b9\b9_\b3\b3_\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 |\n-|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bm_\be_\br_\bk_\bl_\be_\b__\bt_\br_\be_\be_\b._\bc_\bp_\bp_\b: |add test for add_hashes() with an odd number of blocks |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b9_\b3_\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* a\bad\bdd\bd t\bte\bes\bst\bt f\bfo\bor\br a\bad\bdd\bd_\b_h\bha\bas\bsh\bhe\bes\bs(\b()\b) w\bwi\bit\bth\bh a\ban\bn o\bod\bdd\bd n\bnu\bum\bmb\bbe\ber\br o\bof\bf b\bbl\blo\boc\bck\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__\bm\bm_\be\be_\br\br_\bk\bk_\bl\bl_\be\be_\b_\b__\bt\bt_\br\br_\be\be_\be\be_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b9\b9_\b3\b3_\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 |\n-|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bm_\be_\br_\bk_\bl_\be_\b__\bt_\br_\be_\be_\b._\bc_\bp_\bp_\b: |add test for set_block() (setting the last block) with an odd number of blocks |\n-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b9_\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 _\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 t\bte\bes\bst\bt f\bfo\bor\br s\bse\bet\bt_\b_b\bbl\blo\boc\bck\bk(\b()\b) (\b(s\bse\bet\btt\bti\bin\bng\bg t\bth\bhe\be l\bla\bas\bst\bt b\bbl\blo\boc\bck\bk)\b) w\bwi\bit\bth\bh a\ban\bn o\bod\bdd\bd n\bnu\bum\bmb\bbe\ber\br o\bof\bf b\bbl\blo\boc\bck\bks\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_m\bme\ber\brk\bkl\ble\be_\b_t\btr\bre\bee\be.\b.c\bcp\bpp\bp:\b:9\b94\b40\b0 *\b**\b**\b* |\n-|\t\tfor (int i = 0; i < 7; ++i) |\n-|\t\t\tTEST_EQUAL(t[i], f[i]); |\n-|\t} |\n-| |\n-|\t// use a proof that ties the first piece node 3 (since we don't need it all |\n-|\t// the way to the root). |\n-|\tauto const result = t.add_hashes(127, pdiff(1), range(f, 127, 4), build_proof(f, 31, 3)); |\n-|\tTEST_CHECK(result); |\n-| |\n-|\tauto const& res = *result; |\n-|\tTEST_EQUAL(res.passed.size(), 0); |\n-|\tTEST_EQUAL(res.failed.size(), 0); |\n-| |\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+|\t// dummy dht test |\n+|\tTEST_CHECK(true); |\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+|_\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 |_\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@@ -5645,185 +5375,267 @@\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-|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/ |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__\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-|\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-|\t\t}; |\n-| |\n-|\t\tbdecode_node parsed[4]; |\n-|\t\tchar error_string[200]; |\n-| |\n-|\t\tint ret = verify_message(response, desc, parsed, error_string); |\n-|\t\tif (ret) |\n-|\t\t{ |\n-|\t\t\titems_num.insert(items_num.begin(), j); |\n-|\t\t} |\n-|\t} |\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-|TEST_EQUAL(items_num.size(), 4); |\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-|int sum_distance_exp(int s, node_entry const& e, node_id const& ref) |\n-|{ |\n-|\treturn s + distance_exp(e.id, ref); |\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-|std::vector g_got_peers; |\n+|\tpack.set_bool(settings_pack::allow_multiple_connections_per_ip, false); |\n | |\n-|void get_peers_cb(std::vector const& peers) |\n-|{ |\n-|\tg_got_peers.insert(g_got_peers.end(), peers.begin(), peers.end()); |\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-|std::vector g_got_items; |\n-|dht::item g_put_item; |\n-|int g_put_count; |\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-|void get_mutable_item_cb(dht::item const& i, bool a) |\n-|{ |\n-|\tif (!a) return; |\n-|\tif (!i.empty()) |\n-|\t\tg_got_items.push_back(i); |\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-|void put_mutable_item_data_cb(dht::item& i) |\n-|{ |\n-|\tif (!i.empty()) |\n-|_\b\t_\b\t_\bg_\b__\bg_\bo_\bt_\b__\bi_\bt_\be_\bm_\bs_\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_\b0_\b|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bd_\bh_\bt_\b._\bc_\bp_\bp_\b:_\b3_\b2_\b2_\b3_\b _\b _\b _\b _\b _\b|_\bt_\bh_\bi_\bs_\b _\bw_\bo_\bn_\b'_\bt_\b _\bw_\bo_\br_\bk_\b _\bb_\be_\bc_\ba_\bu_\bs_\be_\b _\bt_\bh_\be_\b _\bs_\be_\bc_\bo_\bn_\bd_\b _\bn_\bo_\bd_\be_\b _\bi_\bs_\bn_\b'_\bt_\b _\bp_\bi_\bn_\bg_\be_\bd_\b _\bs_\bo_\b _\bi_\bt_\b _\bw_\bo_\bn_\bt_\b _\bb_\be_\b _\ba_\bd_\bd_\be_\bd_\b _\bt_\bo_\b _\bt_\bh_\be_\b _\br_\bo_\bu_\bt_\bi_\bn_\bg_\b _\bt_\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 |\n-|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs w\bwo\bon\bn'\b't\bt w\bwo\bor\brk\bk b\bbe\bec\bca\bau\bus\bse\be t\bth\bhe\be s\bse\bec\bco\bon\bnd\bd n\bno\bod\bde\be i\bis\bsn\bn'\b't\bt p\bpi\bin\bng\bge\bed\bd s\bso\bo i\bit\bt w\bwo\bon\bnt\bt b\bbe\be a\bad\bdd\bde\bed\bd t\bto\bo t\bth\bhe\be r\bro\bou\but\bti\bin\bng\bg t\bta\bab\bbl\ble\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_d\bdh\bht\bt.\b.c\bcp\bpp\bp:\b:3\b32\b22\b23\b3 *\b**\b**\b* |\n-|bool ret = verify_message(request, get_item_desc_ro, parsed, error_string); |\n+|\tses2.apply_settings(pack); |\n | |\n-|\tTEST_CHECK(ret); |\n-|\tTEST_EQUAL(parsed[3].int_value(), 1); |\n+|\ttorrent_handle tor1; |\n+|\ttorrent_handle tor2; |\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-|\t// and no replacement nodes |\n-|\tTEST_EQUAL(std::get<1>(node.size()), 0); |\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-|\t// now, disable read_only, try again. |\n-|\tg_sent_packets.clear(); |\n-|\tsett.set_bool(settings_pack::dht_read_only, false); |\n+|\tTEST_CHECK(exists(combine_path(\"tmp1_transfer\", \"temporary\"))); |\n | |\n-|\tsend_dht_request(node, \"get\", source, &response); |\n-|\t// sender should be added to replacement bucket |\n-|\tTEST_EQUAL(std::get<1>(node.size()), 1); |\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-|\tg_sent_packets.clear(); |\n-|#if 0 |\n-|target = generate_next(); |\n-|node.get_item(target, get_immutable_item_cb); |\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+|_\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+|\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+|\t} |\n | |\n-|\t// since we have 2 nodes, we should have two packets. |\n-|\tTEST_EQUAL(g_sent_packets.size(), 2); |\n+|\tstd::string certificate = combine_path(\"..\", combine_path(\"ssl\", \"peer_certificate.pem\")); |\n+|\tstd::string private_key = combine_path(\"..\", combine_path(\"ssl\", \"peer_private_key.pem\")); |\n+|\tstd::string dh_params = combine_path(\"..\", combine_path(\"ssl\", \"dhparams.pem\")); |\n | |\n-|\t// both of them shouldn't have a 'ro' key. |\n-|\tnode_from_entry(g_sent_packets.front().second, request); |\n-|\tret = verify_message(request, get_item_desc_ro, parsed, error_string); |\n+|\tif (flags & invalid_certificate) |\n+|\t{ |\n+|\t\tcertificate = combine_path(\"..\", combine_path(\"ssl\", \"invalid_peer_certificate.pem\")); |\n+|\t\tprivate_key = combine_path(\"..\", combine_path(\"ssl\", \"invalid_peer_private_key.pem\")); |\n+|\t} |\n | |\n-|\tTEST_CHECK(ret); |\n-|\tTEST_CHECK(!parsed[3]); |\n | |\n-|\tnode_from_entry(g_sent_packets.back().second, request); |\n-|\tret = verify_message(request, get_item_desc_ro, parsed, error_string); |\n+|if (flags & (valid_certificate | invalid_certificate)) |\n+|\t{ |\n+|\t\tstd::printf(\"set_password_callback\\n\"); |\n+|\t\tctx.set_password_callback( |\n+|\t\t\t[](std::size_t, context::password_purpose) { return \"test\"; } |\n+|\t\t\t, ec); |\n+|\t\tif (ec) |\n+|\t\t{ |\n+|\t\t\tstd::printf(\"Failed to set certificate passphrase: %s\\n\" |\n+|\t\t\t\t, ec.message().c_str()); |\n+|\t\t\tTEST_CHECK(!ec); |\n+|\t\t\treturn false; |\n+|\t\t} |\n+|\t\tstd::printf(\"use_certificate_file \\\"%s\\\"\\n\", certificate.c_str()); |\n+|\t\tctx.use_certificate_file(certificate, context::pem, ec); |\n+|\t\tif (ec) |\n+|\t\t{ |\n+|\t\t\tstd::printf(\"Failed to set certificate file: %s\\n\" |\n+|\t\t\t\t, ec.message().c_str()); |\n+|\t\t\tTEST_CHECK(!ec); |\n+|\t\t\treturn false; |\n+|\t\t} |\n+|\t\tstd::printf(\"use_private_key_file \\\"%s\\\"\\n\", private_key.c_str()); |\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+|_\b\t_\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 |\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:_\b5_\b0_\b9_\b _\b _\b _\b _\b _\b _\b|_\ba_\bl_\bs_\bo_\b _\bt_\be_\bs_\bt_\b _\bu_\bs_\bi_\bn_\bg_\b _\ba_\b _\bh_\ba_\bs_\bh_\b _\bt_\bh_\ba_\bt_\b _\br_\be_\bf_\be_\br_\bs_\b _\bt_\bo_\b _\ba_\b _\bv_\ba_\bl_\bi_\bd_\b _\bt_\bo_\br_\br_\be_\bn_\bt_\b _\bb_\bu_\bt_\b _\bt_\bh_\ba_\bt_\b _\bd_\bi_\bf_\bf_\be_\br_\bs_\b _\bf_\br_\bo_\bm_\b _\bt_\bh_\be_\b _\bS_\bN_\bI_\b _\bh_\ba_\bs_\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 |\n+|*\b**\b**\b**\b**\b* a\bal\bls\bso\bo t\bte\bes\bst\bt u\bus\bsi\bin\bng\bg a\ba h\bha\bas\bsh\bh t\bth\bha\bat\bt r\bre\bef\bfe\ber\brs\bs t\bto\bo a\ba v\bva\bal\bli\bid\bd t\bto\bor\brr\bre\ben\bnt\bt b\bbu\but\bt t\bth\bha\bat\bt d\bdi\bif\bff\bfe\ber\brs\bs f\bfr\bro\bom\bm t\bth\bhe\be S\bSN\bNI\bI h\bha\bas\bsh\bh *\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:5\b50\b09\b9 *\b**\b**\b* |\n+|print_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 | |\n-|\tTEST_CHECK(ret); |\n-|\tTEST_CHECK(!parsed[3]); |\n-|#endif |\n+|\tchar handshake[] = \"\\x13\" \"BitTorrent protocol\\0\\0\\0\\0\\0\\0\\0\\x04\" |\n+|\t\t\" \" // space for info-hash |\n+|\t\t\"aaaaaaaaaaaaaaaaaaaa\" // peer-id |\n+|\t\t\"\\0\\0\\0\\x01\\x02\"; // interested |\n+| |\n+|\t// fill in the info-hash |\n+|\tif (flags & valid_bittorrent_hash) |\n+|\t{ |\n+|\t\tstd::memcpy(handshake + 28, &t->info_hashes().v1[0], 20); |\n+|\t} |\n+|\telse |\n+|\t{ |\n+|std::generate(handshake + 28, handshake + 48, &rand); |\n |} |\n | |\n-|#ifndef TORRENT_DISABLE_LOGGING |\n-|// these tests rely on logging being enabled |\n+|\t// fill in the peer-id |\n+|\tstd::generate(handshake + 48, handshake + 68, &rand); |\n | |\n-|TORRENT_TEST(invalid_error_msg) |\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__\bd_\bh_\bt_\b._\bc_\bp_\bp_\b:_\b4_\b0_\b8_\b1_\b _\b _\b _\b _\b _\b|_\bt_\be_\bs_\bt_\b _\bo_\bb_\bf_\bu_\bs_\bc_\ba_\bt_\be_\bd_\b__\bg_\be_\bt_\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 _\b |\n-|*\b**\b**\b**\b**\b* t\bte\bes\bst\bt o\bob\bbf\bfu\bus\bsc\bca\bat\bte\bed\bd_\b_g\bge\bet\bt_\b_p\bpe\bee\ber\brs\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_d\bdh\bht\bt.\b.c\bcp\bpp\bp:\b:4\b40\b08\b81\b1 *\b**\b**\b* |\n-|TEST_CHECK(sm.has_quota()); |\n-|\t}); |\n-|} |\n+|\tstd::printf(\"bittorrent handshake\\n\"); |\n+|\tboost::asio::write(ssl_sock, boost::asio::buffer(handshake, (sizeof(handshake) - 1)), ec); |\n+|\tprint_alerts(ses1, \"ses1\", true, true, &on_alert); |\n+|\tif (ec) |\n+|\t{ |\n+|\t\tstd::printf(\"failed to write bittorrent handshake: %s\\n\" |\n+|\t\t\t, ec.message().c_str()); |\n+|\t\treturn false; |\n+|\t} |\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::max()); |\n+|\tchar buf[68]; |\n+|\tstd::printf(\"read bittorrent handshake\\n\"); |\n+|\tboost::asio::read(ssl_sock, boost::asio::buffer(buf, sizeof(buf)), ec); |\n+|\tprint_alerts(ses1, \"ses1\", true, true, &on_alert); |\n+|\tif (ec) |\n+|\t{ |\n+|\t\tstd::printf(\"failed to read bittorrent handshake: %s\\n\" |\n+|\t\t\t, ec.message().c_str()); |\n+|\t\treturn false; |\n+|\t} |\n | |\n-|\ttest_rate_limit(sett, [](lt::dht::socket_manager& sm) { |\n-|\t\tTEST_CHECK(sm.has_quota()); |\n-|\t\tfor (int i = 0; i < 10; ++i) |\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__\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\tstd::this_thread::sleep_for(milliseconds(500)); |\n-|\t\t\tTEST_CHECK(sm.has_quota()); |\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+|\t\t\treturn true; |\n |\t\t} |\n-|\t}); |\n-|} |\n | |\n+|\t\tvoid log_portmap(portmap_transport, char const* msg |\n+|\t\t\t, aux::listen_socket_handle const&) const override |\n+|\t\t{ |\n+|\t\t\tstd::cout << \"UPnP: \" << msg << std::endl; |\n+|} |\n+|#endif |\n+|\t}; |\n | |\n+|ip_interface pick_upnp_interface() |\n+|{ |\n+|\tlt::io_context ios; |\n+|\terror_code ec; |\n+|\tstd::vector const routes = enum_routes(ios, ec); |\n+|\tif (ec) |\n+|\t{ |\n+|\t\tstd::cerr << \"failed to enumerate routes: \" << ec.message() << '\\n'; |\n+|\t\tTEST_CHECK(false); |\n+|\t\treturn {}; |\n+|\t} |\n+|\tstd::vector const ifs = enum_net_interfaces(ios, ec); |\n+|\tif (ec) |\n+|\t{ |\n+|\t\tstd::cerr << \"failed to enumerate network interfaces: \" << ec.message() << '\\n'; |\n+|\t\tTEST_CHECK(false); |\n+|\t\treturn {}; |\n+|\t} |\n+|\tint idx = 0; |\n+|\tfor (auto const& face : ifs) |\n+|\t{ |\n+|\t\tif (!face.interface_address.is_v4()) continue; |\n+|\t\tstd::cout << \" - \" << idx |\n+|\t\t\t<< ' ' << face.interface_address.to_string() |\n+|\t\t\t<< ' ' << int(static_cast(face.state)) |\n+|\t\t\t<< ' ' << static_cast(face.flags) |\n+|_\b\t_\b\t_\b\t_\b<_\b<_\b _\b'_\b _\b'_\b _\b<_\b<_\b _\bf_\ba_\bc_\be_\b._\bn_\ba_\bm_\be_\b _\b<_\b<_\b _\b'_\b\\_\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 |\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-|#else |\n-|TORRENT_TEST(dht) |\n+|TORRENT_TEST(timestamp_history) |\n |{ |\n-|\t// dummy dht test |\n-|\tTEST_CHECK(true); |\n-|} |\n+|\tusing namespace lt; |\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+|\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+|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/ |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@@ -5896,14 +5708,111 @@\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__\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/_\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__\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@@ -6012,14 +5921,105 @@\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+|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/_\bt_\be_\bs_\bt_\b__\bm_\be_\br_\bk_\bl_\be_\b__\bt_\br_\be_\be_\b._\bc_\bp_\bp_\b: |use structured bindings in C++17 |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b2_\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 _\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/t\bte\bes\bst\bt/\b/t\bte\bes\bst\bt_\b_m\bme\ber\brk\bkl\ble\be_\b_t\btr\bre\bee\be.\b.c\bcp\bpp\bp:\b:2\b23\b33\b3 *\b**\b**\b* |\n+|mask[std::size_t(i)] = true; |\n+|\t\tt.load_sparse_tree(span(f).subspan(first_piece, num_pieces), mask, empty_verified); |\n+|\t\tint const end_piece_layer = first_piece + merkle_num_leafs(num_pieces); |\n+|\t\tfor (int i = 0; i < end_piece_layer; ++i) |\n+|\t\t{ |\n+|\t\t\tTEST_CHECK(t.has_node(i)); |\n+|\t\t\tTEST_CHECK(t.compare_node(i, f[i])); |\n+|\t\t} |\n+|\t\tfor (int i = end_piece_layer; i < num_nodes; ++i) |\n+|\t\t{ |\n+|\t\t\tTEST_CHECK(!t.has_node(i)); |\n+|\t\t} |\n+|\t} |\n+|} |\n+| |\n+|namespace { |\n+|void test_roundtrip(aux::merkle_tree const& t |\n+|\t, int const block_count |\n+|\t, int const blocks_per_piece) |\n+|{ |\n+|aux::vector mask; |\n+|std::vector tree; |\n+|\tstd::tie(tree, mask) = t.build_sparse_vector(); |\n+| |\n+|\taux::merkle_tree t2(block_count, blocks_per_piece, f[0].data()); |\n+|\tt2.load_sparse_tree(tree, mask, empty_verified); |\n+| |\n+|\tTEST_CHECK(t.build_vector() == t2.build_vector()); |\n+|\tfor (int i = 0; i < int(t.size()); ++i) |\n+|\t{ |\n+|\t\tTEST_EQUAL(t[i], t2[i]); |\n+|\t\tTEST_EQUAL(t.has_node(i), t2.has_node(i)); |\n+| |\n+|\t\tif (!t.has_node(i)) |\n+|\t\t\tTEST_CHECK(t[i].is_all_zeros()); |\n+|\t\tif (!t2.has_node(i)) |\n+|\t\t\tTEST_CHECK(t2[i].is_all_zeros()); |\n+| |\n+|\t\tTEST_CHECK(t.compare_node(i, t2[i])); |\n+|\t\tTEST_CHECK(t2.compare_node(i, t[i])); |\n+|\t} |\n+|} |\n+|} |\n+| |\n+|TORRENT_TEST(roundtrip_empty_tree) |\n+|{ |\n+|\taux::merkle_tree t(num_blocks, 1, f[0].data()); |\n+|\ttest_roundtrip(t, num_blocks, 1); |\n+|} |\n+| |\n+|_\bT_\bO_\bR_\bR_\bE_\bN_\bT_\b__\bT_\bE_\bS_\bT_\b(_\br_\bo_\bu_\bn_\bd_\bt_\br_\bi_\bp_\b__\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 |\n+|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bm_\be_\br_\bk_\bl_\be_\b__\bt_\br_\be_\be_\b._\bc_\bp_\bp_\b: |add test for load_piece_layer() |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b9_\b3_\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* a\bad\bdd\bd t\bte\bes\bst\bt f\bfo\bor\br l\blo\boa\bad\bd_\b_p\bpi\bie\bec\bce\be_\b_l\bla\bay\bye\ber\br(\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__\bm\bm_\be\be_\br\br_\bk\bk_\bl\bl_\be\be_\b_\b__\bt\bt_\br\br_\be\be_\be\be_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b9\b9_\b3\b3_\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 |\n+|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bm_\be_\br_\bk_\bl_\be_\b__\bt_\br_\be_\be_\b._\bc_\bp_\bp_\b: |add test for add_hashes() with an odd number of blocks |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b9_\b3_\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* a\bad\bdd\bd t\bte\bes\bst\bt f\bfo\bor\br a\bad\bdd\bd_\b_h\bha\bas\bsh\bhe\bes\bs(\b()\b) w\bwi\bit\bth\bh a\ban\bn o\bod\bdd\bd n\bnu\bum\bmb\bbe\ber\br o\bof\bf b\bbl\blo\boc\bck\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__\bm\bm_\be\be_\br\br_\bk\bk_\bl\bl_\be\be_\b_\b__\bt\bt_\br\br_\be\be_\be\be_\b.\b._\bc\bc_\bp\bp_\bp\bp_\b:\b:_\b9\b9_\b3\b3_\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 |\n+|relevance\u00a00|_\b._\b._\b/_\bt_\be_\bs_\bt_\b/_\bt_\be_\bs_\bt_\b__\bm_\be_\br_\bk_\bl_\be_\b__\bt_\br_\be_\be_\b._\bc_\bp_\bp_\b: |add test for set_block() (setting the last block) with an odd number of blocks |\n+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b9_\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 _\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 t\bte\bes\bst\bt f\bfo\bor\br s\bse\bet\bt_\b_b\bbl\blo\boc\bck\bk(\b()\b) (\b(s\bse\bet\btt\bti\bin\bng\bg t\bth\bhe\be l\bla\bas\bst\bt b\bbl\blo\boc\bck\bk)\b) w\bwi\bit\bth\bh a\ban\bn o\bod\bdd\bd n\bnu\bum\bmb\bbe\ber\br o\bof\bf b\bbl\blo\boc\bck\bks\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_m\bme\ber\brk\bkl\ble\be_\b_t\btr\bre\bee\be.\b.c\bcp\bpp\bp:\b:9\b94\b40\b0 *\b**\b**\b* |\n+|\t\tfor (int i = 0; i < 7; ++i) |\n+|\t\t\tTEST_EQUAL(t[i], f[i]); |\n+|\t} |\n+| |\n+|\t// use a proof that ties the first piece node 3 (since we don't need it all |\n+|\t// the way to the root). |\n+|\tauto const result = t.add_hashes(127, pdiff(1), range(f, 127, 4), build_proof(f, 31, 3)); |\n+|\tTEST_CHECK(result); |\n+| |\n+|\tauto const& res = *result; |\n+|\tTEST_EQUAL(res.passed.size(), 0); |\n+|\tTEST_EQUAL(res.failed.size(), 0); |\n+| |\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/ |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@@ -6075,517 +6075,163 @@\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/_\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-|\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-|struct identity |\n-|{ |\n-|\t\tbool operator()(bool b) const { return b; } |\n-|\t}; |\n-|} |\n-| |\n-|\tvoid merkle_tree::load_sparse_tree(span t |\n-|\t\t, std::vector const& mask |\n-|\t\t, std::vector 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-|_\b\t_\b\t_\b\t_\b\t_\br_\be_\bt_\bu_\br_\bn_\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 |\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:_\b3_\b1_\b9_\b _\b _\b _\b _\b|_\bt_\bh_\bi_\bs_\b _\bc_\ba_\bn_\b _\bb_\be_\b _\bo_\bp_\bt_\bi_\bm_\bi_\bz_\be_\bd_\b _\bb_\by_\b _\bu_\bs_\bi_\bn_\bg_\b _\bm_\b__\bt_\br_\be_\be_\b _\ba_\bs_\b _\bs_\bt_\bo_\br_\ba_\bg_\be_\b _\bt_\bo_\b _\bf_\bi_\bl_\bl_\b _\bt_\bh_\bi_\bs_\b _\bt_\br_\be_\be_\b _\bi_\bn_\bt_\bo_\b,_\b _\ba_\bn_\bd_\b _\bt_\bh_\be_\bn_\b _\bc_\bl_\be_\ba_\br_\b _\bi_\bt_\b _\bi_\bf_\b _\bt_\bh_\be_\b _\bh_\ba_\bs_\bh_\be_\bs_\b _\bf_\ba_\bi_\bl_\b _\b _\b _\b _\b _\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\bby\by u\bus\bsi\bin\bng\bg m\bm_\b_t\btr\bre\bee\be a\bas\bs s\bst\bto\bor\bra\bag\bge\be t\bto\bo f\bfi\bil\bll\bl t\bth\bhi\bis\bs t\btr\bre\bee\be i\bin\bnt\bto\bo,\b, a\ban\bnd\bd t\bth\bhe\ben\bn c\bcl\ble\bea\bar\br i\bit\bt i\bif\bf t\bth\bhe\be h\bha\bas\bsh\bhe\bes\bs f\bfa\bai\bil\bl *\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:3\b31\b19\b9 *\b**\b**\b* |\n-|{ |\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-|int const leaf_count = merkle_num_leafs(int(hashes.size())); |\n-|aux::vector 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-|_\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_\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:_\b3_\b6_\b7_\b _\b _\b _\b _\b|_\ba_\b _\bp_\bi_\be_\bc_\be_\b _\bo_\bu_\bt_\bs_\bi_\bd_\be_\b _\bo_\bf_\b _\bt_\bh_\bi_\bs_\b _\br_\ba_\bn_\bg_\be_\b _\bm_\ba_\by_\b _\ba_\bl_\bs_\bo_\b _\bf_\ba_\bi_\bl_\b,_\b _\bi_\bf_\b _\bo_\bn_\be_\b _\bo_\bf_\b _\bt_\bh_\be_\b _\bu_\bn_\bc_\bl_\be_\b _\bh_\ba_\bs_\bh_\be_\bs_\b _\bi_\bs_\b _\ba_\bt_\b _\bt_\bh_\be_\b _\bl_\ba_\by_\be_\br_\b _\br_\bi_\bg_\bh_\bt_\b _\ba_\bb_\bo_\bv_\be_\b _\bt_\bh_\be_\b _\bb_\bl_\bo_\bc_\bk_\b _\bh_\ba_\bs_\bh_\be_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-|*\b**\b**\b**\b**\b* a\ba p\bpi\bie\bec\bce\be o\bou\but\bts\bsi\bid\bde\be o\bof\bf t\bth\bhi\bis\bs r\bra\ban\bng\bge\be m\bma\bay\by a\bal\bls\bso\bo f\bfa\bai\bil\bl,\b, i\bif\bf o\bon\bne\be o\bof\bf t\bth\bhe\be u\bun\bnc\bcl\ble\be h\bha\bas\bsh\bhe\bes\bs i\bis\bs a\bat\bt t\bth\bhe\be l\bla\bay\bye\ber\br r\bri\big\bgh\bht\bt a\bab\bbo\bov\bve\be t\bth\bhe\be b\bbl\blo\boc\bck\bk h\bha\bas\bsh\bhe\bes\bs *\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:3\b36\b67\b7 *\b**\b**\b* |\n-|int 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-|for (int layer_size = leaf_count; layer_size != 0; layer_size /= 2) |\n-|{ |\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-|\t\t\t\t\tif (m_tree[dst_idx] != tree[src_idx]) |\n-|\t\t\t\t\t{ |\n-|\t\t\t\t\t\t// this must be a block hash because inner nodes are not filled in until |\n-|\t\t\t\t\t\t// they can be verified. This assert ensures we're at the |\n-|\t\t\t\t\t\t// leaf layer of the file tree |\n-|\t\t\t\t\t\tTORRENT_ASSERT(dst_idx >= first_leaf); |\n-| |\n-|\t\t\t\t\t\tint const pos = dst_idx - first_leaf; |\n-|\t\t\t\t\t\tauto const piece = piece_index_t{pos >> m_blocks_per_piece_log} + file_piece_offset; |\n-|\t\t\t\t\t\tint const block = pos & ((1 << m_blocks_per_piece_log) - 1); |\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\t\t\t\tTORRENT_ASSERT(pos < m_num_blocks); |\n-|\t\t\t\t\t\tif (!ret.failed.empty() && ret.failed.back().first == piece) |\n-|\t\t\t\t\t\t\tret.failed.back().second.push_back(block); |\n-|\t\t\t\t\t\telse |\n-|\t\t\t\t\t\t\tret.failed.emplace_back(piece, std::vector{block}); |\n+|\t\t\tint rate_threshold = sett.get_int(settings_pack::rate_choker_initial_threshold); |\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-|_\b\t_\b\t_\b\t_\b\t_\b\t_\be_\bl_\bs_\be_\b _\bi_\bf_\b _\b(_\bd_\bs_\bt_\b__\bi_\bd_\bx_\b _\b>_\b=_\b _\bf_\bi_\br_\bs_\bt_\b__\bl_\be_\ba_\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 |\n-|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\bm_\be_\br_\bk_\bl_\be_\b__\bt_\br_\be_\be_\b._\bc_\bp_\bp_\b:_\b4_\b4_\b7 |instead of overwriting the root and comparing it against hashes[], write a functions that *validates* a tree by just filling it up |\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|_\bt_\bo_\b _\bt_\bh_\be_\b _\bl_\be_\bv_\be_\bl_\b _\bb_\be_\bl_\bo_\bw_\b _\bt_\bh_\be_\b _\br_\bo_\bo_\bt_\b _\ba_\bn_\bd_\b _\bt_\bh_\be_\bn_\b _\bv_\ba_\bl_\bi_\bd_\ba_\bt_\be_\bs_\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 |\n-|*\b**\b**\b**\b**\b* i\bin\bns\bst\bte\bea\bad\bd o\bof\bf o\bov\bve\ber\brw\bwr\bri\bit\bti\bin\bng\bg t\bth\bhe\be r\bro\boo\bot\bt a\ban\bnd\bd c\bco\bom\bmp\bpa\bar\bri\bin\bng\bg i\bit\bt a\bag\bga\bai\bin\bns\bst\bt h\bha\bas\bsh\bhe\bes\bs[\b[]\b],\b, w\bwr\bri\bit\bte\be a\ba f\bfu\bun\bnc\bct\bti\bio\bon\bns\bs t\bth\bha\bat\bt *\b*v\bva\bal\bli\bid\bda\bat\bte\bes\bs*\b* a\ba t\btr\bre\bee\be b\bby\by j\bju\bus\bst\bt f\bfi\bil\bll\bli\bin\bng\bg i\bit\bt u\bup\bp t\bto\bo t\bth\bhe\be l\ble\bev\bve\bel\bl b\bbe\bel\blo\bow\bw t\bth\bhe\be r\bro\boo\bot\bt a\ban\bnd\bd t\bth\bhe\ben\bn |\n-|v\bva\bal\bli\bid\bda\bat\bte\bes\bs i\bit\bt.\b. *\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:4\b44\b47\b7 *\b**\b**\b* |\n-|&& dest_start_idx < first_piece_idx + num_pieces()) |\n-|\t\t{ |\n-|\t\t\tint const blocks_in_piece = 1 << base; |\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\t// it may now be possible to verify the hashes of previously received blocks |\n-|\t\t\t// try to verify as many child nodes of the received hashes as possible |\n-|\t\t\tfor (int i = 0; i < int(hashes.size()); ++i) |\n+|\t\t\tfor (auto const* p : peers) |\n |\t\t\t{ |\n-|\t\t\t\tint const piece = dest_start_idx + i; |\n-|\t\t\t\tif (piece - first_piece_idx >= num_pieces()) |\n-|\t\t\t\t\tbreak; |\n-|\t\t\t\t// the first block in this piece |\n-|\t\t\t\tint const block_idx = merkle_get_first_child(piece, base); |\n-| |\n-|\t\t\t\tint const block_end_idx = std::min(block_idx + blocks_in_piece, first_leaf + m_num_blocks); |\n-|\t\t\t\tif (std::any_of(m_tree.begin() + block_idx |\n-|\t\t\t\t\t, m_tree.begin() + block_end_idx |\n-|\t\t\t\t\t, [](sha256_hash const& h) { return h.is_all_zeros(); })) |\n-|\t\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-|merkle_fill_tree(m_tree, blocks_in_piece, block_idx); |\n-|if (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+|\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\t// an empty blocks vector indicates that we don't have the |\n-|\t\t\t\t\t// block hashes, and we can't know which block failed |\n-|\t\t\t\t\t// this will cause the block hashes to be requested |\n-|\t\t\t\t\tret.failed.emplace_back(piece_index_t{piece - first_piece_idx} + file_piece_offset |\n-|\t\t\t\t\t\t, std::vector()); |\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-|_\b\t_\b\t_\b\t_\b\t_\b\t_\bi_\bn_\bt_\b _\bc_\bo_\bn_\bs_\bt_\b _\bl_\be_\ba_\bf_\bs_\b__\be_\bn_\bd_\b _\b=_\b _\bs_\bt_\bd_\b:_\b:_\bm_\bi_\bn_\b(_\bm_\b__\bn_\bu_\bm_\b__\bb_\bl_\bo_\bc_\bk_\bs_\b,_\b _\bl_\be_\ba_\bf_\bs_\b__\bs_\bt_\ba_\br_\bt_\b _\b+_\b _\bb_\bl_\bo_\bc_\bk_\bs_\b__\bi_\bn_\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 |\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:_\b4_\b7_\b1_\b _\b _\b _\b _\b|_\bt_\bh_\bi_\bs_\b _\bc_\bo_\bu_\bl_\bd_\b _\bb_\be_\b _\bd_\bo_\bn_\be_\b _\bm_\bo_\br_\be_\b _\be_\bf_\bf_\bi_\bc_\bi_\be_\bn_\bt_\bl_\by_\b _\bi_\bf_\b _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd_\b _\bh_\ba_\bd_\b _\ba_\b _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn_\b _\bt_\bo_\b _\bs_\be_\bt_\b _\ba_\b _\br_\ba_\bn_\bg_\be_\b _\bo_\bf_\b _\bb_\bi_\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 |\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 i\bif\bf b\bbi\bit\btf\bfi\bie\bel\bld\bd h\bha\bad\bd a\ba f\bfu\bun\bnc\bct\bti\bio\bon\bn t\bto\bo s\bse\bet\bt a\ba r\bra\ban\bng\bge\be o\bof\bf b\bbi\bit\bts\bs *\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:4\b47\b71\b1 *\b**\b**\b* |\n-|merkle_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+|\t\t\t\t++upload_slots; |\n | |\n-|\t\t\t\t\t// an empty blocks vector indicates that we don't have the |\n-|\t\t\t\t\t// block hashes, and we can't know which block failed |\n-|\t\t\t\t\t// this will cause the block hashes to be requested |\n-|\t\t\t\t\tret.failed.emplace_back(piece_index_t{piece - first_piece_idx} + file_piece_offset |\n-|\t\t\t\t\t\t, std::vector()); |\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-|for (int k = leafs_start; k < leafs_end; ++k) |\n-|m_block_verified.set_bit(k); |\n-|\t\t\t\t} |\n-|\t\t\t\tTORRENT_ASSERT((piece - first_piece_idx) >= 0); |\n-|\t\t\t} |\n+|rate_threshold += 2048; |\n+|} |\n+|\t\t\t++upload_slots; |\n |\t\t} |\n | |\n-|\t\toptimize_storage(); |\n-| |\n-|\t\treturn ret; |\n-|\t} |\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-|\tstd::tuple merkle_tree::set_block(int const block_index |\n-|\t\t, sha256_hash const& h) |\n-|\t{ |\n-|#ifdef TORRENT_EXPENSIVE_INVARIANT_CHECKS |\n-|\t\tINVARIANT_CHECK; |\n-|#endif |\n-|\t\tTORRENT_ASSERT(block_index < m_num_blocks); |\n+|\t\t// we use partial sort here, because we only care about the top |\n+|\t\t// upload_slots peers. |\n | |\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\tauto const block_tree_index = first_leaf + block_index; |\n+|\t\tint const slots = std::min(upload_slots, int(peers.size())); |\n | |\n-|\t\tif (blocks_verified(block_index, 1)) |\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// 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-|_\b\t_\b\t_\b\t_\b\t_\br_\be_\bt_\bu_\br_\bn_\b _\bs_\bt_\bd_\b:_\b:_\bm_\ba_\bk_\be_\b__\bt_\bu_\bp_\bl_\be_\b(_\bs_\be_\bt_\b__\bb_\bl_\bo_\bc_\bk_\b__\br_\be_\bs_\bu_\bl_\bt_\b:_\b:_\bb_\bl_\bo_\bc_\bk_\b__\bh_\ba_\bs_\bh_\b__\bf_\ba_\bi_\bl_\be_\bd_\b,_\b _\bb_\bl_\bo_\bc_\bk_\b__\bi_\bn_\bd_\be_\bx_\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 |\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:_\b5_\b1_\b4_\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_\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 _\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\bg 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/m\bme\ber\brk\bkl\ble\be_\b_t\btr\bre\bee\be.\b.c\bcp\bpp\bp:\b:5\b51\b14\b4 *\b**\b**\b* |\n-|auto const first_leaf = merkle_first_leaf(num_leafs); |\n-|\t\tauto const block_tree_index = first_leaf + block_index; |\n+|\t\t\tint const pieces = sett.get_int(settings_pack::seeding_piece_quota); |\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-|\t\t\telse |\n-|\t\t\t\treturn std::make_tuple(set_block_result::block_hash_failed, block_index, 1); |\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-| |\n-|\t\tallocate_full(); |\n-| |\n-|\t\tm_tree[block_tree_index] = h; |\n-| |\n-|\t\t// to avoid wasting a lot of time hashing nodes only to discover they |\n-|\t\t// cannot be verified, check first to see if the root of the largest |\n-|\t\t// computable subtree is known |\n-| |\n-|int leafs_start; |\n-|int leafs_size; |\n-|\t\tint root_index; |\n-|\t\tstd::tie(leafs_start, leafs_size, root_index) = |\n-|\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-|\t\tsha256_hash const root = m_tree[root_index]; |\n-|\t\tmerkle_fill_tree(m_tree, leafs_size, first_leaf + leafs_start); |\n-| |\n-|\t\tif (root != m_tree[root_index]) |\n-|\t\t{ |\n-|\t\t\t// hash failure, clear all the internal nodes |\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-|_\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/_\bm_\be_\br_\bk_\bl_\be_\b__\bt_\br_\be_\be_\b._\bc_\bp_\bp_\b:_\b5_\b3_\b9_\b _\b _\b _\b _\b|_\bt_\bh_\bi_\bs_\b _\bc_\bo_\bu_\bl_\bd_\b _\bb_\be_\b _\bd_\bo_\bn_\be_\b _\bm_\bo_\br_\be_\b _\be_\bf_\bf_\bi_\bc_\bi_\be_\bn_\bt_\bl_\by_\b _\bi_\bf_\b _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd_\b _\bh_\ba_\bd_\b _\ba_\b _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn_\b _\bt_\bo_\b _\bs_\be_\bt_\b _\ba_\b _\br_\ba_\bn_\bg_\be_\b _\bo_\bf_\b _\bb_\bi_\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 |\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 i\bif\bf b\bbi\bit\btf\bfi\bie\bel\bld\bd h\bha\bad\bd a\ba f\bfu\bun\bnc\bct\bti\bio\bon\bn t\bto\bo s\bse\bet\bt a\ba r\bra\ban\bng\bge\be o\bof\bf b\bbi\bit\bts\bs *\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:5\b53\b39\b9 *\b**\b**\b* |\n-|merkle_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-|\t\tsha256_hash const root = m_tree[root_index]; |\n-|\t\tmerkle_fill_tree(m_tree, leafs_size, first_leaf + leafs_start); |\n-| |\n-|\t\tif (root != m_tree[root_index]) |\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\t// hash failure, clear all the internal nodes |\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-|int const leafs_end = std::min(m_num_blocks, leafs_start + leafs_size); |\n-|for (int i = leafs_start; i < leafs_end; ++i) |\n-|\t\t\tm_block_verified.set_bit(i); |\n-| |\n-|\t\t// attempting to optimize storage is quite costly, only do it if we have |\n-|\t\t// a reason to believe it might have an effect |\n-|\t\tif (block_index == m_num_blocks - 1 || !m_tree[block_tree_index + 1].is_all_zeros()) |\n-|\t\t\toptimize_storage(); |\n-| |\n-|\t\treturn std::make_tuple(set_block_result::ok, leafs_start, leafs_size); |\n-|\t} |\n-| |\n-|\tstd::size_t merkle_tree::size() const |\n-|\t{ |\n-|\t\treturn static_cast(merkle_num_nodes(merkle_num_leafs(m_num_blocks))); |\n-|\t} |\n-| |\n-|\tint merkle_tree::num_pieces() const |\n-|\t{ |\n-|\t\tint const ps = blocks_per_piece(); |\n-|\t\tTORRENT_ASSERT(ps > 0); |\n-|\t\treturn (m_num_blocks + ps - 1) >> m_blocks_per_piece_log; |\n-|\t} |\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/ |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+|\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+|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-|\t\tTORRENT_ASSERT(!m_torrent.lock()->is_upload_only()); |\n+|\tstatic_assert(std::is_nothrow_move_constructible::value |\n+|\t\t, \"should be nothrow move constructible\"); |\n | |\n-|\t\t// we only want left-over bandwidth |\n+|\tstatic_assert(std::is_nothrow_move_constructible::value |\n+|\t\t, \"should be nothrow move constructible\"); |\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+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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-|\t\tif (m_port == -1 && protocol == \"http\") |\n-|\t\t\tm_port = 80; |\n+|\tstatic_assert(std::is_nothrow_move_constructible::value |\n+|\t\t, \"should be nothrow move constructible\"); |\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+|\tstatic_assert(std::is_nothrow_move_constructible::value |\n+|\t\t, \"should be nothrow move constructible\"); |\n | |\n-|\t\tif (!m_basic_auth.empty()) |\n-|\t\t\tm_basic_auth = base64encode(m_basic_auth); |\n | |\n-|\t\tm_server_string = m_host; |\n-|\t\taux::verify_encoding(m_server_string); |\n-|\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/_\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+|namespace aux { |\n | |\n-|\tif (m_stalled) |\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\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-|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\treturn !atp.have_pieces.empty() |\n+|\t\t\t|| (atp.flags & torrent_flags::seed_mode); |\n |\t} |\n+|} |\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_\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 _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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\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+|*\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+|#ifdef TORRENT_WINDOWS |\n+|\t\t\tret = file_pointer(::_wfopen(convert_to_native_path_string(fn).c_str(), L\"wb+\")); |\n+|#else |\n+|\t\t\tret = file_pointer(::fopen(fn.c_str(), \"wb+\")); |\n+|#endif |\n+|\t\t\tif (ret.file() == nullptr) |\n+|\t\t\t\tec.assign(errno, generic_category()); |\n |\t\t} |\n-|\t} |\n-|\tcatch (storage_error const& e) |\n-|\t{ |\n-|\t\tec = e.ec; |\n-|\t\treturn {}; |\n+|\t\tif (ec) return {}; |\n+|\t\treturn ret; |\n |\t} |\n | |\n-|\tvoid part_file::free_piece(piece_index_t const piece) |\n+|\tvoid posix_part_file::free_piece(piece_index_t const piece) |\n |\t{ |\n-|\t\tstd::lock_guard 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 |m_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+|\tvoid posix_part_file::move_partfile(std::string const& path, error_code& ec) |\n |\t{ |\n-|\t\tstd::lock_guard 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@@ -6598,39 +6244,41 @@\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+|\t\t} |\n+|\t\tm_path = path; |\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/_\bp_\bo_\bs_\bi_\bx_\b__\bp_\ba_\br_\bt_\b__\bf_\bi_\bl_\be_\b._\bc_\bp_\bp_\b:_\b4_\b2_\b4_\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+|*\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:4\b42\b24\b4 *\b**\b**\b* |\n+|} |\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+|\t\t\t\tf(file_offset, {buf.get(), block_to_copy}); |\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+|\tvoid posix_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+|void posix_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\t// if we don't have any pieces left in the |\n@@ -6639,28 +6287,136 @@\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\tauto f = open_file(open_mode::read_write, 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/_\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/ |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\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\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+|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\tcb->tracker_response(tracker_req(), m_target.address(), ip_list, resp); |\n+| |\n+|\t\tclose(); |\n+|\t\treturn true; |\n+|\t} |\n+| |\n+|\tbool udp_tracker_connection::on_scrape_response(span buf) |\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+| |\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\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+|\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 |_\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@@ -6921,230 +6677,312 @@\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/_\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+|_\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+|#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-|\t\t\tint rate_threshold = sett.get_int(settings_pack::rate_choker_initial_threshold); |\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} |\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+|\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-|\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+|} // anonymous namespace |\n | |\n-|\t\t\t\t// always have at least 1 unchoke slot |\n-|\t\t\t\tif (rate < rate_threshold) break; |\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/_\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-|\t\t\t\t++upload_slots; |\n+|#if defined TORRENT_ANDROID && !defined IFA_F_DADFAILED |\n+|#define IFA_F_DADFAILED 8 |\n+|#endif |\n | |\n-|rate_threshold += 2048; |\n-|} |\n-|\t\t\t++upload_slots; |\n-|\t\t} |\n+|#endif |\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+|#if TORRENT_USE_IFADDRS |\n+|#include |\n+|#include |\n+|#include |\n+|#endif |\n | |\n-|\t\t// we use partial sort here, because we only care about the top |\n-|\t\t// upload_slots peers. |\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-|\t\tint const slots = std::min(upload_slots, int(peers.size())); |\n+|#include \"libtorrent/aux_/disable_warnings_pop.hpp\" |\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+|#if defined(TORRENT_OS2) && !defined(IF_NAMESIZE) |\n+|#define IF_NAMESIZE IFNAMSIZ |\n+|#endif |\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_\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+|namespace libtorrent { |\n | |\n-|\t\tfor (int i = 0; i < settings_pack::num_int_settings; ++i) |\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+|#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\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\tint const read_len = int(recv(sock, buf.data(), buf.size(), 0)); |\n+|\t\t\tif (read_len < 0) return -1; |\n | |\n-|\t\tfor (int i = 0; i < settings_pack::num_bool_settings; ++i) |\n+|\t\t\tauto const* nl_hdr = reinterpret_cast(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+|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\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\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+| |\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+|\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 |\t} |\n | |\n-|\tsettings_pack default_settings() |\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\tsettings_pack ret; |\n-|for (int i = 0; i < settings_pack::num_string_settings; ++i) |\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(&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\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\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\tfor (int i = 0; i < settings_pack::num_int_settings; ++i) |\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\tret.set_int(settings_pack::int_type_base + i, int_settings[i].default_value); |\n+|\t\t\t--m_size; |\n+|\t\t\tif (m_size == 0) m_last = m_first; |\n |\t\t} |\n | |\n-|\t\tfor (int i = 0; i < settings_pack::num_bool_settings; ++i) |\n+|\t\tif (idx == m_first && m_size != 0) |\n |\t\t{ |\n-|\t\t\tret.set_bool(settings_pack::bool_type_base + i, bool_settings[i].default_value); |\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-|\t\treturn ret; |\n-|\t} |\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 callbacks; |\n-| |\n-|\t\tsett.bulk_set([&](aux::session_settings_single_thread& s) |\n+|\t\tif (((idx + 1) & 0xffff) == m_last && m_size != 0) |\n |\t\t{ |\n-|\t\t\tapply_pack_impl(pack, s, ses ? &callbacks : nullptr); |\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+|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-|\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/_\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-|\t\tTORRENT_ASSERT_PRECOND(!params.save_path.empty()); |\n-|#endif |\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-|#if TORRENT_ABI_VERSION < 3 |\n-|\t\tif (!params.info_hashes.has_v1() && !params.info_hashes.has_v2() && !params.ti) |\n-|\t\t\tparams.info_hashes.v1 = params.info_hash; |\n-|#endif |\n+|\t\tpost(m_ios, [h = std::move(handler)] { h(storage_error{}); }); |\n+|\t\treturn false; |\n+|\t} |\n | |\n-|\t\t// the internal torrent object keeps and mutates state in the |\n-|\t\t// torrent_info object. We can't let that leak back to the client |\n-|\t\tif (params.ti) |\n-|\t\t\tparams.ti = std::make_shared(*params.ti); |\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-|\t\t// we cannot capture a unique_ptr into a lambda in c++11, so we use a raw |\n-|\t\t// pointer for now. async_call uses a lambda expression to post the call |\n-|\t\t// to the main thread |\n-|auto* p = new add_torrent_params(std::move(params)); |\n-|auto guard = aux::scope_end([p]{ delete p; }); |\n-|\t\tp->save_path = complete(p->save_path); |\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-|#if TORRENT_ABI_VERSION == 1 |\n-|\t\thandle_backwards_compatible_resume_data(*p); |\n-|#endif |\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-|\t\tasync_call(&session_impl::async_add_torrent, p); |\n-|\t\tguard.disarm(); |\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-|#ifndef BOOST_NO_EXCEPTIONS |\n-|#if TORRENT_ABI_VERSION == 1 |\n-|\t// if the torrent already exists, this will throw duplicate_torrent |\n-|\ttorrent_handle session_handle::add_torrent( |\n-|\t\ttorrent_info const& ti |\n-|\t\t, std::string const& save_path |\n-|\t\t, entry const& resume_data |\n-|\t\t, storage_mode_t storage_mode |\n-|\t\t, bool const add_paused) |\n+|\tvoid async_delete_files(storage_index_t |\n+|\t\t, remove_flags_t, std::function handler) override |\n |\t{ |\n-|\t\tadd_torrent_params p; |\n-|\t\tp.ti = std::make_shared(ti); |\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+|\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 |_\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@@ -7190,473 +7028,1055 @@\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-|_\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+|_\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+|\t} |\n+| |\n+|\tstd::array export_key(key_t const& k) |\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} |\n+| |\n+|\tstd::array export_key(key_t const& k) |\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, is_v6_addr(false) |\n-|#if TORRENT_USE_I2P |\n-|\t\t, is_i2p_addr(false) |\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, 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\t\tstd::memset(begin, 0, aux::numeric_cast(96 - len)); |\n+|\t\t} |\n+|\t\treturn ret; |\n+|\t} |\n | |\n-|\tstd::uint32_t torrent_peer::rank(external_ip const& external, int external_port) const |\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 |\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\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/_\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+|\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+|\t{ |\n |#ifndef TORRENT_DISABLE_LOGGING |\n-|\tstd::string torrent_peer::to_string() const |\n+|\t\tsession_log(\"start session\"); |\n+|#endif |\n+| |\n+|#if TORRENT_USE_SSL |\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+|X509_STORE* store = X509_STORE_new(); |\n+|if (store) |\n+|\t\t{ |\n+|\t\t\tHCERTSTORE system_store = CertOpenSystemStoreA(0, \"ROOT\"); |\n+|\t\t\t// this is best effort |\n+|\t\t\tif (system_store) |\n+|\t\t\t{ |\n+|\t\t\t\tCERT_CONTEXT const* ctx = nullptr; |\n+|\t\t\t\twhile ((ctx = CertEnumCertificatesInStore(system_store, ctx)) != nullptr) |\n+|\t\t\t\t{ |\n+|\t\t\t\t\tunsigned char const* cert_ptr = reinterpret_cast(ctx->pbCertEncoded); |\n+|\t\t\t\t\tX509* x509 = d2i_X509(nullptr, &cert_ptr, ctx->cbCertEncoded); |\n+|\t\t\t\t\t// this is best effort |\n+|\t\t\t\t\tif (!x509) continue; |\n+|\t\t\t\t\tX509_STORE_add_cert(store, x509); |\n+|\t\t\t\t\tX509_free(x509); |\n+|\t\t\t\t} |\n+|\t\t\t\tCertFreeCertificateContext(ctx); |\n+|\t\t\t\tCertCloseStore(system_store, 0); |\n+|\t\t\t} |\n+|\t\t} |\n+| |\n+|\t\tSSL_CTX* ssl_ctx = m_ssl_ctx.native_handle(); |\n+|\t\tSSL_CTX_set_cert_store(ssl_ctx, store); |\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+|_\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+|_\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:_\b1_\b4_\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 _\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\bes\bss\bsi\bio\bon\bn_\b_i\bim\bmp\bpl\bl.\b.c\bcp\bpp\bp:\b:1\b14\b48\b84\b4 *\b**\b**\b* |\n+|bandwidth_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+|\t} |\n+| |\n+|\t// session_impl is responsible for deleting 'pack' |\n+|\tvoid session_impl::apply_settings_pack(std::shared_ptr pack) |\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\tINVARIANT_CHECK; |\n+|\t\tapply_settings_pack_impl(*pack); |\n |\t} |\n-|#endif |\n | |\n-|\tstd::int64_t torrent_peer::total_download() const |\n+|\tsettings_pack session_impl::get_settings() const |\n |\t{ |\n-|\t\tTORRENT_ASSERT(in_use); |\n-|\t\tif (connection != nullptr) |\n+|\t\tsettings_pack ret; |\n+|for (int i = settings_pack::string_type_base; |\n+|i < settings_pack::max_string_setting_internal; ++i) |\n |\t\t{ |\n-|\t\t\tTORRENT_ASSERT(prev_amount_download == 0); |\n-|\t\t\treturn connection->statistics().total_payload_download(); |\n+|\t\t\tret.set_str(i, m_settings.get_str(i)); |\n |\t\t} |\n-|\t\telse |\n+|\t\tfor (int i = settings_pack::int_type_base; |\n+|\t\t\ti < settings_pack::max_int_setting_internal; ++i) |\n |\t\t{ |\n-|\t\t\treturn std::int64_t(prev_amount_download) << 10; |\n+|\t\t\tret.set_int(i, m_settings.get_int(i)); |\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/_\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\tfor (int i = settings_pack::bool_type_base; |\n+|\t\t\ti < settings_pack::max_bool_setting_internal; ++i) |\n+|\t\t{ |\n+|\t\t\tret.set_bool(i, m_settings.get_bool(i)); |\n+|\t\t} |\n+|\t\treturn ret; |\n |\t} |\n+| |\n+|namespace { |\n+|\ttemplate |\n+|\tint get_setting_impl(Pack const& p, int name, int*) |\n+|\t{ return p.get_int(name); } |\n+| |\n+|\ttemplate |\n+|\tbool get_setting_impl(Pack const& p, int name, bool*) |\n+|\t{ return p.get_bool(name); } |\n+| |\n+|\ttemplate |\n+|\tstd::string get_setting_impl(Pack const& p, int name, std::string*) |\n+|_\b\t_\b{_\b _\br_\be_\bt_\bu_\br_\bn_\b _\bp_\b._\bg_\be_\bt_\b__\bs_\bt_\br_\b(_\bn_\ba_\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 _\b _\b _\b _\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_\be_\bs_\bs_\bi_\bo_\bn_\b__\bi_\bm_\bp_\bl_\b._\bc_\bp_\bp_\b:_\b1_\b9_\b9_\b8 |could this function be merged with expand_unspecified_addresses? right now both listen_endpoint_t and listen_interface_t are almost |\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_\bd_\be_\bn_\bt_\bi_\bc_\ba_\bl_\b,_\b _\bm_\ba_\by_\bb_\be_\b _\bt_\bh_\be_\b _\bl_\ba_\bt_\bt_\be_\br_\b _\bc_\bo_\bu_\bl_\bd_\b _\bb_\be_\b _\br_\be_\bm_\bo_\bv_\be_\bd_\b _\bt_\bo_\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 |\n+|*\b**\b**\b**\b**\b* c\bco\bou\bul\bld\bd t\bth\bhi\bis\bs f\bfu\bun\bnc\bct\bti\bio\bon\bn b\bbe\be m\bme\ber\brg\bge\bed\bd w\bwi\bit\bth\bh e\bex\bxp\bpa\ban\bnd\bd_\b_u\bun\bns\bsp\bpe\bec\bci\bif\bfi\bie\bed\bd_\b_a\bad\bdd\bdr\bre\bes\bss\bse\bes\bs?\b? r\bri\big\bgh\bht\bt n\bno\bow\bw b\bbo\bot\bth\bh l\bli\bis\bst\bte\ben\bn_\b_e\ben\bnd\bdp\bpo\boi\bin\bnt\bt_\b_t\bt a\ban\bnd\bd l\bli\bis\bst\bte\ben\bn_\b_i\bin\bnt\bte\ber\brf\bfa\bac\bce\be_\b_t\bt a\bar\bre\be a\bal\blm\bmo\bos\bst\bt i\bid\bde\ben\bnt\bti\bic\bca\bal\bl,\b, m\bma\bay\byb\bbe\be t\bth\bhe\be l\bla\bat\btt\bte\ber\br c\bco\bou\bul\bld\bd b\bbe\be |\n+|r\bre\bem\bmo\bov\bve\bed\bd t\bto\boo\bo *\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:1\b19\b99\b98\b8 *\b**\b**\b* |\n+|session_log(\"FATAL SESSION ERROR (%s : %d) [%s]\" |\n+|\t\t\t, ec.category().name(), ec.value(), ec.message().c_str()); |\n |#endif |\n-|#endif |\n+|\t\tthis->abort(); |\n+|\t} |\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+|\tvoid session_impl::on_ip_change(error_code const& 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+|#ifndef TORRENT_DISABLE_LOGGING |\n+|\t\tif (!ec) |\n+|\t\t\tsession_log(\"received ip change from internal ip_notifier\"); |\n+|\t\telse |\n+|\t\t\tsession_log(\"received error on_ip_change: %d, %s\", ec.value(), ec.message().c_str()); |\n+|#endif |\n+|\t\tif (ec || m_abort || !m_ip_notifier) return; |\n+|\t\tm_ip_notifier->async_wait([this] (error_code const& e) |\n+|\t\t\t{ wrap(&session_impl::on_ip_change, e); }); |\n+|\t\treopen_network_sockets({}); |\n |\t} |\n | |\n+|void interface_to_endpoints(listen_interface_t const& iface |\n+|, listen_socket_flags_t flags |\n+|\t\t, span const ifs |\n+|\t\t, std::vector& eps) |\n+|\t{ |\n+|\t\tflags |= iface.local ? listen_socket_t::local_network : listen_socket_flags_t{}; |\n+|\t\ttransport const ssl = iface.ssl ? transport::ssl : transport::plaintext; |\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\t// First, check to see if it's an IP address |\n+|\t\terror_code err; |\n+|\t\taddress const adr = make_address(iface.device.c_str(), err); |\n+|\t\tif (!err) |\n+|\t\t{ |\n+|\t\t\teps.emplace_back(adr, iface.port, std::string{}, ssl, flags); |\n+|\t\t} |\n+|\t\telse |\n+|\t\t{ |\n+|\t\t\tflags |= listen_socket_t::was_expanded; |\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\t\t// this is the case where device names a network device. We need to |\n+|\t\t\t// enumerate all IPs associated with this device |\n+|\t\t\tfor (auto const& ipface : 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 (iface.device != ipface.name) continue; |\n | |\n-|void socks5::on_connect_timeout(error_code const& e) |\n+|\t\t\t\tbool const local = iface.local |\n+|\t\t\t\t\t|| ipface.interface_address.is_loopback() |\n+|_\b\t_\b\t_\b\t_\b\t_\b\t_\b|_\b|_\b _\bi_\bs_\b__\bl_\bi_\bn_\bk_\b__\bl_\bo_\bc_\ba_\bl_\b(_\bi_\bp_\bf_\ba_\bc_\be_\b._\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be_\b__\ba_\bd_\bd_\br_\be_\bs_\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 |\n+| | |it would probably be better to do this by having a listen-socket \"version\" number that gets bumped. And instead of setting a bool to|\n+|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bi_\bm_\bp_\bl_\b._\bc_\bp_\bp_\b:_\b2_\b3_\b0_\b6 |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 |\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|_\b2_\b._\b0_\b _\bo_\br_\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 _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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 p\bpr\bro\bob\bba\bab\bbl\bly\by b\bbe\be b\bbe\bet\btt\bte\ber\br t\bto\bo d\bdo\bo t\bth\bhi\bis\bs b\bby\by h\bha\bav\bvi\bin\bng\bg a\ba l\bli\bis\bst\bte\ben\bn-\b-s\bso\boc\bck\bke\bet\bt \"\b\"v\bve\ber\brs\bsi\bio\bon\bn\"\b\" n\bnu\bum\bmb\bbe\ber\br t\bth\bha\bat\bt g\bge\bet\bts\bs b\bbu\bum\bmp\bpe\bed\bd.\b. A\bAn\bnd\bd i\bin\bns\bst\bte\bea\bad\bd o\bof\bf s\bse\bet\btt\bti\bin\bng\bg a\ba b\bbo\boo\bol\bl t\bto\bo d\bdi\bis\bsa\bab\bbl\ble\be a\ba t\btr\bra\bac\bck\bke\ber\br,\b, w\bwe\be s\bse\bet\bt t\bth\bhe\be |\n+|v\bve\ber\brs\bsi\bio\bon\bn n\bnu\bum\bmb\bbe\ber\br t\bth\bha\bat\bt i\bit\bt w\bwa\bas\bs d\bdi\bis\bsa\bab\bbl\ble\bed\bd a\bat\bt.\b. T\bTh\bhi\bis\bs c\bch\bha\ban\bng\bge\be w\bwo\bou\bul\bld\bd a\baf\bff\bfe\bec\bct\bt t\bth\bhe\be A\bAB\bBI\bI i\bin\bn 1\b1.\b.2\b2,\b, s\bso\bo s\bsh\bho\bou\bul\bld\bd b\bbe\be d\bdo\bon\bne\be i\bin\bn 2\b2.\b.0\b0 o\bor\br l\bla\bat\bte\ber\br *\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:2\b23\b30\b06\b6 *\b**\b**\b* |\n |{ |\n-|\tCOMPLETE_ASYNC(\"socks5::on_connect_timeout\"); |\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+|\t\telse |\n+|\t\t{ |\n+|\t\t\t// new sockets need to map ports even if the caller did not request |\n+|\t\t\t// re-mapping |\n+|\t\t\tfor (auto const& s : new_sockets) |\n+|\t\t\t\tremap_ports(remap_natpmp_and_upnp, *s); |\n+|\t\t} |\n | |\n-|\tif (e == boost::asio::error::operation_aborted) return; |\n+|\t\tupdate_lsd(); |\n | |\n-|\tif (m_abort) return; |\n+|#if TORRENT_USE_I2P |\n+|\t\topen_new_incoming_i2p_connection(); |\n+|#endif |\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// trackers that were not reachable, may have become reachable now. |\n+|\t\t// so clear the \"disabled\" flags to let them be tried one more time |\n+|for (auto& t : m_torrents) |\n+|t->enable_all_trackers(); |\n+|\t} |\n | |\n-|\terror_code ignore; |\n-|\tm_socks5_sock.close(ignore); |\n+|\tvoid session_impl::reopen_network_sockets(reopen_network_flags_t const options) |\n+|\t{ |\n+|\t\treopen_listen_sockets(bool(options & session_handle::reopen_map_ports)); |\n+|\t} |\n | |\n-|\t++m_failures; |\n-|\tretry_connection(); |\n-|} |\n+|\tnamespace { |\n+|\t\ttemplate |\n+|\t\tvoid map_port(MapProtocol& m, ProtoType protocol, EndpointType const& ep |\n+|\t\t\t, port_mapping_t& map_handle, std::string const& device) |\n+|\t\t{ |\n+|\t\t\tif (map_handle != port_mapping_t{-1}) m.delete_mapping(map_handle); |\n+|\t\t\tmap_handle = port_mapping_t{-1}; |\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-|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\taddress const addr = ep.address(); |\n+|\t\t\t// with IPv4 the interface might be behind NAT so we can't skip them |\n+|\t\t\t// based on the scope of the local address |\n+|\t\t\tif (addr.is_v6() && is_local(addr)) |\n+|\t\t\t\treturn; |\n+| |\n+|\t\t\t// only update this mapping if we actually have a socket listening |\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+|_\b\t_\b\t_\b,_\b _\bl_\bi_\bs_\bt_\be_\bn_\b__\bs_\bo_\bc_\bk_\be_\bt_\b__\bt_\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 _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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:_\b2_\b8_\b6_\b6_\b _\b _\b|_\bt_\bh_\bi_\bs_\b _\bs_\bi_\bz_\be_\b _\bn_\be_\be_\bd_\b _\bt_\bo_\b _\bb_\be_\b _\bc_\ba_\bp_\bp_\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 |\n+|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs s\bsi\biz\bze\be n\bne\bee\bed\bd t\bto\bo b\bbe\be c\bca\bap\bpp\bpe\bed\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_i\bim\bmp\bpl\bl.\b.c\bcp\bpp\bp:\b:2\b28\b86\b66\b6 *\b**\b**\b* |\n+|// handshaking |\n+|\t\t\t\treturn socket_type(ssl_stream(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+|\t\t}(); |\n+| |\n+|#ifdef TORRENT_SSL_PEERS |\n+|\t\tTORRENT_ASSERT((ssl == transport::ssl) == is_ssl(c)); |\n+|#endif |\n+| |\n+|#ifdef TORRENT_SSL_PEERS |\n+|\t\tif (ssl == transport::ssl) |\n+|\t\t{ |\n+|\t\t\tTORRENT_ASSERT(is_ssl(c)); |\n+| |\n+|\t\t\t// save the socket so we can cancel the handshake |\n+|auto iter = m_incoming_sockets.emplace(std::make_unique(std::move(c))).first; |\n+| |\n+|\t\t\tauto sock = iter->get(); |\n+|\t\t\t// for SSL connections, incoming_connection() is called |\n+|\t\t\t// after the handshake is done |\n+|\t\t\tADD_OUTSTANDING_ASYNC(\"session_impl::ssl_handshake\"); |\n+|\t\t\tboost::get>(**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-|\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\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\tincoming_connection(std::move(c)); |\n |\t\t} |\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+|#ifdef TORRENT_SSL_PEERS |\n | |\n-|\t\tcb->tracker_response(tracker_req(), m_target.address(), ip_list, resp); |\n+|\tvoid session_impl::on_incoming_utp_ssl(socket_type s) |\n+|\t{ |\n+|\t\tTORRENT_ASSERT(is_ssl(s)); |\n | |\n-|\t\tclose(); |\n-|\t\treturn true; |\n+|_\b\t_\b\t_\b/_\b/_\b _\bs_\ba_\bv_\be_\b _\bt_\bh_\be_\b _\bs_\bo_\bc_\bk_\be_\bt_\b _\bs_\bo_\b _\bw_\be_\b _\bc_\ba_\bn_\b _\bc_\ba_\bn_\bc_\be_\bl_\b _\bt_\bh_\be_\b _\bh_\ba_\bn_\bd_\bs_\bh_\ba_\bk_\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_\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:_\b2_\b8_\b9_\b1_\b _\b _\b|_\bt_\bh_\bi_\bs_\b _\bs_\bi_\bz_\be_\b _\bn_\be_\be_\bd_\b _\bt_\bo_\b _\bb_\be_\b _\bc_\ba_\bp_\bp_\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 |\n+|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs s\bsi\biz\bze\be n\bne\bee\bed\bd t\bto\bo b\bbe\be c\bca\bap\bpp\bpe\bed\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_i\bim\bmp\bpl\bl.\b.c\bcp\bpp\bp:\b:2\b28\b89\b91\b1 *\b**\b**\b* |\n+|// after the handshake is done |\n+|\t\t\tADD_OUTSTANDING_ASYNC(\"session_impl::ssl_handshake\"); |\n+|\t\t\tboost::get>(**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+|\t\t\tincoming_connection(std::move(c)); |\n+|\t\t} |\n |\t} |\n | |\n-|\tbool udp_tracker_connection::on_scrape_response(span buf) |\n+|#ifdef TORRENT_SSL_PEERS |\n+| |\n+|\tvoid session_impl::on_incoming_utp_ssl(socket_type s) |\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\tTORRENT_ASSERT(is_ssl(s)); |\n | |\n-|\t\tif (transaction != m_transaction_id) |\n+|\t\t// save the socket so we can cancel the handshake |\n+| |\n+|auto iter = m_incoming_sockets.emplace(std::make_unique(std::move(s))).first; |\n+|auto sock = iter->get(); |\n+| |\n+|\t\t// for SSL connections, incoming_connection() is called |\n+|\t\t// after the handshake is done |\n+|\t\tADD_OUTSTANDING_ASYNC(\"session_impl::ssl_handshake\"); |\n+|\t\tboost::get>(**iter).async_accept_handshake( |\n+|\t\t\t[this, sock] (error_code const& err) { ssl_handshake(err, sock); }); |\n+|\t} |\n+| |\n+|\t// to test SSL connections, one can use this openssl command template: |\n+|\t// |\n+|\t// openssl s_client -cert .pem -key .pem |\n+|\t// -CAfile .pem -debug -connect 127.0.0.1:4433 -tls1 |\n+|\t// -servername |\n+| |\n+|\tvoid session_impl::ssl_handshake(error_code const& ec, socket_type* sock) |\n+|\t{ |\n+|\t\tCOMPLETE_ASYNC(\"session_impl::ssl_handshake\"); |\n+| |\n+|\t\tauto iter = m_incoming_sockets.find(sock); |\n+| |\n+|\t\t// this happens if the SSL connection is aborted because we're shutting |\n+|\t\t// down |\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+|_\b\t_\b\t_\be_\br_\br_\bo_\br_\b__\bc_\bo_\bd_\be_\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 |\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:_\b3_\b5_\b9_\b0_\b _\b _\b|_\bh_\ba_\bv_\be_\b _\ba_\b _\bs_\be_\bp_\ba_\br_\ba_\bt_\be_\b _\bl_\bi_\bs_\bt_\b _\bf_\bo_\br_\b _\bt_\bh_\be_\bs_\be_\b _\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\bs_\b,_\b _\bi_\bn_\bs_\bt_\be_\ba_\bd_\b _\bo_\bf_\b _\bh_\ba_\bv_\bi_\bn_\bg_\b _\bt_\bo_\b _\bl_\bo_\bo_\bp_\b _\bt_\bh_\br_\bo_\bu_\bg_\bh_\b _\ba_\bl_\bl_\b _\bo_\bf_\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 |\n+|*\b**\b**\b**\b**\b* h\bha\bav\bve\be a\ba s\bse\bep\bpa\bar\bra\bat\bte\be l\bli\bis\bst\bt f\bfo\bor\br t\bth\bhe\bes\bse\be c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bns\bs,\b, i\bin\bns\bst\bte\bea\bad\bd o\bof\bf h\bha\bav\bvi\bin\bng\bg t\bto\bo l\blo\boo\bop\bp t\bth\bhr\bro\bou\bug\bgh\bh a\bal\bll\bl o\bof\bf t\bth\bhe\bem\bm *\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:3\b35\b59\b90\b0 *\b**\b**\b* |\n+|// -------------------------------------------------------------- |\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\tfail(error_code(errors::invalid_tracker_transaction_id), operation_t::bittorrent); |\n-|\t\t\treturn false; |\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-|\t\tif (action == action_t::error) |\n+|\t\t// -------------------------------------------------------------- |\n+|\t\t// check for incoming connections that might have timed out |\n+|\t\t// -------------------------------------------------------------- |\n+| |\n+|\t\tfor (auto i = m_connections.begin(); i != m_connections.end();) |\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\tpeer_connection* p = (*i).get(); |\n+|\t\t\t++i; |\n+|\t\t\t// ignore connections that already have a torrent, since they |\n+|\t\t\t// are ticked through the torrents' second_tick |\n+|\t\t\tif (!p->associated_torrent().expired()) continue; |\n+| |\n+|int timeout = m_settings.get_int(settings_pack::handshake_timeout); |\n+|#if TORRENT_USE_I2P |\n+|\t\t\ttimeout *= is_i2p(p->get_socket()) ? 4 : 1; |\n+|#endif |\n+|\t\t\tif (m_last_tick - p->connected_time () > seconds(timeout)) |\n+|\t\t\t\tp->disconnect(errors::timed_out, operation_t::bittorrent); |\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-|_\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// -------------------------------------------------------------- |\n+|\t\t// second_tick every torrent (that wants it) |\n+|\t\t// -------------------------------------------------------------- |\n+| |\n+|#if TORRENT_DEBUG_STREAMING > 0 |\n+|\t\tstd::printf(\"\\033[2J\\033[0;0H\"); |\n+|#endif |\n+| |\n+|\t\taux::vector& 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+|\t\t\tTORRENT_ASSERT(t.want_tick()); |\n+|\t\t\tTORRENT_ASSERT(!t.is_aborted()); |\n+| |\n+|\t\t\tt.second_tick(tick_interval_ms); |\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+|_\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/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bi_\bm_\bp_\bl_\b._\bc_\bp_\bp_\b:_\b3_\b6_\b2_\b3_\b _\b _\b|_\bt_\bh_\bi_\bs_\b _\bs_\bh_\bo_\bu_\bl_\bd_\b _\ba_\bp_\bp_\bl_\by_\b _\bt_\bo_\b _\ba_\bl_\bl_\b _\bb_\ba_\bn_\bd_\bw_\bi_\bd_\bt_\bh_\b _\bc_\bh_\ba_\bn_\bn_\be_\bl_\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 |\n+|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs s\bsh\bho\bou\bul\bld\bd a\bap\bpp\bpl\bly\by t\bto\bo a\bal\bll\bl b\bba\ban\bnd\bdw\bwi\bid\bdt\bth\bh c\bch\bha\ban\bnn\bne\bel\bls\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:3\b36\b62\b23\b3 *\b**\b**\b* |\n+|#if TORRENT_DEBUG_STREAMING > 0 |\n+|\t\tstd::printf(\"\\033[2J\\033[0;0H\"); |\n+|#endif |\n+| |\n+|\t\taux::vector& 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+|\t\t\tTORRENT_ASSERT(t.want_tick()); |\n+|\t\t\tTORRENT_ASSERT(!t.is_aborted()); |\n+| |\n+|\t\t\tt.second_tick(tick_interval_ms); |\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+| |\n+|if (m_settings.get_bool(settings_pack::rate_limit_ip_overhead)) |\n+|{ |\n+|\t\t\tint const up_limit = upload_rate_limit(m_global_class); |\n+|\t\t\tint const down_limit = download_rate_limit(m_global_class); |\n+| |\n+|\t\t\tif (down_limit > 0 |\n+|\t\t\t\t&& m_stat.download_ip_overhead() >= down_limit |\n+|\t\t\t\t&& m_alerts.should_post()) |\n+|\t\t\t{ |\n+|\t\t\t\tm_alerts.emplace_alert(torrent_handle() |\n+|\t\t\t\t\t, performance_alert::download_limit_too_low); |\n+|\t\t\t} |\n+| |\n+|\t\t\tif (up_limit > 0 |\n+|\t\t\t\t&& m_stat.upload_ip_overhead() >= up_limit |\n+|\t\t\t\t&& m_alerts.should_post()) |\n+|\t\t\t{ |\n+|\t\t\t\tm_alerts.emplace_alert(torrent_handle() |\n+|\t\t\t\t\t, performance_alert::upload_limit_too_low); |\n+|\t\t\t} |\n+|\t\t} |\n+| |\n+|#if TORRENT_ABI_VERSION == 1 |\n+|\t\tm_peak_up_rate = std::max(m_stat.upload_rate(), m_peak_up_rate); |\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+|_\b\t_\b\t_\b/_\b/_\b _\b(_\bu_\bn_\bl_\be_\bs_\bs_\b _\bt_\bh_\be_\b _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b _\bi_\bs_\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 _\b _\b _\b _\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_\be_\bs_\bs_\bi_\bo_\bn_\b__\bi_\bm_\bp_\bl_\b._\bc_\bp_\bp_\b:_\b4_\b3_\b1_\b4 |use a lower limit than m_settings.connections_limit to allocate the to 10% or so of connection slots for incoming connections cap |\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|_\bt_\bh_\bi_\bs_\b _\ba_\bt_\b _\bm_\ba_\bx_\b _\b-_\b _\b1_\b,_\b _\bs_\bi_\bn_\bc_\be_\b _\bw_\be_\b _\bm_\ba_\by_\b _\ba_\bd_\bd_\b _\bo_\bn_\be_\b _\bb_\be_\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 _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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 a\ba l\blo\bow\bwe\ber\br l\bli\bim\bmi\bit\bt t\bth\bha\ban\bn m\bm_\b_s\bse\bet\btt\bti\bin\bng\bgs\bs.\b.c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bns\bs_\b_l\bli\bim\bmi\bit\bt t\bto\bo a\bal\bll\blo\boc\bca\bat\bte\be t\bth\bhe\be t\bto\bo 1\b10\b0%\b% o\bor\br s\bso\bo o\bof\bf c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn s\bsl\blo\bot\bts\bs f\bfo\bor\br i\bin\bnc\bco\bom\bmi\bin\bng\bg c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bns\bs c\bca\bap\bp t\bth\bhi\bis\bs a\bat\bt m\bma\bax\bx -\b- 1\b1,\b, s\bsi\bin\bnc\bce\be w\bwe\be m\bma\bay\by a\bad\bdd\bd o\bon\bne\be |\n+|b\bbe\bel\blo\bow\bw *\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:4\b43\b31\b14\b4 *\b**\b**\b* |\n+|// 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+|\t\t\tif (m_boost_connections > max_connections) |\n+|\t\t\t{ |\n+|\t\t\t\tm_boost_connections -= max_connections; |\n+|\t\t\t\tmax_connections = 0; |\n+|\t\t\t} |\n+|\t\t\telse |\n+|\t\t\t{ |\n+|\t\t\t\tmax_connections -= m_boost_connections; |\n+|\t\t\t\tm_boost_connections = 0; |\n+|\t\t\t} |\n+|\t\t} |\n+| |\n+|\t\t// zero connections speeds are allowed, we just won't make any connections |\n+|\t\tif (max_connections <= 0) return; |\n+| |\n+|int const limit = std::min(m_settings.get_int(settings_pack::connections_limit) |\n+|- num_connections(), std::numeric_limits::max() - 1); |\n+| |\n+|\t\t// this logic is here to smooth out the number of new connection |\n+|\t\t// attempts over time, to prevent connecting a large number of |\n+|\t\t// sockets, wait 10 seconds, and then try again |\n+|\t\tif (m_settings.get_bool(settings_pack::smooth_connects) && max_connections > (limit+1) / 2) |\n+|\t\t\tmax_connections = (limit + 1) / 2; |\n+| |\n+|\t\taux::vector& want_peers_download = m_torrent_lists[torrent_want_peers_download]; |\n+|\t\taux::vector& want_peers_finished = m_torrent_lists[torrent_want_peers_finished]; |\n+| |\n+|\t\t// if no torrent want any peers, just return |\n+|\t\tif (want_peers_download.empty() && want_peers_finished.empty()) return; |\n+| |\n+|\t\t// if we don't have any connection attempt quota, return |\n+|\t\tif (max_connections <= 0) return; |\n+| |\n+|\t\tint steps_since_last_connect = 0; |\n+|\t\tint const num_torrents = int(want_peers_finished.size() + want_peers_download.size()); |\n+|\t\tfor (;;) |\n+|\t\t{ |\n+|\t\t\tif (m_next_downloading_connect_torrent >= int(want_peers_download.size())) |\n+|\t\t\t\tm_next_downloading_connect_torrent = 0; |\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+|_\b\t_\b\t_\b\t_\bw_\bh_\bi_\bl_\be_\b _\b(_\b!_\bm_\b__\bp_\br_\bi_\bo_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\bs_\b._\be_\bm_\bp_\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 _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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:_\b4_\b4_\b5_\b9_\b _\b _\b|_\bp_\bo_\bs_\bt_\b _\ba_\b _\bm_\be_\bs_\bs_\ba_\bg_\be_\b _\bt_\bo_\b _\bh_\ba_\bv_\be_\b _\bt_\bh_\bi_\bs_\b _\bh_\ba_\bp_\bp_\be_\bn_\b _\bi_\bm_\bm_\be_\bd_\bi_\ba_\bt_\be_\bl_\by_\b _\bi_\bn_\bs_\bt_\be_\ba_\bd_\b _\bo_\bf_\b _\bw_\ba_\bi_\bt_\bi_\bn_\bg_\b _\bf_\bo_\br_\b _\bt_\bh_\be_\b _\bn_\be_\bx_\bt_\b _\bt_\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 |\n+|*\b**\b**\b**\b**\b* p\bpo\bos\bst\bt a\ba m\bme\bes\bss\bsa\bag\bge\be t\bto\bo h\bha\bav\bve\be t\bth\bhi\bis\bs h\bha\bap\bpp\bpe\ben\bn i\bim\bmm\bme\bed\bdi\bia\bat\bte\bel\bly\by i\bin\bns\bst\bte\bea\bad\bd o\bof\bf w\bwa\bai\bit\bti\bin\bng\bg f\bfo\bor\br t\bth\bhe\be n\bne\bex\bxt\bt t\bti\bic\bck\bk *\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:4\b44\b45\b59\b9 *\b**\b**\b* |\n+|continue; |\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+|\t\t\t\t// this peer is not unchokable. So, if it's unchoked |\n+|\t\t\t\t// already, make sure to choke it. |\n+|\t\t\t\tif (p->is_choked()) |\n |\t\t\t\t{ |\n-|\t\t\t\t\tmask[std::size_t(i)] = true; |\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+|\t\t\t\t\t// force a new optimistic unchoke |\n+|\t\t\t\t\tm_optimistic_unchoke_time_scaler = 0; |\n+|} |\n+|t->choke_peer(*p); |\n+|\t\t\t\tp->reset_choke_counters(); |\n+|\t\t\t\tcontinue; |\n |\t\t\t} |\n-|\t\t\tti->free_piece_layers(); |\n+| |\n+|\t\t\tpeers.push_back(p.get()); |\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\tint const allowed_upload_slots = unchoke_sort(peers |\n+|\t\t\t, unchoke_interval, m_settings); |\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+|\t\tif (m_settings.get_int(settings_pack::choking_algorithm) == settings_pack::fixed_slots_choker) |\n+|\t\t{ |\n+|\t\t\tint const upload_slots = get_int_setting(settings_pack::unchoke_slots_limit); |\n+|\t\t\tm_stats_counters.set_value(counters::num_unchoke_slots, upload_slots); |\n+|\t\t} |\n+|\t\telse |\n+|\t\t{ |\n+|\t\t\tm_stats_counters.set_value(counters::num_unchoke_slots |\n+|\t\t\t\t, allowed_upload_slots); |\n+|\t\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+|#ifndef TORRENT_DISABLE_LOGGING |\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+|_\b\t_\b\t_\b\t_\b\t_\b,_\b _\bi_\bn_\bt_\b(_\bp_\be_\be_\br_\bs_\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 _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+| | |it 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, |\n+|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bi_\bm_\bp_\bl_\b._\bc_\bp_\bp_\b:_\b4_\b7_\b8_\b6 |they would nicely be round-robined because the torrent lists are always pushed back. Perhaps the status_update_alert could even have|\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|_\ba_\b _\bf_\bi_\bx_\be_\bd_\b _\ba_\br_\br_\ba_\by_\b _\bo_\bf_\b _\bn_\b _\be_\bn_\bt_\br_\bi_\be_\bs_\b _\br_\ba_\bt_\bh_\be_\br_\b _\bt_\bh_\ba_\bn_\b _\ba_\b _\bv_\be_\bc_\bt_\bo_\br_\b,_\b _\bt_\bo_\b _\bf_\bu_\br_\bt_\bh_\be_\br_\b _\bi_\bm_\bp_\br_\bo_\bv_\be_\b _\bm_\be_\bm_\bo_\br_\by_\b _\bl_\bo_\bc_\ba_\bl_\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 |\n+|*\b**\b**\b**\b**\b* i\bit\bt m\bmi\big\bgh\bht\bt b\bbe\be a\ba n\bni\bic\bce\be f\bfe\bea\bat\btu\bur\bre\be h\bhe\ber\bre\be t\bto\bo l\bli\bim\bmi\bit\bt t\bth\bhe\be n\bnu\bum\bmb\bbe\ber\br o\bof\bf t\bto\bor\brr\bre\ben\bnt\bts\bs t\bto\bo s\bse\ben\bnd\bd i\bin\bn a\ba s\bsi\bin\bng\bgl\ble\be u\bup\bpd\bda\bat\bte\be.\b. B\bBy\by j\bju\bus\bst\bt p\bpo\bos\bst\bti\bin\bng\bg t\bth\bhe\be f\bfi\bir\brs\bst\bt n\bn t\bto\bor\brr\bre\ben\bnt\bts\bs,\b, t\bth\bhe\bey\by w\bwo\bou\bul\bld\bd n\bni\bic\bce\bel\bly\by b\bbe\be r\bro\bou\bun\bnd\bd-\b-r\bro\bob\bbi\bin\bne\bed\bd |\n+|b\bbe\bec\bca\bau\bus\bse\be t\bth\bhe\be t\bto\bor\brr\bre\ben\bnt\bt l\bli\bis\bst\bts\bs a\bar\bre\be a\bal\blw\bwa\bay\bys\bs p\bpu\bus\bsh\bhe\bed\bd b\bba\bac\bck\bk.\b. P\bPe\ber\brh\bha\bap\bps\bs t\bth\bhe\be s\bst\bta\bat\btu\bus\bs_\b_u\bup\bpd\bda\bat\bte\be_\b_a\bal\ble\ber\brt\bt c\bco\bou\bul\bld\bd e\bev\bve\ben\bn h\bha\bav\bve\be a\ba f\bfi\bix\bxe\bed\bd a\bar\brr\bra\bay\by o\bof\bf n\bn e\ben\bnt\btr\bri\bie\bes\bs r\bra\bat\bth\bhe\ber\br t\bth\bha\ban\bn a\ba v\bve\bec\bct\bto\bor\br,\b, t\bto\bo f\bfu\bur\brt\bth\bhe\ber\br i\bim\bmp\bpr\bro\bov\bve\be m\bme\bem\bmo\bor\bry\by |\n+|l\blo\boc\bca\bal\bli\bit\bty\by.\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:4\b47\b78\b86\b6 *\b**\b**\b* |\n+|t->status(&st, flags); |\n+|\t\t} |\n |\t} |\n | |\n-|\tadd_torrent_params load_torrent_parsed(bdecode_node const& torrent_file, load_torrent_limits const& cfg) |\n+|\tvoid session_impl::post_torrent_updates(status_flags_t const flags) |\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\tINVARIANT_CHECK; |\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/_\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-|#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\tTORRENT_ASSERT(is_single_thread()); |\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} |\n+|\t\tstd::vector& state_updates |\n+|\t\t\t= m_torrent_lists[aux::session_impl::torrent_state_updates]; |\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+|#if TORRENT_USE_ASSERTS |\n+|\t\tm_posting_torrent_updates = true; |\n |#endif |\n-|#else |\n-|\t\treturn false; |\n+| |\n+|\t\tstd::vector status; |\n+|\t\tstatus.reserve(state_updates.size()); |\n+| |\n+|for (auto& t : state_updates) |\n+|{ |\n+|\t\t\tTORRENT_ASSERT(t->m_links[aux::session_impl::torrent_state_updates].in_list()); |\n+|\t\t\tstatus.emplace_back(); |\n+|\t\t\t// querying accurate download counters may require |\n+|\t\t\t// the torrent to be loaded. Loading a torrent, and evicting another |\n+|\t\t\t// one will lead to calling state_updated(), which screws with |\n+|\t\t\t// this list while we're working on it, and break things |\n+|\t\t\tt->status(&status.back(), flags); |\n+|\t\t\tt->clear_in_state_update(); |\n+|\t\t} |\n+|\t\tstate_updates.clear(); |\n+| |\n+|#if TORRENT_USE_ASSERTS |\n+|\t\tm_posting_torrent_updates = false; |\n |#endif |\n+| |\n+|\t\tm_alerts.emplace_alert(std::move(status)); |\n |\t} |\n | |\n-|} // anonymous namespace |\n+|\tvoid session_impl::post_session_stats() |\n+|\t{ |\n+|\t\tif (!m_posted_stats_header) |\n+|\t\t{ |\n+|\t\t\tm_posted_stats_header = true; |\n+|\t\t\tm_alerts.emplace_alert(); |\n+|\t\t} |\n+|\t\tm_disk_thread->update_stats_counters(m_stats_counters); |\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/_\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+|#ifndef TORRENT_DISABLE_DHT |\n+|_\b\t_\b\t_\bi_\bf_\b _\b(_\bm_\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 _\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:_\b5_\b1_\b6_\b1_\b _\b _\b|_\bf_\ba_\bc_\bt_\bo_\br_\b _\bo_\bu_\bt_\b _\bt_\bh_\bi_\bs_\b _\bl_\bo_\bg_\bi_\bc_\b _\bi_\bn_\bt_\bo_\b _\ba_\b _\bs_\be_\bp_\ba_\br_\ba_\bt_\be_\b _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn_\b _\bf_\bo_\br_\b _\bu_\bn_\bi_\bt_\b _\bt_\be_\bs_\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 |\n+|*\b**\b**\b**\b**\b* f\bfa\bac\bct\bto\bor\br o\bou\but\bt t\bth\bhi\bis\bs l\blo\bog\bgi\bic\bc i\bin\bnt\bto\bo a\ba s\bse\bep\bpa\bar\bra\bat\bte\be f\bfu\bun\bnc\bct\bti\bio\bon\bn f\bfo\bor\br u\bun\bni\bit\bt t\bte\bes\bst\bti\bin\bng\bg *\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\b51\b16\b61\b1 *\b**\b**\b* |\n+|if (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\tstd::generate(buffer.begin(), buffer.end(), [] { return char(random(0xff)); }); |\n+|\t\t\ts.set_option(tcp::acceptor::reuse_address(true), ec); |\n |#endif |\n+|\t\t\t// ignore errors because the underlying socket may not |\n+|\t\t\t// be opened yet. This happens when we're routing through |\n+|\t\t\t// a proxy. In that case, we don't yet know the address of |\n+|\t\t\t// the proxy server, and more importantly, we don't know |\n+|\t\t\t// the address family of its address. This means we can't |\n+|\t\t\t// open the socket yet. The socks abstraction layer defers |\n+|\t\t\t// opening it. |\n+|\t\t\tec.clear(); |\n+|\t\t\tbind_ep.port(std::uint16_t(next_port())); |\n |\t\t} |\n | |\n-|\t\tvoid crypto_random_bytes(span buffer) |\n+|\t\tif (is_utp(s)) |\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+|utp_socket_impl* impl = nullptr; |\n+|\t\t\ttransport ssl = transport::plaintext; |\n+|#if TORRENT_USE_SSL |\n+|\t\t\tif (boost::get>(&s) != nullptr) |\n+|\t\t\t{ |\n+|\t\t\t\timpl = boost::get>(s).next_layer().get_impl(); |\n+|\t\t\t\tssl = transport::ssl; |\n+|\t\t\t} |\n+|\t\t\telse |\n |#endif |\n+|\t\t\t\timpl = boost::get(s).get_impl(); |\n+| |\n+|\t\t\tstd::vector> with_gateways; |\n+|\t\t\tstd::shared_ptr match; |\n+|\t\t\tfor (auto& ls : m_listen_sockets) |\n+|\t\t\t{ |\n+|\t\t\t\t// this is almost, but not quite, like can_route() |\n+|\t\t\t\tif (!(ls->flags & listen_socket_t::proxy) |\n+|\t\t\t\t\t&& is_v4(ls->local_endpoint) != remote_address.is_v4()) |\n+|\t\t\t\t\tcontinue; |\n+|\t\t\t\tif (ls->ssl != ssl) continue; |\n+|\t\t\t\tif (!(ls->flags & listen_socket_t::local_network)) |\n+|\t\t\t\t\twith_gateways.push_back(ls); |\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+|_\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/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bi_\bm_\bp_\bl_\b._\bc_\bp_\bp_\b:_\b5_\b8_\b8_\b0_\b _\b _\b|_\br_\be_\bf_\ba_\bc_\bt_\bo_\br_\b,_\b _\bm_\bo_\bv_\be_\b _\bt_\bh_\be_\b _\bs_\bt_\bo_\br_\ba_\bg_\be_\b _\bt_\bo_\b _\bd_\bh_\bt_\b__\bt_\br_\ba_\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 |\n+|*\b**\b**\b**\b**\b* r\bre\bef\bfa\bac\bct\bto\bor\br,\b, m\bmo\bov\bve\be t\bth\bhe\be s\bst\bto\bor\bra\bag\bge\be t\bto\bo d\bdh\bht\bt_\b_t\btr\bra\bac\bck\bke\ber\br *\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\b58\b88\b80\b0 *\b**\b**\b* |\n+|#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+|\t\t{ |\n+|#ifndef TORRENT_DISABLE_LOGGING |\n+|\t\t\tsession_log(\"not starting DHT, aborting\"); |\n |#endif |\n+|\t\t\treturn; |\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-|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+|#ifndef TORRENT_DISABLE_LOGGING |\n+|\t\tsession_log(\"starting DHT, running: %s, router lookups: %d\" |\n+|\t\t\t, m_dht ? \"true\" : \"false\", m_outstanding_router_lookups); |\n+|#endif |\n+| |\n+|m_dht_storage = m_dht_storage_constructor(m_settings); |\n+|m_dht = std::make_shared( |\n+|\t\t\tstatic_cast(this) |\n+|\t\t\t, m_io_context |\n+|\t\t\t, [this](aux::listen_socket_handle const& sock |\n+|\t\t\t\t, udp::endpoint const& ep |\n+|\t\t\t\t, span p |\n+|\t\t\t\t, error_code& ec |\n+|\t\t\t\t, udp_send_flags_t const flags) |\n+|\t\t\t\t{ send_udp_packet_listen(sock, ep, p, ec, flags); } |\n+|\t\t\t, m_settings |\n+|\t\t\t, m_stats_counters |\n+|\t\t\t, *m_dht_storage |\n+|\t\t\t, std::move(m_dht_state)); |\n+| |\n+|\t\tfor (auto& s : m_listen_sockets) |\n |\t\t{ |\n-|\t\t\trate = m_download_rate_peak; |\n+|\t\t\tif (s->ssl != transport::ssl |\n+|\t\t\t\t&& !(s->flags & listen_socket_t::local_network)) |\n+|\t\t\t{ |\n+|\t\t\t\tm_dht->new_socket(s); |\n+|\t\t\t} |\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+| |\n+|\t\tfor (auto const& n : m_dht_router_nodes) |\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+|\t\t\tm_dht->add_router_node(n); |\n+|\t\t} |\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+|\t\tfor (auto const& n : m_dht_nodes) |\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/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bi_\bm_\bp_\bl_\b._\bc_\bp_\bp_\b:_\b6_\b2_\b6_\b7_\b _\b _\b|_\ba_\bs_\bs_\be_\br_\bt_\bs_\b _\bt_\bh_\ba_\bt_\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 _\ba_\br_\be_\b _\bs_\bt_\bi_\bl_\bl_\b _\bi_\bn_\b _\bf_\bl_\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 |\n+|*\b**\b**\b**\b**\b* a\bas\bss\bse\ber\brt\bts\bs t\bth\bha\bat\bt 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 a\bar\bre\be s\bst\bti\bil\bll\bl i\bin\bn f\bfl\bli\big\bgh\bht\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_i\bim\bmp\bpl\bl.\b.c\bcp\bpp\bp:\b:6\b62\b26\b67\b7 *\b**\b**\b* |\n+|if (!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-|rate = t->statistics().transfer_rate(stat::download_payload) / peers_with_requests; |\n-|} |\n-|\t\telse |\n+|#endif |\n+| |\n+|\tbool session_impl::is_listening() const |\n+|\t{ |\n+|\t\treturn !m_listen_sockets.empty(); |\n+|\t} |\n+| |\n+|\tsession_impl::~session_impl() |\n+|\t{ |\n+|\t\t// since we're destructing the session, no more alerts will make it out to |\n+|\t\t// the user. So stop posting them now |\n+|\t\tm_alerts.set_alert_mask({}); |\n+|\t\tm_alerts.set_notify_function({}); |\n+| |\n+|\t\t// this is not allowed to be the network thread! |\n+|//\t\tTORRENT_ASSERT(is_not_thread()); |\n+| |\n+|// this can happen if we end the io_context run loop with an exception |\n+|\t\tm_connections.clear(); |\n+|\t\tfor (auto& t : m_torrents) |\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\tt->panic(); |\n+|\t\t\tt->abort(); |\n |\t\t} |\n+|\t\tm_torrents.clear(); |\n | |\n-|\t\t// avoid division by zero |\n-|\t\tif (rate < 50) rate = 50; |\n+|\t\t// this has probably been called already, but in case of sudden |\n+|\t\t// termination through an exception, it may not have been done |\n+|\t\tabort_stage2(); |\n | |\n-|\t\t// average of current rate and peak |\n-|//\t\trate = (rate + m_download_rate_peak) / 2; |\n+|#if defined TORRENT_ASIO_DEBUGGING |\n+|\t\tFILE* f = fopen(\"wakeups.log\", \"w+\"); |\n+|\t\tif (f != nullptr) |\n+|\t\t{ |\n+|\t\t\ttime_point m = min_time(); |\n+|\t\t\tif (!_wakeups.empty()) m = _wakeups[0].timestamp; |\n+|\t\t\ttime_point prev = m; |\n+|\t\t\tstd::uint64_t prev_csw = 0; |\n+|\t\t\tif (!_wakeups.empty()) prev_csw = _wakeups[0].context_switches; |\n+|\t\t\tstd::fprintf(f, \"abs. time\\trel. time\\tctx switch\\tidle-wakeup\\toperation\\n\"); |\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/_\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\treturn milliseconds((m_outstanding_bytes + extra_bytes |\n-|\t\t\t+ m_queued_time_critical * t->block_size() * 1000) / rate); |\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-|\tvoid peer_connection::add_stat(std::int64_t const downloaded, std::int64_t const uploaded) |\n+|\tfile_index_t file_storage::file_index_at_piece(piece_index_t const piece) const |\n |\t{ |\n-|\t\tTORRENT_ASSERT(is_single_thread()); |\n-|\t\tm_statistics.add_stat(downloaded, uploaded); |\n+|\t\treturn file_index_at_offset(static_cast(piece) * std::int64_t(piece_length())); |\n |\t} |\n | |\n-|\tsha1_hash peer_connection::associated_info_hash() const |\n+|\tfile_index_t file_storage::file_index_for_root(sha256_hash const& root_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+|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-|\tstd::vector const& peer_connection::allowed_fast() |\n+|\tpiece_index_t file_storage::piece_index_at_file(file_index_t f) const |\n |\t{ |\n-|\t\tTORRENT_ASSERT(is_single_thread()); |\n-|\t\tstd::shared_ptr t = m_torrent.lock(); |\n-|\t\tTORRENT_ASSERT(t); |\n+|\t\treturn piece_index_t{aux::numeric_cast(file_offset(f) / piece_length())}; |\n+|\t} |\n | |\n-|return m_allowed_fast; |\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-|\tbool peer_connection::can_request_time_critical() const |\n+|\tvoid file_storage::canonicalize_impl(bool const backwards_compatible) |\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+|\t\tTORRENT_ASSERT(piece_length() >= 16 * 1024); |\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\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-|\tbool peer_connection::make_time_critical(piece_block const& block) |\n+|\tvoid file_storage::sanitize_symlinks() |\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-|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+|\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+|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\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-|#ifdef TORRENT_WINDOWS |\n-|\t\t\tret = file_pointer(::_wfopen(convert_to_native_path_string(fn).c_str(), L\"wb+\")); |\n-|#else |\n-|\t\t\tret = file_pointer(::fopen(fn.c_str(), \"wb+\")); |\n-|#endif |\n-|\t\t\tif (ret.file() == nullptr) |\n-|\t\t\t\tec.assign(errno, generic_category()); |\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\tif (ec) return {}; |\n-|\t\treturn ret; |\n+|\t} |\n+|\tcatch (storage_error const& e) |\n+|\t{ |\n+|\t\tec = e.ec; |\n+|\t\treturn {}; |\n |\t} |\n | |\n-|\tvoid posix_part_file::free_piece(piece_index_t const piece) |\n+|\tvoid part_file::free_piece(piece_index_t const piece) |\n |\t{ |\n+|\t\tstd::lock_guard 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 |m_free_slots.push_back(i->second); |\n |\t\tm_piece_map.erase(i); |\n |\t\tm_dirty_metadata = true; |\n |\t} |\n | |\n-|\tvoid posix_part_file::move_partfile(std::string const& path, error_code& ec) |\n+|\tvoid part_file::move_partfile(std::string const& path, error_code& ec) |\n |\t{ |\n+|\t\tstd::lock_guard 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@@ -7669,41 +8089,39 @@\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-|\t\tm_path = path; |\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/_\bp_\bo_\bs_\bi_\bx_\b__\bp_\ba_\br_\bt_\b__\bf_\bi_\bl_\be_\b._\bc_\bp_\bp_\b:_\b4_\b2_\b4_\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\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\bpo\bos\bsi\bix\bx_\b_p\bpa\bar\brt\bt_\b_f\bfi\bil\ble\be.\b.c\bcp\bpp\bp:\b:4\b42\b24\b4 *\b**\b**\b* |\n-|} |\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-|\t\t\t\tf(file_offset, {buf.get(), block_to_copy}); |\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-|\tvoid posix_part_file::flush_metadata(error_code& ec) |\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 posix_part_file::flush_metadata_impl(error_code& ec) |\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\t// if we don't have any pieces left in the |\n@@ -7712,115 +8130,130 @@\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(open_mode::read_write, ec); |\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/_\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+|_\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-|\tnamespace mp = boost::multiprecision; |\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-|\tnamespace { |\n-|key_t const dh_prime |\n-|(\"0xFFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A63|36210000000000090563\");\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-|\tstd::array export_key(key_t const& k) |\n+|\tadd_torrent_params load_torrent_buffer(span buffer, load_torrent_limits const& cfg) |\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\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-|\tstd::array export_key(key_t const& k) |\n+|\tadd_torrent_params load_torrent_parsed(bdecode_node const& torrent_file, load_torrent_limits const& cfg) |\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+|\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-|if (end < begin + 96) |\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/_\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\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\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-|\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+|\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// Set the prime P and the generator, generate local public key |\n-|\tdh_key_exchange::dh_key_exchange() |\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+|\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// create local key (random) |\n-|\t\tmp::import_bits(m_dh_local_secret, random_key.begin(), random_key.end()); |\n+|\t\t\tif (!m_pc.packet_finished()) return true; |\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+|\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/_\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@@ -7867,14 +8300,68 @@\n |\t\t} |\n |\t\tasync_call(&torrent::prioritize_files, file_prio); |\n |\t} |\n | |\n |\tstd::vector torrent_handle::file_priorities() const |\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+|_\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+|\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/_\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@@ -7921,121 +8408,122 @@\n | |\n |\t\t// #error send reset |\n | |\n |\t\treturn false; |\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/_\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+|_\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+|\t\tTORRENT_ASSERT_PRECOND(!params.save_path.empty()); |\n+|#endif |\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+|#if TORRENT_ABI_VERSION < 3 |\n+|\t\tif (!params.info_hashes.has_v1() && !params.info_hashes.has_v2() && !params.ti) |\n+|\t\t\tparams.info_hashes.v1 = params.info_hash; |\n+|#endif |\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+|\t\t// the internal torrent object keeps and mutates state in the |\n+|\t\t// torrent_info object. We can't let that leak back to the client |\n+|\t\tif (params.ti) |\n+|\t\t\tparams.ti = std::make_shared(*params.ti); |\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/_\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+|\t\t// we cannot capture a unique_ptr into a lambda in c++11, so we use a raw |\n+|\t\t// pointer for now. async_call uses a lambda expression to post the call |\n+|\t\t// to the main thread |\n+|auto* p = new add_torrent_params(std::move(params)); |\n+|auto guard = aux::scope_end([p]{ delete p; }); |\n+|\t\tp->save_path = complete(p->save_path); |\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+|#if TORRENT_ABI_VERSION == 1 |\n+|\t\thandle_backwards_compatible_resume_data(*p); |\n+|#endif |\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+|\t\tasync_call(&session_impl::async_add_torrent, p); |\n+|\t\tguard.disarm(); |\n+|\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+|#ifndef BOOST_NO_EXCEPTIONS |\n+|#if TORRENT_ABI_VERSION == 1 |\n+|\t// if the torrent already exists, this will throw duplicate_torrent |\n+|\ttorrent_handle session_handle::add_torrent( |\n+|\t\ttorrent_info const& ti |\n+|\t\t, std::string const& save_path |\n+|\t\t, entry const& resume_data |\n+|\t\t, storage_mode_t storage_mode |\n+|\t\t, bool const add_paused) |\n+|\t{ |\n+|\t\tadd_torrent_params p; |\n+|\t\tp.ti = std::make_shared(ti); |\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/_\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-|\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+|\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-|\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+|\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\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+|\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\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/_\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@@ -8479,321 +8967,318 @@\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+|_\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-|\tstatic_assert(std::is_nothrow_move_constructible::value |\n-|\t\t, \"should be nothrow move constructible\"); |\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-|\tstatic_assert(std::is_nothrow_move_constructible::value |\n-|\t\t, \"should be nothrow move constructible\"); |\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/_\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+|#include \"libtorrent/aux_/ip_notifier.hpp\" |\n+|#include \"libtorrent/assert.hpp\" |\n | |\n-|\tstatic_assert(std::is_nothrow_move_constructible::value |\n-|\t\t, \"should be nothrow move constructible\"); |\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-|\tstatic_assert(std::is_nothrow_move_constructible::value |\n-|\t\t, \"should be nothrow move constructible\"); |\n+|#include \"libtorrent/aux_/netlink_utils.hpp\" |\n | |\n+|namespace libtorrent { namespace aux { |\n | |\n+|namespace { |\n | |\n-|namespace aux { |\n+|#if (TORRENT_USE_SYSTEMCONFIGURATION || TORRENT_USE_SC_NETWORK_REACHABILITY) && \\ |\n+|\t!defined TORRENT_BUILD_SIMULATOR |\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+|// 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/_\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\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/_\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\tif (m_thread && m_thread.use_count() == 1) |\n |\t\t{ |\n-|\t\t\tstd::unique_lock 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-|\t\t\t\t, static_cast(j->piece), j->d.io.offset |\n-|\t\t\t\t, j->storage ? j->storage->num_outstanding_jobs() : -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-|\t\tstd::shared_ptr storage = j->storage; |\n-| |\n-|\t\tTORRENT_ASSERT(static_cast(j->action) < int(job_functions.size())); |\n+|\tTORRENT_EXPORT std::unique_ptr 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+|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\tm_stats_counters.inc_stats_counter(counters::num_running_disk_jobs, 1); |\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/_\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// call disk function |\n-|status_t ret = status_t::no_error; |\n-|try |\n-|\t\t{ |\n-|\t\t\tint const idx = static_cast(j->action); |\n-|\t\t\tret = (this->*(job_functions[static_cast(idx)]))(j); |\n-|\t\t} |\n-|\t\tcatch (boost::system::system_error const& err) |\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\tret = status_t::fatal_disk_error; |\n-|\t\t\tj->error.ec = err.code(); |\n-|\t\t\tj->error.operation = operation_t::exception; |\n+|\t\t\trate = m_download_rate_peak; |\n |\t\t} |\n-|\t\tcatch (std::bad_alloc const&) |\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\tret = status_t::fatal_disk_error; |\n-|\t\t\tj->error.ec = errors::no_memory; |\n-|\t\t\tj->error.operation = operation_t::exception; |\n-|\t\t} |\n-|\t\tcatch (std::exception const&) |\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\tret = status_t::fatal_disk_error; |\n-|\t\t\tj->error.ec = boost::asio::error::fault; |\n-|\t\t\tj->error.operation = operation_t::exception; |\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// 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+|\t\t// avoid division by zero |\n+|\t\tif (rate < 50) rate = 50; |\n | |\n-|_\b\t_\b\t_\bm_\b__\bs_\bt_\ba_\bt_\bs_\b__\bc_\bo_\bu_\bn_\bt_\be_\br_\bs_\b._\bi_\bn_\bc_\b__\bs_\bt_\ba_\bt_\bs_\b__\bc_\bo_\bu_\bn_\bt_\be_\br_\b(_\bc_\bo_\bu_\bn_\bt_\be_\br_\bs_\b:_\b:_\bn_\bu_\bm_\b__\br_\bu_\bn_\bn_\bi_\bn_\bg_\b__\bd_\bi_\bs_\bk_\b__\bj_\bo_\bb_\bs_\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 |\n-|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\bm_\bm_\ba_\bp_\b__\bd_\bi_\bs_\bk_\b__\bi_\bo_\b._\bc_\bp_\bp_\b:_\b1_\b0_\b1_\b7 |this 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 |\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|_\bt_\bh_\be_\b _\bc_\bo_\bm_\bp_\bl_\be_\bx_\bi_\bt_\by_\b _\ba_\bn_\bd_\b _\bc_\bo_\bs_\bt_\b _\bj_\bu_\bs_\bt_\b _\bf_\bo_\br_\b _\bt_\bh_\be_\b _\be_\bd_\bg_\be_\b _\bc_\ba_\bs_\be_\b _\bo_\bf_\b _\br_\be_\bc_\be_\bi_\bv_\bi_\bn_\bg_\b _\ba_\b _\bc_\bo_\br_\br_\bu_\bp_\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 |\n-|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs i\bis\bs p\bpo\bot\bte\ben\bnt\bti\bia\bal\bll\bly\by v\bve\ber\bry\by e\bex\bxp\bpe\ben\bns\bsi\biv\bve\be.\b. O\bOn\bne\be w\bwa\bay\by t\bto\bo s\bso\bol\blv\bve\be i\bit\bt w\bwo\bou\bul\bld\bd b\bbe\be t\bto\bo h\bha\bav\bve\be a\ba f\bfe\ben\bnc\bce\be f\bfo\bor\br j\bju\bus\bst\bt t\bth\bhi\bis\bs o\bon\bne\be p\bpi\bie\bec\bce\be.\b. b\bbu\but\bt i\bit\bt h\bha\bar\brd\bdl\bly\by s\bse\bee\bem\bms\bs w\bwo\bor\brt\bth\bh t\bth\bhe\be c\bco\bom\bmp\bpl\ble\bex\bxi\bit\bty\by a\ban\bnd\bd c\bco\bos\bst\bt j\bju\bus\bst\bt f\bfo\bor\br t\bth\bhe\be |\n-|e\bed\bdg\bge\be c\bca\bas\bse\be o\bof\bf r\bre\bec\bce\bei\biv\bvi\bin\bng\bg a\ba c\bco\bor\brr\bru\bup\bpt\bt p\bpi\bie\bec\bce\be *\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:1\b10\b01\b17\b7 *\b**\b**\b* |\n-|aux::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+|\t\t// average of current rate and peak |\n+|//\t\trate = (rate + m_download_rate_peak) / 2; |\n | |\n-|\t\tadd_fence_job(j); |\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 mmap_disk_io::async_clear_piece(storage_index_t const storage |\n-|\t\t, piece_index_t const index, std::function handler) |\n+|\tvoid peer_connection::add_stat(std::int64_t const downloaded, std::int64_t const uploaded) |\n |\t{ |\n-|\t\taux::mmap_disk_job* j = m_job_pool.allocate_job(aux::job_action_t::clear_piece); |\n-|\t\tj->storage = m_torrents[storage]->shared_from_this(); |\n-|\t\tj->piece = index; |\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-|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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/_\bm_\bm_\ba_\bp_\b__\bd_\bi_\bs_\bk_\b__\bi_\bo_\b._\bc_\bp_\bp_\b:_\b1_\b0_\b2_\b2 |Perhaps the job queue could be traversed and all jobs for this piece could be cancelled. If there are no threads currently writing |\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|_\bt_\bo_\b _\bt_\bh_\bi_\bs_\b _\bp_\bi_\be_\bc_\be_\b,_\b _\bw_\be_\b _\bc_\bo_\bu_\bl_\bd_\b _\bs_\bk_\bi_\bp_\b _\bt_\bh_\be_\b _\bf_\be_\bn_\bc_\be_\b _\ba_\bl_\bt_\bo_\bg_\be_\bt_\bh_\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 |\n-|*\b**\b**\b**\b**\b* P\bPe\ber\brh\bha\bap\bps\bs t\bth\bhe\be j\bjo\bob\bb q\bqu\bue\beu\bue\be c\bco\bou\bul\bld\bd b\bbe\be t\btr\bra\bav\bve\ber\brs\bse\bed\bd a\ban\bnd\bd a\bal\bll\bl j\bjo\bob\bbs\bs f\bfo\bor\br t\bth\bhi\bis\bs p\bpi\bie\bec\bce\be c\bco\bou\bul\bld\bd b\bbe\be c\bca\ban\bnc\bce\bel\bll\ble\bed\bd.\b. I\bIf\bf t\bth\bhe\ber\bre\be a\bar\bre\be n\bno\bo t\bth\bhr\bre\bea\bad\bds\bs c\bcu\bur\brr\bre\ben\bnt\btl\bly\by w\bwr\bri\bit\bti\bin\bng\bg t\bto\bo t\bth\bhi\bis\bs p\bpi\bie\bec\bce\be,\b, w\bwe\be c\bco\bou\bul\bld\bd s\bsk\bki\bip\bp t\bth\bhe\be f\bfe\ben\bnc\bce\be|\n-|a\bal\blt\bto\bog\bge\bet\bth\bhe\ber\br *\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:1\b10\b02\b22\b2 *\b**\b**\b* |\n-|j->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\tTORRENT_ASSERT(is_single_thread()); |\n+|\t\tm_statistics.add_stat(downloaded, uploaded); |\n |\t} |\n | |\n-|\tvoid mmap_disk_io::async_clear_piece(storage_index_t const storage |\n-|\t\t, piece_index_t const index, std::function handler) |\n+|\tsha1_hash peer_connection::associated_info_hash() const |\n |\t{ |\n-|\t\taux::mmap_disk_job* j = m_job_pool.allocate_job(aux::job_action_t::clear_piece); |\n-|\t\tj->storage = m_torrents[storage]->shared_from_this(); |\n-|\t\tj->piece = index; |\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+|\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-|add_fence_job(j); |\n+|return m_allowed_fast; |\n |} |\n | |\n-|\tstatus_t mmap_disk_io::do_hash(aux::mmap_disk_job* j) |\n+|\tbool peer_connection::can_request_time_critical() const |\n |\t{ |\n-|\t\t// we're not using a cache. This is the simple path |\n-|\t\t// just read straight from the file |\n-|\t\tTORRENT_ASSERT(m_magic == 0x1337); |\n-| |\n-|\t\tbool const v1 = bool(j->flags & disk_interface::v1_hash); |\n-|\t\tbool const v2 = !j->d.h.block_hashes.empty(); |\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\tint const piece_size = v1 ? j->storage->files().piece_size(j->piece) : 0; |\n-|\t\tint const piece_size2 = v2 ? j->storage->files().piece_size2(j->piece) : 0; |\n-|\t\tint const blocks_in_piece = v1 ? (piece_size + default_block_size - 1) / default_block_size : 0; |\n-|\t\tint const blocks_in_piece2 = v2 ? j->storage->files().blocks_in_piece2(j->piece) : 0; |\n-|\t\taux::open_mode_t const file_mode = file_mode_for_job(j); |\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\tTORRENT_ASSERT(!v2 || int(j->d.h.block_hashes.size()) >= blocks_in_piece2); |\n-|\t\tTORRENT_ASSERT(v1 || v2); |\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/_\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\thasher h; |\n-|\t\tint ret = 0; |\n-|\t\tint offset = 0; |\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\tvoid crypto_random_bytes(span buffer) |\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-|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+|#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\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+|// 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-|\t\t\tif (m_parser.status_code() == 503) |\n-|\t\t\t{ |\n-|\t\t\t\tif (!m_parser.finished()) return; |\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\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+|\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/_\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\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+|\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 | |\n-|\t\t\t// we only received the header, no data |\n-|\t\t\tif (recv_buffer.empty()) break; |\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\t\tif (recv_buffer.size() < front_request.length) break; |\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\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/_\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+|void socks5::on_connect_timeout(error_code const& e) |\n+|{ |\n+|\tCOMPLETE_ASYNC(\"socks5::on_connect_timeout\"); |\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+|\tif (e == boost::asio::error::operation_aborted) return; |\n | |\n-|\t\t\tcopy_on_write(); |\n-|\t\t\tm_files.rename_file(i, filename); |\n-|\t\t} |\n-|\t} |\n+|\tif (m_abort) return; |\n | |\n-|\tvoid torrent_info::remap_files(file_storage const& f) |\n-|\t{ |\n-|\t\tINVARIANT_CHECK; |\n+|\tif (m_alerts.should_post()) |\n+|\t\tm_alerts.emplace_alert(m_proxy_addr, operation_t::connect, errors::timed_out); |\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+|\terror_code ignore; |\n+|\tm_socks5_sock.close(ignore); |\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+|\t++m_failures; |\n+|\tretry_connection(); |\n+|} |\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+|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 |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@@ -8897,49 +9382,366 @@\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-|_\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+|_\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\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+|\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/ |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-|\t\t\tm_thread->join(); |\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/_\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\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+| |\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} |\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+|\tsettings_pack default_settings() |\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\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+| |\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+| |\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+| |\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 callbacks; |\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+| |\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/_\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+|\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+|\t\t\t\t, static_cast(j->piece), j->d.io.offset |\n+|\t\t\t\t, j->storage ? j->storage->num_outstanding_jobs() : -1); |\n+|\t\t} |\n |#endif |\n+| |\n+|\t\tstd::shared_ptr storage = j->storage; |\n+| |\n+|\t\tTORRENT_ASSERT(static_cast(j->action) < int(job_functions.size())); |\n+| |\n+|\t\tm_stats_counters.inc_stats_counter(counters::num_running_disk_jobs, 1); |\n+| |\n+|\t\t// call disk function |\n+|status_t ret = status_t::no_error; |\n+|try |\n+|\t\t{ |\n+|\t\t\tint const idx = static_cast(j->action); |\n+|\t\t\tret = (this->*(job_functions[static_cast(idx)]))(j); |\n+|\t\t} |\n+|\t\tcatch (boost::system::system_error const& err) |\n+|\t\t{ |\n+|\t\t\tret = status_t::fatal_disk_error; |\n+|\t\t\tj->error.ec = err.code(); |\n+|\t\t\tj->error.operation = operation_t::exception; |\n+|\t\t} |\n+|\t\tcatch (std::bad_alloc const&) |\n+|\t\t{ |\n+|\t\t\tret = status_t::fatal_disk_error; |\n+|\t\t\tj->error.ec = errors::no_memory; |\n+|\t\t\tj->error.operation = operation_t::exception; |\n+|\t\t} |\n+|\t\tcatch (std::exception const&) |\n+|\t\t{ |\n+|\t\t\tret = status_t::fatal_disk_error; |\n+|\t\t\tj->error.ec = boost::asio::error::fault; |\n+|\t\t\tj->error.operation = operation_t::exception; |\n+|\t\t} |\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+|_\b\t_\b\t_\bm_\b__\bs_\bt_\ba_\bt_\bs_\b__\bc_\bo_\bu_\bn_\bt_\be_\br_\bs_\b._\bi_\bn_\bc_\b__\bs_\bt_\ba_\bt_\bs_\b__\bc_\bo_\bu_\bn_\bt_\be_\br_\b(_\bc_\bo_\bu_\bn_\bt_\be_\br_\bs_\b:_\b:_\bn_\bu_\bm_\b__\br_\bu_\bn_\bn_\bi_\bn_\bg_\b__\bd_\bi_\bs_\bk_\b__\bj_\bo_\bb_\bs_\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 |\n+|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\bm_\bm_\ba_\bp_\b__\bd_\bi_\bs_\bk_\b__\bi_\bo_\b._\bc_\bp_\bp_\b:_\b1_\b0_\b1_\b7 |this 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 |\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|_\bt_\bh_\be_\b _\bc_\bo_\bm_\bp_\bl_\be_\bx_\bi_\bt_\by_\b _\ba_\bn_\bd_\b _\bc_\bo_\bs_\bt_\b _\bj_\bu_\bs_\bt_\b _\bf_\bo_\br_\b _\bt_\bh_\be_\b _\be_\bd_\bg_\be_\b _\bc_\ba_\bs_\be_\b _\bo_\bf_\b _\br_\be_\bc_\be_\bi_\bv_\bi_\bn_\bg_\b _\ba_\b _\bc_\bo_\br_\br_\bu_\bp_\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 |\n+|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs i\bis\bs p\bpo\bot\bte\ben\bnt\bti\bia\bal\bll\bly\by v\bve\ber\bry\by e\bex\bxp\bpe\ben\bns\bsi\biv\bve\be.\b. O\bOn\bne\be w\bwa\bay\by t\bto\bo s\bso\bol\blv\bve\be i\bit\bt w\bwo\bou\bul\bld\bd b\bbe\be t\bto\bo h\bha\bav\bve\be a\ba f\bfe\ben\bnc\bce\be f\bfo\bor\br j\bju\bus\bst\bt t\bth\bhi\bis\bs o\bon\bne\be p\bpi\bie\bec\bce\be.\b. b\bbu\but\bt i\bit\bt h\bha\bar\brd\bdl\bly\by s\bse\bee\bem\bms\bs w\bwo\bor\brt\bth\bh t\bth\bhe\be c\bco\bom\bmp\bpl\ble\bex\bxi\bit\bty\by a\ban\bnd\bd c\bco\bos\bst\bt j\bju\bus\bst\bt f\bfo\bor\br t\bth\bhe\be |\n+|e\bed\bdg\bge\be c\bca\bas\bse\be o\bof\bf r\bre\bec\bce\bei\biv\bvi\bin\bng\bg a\ba c\bco\bor\brr\bru\bup\bpt\bt p\bpi\bie\bec\bce\be *\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:1\b10\b01\b17\b7 *\b**\b**\b* |\n+|aux::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+|\t\tadd_fence_job(j); |\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+|\tvoid mmap_disk_io::async_clear_piece(storage_index_t const storage |\n+|\t\t, piece_index_t const index, std::function handler) |\n+|\t{ |\n+|\t\taux::mmap_disk_job* j = m_job_pool.allocate_job(aux::job_action_t::clear_piece); |\n+|\t\tj->storage = m_torrents[storage]->shared_from_this(); |\n+|\t\tj->piece = index; |\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+|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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/_\bm_\bm_\ba_\bp_\b__\bd_\bi_\bs_\bk_\b__\bi_\bo_\b._\bc_\bp_\bp_\b:_\b1_\b0_\b2_\b2 |Perhaps the job queue could be traversed and all jobs for this piece could be cancelled. If there are no threads currently writing |\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|_\bt_\bo_\b _\bt_\bh_\bi_\bs_\b _\bp_\bi_\be_\bc_\be_\b,_\b _\bw_\be_\b _\bc_\bo_\bu_\bl_\bd_\b _\bs_\bk_\bi_\bp_\b _\bt_\bh_\be_\b _\bf_\be_\bn_\bc_\be_\b _\ba_\bl_\bt_\bo_\bg_\be_\bt_\bh_\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 |\n+|*\b**\b**\b**\b**\b* P\bPe\ber\brh\bha\bap\bps\bs t\bth\bhe\be j\bjo\bob\bb q\bqu\bue\beu\bue\be c\bco\bou\bul\bld\bd b\bbe\be t\btr\bra\bav\bve\ber\brs\bse\bed\bd a\ban\bnd\bd a\bal\bll\bl j\bjo\bob\bbs\bs f\bfo\bor\br t\bth\bhi\bis\bs p\bpi\bie\bec\bce\be c\bco\bou\bul\bld\bd b\bbe\be c\bca\ban\bnc\bce\bel\bll\ble\bed\bd.\b. I\bIf\bf t\bth\bhe\ber\bre\be a\bar\bre\be n\bno\bo t\bth\bhr\bre\bea\bad\bds\bs c\bcu\bur\brr\bre\ben\bnt\btl\bly\by w\bwr\bri\bit\bti\bin\bng\bg t\bto\bo t\bth\bhi\bis\bs p\bpi\bie\bec\bce\be,\b, w\bwe\be c\bco\bou\bul\bld\bd s\bsk\bki\bip\bp t\bth\bhe\be f\bfe\ben\bnc\bce\be|\n+|a\bal\blt\bto\bog\bge\bet\bth\bhe\ber\br *\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:1\b10\b02\b22\b2 *\b**\b**\b* |\n+|j->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+| |\n+|\tvoid mmap_disk_io::async_clear_piece(storage_index_t const storage |\n+|\t\t, piece_index_t const index, std::function handler) |\n+|\t{ |\n+|\t\taux::mmap_disk_job* j = m_job_pool.allocate_job(aux::job_action_t::clear_piece); |\n+|\t\tj->storage = m_torrents[storage]->shared_from_this(); |\n+|\t\tj->piece = index; |\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+|add_fence_job(j); |\n+|} |\n+| |\n+|\tstatus_t mmap_disk_io::do_hash(aux::mmap_disk_job* j) |\n+|\t{ |\n+|\t\t// we're not using a cache. This is the simple path |\n+|\t\t// just read straight from the file |\n+|\t\tTORRENT_ASSERT(m_magic == 0x1337); |\n+| |\n+|\t\tbool const v1 = bool(j->flags & disk_interface::v1_hash); |\n+|\t\tbool const v2 = !j->d.h.block_hashes.empty(); |\n+| |\n+|\t\tint const piece_size = v1 ? j->storage->files().piece_size(j->piece) : 0; |\n+|\t\tint const piece_size2 = v2 ? j->storage->files().piece_size2(j->piece) : 0; |\n+|\t\tint const blocks_in_piece = v1 ? (piece_size + default_block_size - 1) / default_block_size : 0; |\n+|\t\tint const blocks_in_piece2 = v2 ? j->storage->files().blocks_in_piece2(j->piece) : 0; |\n+|\t\taux::open_mode_t const file_mode = file_mode_for_job(j); |\n+| |\n+|\t\tTORRENT_ASSERT(!v2 || int(j->d.h.block_hashes.size()) >= blocks_in_piece2); |\n+|\t\tTORRENT_ASSERT(v1 || v2); |\n+| |\n+|\t\thasher h; |\n+|\t\tint ret = 0; |\n+|\t\tint offset = 0; |\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/_\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@@ -8986,418 +9788,373 @@\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-|_\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+|_\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-|\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+|\t\tmerkle_validate_copy(t, m_tree, root(), m_block_verified); |\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+|\t\tload_verified_bits(verified); |\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\toptimize_storage(); |\n+|\t\toptimize_storage_piece_layer(); |\n |\t} |\n | |\n-|#if TORRENT_ABI_VERSION <= 2 |\n-|\tchar const* file_storage::file_name_ptr(file_index_t const index) const |\n+|\tvoid merkle_tree::clear() |\n |\t{ |\n-|\t\treturn m_files[index].name; |\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-|\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+|namespace { |\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+|struct identity |\n+|{ |\n+|\t\tbool operator()(bool b) const { return b; } |\n+|\t}; |\n |} |\n | |\n-|\tvoid file_storage::canonicalize_impl(bool const backwards_compatible) |\n+|\tvoid merkle_tree::load_sparse_tree(span t |\n+|\t\t, std::vector const& mask |\n+|\t\t, std::vector const& verified) |\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+|\t\tINVARIANT_CHECK; |\n+|\t\tTORRENT_ASSERT(mask.size() == size()); |\n+|\t\tif (size() != mask.size()) return; |\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+|\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-|// 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// 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// 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+|\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\taux::vector new_files; |\n-|\t\taux::vector new_file_hashes; |\n-|\t\taux::vector new_mtime; |\n+|\t\t\t// discrepancy |\n+|\t\t\tif (t.size() < block_index + m_num_blocks) |\n+|_\b\t_\b\t_\b\t_\b\t_\br_\be_\bt_\bu_\br_\bn_\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 |\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:_\b3_\b1_\b9_\b _\b _\b _\b _\b|_\bt_\bh_\bi_\bs_\b _\bc_\ba_\bn_\b _\bb_\be_\b _\bo_\bp_\bt_\bi_\bm_\bi_\bz_\be_\bd_\b _\bb_\by_\b _\bu_\bs_\bi_\bn_\bg_\b _\bm_\b__\bt_\br_\be_\be_\b _\ba_\bs_\b _\bs_\bt_\bo_\br_\ba_\bg_\be_\b _\bt_\bo_\b _\bf_\bi_\bl_\bl_\b _\bt_\bh_\bi_\bs_\b _\bt_\br_\be_\be_\b _\bi_\bn_\bt_\bo_\b,_\b _\ba_\bn_\bd_\b _\bt_\bh_\be_\bn_\b _\bc_\bl_\be_\ba_\br_\b _\bi_\bt_\b _\bi_\bf_\b _\bt_\bh_\be_\b _\bh_\ba_\bs_\bh_\be_\bs_\b _\bf_\ba_\bi_\bl_\b _\b _\b _\b _\b _\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\bby\by u\bus\bsi\bin\bng\bg m\bm_\b_t\btr\bre\bee\be a\bas\bs s\bst\bto\bor\bra\bag\bge\be t\bto\bo f\bfi\bil\bll\bl t\bth\bhi\bis\bs t\btr\bre\bee\be i\bin\bnt\bto\bo,\b, a\ban\bnd\bd t\bth\bhe\ben\bn c\bcl\ble\bea\bar\br i\bit\bt i\bif\bf t\bth\bhe\be h\bha\bas\bsh\bhe\bes\bs f\bfa\bai\bil\bl *\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:3\b31\b19\b9 *\b**\b**\b* |\n+|{ |\n+|\t\tINVARIANT_CHECK; |\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+|\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// 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// 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\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+|\t\tallocate_full(); |\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+|int const leaf_count = merkle_num_leafs(int(hashes.size())); |\n+|aux::vector tree(merkle_num_nodes(leaf_count)); |\n+|\t\tstd::copy(hashes.begin(), hashes.end(), tree.end() - leaf_count); |\n | |\n-|\t\tfor (auto const i : file_range()) |\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\tif (!(file_flags(i) & file_storage::flag_symlink)) continue; |\n-| |\n-|\t\t\tif (!file_map_initialized) |\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\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\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\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-|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+|\t\tmerkle_fill_tree(tree, leaf_count); |\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+|\t\tint const base_num_layers = merkle_num_layers(leaf_count); |\n | |\n-|\t\tpost(m_ios, [h = std::move(handler)] { h(storage_error{}); }); |\n-|\t\treturn false; |\n-|\t} |\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-|\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+|\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+|_\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_\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:_\b3_\b6_\b7_\b _\b _\b _\b _\b|_\ba_\b _\bp_\bi_\be_\bc_\be_\b _\bo_\bu_\bt_\bs_\bi_\bd_\be_\b _\bo_\bf_\b _\bt_\bh_\bi_\bs_\b _\br_\ba_\bn_\bg_\be_\b _\bm_\ba_\by_\b _\ba_\bl_\bs_\bo_\b _\bf_\ba_\bi_\bl_\b,_\b _\bi_\bf_\b _\bo_\bn_\be_\b _\bo_\bf_\b _\bt_\bh_\be_\b _\bu_\bn_\bc_\bl_\be_\b _\bh_\ba_\bs_\bh_\be_\bs_\b _\bi_\bs_\b _\ba_\bt_\b _\bt_\bh_\be_\b _\bl_\ba_\by_\be_\br_\b _\br_\bi_\bg_\bh_\bt_\b _\ba_\bb_\bo_\bv_\be_\b _\bt_\bh_\be_\b _\bb_\bl_\bo_\bc_\bk_\b _\bh_\ba_\bs_\bh_\be_\bs_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n+|*\b**\b**\b**\b**\b* a\ba p\bpi\bie\bec\bce\be o\bou\but\bts\bsi\bid\bde\be o\bof\bf t\bth\bhi\bis\bs r\bra\ban\bng\bge\be m\bma\bay\by a\bal\bls\bso\bo f\bfa\bai\bil\bl,\b, i\bif\bf o\bon\bne\be o\bof\bf t\bth\bhe\be u\bun\bnc\bcl\ble\be h\bha\bas\bsh\bhe\bes\bs i\bis\bs a\bat\bt t\bth\bhe\be l\bla\bay\bye\ber\br r\bri\big\bgh\bht\bt a\bab\bbo\bov\bve\be t\bth\bhe\be b\bbl\blo\boc\bck\bk h\bha\bas\bsh\bhe\bes\bs *\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:3\b36\b67\b7 *\b**\b**\b* |\n+|int const insert_root_idx = dest_start_idx >> base_num_layers; |\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+|\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-|\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+|\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-|\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+|\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-|\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+|\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-|\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/_\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+|for (int layer_size = leaf_count; layer_size != 0; layer_size /= 2) |\n+|{ |\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+|\t\t\t\t\tif (m_tree[dst_idx] != tree[src_idx]) |\n+|\t\t\t\t\t{ |\n+|\t\t\t\t\t\t// this must be a block hash because inner nodes are not filled in until |\n+|\t\t\t\t\t\t// they can be verified. This assert ensures we're at the |\n+|\t\t\t\t\t\t// leaf layer of the file tree |\n+|\t\t\t\t\t\tTORRENT_ASSERT(dst_idx >= first_leaf); |\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+|\t\t\t\t\t\tint const pos = dst_idx - first_leaf; |\n+|\t\t\t\t\t\tauto const piece = piece_index_t{pos >> m_blocks_per_piece_log} + file_piece_offset; |\n+|\t\t\t\t\t\tint const block = pos & ((1 << m_blocks_per_piece_log) - 1); |\n | |\n-|*/ |\n+|\t\t\t\t\t\tTORRENT_ASSERT(pos < m_num_blocks); |\n+|\t\t\t\t\t\tif (!ret.failed.empty() && ret.failed.back().first == piece) |\n+|\t\t\t\t\t\t\tret.failed.back().second.push_back(block); |\n+|\t\t\t\t\t\telse |\n+|\t\t\t\t\t\t\tret.failed.emplace_back(piece, std::vector{block}); |\n | |\n-|#include \"libtorrent/aux_/ip_notifier.hpp\" |\n-|#include \"libtorrent/assert.hpp\" |\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+|_\b\t_\b\t_\b\t_\b\t_\b\t_\be_\bl_\bs_\be_\b _\bi_\bf_\b _\b(_\bd_\bs_\bt_\b__\bi_\bd_\bx_\b _\b>_\b=_\b _\bf_\bi_\br_\bs_\bt_\b__\bl_\be_\ba_\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 |\n+|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\bm_\be_\br_\bk_\bl_\be_\b__\bt_\br_\be_\be_\b._\bc_\bp_\bp_\b:_\b4_\b4_\b7 |instead of overwriting the root and comparing it against hashes[], write a functions that *validates* a tree by just filling it up |\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|_\bt_\bo_\b _\bt_\bh_\be_\b _\bl_\be_\bv_\be_\bl_\b _\bb_\be_\bl_\bo_\bw_\b _\bt_\bh_\be_\b _\br_\bo_\bo_\bt_\b _\ba_\bn_\bd_\b _\bt_\bh_\be_\bn_\b _\bv_\ba_\bl_\bi_\bd_\ba_\bt_\be_\bs_\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 |\n+|*\b**\b**\b**\b**\b* i\bin\bns\bst\bte\bea\bad\bd o\bof\bf o\bov\bve\ber\brw\bwr\bri\bit\bti\bin\bng\bg t\bth\bhe\be r\bro\boo\bot\bt a\ban\bnd\bd c\bco\bom\bmp\bpa\bar\bri\bin\bng\bg i\bit\bt a\bag\bga\bai\bin\bns\bst\bt h\bha\bas\bsh\bhe\bes\bs[\b[]\b],\b, w\bwr\bri\bit\bte\be a\ba f\bfu\bun\bnc\bct\bti\bio\bon\bns\bs t\bth\bha\bat\bt *\b*v\bva\bal\bli\bid\bda\bat\bte\bes\bs*\b* a\ba t\btr\bre\bee\be b\bby\by j\bju\bus\bst\bt f\bfi\bil\bll\bli\bin\bng\bg i\bit\bt u\bup\bp t\bto\bo t\bth\bhe\be l\ble\bev\bve\bel\bl b\bbe\bel\blo\bow\bw t\bth\bhe\be r\bro\boo\bot\bt a\ban\bnd\bd t\bth\bhe\ben\bn |\n+|v\bva\bal\bli\bid\bda\bat\bte\bes\bs i\bit\bt.\b. *\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:4\b44\b47\b7 *\b**\b**\b* |\n+|&& dest_start_idx < first_piece_idx + num_pieces()) |\n+|\t\t{ |\n+|\t\t\tint const blocks_in_piece = 1 << base; |\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+|\t\t\t// it may now be possible to verify the hashes of previously received blocks |\n+|\t\t\t// try to verify as many child nodes of the received hashes as possible |\n+|\t\t\tfor (int i = 0; i < int(hashes.size()); ++i) |\n+|\t\t\t{ |\n+|\t\t\t\tint const piece = dest_start_idx + i; |\n+|\t\t\t\tif (piece - first_piece_idx >= num_pieces()) |\n+|\t\t\t\t\tbreak; |\n+|\t\t\t\t// the first block in this piece |\n+|\t\t\t\tint const block_idx = merkle_get_first_child(piece, base); |\n | |\n-|#include \"libtorrent/aux_/netlink_utils.hpp\" |\n+|\t\t\t\tint const block_end_idx = std::min(block_idx + blocks_in_piece, first_leaf + m_num_blocks); |\n+|\t\t\t\tif (std::any_of(m_tree.begin() + block_idx |\n+|\t\t\t\t\t, m_tree.begin() + block_end_idx |\n+|\t\t\t\t\t, [](sha256_hash const& h) { return h.is_all_zeros(); })) |\n+|\t\t\t\t\tcontinue; |\n | |\n-|namespace libtorrent { namespace aux { |\n+|merkle_fill_tree(m_tree, blocks_in_piece, block_idx); |\n+|if (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 | |\n-|namespace { |\n+|\t\t\t\t\t// an empty blocks vector indicates that we don't have the |\n+|\t\t\t\t\t// block hashes, and we can't know which block failed |\n+|\t\t\t\t\t// this will cause the block hashes to be requested |\n+|\t\t\t\t\tret.failed.emplace_back(piece_index_t{piece - first_piece_idx} + file_piece_offset |\n+|\t\t\t\t\t\t, std::vector()); |\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+|_\b\t_\b\t_\b\t_\b\t_\b\t_\bi_\bn_\bt_\b _\bc_\bo_\bn_\bs_\bt_\b _\bl_\be_\ba_\bf_\bs_\b__\be_\bn_\bd_\b _\b=_\b _\bs_\bt_\bd_\b:_\b:_\bm_\bi_\bn_\b(_\bm_\b__\bn_\bu_\bm_\b__\bb_\bl_\bo_\bc_\bk_\bs_\b,_\b _\bl_\be_\ba_\bf_\bs_\b__\bs_\bt_\ba_\br_\bt_\b _\b+_\b _\bb_\bl_\bo_\bc_\bk_\bs_\b__\bi_\bn_\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 |\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:_\b4_\b7_\b1_\b _\b _\b _\b _\b|_\bt_\bh_\bi_\bs_\b _\bc_\bo_\bu_\bl_\bd_\b _\bb_\be_\b _\bd_\bo_\bn_\be_\b _\bm_\bo_\br_\be_\b _\be_\bf_\bf_\bi_\bc_\bi_\be_\bn_\bt_\bl_\by_\b _\bi_\bf_\b _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd_\b _\bh_\ba_\bd_\b _\ba_\b _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn_\b _\bt_\bo_\b _\bs_\be_\bt_\b _\ba_\b _\br_\ba_\bn_\bg_\be_\b _\bo_\bf_\b _\bb_\bi_\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 |\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 i\bif\bf b\bbi\bit\btf\bfi\bie\bel\bld\bd h\bha\bad\bd a\ba f\bfu\bun\bnc\bct\bti\bio\bon\bn t\bto\bo s\bse\bet\bt a\ba r\bra\ban\bng\bge\be o\bof\bf b\bbi\bit\bts\bs *\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:4\b47\b71\b1 *\b**\b**\b* |\n+|merkle_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 | |\n-|#if (TORRENT_USE_SYSTEMCONFIGURATION || TORRENT_USE_SC_NETWORK_REACHABILITY) && \\ |\n-|\t!defined TORRENT_BUILD_SIMULATOR |\n+|\t\t\t\t\t// an empty blocks vector indicates that we don't have the |\n+|\t\t\t\t\t// block hashes, and we can't know which block failed |\n+|\t\t\t\t\t// this will cause the block hashes to be requested |\n+|\t\t\t\t\tret.failed.emplace_back(piece_index_t{piece - first_piece_idx} + file_piece_offset |\n+|\t\t\t\t\t\t, std::vector()); |\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+|for (int k = leafs_start; k < leafs_end; ++k) |\n+|m_block_verified.set_bit(k); |\n+|\t\t\t\t} |\n+|\t\t\t\tTORRENT_ASSERT((piece - first_piece_idx) >= 0); |\n+|\t\t\t} |\n+|\t\t} |\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-|_\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+|\t\toptimize_storage(); |\n | |\n-|#if defined TORRENT_ANDROID && !defined IFA_F_DADFAILED |\n-|#define IFA_F_DADFAILED 8 |\n-|#endif |\n+|\t\treturn ret; |\n+|\t} |\n | |\n+|\tstd::tuple merkle_tree::set_block(int const block_index |\n+|\t\t, sha256_hash const& h) |\n+|\t{ |\n+|#ifdef TORRENT_EXPENSIVE_INVARIANT_CHECKS |\n+|\t\tINVARIANT_CHECK; |\n |#endif |\n+|\t\tTORRENT_ASSERT(block_index < m_num_blocks); |\n | |\n-|#if TORRENT_USE_IFADDRS |\n-|#include |\n-|#include |\n-|#include |\n-|#endif |\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\tauto const block_tree_index = first_leaf + block_index; |\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+|\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+|_\b\t_\b\t_\b\t_\b\t_\br_\be_\bt_\bu_\br_\bn_\b _\bs_\bt_\bd_\b:_\b:_\bm_\ba_\bk_\be_\b__\bt_\bu_\bp_\bl_\be_\b(_\bs_\be_\bt_\b__\bb_\bl_\bo_\bc_\bk_\b__\br_\be_\bs_\bu_\bl_\bt_\b:_\b:_\bb_\bl_\bo_\bc_\bk_\b__\bh_\ba_\bs_\bh_\b__\bf_\ba_\bi_\bl_\be_\bd_\b,_\b _\bb_\bl_\bo_\bc_\bk_\b__\bi_\bn_\bd_\be_\bx_\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 |\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:_\b5_\b1_\b4_\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_\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 _\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\bg 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/m\bme\ber\brk\bkl\ble\be_\b_t\btr\bre\bee\be.\b.c\bcp\bpp\bp:\b:5\b51\b14\b4 *\b**\b**\b* |\n+|auto const first_leaf = merkle_first_leaf(num_leafs); |\n+|\t\tauto const block_tree_index = first_leaf + block_index; |\n | |\n-|#include \"libtorrent/aux_/disable_warnings_pop.hpp\" |\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+|\t\t} |\n | |\n-|#if defined(TORRENT_OS2) && !defined(IF_NAMESIZE) |\n-|#define IF_NAMESIZE IFNAMSIZ |\n-|#endif |\n+|\t\tallocate_full(); |\n | |\n-|namespace libtorrent { |\n+|\t\tm_tree[block_tree_index] = h; |\n | |\n-|namespace { |\n+|\t\t// to avoid wasting a lot of time hashing nodes only to discover they |\n+|\t\t// cannot be verified, check first to see if the root of the largest |\n+|\t\t// computable subtree is known |\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+|int leafs_start; |\n+|int leafs_size; |\n+|\t\tint root_index; |\n+|\t\tstd::tie(leafs_start, leafs_size, root_index) = |\n+|\t\t\tmerkle_find_known_subtree(m_tree, block_index, m_num_blocks); |\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+|\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-|#if TORRENT_USE_NETLINK |\n+|\t\t// save the root hash because merkle_fill_tree will overwrite it |\n+|\t\tsha256_hash const root = m_tree[root_index]; |\n+|\t\tmerkle_fill_tree(m_tree, leafs_size, first_leaf + leafs_start); |\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\tif (root != m_tree[root_index]) |\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\t\t// hash failure, clear all the internal nodes |\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+|_\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/_\bm_\be_\br_\bk_\bl_\be_\b__\bt_\br_\be_\be_\b._\bc_\bp_\bp_\b:_\b5_\b3_\b9_\b _\b _\b _\b _\b|_\bt_\bh_\bi_\bs_\b _\bc_\bo_\bu_\bl_\bd_\b _\bb_\be_\b _\bd_\bo_\bn_\be_\b _\bm_\bo_\br_\be_\b _\be_\bf_\bf_\bi_\bc_\bi_\be_\bn_\bt_\bl_\by_\b _\bi_\bf_\b _\bb_\bi_\bt_\bf_\bi_\be_\bl_\bd_\b _\bh_\ba_\bd_\b _\ba_\b _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn_\b _\bt_\bo_\b _\bs_\be_\bt_\b _\ba_\b _\br_\ba_\bn_\bg_\be_\b _\bo_\bf_\b _\bb_\bi_\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 |\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 i\bif\bf b\bbi\bit\btf\bfi\bie\bel\bld\bd h\bha\bad\bd a\ba f\bfu\bun\bnc\bct\bti\bio\bon\bn t\bto\bo s\bse\bet\bt a\ba r\bra\ban\bng\bge\be o\bof\bf b\bbi\bit\bts\bs *\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:5\b53\b39\b9 *\b**\b**\b* |\n+|merkle_find_known_subtree(m_tree, block_index, m_num_blocks); |\n | |\n-|\t\t\tauto const* nl_hdr = reinterpret_cast(buf.data()); |\n-|\t\t\tint len = read_len; |\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\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\t// save the root hash because merkle_fill_tree will overwrite it |\n+|\t\tsha256_hash const root = m_tree[root_index]; |\n+|\t\tmerkle_fill_tree(m_tree, leafs_size, first_leaf + leafs_start); |\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\tif (root != m_tree[root_index]) |\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-| |\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+|\t\t\t// hash failure, clear all the internal nodes |\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-|\t\t\t\tif (nl_hdr->nlmsg_type == NLMSG_DONE) return 0; |\n+|int const leafs_end = std::min(m_num_blocks, leafs_start + leafs_size); |\n+|for (int i = leafs_start; i < leafs_end; ++i) |\n+|\t\t\tm_block_verified.set_bit(i); |\n | |\n-|\t\t\t\ton_msg(nl_hdr); |\n+|\t\t// attempting to optimize storage is quite costly, only do it if we have |\n+|\t\t// a reason to believe it might have an effect |\n+|\t\tif (block_index == m_num_blocks - 1 || !m_tree[block_tree_index + 1].is_all_zeros()) |\n+|\t\t\toptimize_storage(); |\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+|\t\treturn std::make_tuple(set_block_result::ok, leafs_start, leafs_size); |\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+|\tstd::size_t merkle_tree::size() const |\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+|\t\treturn static_cast(merkle_num_nodes(merkle_num_leafs(m_num_blocks))); |\n+|\t} |\n | |\n-|\t\tif (::send(sock, request_msg, request_msg->nlmsg_len, 0) < 0) |\n-|\t\t\treturn -1; |\n+|\tint merkle_tree::num_pieces() const |\n+|\t{ |\n+|\t\tint const ps = blocks_per_piece(); |\n+|\t\tTORRENT_ASSERT(ps > 0); |\n+|\t\treturn (m_num_blocks + ps - 1) >> m_blocks_per_piece_log; |\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+|\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 |_\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@@ -9704,826 +10461,227 @@\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/_\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-|\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+|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-|#ifndef TORRENT_DISABLE_LOGGING |\n-|\t\tsession_log(\"start session\"); |\n-|#endif |\n-| |\n-|#if TORRENT_USE_SSL |\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-|X509_STORE* store = X509_STORE_new(); |\n-|if (store) |\n-|\t\t{ |\n-|\t\t\tHCERTSTORE system_store = CertOpenSystemStoreA(0, \"ROOT\"); |\n-|\t\t\t// this is best effort |\n-|\t\t\tif (system_store) |\n-|\t\t\t{ |\n-|\t\t\t\tCERT_CONTEXT const* ctx = nullptr; |\n-|\t\t\t\twhile ((ctx = CertEnumCertificatesInStore(system_store, ctx)) != nullptr) |\n-|\t\t\t\t{ |\n-|\t\t\t\t\tunsigned char const* cert_ptr = reinterpret_cast(ctx->pbCertEncoded); |\n-|\t\t\t\t\tX509* x509 = d2i_X509(nullptr, &cert_ptr, ctx->cbCertEncoded); |\n-|\t\t\t\t\t// this is best effort |\n-|\t\t\t\t\tif (!x509) continue; |\n-|\t\t\t\t\tX509_STORE_add_cert(store, x509); |\n-|\t\t\t\t\tX509_free(x509); |\n-|\t\t\t\t} |\n-|\t\t\t\tCertFreeCertificateContext(ctx); |\n-|\t\t\t\tCertCloseStore(system_store, 0); |\n-|\t\t\t} |\n-|\t\t} |\n-| |\n-|\t\tSSL_CTX* ssl_ctx = m_ssl_ctx.native_handle(); |\n-|\t\tSSL_CTX_set_cert_store(ssl_ctx, store); |\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-|_\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-|_\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:_\b1_\b4_\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 _\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\bes\bss\bsi\bio\bon\bn_\b_i\bim\bmp\bpl\bl.\b.c\bcp\bpp\bp:\b:1\b14\b48\b84\b4 *\b**\b**\b* |\n-|bandwidth_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-|\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// session_impl is responsible for deleting 'pack' |\n-|\tvoid session_impl::apply_settings_pack(std::shared_ptr pack) |\n-|\t{ |\n |\t\tINVARIANT_CHECK; |\n-|\t\tapply_settings_pack_impl(*pack); |\n-|\t} |\n-| |\n-|\tsettings_pack session_impl::get_settings() const |\n-|\t{ |\n-|\t\tsettings_pack ret; |\n-|for (int i = settings_pack::string_type_base; |\n-|i < settings_pack::max_string_setting_internal; ++i) |\n-|\t\t{ |\n-|\t\t\tret.set_str(i, m_settings.get_str(i)); |\n-|\t\t} |\n-|\t\tfor (int i = settings_pack::int_type_base; |\n-|\t\t\ti < settings_pack::max_int_setting_internal; ++i) |\n-|\t\t{ |\n-|\t\t\tret.set_int(i, m_settings.get_int(i)); |\n-|\t\t} |\n-|\t\tfor (int i = settings_pack::bool_type_base; |\n-|\t\t\ti < settings_pack::max_bool_setting_internal; ++i) |\n-|\t\t{ |\n-|\t\t\tret.set_bool(i, m_settings.get_bool(i)); |\n-|\t\t} |\n-|\t\treturn ret; |\n-|\t} |\n-| |\n-|namespace { |\n-|\ttemplate |\n-|\tint get_setting_impl(Pack const& p, int name, int*) |\n-|\t{ return p.get_int(name); } |\n-| |\n-|\ttemplate |\n-|\tbool get_setting_impl(Pack const& p, int name, bool*) |\n-|\t{ return p.get_bool(name); } |\n-| |\n-|\ttemplate |\n-|\tstd::string get_setting_impl(Pack const& p, int name, std::string*) |\n-|_\b\t_\b{_\b _\br_\be_\bt_\bu_\br_\bn_\b _\bp_\b._\bg_\be_\bt_\b__\bs_\bt_\br_\b(_\bn_\ba_\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 _\b _\b _\b _\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_\be_\bs_\bs_\bi_\bo_\bn_\b__\bi_\bm_\bp_\bl_\b._\bc_\bp_\bp_\b:_\b1_\b9_\b9_\b8 |could this function be merged with expand_unspecified_addresses? right now both listen_endpoint_t and listen_interface_t are almost |\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_\bd_\be_\bn_\bt_\bi_\bc_\ba_\bl_\b,_\b _\bm_\ba_\by_\bb_\be_\b _\bt_\bh_\be_\b _\bl_\ba_\bt_\bt_\be_\br_\b _\bc_\bo_\bu_\bl_\bd_\b _\bb_\be_\b _\br_\be_\bm_\bo_\bv_\be_\bd_\b _\bt_\bo_\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 |\n-|*\b**\b**\b**\b**\b* c\bco\bou\bul\bld\bd t\bth\bhi\bis\bs f\bfu\bun\bnc\bct\bti\bio\bon\bn b\bbe\be m\bme\ber\brg\bge\bed\bd w\bwi\bit\bth\bh e\bex\bxp\bpa\ban\bnd\bd_\b_u\bun\bns\bsp\bpe\bec\bci\bif\bfi\bie\bed\bd_\b_a\bad\bdd\bdr\bre\bes\bss\bse\bes\bs?\b? r\bri\big\bgh\bht\bt n\bno\bow\bw b\bbo\bot\bth\bh l\bli\bis\bst\bte\ben\bn_\b_e\ben\bnd\bdp\bpo\boi\bin\bnt\bt_\b_t\bt a\ban\bnd\bd l\bli\bis\bst\bte\ben\bn_\b_i\bin\bnt\bte\ber\brf\bfa\bac\bce\be_\b_t\bt a\bar\bre\be a\bal\blm\bmo\bos\bst\bt i\bid\bde\ben\bnt\bti\bic\bca\bal\bl,\b, m\bma\bay\byb\bbe\be t\bth\bhe\be l\bla\bat\btt\bte\ber\br c\bco\bou\bul\bld\bd b\bbe\be |\n-|r\bre\bem\bmo\bov\bve\bed\bd t\bto\boo\bo *\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:1\b19\b99\b98\b8 *\b**\b**\b* |\n-|session_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-|\tvoid session_impl::on_ip_change(error_code const& ec) |\n-|\t{ |\n-|#ifndef TORRENT_DISABLE_LOGGING |\n-|\t\tif (!ec) |\n-|\t\t\tsession_log(\"received ip change from internal ip_notifier\"); |\n-|\t\telse |\n-|\t\t\tsession_log(\"received error on_ip_change: %d, %s\", ec.value(), ec.message().c_str()); |\n-|#endif |\n-|\t\tif (ec || m_abort || !m_ip_notifier) return; |\n-|\t\tm_ip_notifier->async_wait([this] (error_code const& e) |\n-|\t\t\t{ wrap(&session_impl::on_ip_change, e); }); |\n-|\t\treopen_network_sockets({}); |\n-|\t} |\n-| |\n-|void interface_to_endpoints(listen_interface_t const& iface |\n-|, listen_socket_flags_t flags |\n-|\t\t, span const ifs |\n-|\t\t, std::vector& eps) |\n-|\t{ |\n-|\t\tflags |= iface.local ? listen_socket_t::local_network : listen_socket_flags_t{}; |\n-|\t\ttransport const ssl = iface.ssl ? transport::ssl : transport::plaintext; |\n-| |\n-|\t\t// First, check to see if it's an IP address |\n-|\t\terror_code err; |\n-|\t\taddress const adr = make_address(iface.device.c_str(), err); |\n-|\t\tif (!err) |\n-|\t\t{ |\n-|\t\t\teps.emplace_back(adr, iface.port, std::string{}, ssl, flags); |\n-|\t\t} |\n-|\t\telse |\n-|\t\t{ |\n-|\t\t\tflags |= listen_socket_t::was_expanded; |\n-| |\n-|\t\t\t// this is the case where device names a network device. We need to |\n-|\t\t\t// enumerate all IPs associated with this device |\n-|\t\t\tfor (auto const& ipface : 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 (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-|_\b\t_\b\t_\b\t_\b\t_\b\t_\b|_\b|_\b _\bi_\bs_\b__\bl_\bi_\bn_\bk_\b__\bl_\bo_\bc_\ba_\bl_\b(_\bi_\bp_\bf_\ba_\bc_\be_\b._\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be_\b__\ba_\bd_\bd_\br_\be_\bs_\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 |\n-| | |it would probably be better to do this by having a listen-socket \"version\" number that gets bumped. And instead of setting a bool to|\n-|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bi_\bm_\bp_\bl_\b._\bc_\bp_\bp_\b:_\b2_\b3_\b0_\b6 |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 |\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|_\b2_\b._\b0_\b _\bo_\br_\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 _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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 p\bpr\bro\bob\bba\bab\bbl\bly\by b\bbe\be b\bbe\bet\btt\bte\ber\br t\bto\bo d\bdo\bo t\bth\bhi\bis\bs b\bby\by h\bha\bav\bvi\bin\bng\bg a\ba l\bli\bis\bst\bte\ben\bn-\b-s\bso\boc\bck\bke\bet\bt \"\b\"v\bve\ber\brs\bsi\bio\bon\bn\"\b\" n\bnu\bum\bmb\bbe\ber\br t\bth\bha\bat\bt g\bge\bet\bts\bs b\bbu\bum\bmp\bpe\bed\bd.\b. A\bAn\bnd\bd i\bin\bns\bst\bte\bea\bad\bd o\bof\bf s\bse\bet\btt\bti\bin\bng\bg a\ba b\bbo\boo\bol\bl t\bto\bo d\bdi\bis\bsa\bab\bbl\ble\be a\ba t\btr\bra\bac\bck\bke\ber\br,\b, w\bwe\be s\bse\bet\bt t\bth\bhe\be |\n-|v\bve\ber\brs\bsi\bio\bon\bn n\bnu\bum\bmb\bbe\ber\br t\bth\bha\bat\bt i\bit\bt w\bwa\bas\bs d\bdi\bis\bsa\bab\bbl\ble\bed\bd a\bat\bt.\b. T\bTh\bhi\bis\bs c\bch\bha\ban\bng\bge\be w\bwo\bou\bul\bld\bd a\baf\bff\bfe\bec\bct\bt t\bth\bhe\be A\bAB\bBI\bI i\bin\bn 1\b1.\b.2\b2,\b, s\bso\bo s\bsh\bho\bou\bul\bld\bd b\bbe\be d\bdo\bon\bne\be i\bin\bn 2\b2.\b.0\b0 o\bor\br l\bla\bat\bte\ber\br *\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:2\b23\b30\b06\b6 *\b**\b**\b* |\n-|{ |\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-|\t\telse |\n-|\t\t{ |\n-|\t\t\t// new sockets need to map ports even if the caller did not request |\n-|\t\t\t// re-mapping |\n-|\t\t\tfor (auto const& s : new_sockets) |\n-|\t\t\t\tremap_ports(remap_natpmp_and_upnp, *s); |\n-|\t\t} |\n-| |\n-|\t\tupdate_lsd(); |\n-| |\n-|#if TORRENT_USE_I2P |\n-|\t\topen_new_incoming_i2p_connection(); |\n-|#endif |\n-| |\n-|\t\t// trackers that were not reachable, may have become reachable now. |\n-|\t\t// so clear the \"disabled\" flags to let them be tried one more time |\n-|for (auto& t : m_torrents) |\n-|t->enable_all_trackers(); |\n-|\t} |\n | |\n-|\tvoid session_impl::reopen_network_sockets(reopen_network_flags_t const options) |\n-|\t{ |\n-|\t\treopen_listen_sockets(bool(options & session_handle::reopen_map_ports)); |\n-|\t} |\n-| |\n-|\tnamespace { |\n-|\t\ttemplate |\n-|\t\tvoid map_port(MapProtocol& m, ProtoType protocol, EndpointType const& ep |\n-|\t\t\t, port_mapping_t& map_handle, std::string const& device) |\n-|\t\t{ |\n-|\t\t\tif (map_handle != port_mapping_t{-1}) m.delete_mapping(map_handle); |\n-|\t\t\tmap_handle = port_mapping_t{-1}; |\n-| |\n-|\t\t\taddress const addr = ep.address(); |\n-|\t\t\t// with IPv4 the interface might be behind NAT so we can't skip them |\n-|\t\t\t// based on the scope of the local address |\n-|\t\t\tif (addr.is_v6() && is_local(addr)) |\n-|\t\t\t\treturn; |\n-| |\n-|\t\t\t// only update this mapping if we actually have a socket listening |\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+|\t\tTORRENT_ASSERT(is_outgoing()); |\n | |\n-|\tvoid session_impl::remap_ports(remap_port_mask_t const mask |\n-|_\b\t_\b\t_\b,_\b _\bl_\bi_\bs_\bt_\be_\bn_\b__\bs_\bo_\bc_\bk_\be_\bt_\b__\bt_\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 _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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:_\b2_\b8_\b6_\b6_\b _\b _\b|_\bt_\bh_\bi_\bs_\b _\bs_\bi_\bz_\be_\b _\bn_\be_\be_\bd_\b _\bt_\bo_\b _\bb_\be_\b _\bc_\ba_\bp_\bp_\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 |\n-|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs s\bsi\biz\bze\be n\bne\bee\bed\bd t\bto\bo b\bbe\be c\bca\bap\bpp\bpe\bed\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_i\bim\bmp\bpl\bl.\b.c\bcp\bpp\bp:\b:2\b28\b86\b66\b6 *\b**\b**\b* |\n-|// handshaking |\n-|\t\t\t\treturn socket_type(ssl_stream(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-|\t\t}(); |\n+|\t\tTORRENT_ASSERT(!m_torrent.lock()->is_upload_only()); |\n | |\n-|#ifdef TORRENT_SSL_PEERS |\n-|\t\tTORRENT_ASSERT((ssl == transport::ssl) == is_ssl(c)); |\n-|#endif |\n+|\t\t// we only want left-over bandwidth |\n | |\n-|#ifdef TORRENT_SSL_PEERS |\n-|\t\tif (ssl == transport::ssl) |\n-|\t\t{ |\n-|\t\t\tTORRENT_ASSERT(is_ssl(c)); |\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\t\t// save the socket so we can cancel the handshake |\n-|auto iter = m_incoming_sockets.emplace(std::make_unique(std::move(c))).first; |\n+|\t\tif (m_port == -1 && protocol == \"http\") |\n+|\t\t\tm_port = 80; |\n | |\n-|\t\t\tauto sock = iter->get(); |\n-|\t\t\t// for SSL connections, incoming_connection() is called |\n-|\t\t\t// after the handshake is done |\n-|\t\t\tADD_OUTSTANDING_ASYNC(\"session_impl::ssl_handshake\"); |\n-|\t\t\tboost::get>(**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+|#if TORRENT_USE_SSL |\n+|\t\tif (protocol == \"https\") |\n |\t\t{ |\n-|\t\t\tincoming_connection(std::move(c)); |\n-|\t\t} |\n-|\t} |\n-| |\n-|#ifdef TORRENT_SSL_PEERS |\n-| |\n-|\tvoid session_impl::on_incoming_utp_ssl(socket_type s) |\n-|\t{ |\n-|\t\tTORRENT_ASSERT(is_ssl(s)); |\n-| |\n-|_\b\t_\b\t_\b/_\b/_\b _\bs_\ba_\bv_\be_\b _\bt_\bh_\be_\b _\bs_\bo_\bc_\bk_\be_\bt_\b _\bs_\bo_\b _\bw_\be_\b _\bc_\ba_\bn_\b _\bc_\ba_\bn_\bc_\be_\bl_\b _\bt_\bh_\be_\b _\bh_\ba_\bn_\bd_\bs_\bh_\ba_\bk_\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_\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:_\b2_\b8_\b9_\b1_\b _\b _\b|_\bt_\bh_\bi_\bs_\b _\bs_\bi_\bz_\be_\b _\bn_\be_\be_\bd_\b _\bt_\bo_\b _\bb_\be_\b _\bc_\ba_\bp_\bp_\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 |\n-|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs s\bsi\biz\bze\be n\bne\bee\bed\bd t\bto\bo b\bbe\be c\bca\bap\bpp\bpe\bed\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_i\bim\bmp\bpl\bl.\b.c\bcp\bpp\bp:\b:2\b28\b89\b91\b1 *\b**\b**\b* |\n-|// after the handshake is done |\n-|\t\t\tADD_OUTSTANDING_ASYNC(\"session_impl::ssl_handshake\"); |\n-|\t\t\tboost::get>(**iter).async_accept_handshake( |\n-|\t\t\t\t[this, sock] (error_code const& err) { ssl_handshake(err, sock); }); |\n+|\t\t\tm_ssl = true; |\n+|\t\t\tif (m_port == -1) m_port = 443; |\n |\t\t} |\n-|\t\telse |\n |#endif |\n-|\t\t{ |\n-|\t\t\tincoming_connection(std::move(c)); |\n-|\t\t} |\n-|\t} |\n-| |\n-|#ifdef TORRENT_SSL_PEERS |\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-|auto iter = m_incoming_sockets.emplace(std::make_unique(std::move(s))).first; |\n-|auto sock = iter->get(); |\n+|\t\tif (!m_basic_auth.empty()) |\n+|\t\t\tm_basic_auth = base64encode(m_basic_auth); |\n | |\n-|\t\t// for SSL connections, incoming_connection() is called |\n-|\t\t// after the handshake is done |\n-|\t\tADD_OUTSTANDING_ASYNC(\"session_impl::ssl_handshake\"); |\n-|\t\tboost::get>(**iter).async_accept_handshake( |\n-|\t\t\t[this, sock] (error_code const& err) { ssl_handshake(err, sock); }); |\n+|\t\tm_server_string = m_host; |\n+|\t\taux::verify_encoding(m_server_string); |\n |\t} |\n | |\n-|\t// to test SSL connections, one can use this openssl command template: |\n-|\t// |\n-|\t// openssl s_client -cert .pem -key .pem |\n-|\t// -CAfile .pem -debug -connect 127.0.0.1:4433 -tls1 |\n-|\t// -servername |\n-| |\n-|\tvoid session_impl::ssl_handshake(error_code const& ec, socket_type* sock) |\n+|\tint web_connection_base::timeout() const |\n |\t{ |\n-|\t\tCOMPLETE_ASYNC(\"session_impl::ssl_handshake\"); |\n-| |\n-|\t\tauto iter = m_incoming_sockets.find(sock); |\n-| |\n-|\t\t// this happens if the SSL connection is aborted because we're shutting |\n-|\t\t// down |\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-|_\b\t_\b\t_\be_\br_\br_\bo_\br_\b__\bc_\bo_\bd_\be_\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 |\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:_\b3_\b5_\b9_\b0_\b _\b _\b|_\bh_\ba_\bv_\be_\b _\ba_\b _\bs_\be_\bp_\ba_\br_\ba_\bt_\be_\b _\bl_\bi_\bs_\bt_\b _\bf_\bo_\br_\b _\bt_\bh_\be_\bs_\be_\b _\bc_\bo_\bn_\bn_\be_\bc_\bt_\bi_\bo_\bn_\bs_\b,_\b _\bi_\bn_\bs_\bt_\be_\ba_\bd_\b _\bo_\bf_\b _\bh_\ba_\bv_\bi_\bn_\bg_\b _\bt_\bo_\b _\bl_\bo_\bo_\bp_\b _\bt_\bh_\br_\bo_\bu_\bg_\bh_\b _\ba_\bl_\bl_\b _\bo_\bf_\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 |\n-|*\b**\b**\b**\b**\b* h\bha\bav\bve\be a\ba s\bse\bep\bpa\bar\bra\bat\bte\be l\bli\bis\bst\bt f\bfo\bor\br t\bth\bhe\bes\bse\be c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bns\bs,\b, i\bin\bns\bst\bte\bea\bad\bd o\bof\bf h\bha\bav\bvi\bin\bng\bg t\bto\bo l\blo\boo\bop\bp t\bth\bhr\bro\bou\bug\bgh\bh a\bal\bll\bl o\bof\bf t\bth\bhe\bem\bm *\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:3\b35\b59\b90\b0 *\b**\b**\b* |\n-|// -------------------------------------------------------------- |\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-|\t\t// -------------------------------------------------------------- |\n-|\t\t// check for incoming connections that might have timed out |\n-|\t\t// -------------------------------------------------------------- |\n-| |\n-|\t\tfor (auto i = m_connections.begin(); i != m_connections.end();) |\n-|\t\t{ |\n-|\t\t\tpeer_connection* p = (*i).get(); |\n-|\t\t\t++i; |\n-|\t\t\t// ignore connections that already have a torrent, since they |\n-|\t\t\t// are ticked through the torrents' second_tick |\n-|\t\t\tif (!p->associated_torrent().expired()) continue; |\n-| |\n-|int timeout = m_settings.get_int(settings_pack::handshake_timeout); |\n-|#if TORRENT_USE_I2P |\n-|\t\t\ttimeout *= is_i2p(p->get_socket()) ? 4 : 1; |\n-|#endif |\n-|\t\t\tif (m_last_tick - p->connected_time () > seconds(timeout)) |\n-|\t\t\t\tp->disconnect(errors::timed_out, operation_t::bittorrent); |\n-|\t\t} |\n-| |\n-|\t\t// -------------------------------------------------------------- |\n-|\t\t// second_tick every torrent (that wants it) |\n-|\t\t// -------------------------------------------------------------- |\n-| |\n-|#if TORRENT_DEBUG_STREAMING > 0 |\n-|\t\tstd::printf(\"\\033[2J\\033[0;0H\"); |\n-|#endif |\n-| |\n-|\t\taux::vector& 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-|\t\t\tTORRENT_ASSERT(t.want_tick()); |\n-|\t\t\tTORRENT_ASSERT(!t.is_aborted()); |\n-| |\n-|\t\t\tt.second_tick(tick_interval_ms); |\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-|_\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/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bi_\bm_\bp_\bl_\b._\bc_\bp_\bp_\b:_\b3_\b6_\b2_\b3_\b _\b _\b|_\bt_\bh_\bi_\bs_\b _\bs_\bh_\bo_\bu_\bl_\bd_\b _\ba_\bp_\bp_\bl_\by_\b _\bt_\bo_\b _\ba_\bl_\bl_\b _\bb_\ba_\bn_\bd_\bw_\bi_\bd_\bt_\bh_\b _\bc_\bh_\ba_\bn_\bn_\be_\bl_\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 |\n-|*\b**\b**\b**\b**\b* t\bth\bhi\bis\bs s\bsh\bho\bou\bul\bld\bd a\bap\bpp\bpl\bly\by t\bto\bo a\bal\bll\bl b\bba\ban\bnd\bdw\bwi\bid\bdt\bth\bh c\bch\bha\ban\bnn\bne\bel\bls\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:3\b36\b62\b23\b3 *\b**\b**\b* |\n-|#if TORRENT_DEBUG_STREAMING > 0 |\n-|\t\tstd::printf(\"\\033[2J\\033[0;0H\"); |\n-|#endif |\n-| |\n-|\t\taux::vector& 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-|\t\t\tTORRENT_ASSERT(t.want_tick()); |\n-|\t\t\tTORRENT_ASSERT(!t.is_aborted()); |\n-| |\n-|\t\t\tt.second_tick(tick_interval_ms); |\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-| |\n-|if (m_settings.get_bool(settings_pack::rate_limit_ip_overhead)) |\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/_\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-|\t\t\tint const up_limit = upload_rate_limit(m_global_class); |\n-|\t\t\tint const down_limit = download_rate_limit(m_global_class); |\n-| |\n-|\t\t\tif (down_limit > 0 |\n-|\t\t\t\t&& m_stat.download_ip_overhead() >= down_limit |\n-|\t\t\t\t&& m_alerts.should_post()) |\n-|\t\t\t{ |\n-|\t\t\t\tm_alerts.emplace_alert(torrent_handle() |\n-|\t\t\t\t\t, performance_alert::download_limit_too_low); |\n-|\t\t\t} |\n-| |\n-|\t\t\tif (up_limit > 0 |\n-|\t\t\t\t&& m_stat.upload_ip_overhead() >= up_limit |\n-|\t\t\t\t&& m_alerts.should_post()) |\n-|\t\t\t{ |\n-|\t\t\t\tm_alerts.emplace_alert(torrent_handle() |\n-|\t\t\t\t\t, performance_alert::upload_limit_too_low); |\n-|\t\t\t} |\n-|\t\t} |\n-| |\n-|#if TORRENT_ABI_VERSION == 1 |\n-|\t\tm_peak_up_rate = std::max(m_stat.upload_rate(), m_peak_up_rate); |\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-|_\b\t_\b\t_\b/_\b/_\b _\b(_\bu_\bn_\bl_\be_\bs_\bs_\b _\bt_\bh_\be_\b _\bs_\be_\bs_\bs_\bi_\bo_\bn_\b _\bi_\bs_\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 _\b _\b _\b _\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_\be_\bs_\bs_\bi_\bo_\bn_\b__\bi_\bm_\bp_\bl_\b._\bc_\bp_\bp_\b:_\b4_\b3_\b1_\b4 |use a lower limit than m_settings.connections_limit to allocate the to 10% or so of connection slots for incoming connections cap |\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|_\bt_\bh_\bi_\bs_\b _\ba_\bt_\b _\bm_\ba_\bx_\b _\b-_\b _\b1_\b,_\b _\bs_\bi_\bn_\bc_\be_\b _\bw_\be_\b _\bm_\ba_\by_\b _\ba_\bd_\bd_\b _\bo_\bn_\be_\b _\bb_\be_\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 _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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 a\ba l\blo\bow\bwe\ber\br l\bli\bim\bmi\bit\bt t\bth\bha\ban\bn m\bm_\b_s\bse\bet\btt\bti\bin\bng\bgs\bs.\b.c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bns\bs_\b_l\bli\bim\bmi\bit\bt t\bto\bo a\bal\bll\blo\boc\bca\bat\bte\be t\bth\bhe\be t\bto\bo 1\b10\b0%\b% o\bor\br s\bso\bo o\bof\bf c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bn s\bsl\blo\bot\bts\bs f\bfo\bor\br i\bin\bnc\bco\bom\bmi\bin\bng\bg c\bco\bon\bnn\bne\bec\bct\bti\bio\bon\bns\bs c\bca\bap\bp t\bth\bhi\bis\bs a\bat\bt m\bma\bax\bx -\b- 1\b1,\b, s\bsi\bin\bnc\bce\be w\bwe\be m\bma\bay\by a\bad\bdd\bd o\bon\bne\be |\n-|b\bbe\bel\blo\bow\bw *\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:4\b43\b31\b14\b4 *\b**\b**\b* |\n-|// 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-|\t\t\tif (m_boost_connections > max_connections) |\n-|\t\t\t{ |\n-|\t\t\t\tm_boost_connections -= max_connections; |\n-|\t\t\t\tmax_connections = 0; |\n-|\t\t\t} |\n-|\t\t\telse |\n-|\t\t\t{ |\n-|\t\t\t\tmax_connections -= m_boost_connections; |\n-|\t\t\t\tm_boost_connections = 0; |\n-|\t\t\t} |\n-|\t\t} |\n-| |\n-|\t\t// zero connections speeds are allowed, we just won't make any connections |\n-|\t\tif (max_connections <= 0) return; |\n-| |\n-|int const limit = std::min(m_settings.get_int(settings_pack::connections_limit) |\n-|- num_connections(), std::numeric_limits::max() - 1); |\n-| |\n-|\t\t// this logic is here to smooth out the number of new connection |\n-|\t\t// attempts over time, to prevent connecting a large number of |\n-|\t\t// sockets, wait 10 seconds, and then try again |\n-|\t\tif (m_settings.get_bool(settings_pack::smooth_connects) && max_connections > (limit+1) / 2) |\n-|\t\t\tmax_connections = (limit + 1) / 2; |\n-| |\n-|\t\taux::vector& want_peers_download = m_torrent_lists[torrent_want_peers_download]; |\n-|\t\taux::vector& want_peers_finished = m_torrent_lists[torrent_want_peers_finished]; |\n+|\tchar str[1200]; |\n+|\tint const len = canonical_string(v, seq, salt, str); |\n | |\n-|\t\t// if no torrent want any peers, just return |\n-|\t\tif (want_peers_download.empty() && want_peers_finished.empty()) return; |\n+|\treturn ed25519_sign({str, len}, pk, sk); |\n+|} |\n | |\n-|\t\t// if we don't have any connection attempt quota, return |\n-|\t\tif (max_connections <= 0) return; |\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-|\t\tint steps_since_last_connect = 0; |\n-|\t\tint const num_torrents = int(want_peers_finished.size() + want_peers_download.size()); |\n-|\t\tfor (;;) |\n-|\t\t{ |\n-|\t\t\tif (m_next_downloading_connect_torrent >= int(want_peers_download.size())) |\n-|\t\t\t\tm_next_downloading_connect_torrent = 0; |\n+|item::item(entry v) |\n+|\t: m_value(std::move(v)) |\n+|{} |\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+|item::item(bdecode_node const& v) |\n+|{ |\n+|m_value = v; |\n+|} |\n | |\n-|\t\t\ttorrent* t = nullptr; |\n-|\t\t\t// there are prioritized torrents. Pick one of those |\n-|_\b\t_\b\t_\b\t_\bw_\bh_\bi_\bl_\be_\b _\b(_\b!_\bm_\b__\bp_\br_\bi_\bo_\b__\bt_\bo_\br_\br_\be_\bn_\bt_\bs_\b._\be_\bm_\bp_\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 _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\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:_\b4_\b4_\b5_\b9_\b _\b _\b|_\bp_\bo_\bs_\bt_\b _\ba_\b _\bm_\be_\bs_\bs_\ba_\bg_\be_\b _\bt_\bo_\b _\bh_\ba_\bv_\be_\b _\bt_\bh_\bi_\bs_\b _\bh_\ba_\bp_\bp_\be_\bn_\b _\bi_\bm_\bm_\be_\bd_\bi_\ba_\bt_\be_\bl_\by_\b _\bi_\bn_\bs_\bt_\be_\ba_\bd_\b _\bo_\bf_\b _\bw_\ba_\bi_\bt_\bi_\bn_\bg_\b _\bf_\bo_\br_\b _\bt_\bh_\be_\b _\bn_\be_\bx_\bt_\b _\bt_\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 |\n-|*\b**\b**\b**\b**\b* p\bpo\bos\bst\bt a\ba m\bme\bes\bss\bsa\bag\bge\be t\bto\bo h\bha\bav\bve\be t\bth\bhi\bis\bs h\bha\bap\bpp\bpe\ben\bn i\bim\bmm\bme\bed\bdi\bia\bat\bte\bel\bly\by i\bin\bns\bst\bte\bea\bad\bd o\bof\bf w\bwa\bai\bit\bti\bin\bng\bg f\bfo\bor\br t\bth\bhe\be n\bne\bex\bxt\bt t\bti\bic\bck\bk *\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:4\b44\b45\b59\b9 *\b**\b**\b* |\n-|continue; |\n-|\t\t\t} |\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-|\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-|\t\t\t\t// this peer is not unchokable. So, if it's unchoked |\n-|\t\t\t\t// already, make sure to choke it. |\n-|\t\t\t\tif (p->is_choked()) |\n-|\t\t\t\t{ |\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-|\t\t\t\t\t// force a new optimistic unchoke |\n-|\t\t\t\t\tm_optimistic_unchoke_time_scaler = 0; |\n+|void item::assign(entry v) |\n+|{ |\n+|\tm_mutable = false; |\n+|\tm_value = std::move(v); |\n |} |\n-|t->choke_peer(*p); |\n-|\t\t\t\tp->reset_choke_counters(); |\n-|\t\t\t\tcontinue; |\n-|\t\t\t} |\n | |\n-|\t\t\tpeers.push_back(p.get()); |\n-|\t\t} |\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-|\t\tint const allowed_upload_slots = unchoke_sort(peers |\n-|\t\t\t, unchoke_interval, m_settings); |\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/_\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-|\t\tif (m_settings.get_int(settings_pack::choking_algorithm) == settings_pack::fixed_slots_choker) |\n-|\t\t{ |\n-|\t\t\tint const upload_slots = get_int_setting(settings_pack::unchoke_slots_limit); |\n-|\t\t\tm_stats_counters.set_value(counters::num_unchoke_slots, upload_slots); |\n-|\t\t} |\n-|\t\telse |\n-|\t\t{ |\n-|\t\t\tm_stats_counters.set_value(counters::num_unchoke_slots |\n-|\t\t\t\t, allowed_upload_slots); |\n-|\t\t} |\n+|void put_data::done() |\n+|{ |\n+|\tm_done = true; |\n | |\n |#ifndef TORRENT_DISABLE_LOGGING |\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-|_\b\t_\b\t_\b\t_\b\t_\b,_\b _\bi_\bn_\bt_\b(_\bp_\be_\be_\br_\bs_\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 _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |\n-| | |it 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, |\n-|relevance\u00a00|_\b._\b._\b/_\bs_\br_\bc_\b/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bi_\bm_\bp_\bl_\b._\bc_\bp_\bp_\b:_\b4_\b7_\b8_\b6 |they would nicely be round-robined because the torrent lists are always pushed back. Perhaps the status_update_alert could even have|\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|_\ba_\b _\bf_\bi_\bx_\be_\bd_\b _\ba_\br_\br_\ba_\by_\b _\bo_\bf_\b _\bn_\b _\be_\bn_\bt_\br_\bi_\be_\bs_\b _\br_\ba_\bt_\bh_\be_\br_\b _\bt_\bh_\ba_\bn_\b _\ba_\b _\bv_\be_\bc_\bt_\bo_\br_\b,_\b _\bt_\bo_\b _\bf_\bu_\br_\bt_\bh_\be_\br_\b _\bi_\bm_\bp_\br_\bo_\bv_\be_\b _\bm_\be_\bm_\bo_\br_\by_\b _\bl_\bo_\bc_\ba_\bl_\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 |\n-|*\b**\b**\b**\b**\b* i\bit\bt m\bmi\big\bgh\bht\bt b\bbe\be a\ba n\bni\bic\bce\be f\bfe\bea\bat\btu\bur\bre\be h\bhe\ber\bre\be t\bto\bo l\bli\bim\bmi\bit\bt t\bth\bhe\be n\bnu\bum\bmb\bbe\ber\br o\bof\bf t\bto\bor\brr\bre\ben\bnt\bts\bs t\bto\bo s\bse\ben\bnd\bd i\bin\bn a\ba s\bsi\bin\bng\bgl\ble\be u\bup\bpd\bda\bat\bte\be.\b. B\bBy\by j\bju\bus\bst\bt p\bpo\bos\bst\bti\bin\bng\bg t\bth\bhe\be f\bfi\bir\brs\bst\bt n\bn t\bto\bor\brr\bre\ben\bnt\bts\bs,\b, t\bth\bhe\bey\by w\bwo\bou\bul\bld\bd n\bni\bic\bce\bel\bly\by b\bbe\be r\bro\bou\bun\bnd\bd-\b-r\bro\bob\bbi\bin\bne\bed\bd |\n-|b\bbe\bec\bca\bau\bus\bse\be t\bth\bhe\be t\bto\bor\brr\bre\ben\bnt\bt l\bli\bis\bst\bts\bs a\bar\bre\be a\bal\blw\bwa\bay\bys\bs p\bpu\bus\bsh\bhe\bed\bd b\bba\bac\bck\bk.\b. P\bPe\ber\brh\bha\bap\bps\bs t\bth\bhe\be s\bst\bta\bat\btu\bus\bs_\b_u\bup\bpd\bda\bat\bte\be_\b_a\bal\ble\ber\brt\bt c\bco\bou\bul\bld\bd e\bev\bve\ben\bn h\bha\bav\bve\be a\ba f\bfi\bix\bxe\bed\bd a\bar\brr\bra\bay\by o\bof\bf n\bn e\ben\bnt\btr\bri\bie\bes\bs r\bra\bat\bth\bhe\ber\br t\bth\bha\ban\bn a\ba v\bve\bec\bct\bto\bor\br,\b, t\bto\bo f\bfu\bur\brt\bth\bhe\ber\br i\bim\bmp\bpr\bro\bov\bve\be m\bme\bem\bmo\bor\bry\by |\n-|l\blo\boc\bca\bal\bli\bit\bty\by.\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:4\b47\b78\b86\b6 *\b**\b**\b* |\n-|t->status(&st, flags); |\n-|\t\t} |\n-|\t} |\n-| |\n-|\tvoid session_impl::post_torrent_updates(status_flags_t const flags) |\n-|\t{ |\n-|\t\tINVARIANT_CHECK; |\n-| |\n-|\t\tTORRENT_ASSERT(is_single_thread()); |\n-| |\n-|\t\tstd::vector& state_updates |\n-|\t\t\t= m_torrent_lists[aux::session_impl::torrent_state_updates]; |\n-| |\n-|#if TORRENT_USE_ASSERTS |\n-|\t\tm_posting_torrent_updates = true; |\n+|\tget_node().observer()->log(dht_logger::traversal, \"[%u] %s DONE, response %d, timeout %d\" |\n+|\t\t, id(), name(), num_responses(), num_timeouts()); |\n |#endif |\n | |\n-|\t\tstd::vector status; |\n-|\t\tstatus.reserve(state_updates.size()); |\n+|\tm_put_callback(m_data, num_responses()); |\n+|\ttraversal_algorithm::done(); |\n+|} |\n | |\n-|for (auto& t : state_updates) |\n+|bool put_data::invoke(observer_ptr o) |\n |{ |\n-|\t\t\tTORRENT_ASSERT(t->m_links[aux::session_impl::torrent_state_updates].in_list()); |\n-|\t\t\tstatus.emplace_back(); |\n-|\t\t\t// querying accurate download counters may require |\n-|\t\t\t// the torrent to be loaded. Loading a torrent, and evicting another |\n-|\t\t\t// one will lead to calling state_updated(), which screws with |\n-|\t\t\t// this list while we're working on it, and break things |\n-|\t\t\tt->status(&status.back(), flags); |\n-|\t\t\tt->clear_in_state_update(); |\n-|\t\t} |\n-|\t\tstate_updates.clear(); |\n-| |\n-|#if TORRENT_USE_ASSERTS |\n-|\t\tm_posting_torrent_updates = false; |\n-|#endif |\n+|\tif (m_done) return false; |\n | |\n-|\t\tm_alerts.emplace_alert(std::move(status)); |\n-|\t} |\n+|auto* po = static_cast(o.get()); |\n | |\n-|\tvoid session_impl::post_session_stats() |\n+|\tentry e; |\n+|\te[\"y\"] = \"q\"; |\n+|\te[\"q\"] = \"put\"; |\n+|\tentry& a = e[\"a\"]; |\n+|\ta[\"v\"] = m_data.value(); |\n+|\ta[\"token\"] = po->m_token; |\n+|\tif (m_data.is_mutable()) |\n |\t{ |\n-|\t\tif (!m_posted_stats_header) |\n-|\t\t{ |\n-|\t\t\tm_posted_stats_header = true; |\n-|\t\t\tm_alerts.emplace_alert(); |\n-|\t\t} |\n-|\t\tm_disk_thread->update_stats_counters(m_stats_counters); |\n-| |\n-|#ifndef TORRENT_DISABLE_DHT |\n-|_\b\t_\b\t_\bi_\bf_\b _\b(_\bm_\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 _\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:_\b5_\b1_\b6_\b1_\b _\b _\b|_\bf_\ba_\bc_\bt_\bo_\br_\b _\bo_\bu_\bt_\b _\bt_\bh_\bi_\bs_\b _\bl_\bo_\bg_\bi_\bc_\b _\bi_\bn_\bt_\bo_\b _\ba_\b _\bs_\be_\bp_\ba_\br_\ba_\bt_\be_\b _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn_\b _\bf_\bo_\br_\b _\bu_\bn_\bi_\bt_\b _\bt_\be_\bs_\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 |\n-|*\b**\b**\b**\b**\b* f\bfa\bac\bct\bto\bor\br o\bou\but\bt t\bth\bhi\bis\bs l\blo\bog\bgi\bic\bc i\bin\bnt\bto\bo a\ba s\bse\bep\bpa\bar\bra\bat\bte\be f\bfu\bun\bnc\bct\bti\bio\bon\bn f\bfo\bor\br u\bun\bni\bit\bt t\bte\bes\bst\bti\bin\bng\bg *\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\b51\b16\b61\b1 *\b**\b**\b* |\n-|if (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-|\t\t\t// ignore errors because the underlying socket may not |\n-|\t\t\t// be opened yet. This happens when we're routing through |\n-|\t\t\t// a proxy. In that case, we don't yet know the address of |\n-|\t\t\t// the proxy server, and more importantly, we don't know |\n-|\t\t\t// the address family of its address. This means we can't |\n-|\t\t\t// open the socket yet. The socks abstraction layer defers |\n-|\t\t\t// opening it. |\n-|\t\t\tec.clear(); |\n-|\t\t\tbind_ep.port(std::uint16_t(next_port())); |\n-|\t\t} |\n-| |\n-|\t\tif (is_utp(s)) |\n-|\t\t{ |\n-| |\n-|utp_socket_impl* impl = nullptr; |\n-|\t\t\ttransport ssl = transport::plaintext; |\n-|#if TORRENT_USE_SSL |\n-|\t\t\tif (boost::get>(&s) != nullptr) |\n-|\t\t\t{ |\n-|\t\t\t\timpl = boost::get>(s).next_layer().get_impl(); |\n-|\t\t\t\tssl = transport::ssl; |\n-|\t\t\t} |\n-|\t\t\telse |\n-|#endif |\n-|\t\t\t\timpl = boost::get(s).get_impl(); |\n-| |\n-|\t\t\tstd::vector> with_gateways; |\n-|\t\t\tstd::shared_ptr match; |\n-|\t\t\tfor (auto& ls : m_listen_sockets) |\n-|\t\t\t{ |\n-|\t\t\t\t// this is almost, but not quite, like can_route() |\n-|\t\t\t\tif (!(ls->flags & listen_socket_t::proxy) |\n-|\t\t\t\t\t&& is_v4(ls->local_endpoint) != remote_address.is_v4()) |\n-|\t\t\t\t\tcontinue; |\n-|\t\t\t\tif (ls->ssl != ssl) continue; |\n-|\t\t\t\tif (!(ls->flags & listen_socket_t::local_network)) |\n-|\t\t\t\t\twith_gateways.push_back(ls); |\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-|_\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/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bi_\bm_\bp_\bl_\b._\bc_\bp_\bp_\b:_\b5_\b8_\b8_\b0_\b _\b _\b|_\br_\be_\bf_\ba_\bc_\bt_\bo_\br_\b,_\b _\bm_\bo_\bv_\be_\b _\bt_\bh_\be_\b _\bs_\bt_\bo_\br_\ba_\bg_\be_\b _\bt_\bo_\b _\bd_\bh_\bt_\b__\bt_\br_\ba_\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 |\n-|*\b**\b**\b**\b**\b* r\bre\bef\bfa\bac\bct\bto\bor\br,\b, m\bmo\bov\bve\be t\bth\bhe\be s\bst\bto\bor\bra\bag\bge\be t\bto\bo d\bdh\bht\bt_\b_t\btr\bra\bac\bck\bke\ber\br *\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\b58\b88\b80\b0 *\b**\b**\b* |\n-|#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+|\t\ta[\"k\"] = m_data.pk().bytes; |\n+|\t\ta[\"seq\"] = m_data.seq().value; |\n+|\t\ta[\"sig\"] = m_data.sig().bytes; |\n+|\t\tif (!m_data.salt().empty()) |\n |\t\t{ |\n-|#ifndef TORRENT_DISABLE_LOGGING |\n-|\t\t\tsession_log(\"not starting DHT, aborting\"); |\n-|#endif |\n-|\t\t\treturn; |\n+|\t\t\ta[\"salt\"] = m_data.salt(); |\n |\t\t} |\n+|\t} |\n | |\n-|#ifndef TORRENT_DISABLE_LOGGING |\n-|\t\tsession_log(\"starting DHT, running: %s, router lookups: %d\" |\n-|\t\t\t, m_dht ? \"true\" : \"false\", m_outstanding_router_lookups); |\n-|#endif |\n+|\tm_node.stats_counters().inc_stats_counter(counters::dht_put_out); |\n | |\n-|m_dht_storage = m_dht_storage_constructor(m_settings); |\n-|m_dht = std::make_shared( |\n-|\t\t\tstatic_cast(this) |\n-|\t\t\t, m_io_context |\n-|\t\t\t, [this](aux::listen_socket_handle const& sock |\n-|\t\t\t\t, udp::endpoint const& ep |\n-|\t\t\t\t, span p |\n-|\t\t\t\t, error_code& ec |\n-|\t\t\t\t, udp_send_flags_t const flags) |\n-|\t\t\t\t{ send_udp_packet_listen(sock, ep, p, ec, flags); } |\n-|\t\t\t, m_settings |\n-|\t\t\t, m_stats_counters |\n-|\t\t\t, *m_dht_storage |\n-|\t\t\t, std::move(m_dht_state)); |\n+|\treturn m_node.m_rpc.invoke(e, o->target_ep(), o); |\n+|} |\n | |\n-|\t\tfor (auto& s : m_listen_sockets) |\n-|\t\t{ |\n-|\t\t\tif (s->ssl != transport::ssl |\n-|\t\t\t\t&& !(s->flags & listen_socket_t::local_network)) |\n-|\t\t\t{ |\n-|\t\t\t\tm_dht->new_socket(s); |\n-|\t\t\t} |\n-|\t\t} |\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/_\bs_\br_\bc_\b/_\bk_\ba_\bd_\be_\bm_\bl_\bi_\ba_\b/_\bn_\bo_\bd_\be_\b__\bi_\bd_\b._\bc_\bp_\bp_\b:_\b6_\b6|it's a little bit weird to return 159 - leading zeroes. It should probably be 160 - leading zeroes, but all other code in here 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|_\bt_\bu_\bn_\be_\bd_\b _\bt_\bo_\b _\bt_\bh_\bi_\bs_\b _\be_\bx_\bp_\be_\bc_\bt_\ba_\bt_\bi_\bo_\bn_\b _\bn_\bo_\bw_\b,_\b _\ba_\bn_\bd_\b _\bi_\bt_\b _\bd_\bo_\be_\bs_\bn_\b'_\bt_\b _\br_\be_\ba_\bl_\bl_\by_\b _\bm_\ba_\bt_\bt_\be_\br_\b _\b(_\bo_\bt_\bh_\be_\br_\b _\bt_\bh_\ba_\bn_\b _\bc_\bo_\bm_\bp_\bl_\be_\bx_\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 |\n+|*\b**\b**\b**\b**\b* i\bit\bt'\b's\bs a\ba l\bli\bit\btt\btl\ble\be b\bbi\bit\bt w\bwe\bei\bir\brd\bd t\bto\bo r\bre\bet\btu\bur\brn\bn 1\b15\b59\b9 -\b- l\ble\bea\bad\bdi\bin\bng\bg z\bze\ber\bro\boe\bes\bs.\b. I\bIt\bt s\bsh\bho\bou\bul\bld\bd p\bpr\bro\bob\bba\bab\bbl\bly\by b\bbe\be 1\b16\b60\b0 -\b- l\ble\bea\bad\bdi\bin\bng\bg z\bze\ber\bro\boe\bes\bs,\b, b\bbu\but\bt a\bal\bll\bl o\bot\bth\bhe\ber\br c\bco\bod\bde\be i\bin\bn h\bhe\ber\bre\be i\bis\bs t\btu\bun\bne\bed\bd t\bto\bo t\bth\bhi\bis\bs e\bex\bxp\bpe\bec\bct\bta\bat\bti\bio\bon\bn n\bno\bow\bw,\b, a\ban\bnd\bd i\bit\bt |\n+|d\bdo\boe\bes\bsn\bn'\b't\bt r\bre\bea\bal\bll\bly\by m\bma\bat\btt\bte\ber\br (\b(o\bot\bth\bhe\ber\br t\bth\bha\ban\bn c\bco\bom\bmp\bpl\ble\bex\bxi\bit\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/n\bno\bod\bde\be_\b_i\bid\bd.\b.c\bcp\bpp\bp:\b:6\b66\b6 *\b**\b**\b* |\n+|// returns the distance between the two nodes |\n+|// using the kademlia XOR-metric |\n+|node_id distance(node_id const& n1, node_id const& n2) |\n+|{ |\n+|\treturn n1 ^ n2; |\n+|} |\n | |\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+|// returns true if: distance(n1, ref) < distance(n2, ref) |\n+|bool compare_ref(node_id const& n1, node_id const& n2, node_id const& ref) |\n+|{ |\n+|\tnode_id const lhs = n1 ^ ref; |\n+|\tnode_id const rhs = n2 ^ ref; |\n+|\treturn lhs < rhs; |\n+|} |\n | |\n-|\t\tfor (auto const& n : m_dht_nodes) |\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/_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bi_\bm_\bp_\bl_\b._\bc_\bp_\bp_\b:_\b6_\b2_\b6_\b7_\b _\b _\b|_\ba_\bs_\bs_\be_\br_\bt_\bs_\b _\bt_\bh_\ba_\bt_\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 _\ba_\br_\be_\b _\bs_\bt_\bi_\bl_\bl_\b _\bi_\bn_\b _\bf_\bl_\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 |\n-|*\b**\b**\b**\b**\b* a\bas\bss\bse\ber\brt\bts\bs t\bth\bha\bat\bt 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 a\bar\bre\be s\bst\bti\bil\bll\bl i\bin\bn f\bfl\bli\big\bgh\bht\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_i\bim\bmp\bpl\bl.\b.c\bcp\bpp\bp:\b:6\b62\b26\b67\b7 *\b**\b**\b* |\n-|if (!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+|// returns n in: 2^n <= distance(n1, n2) < 2^(n+1) |\n+|// useful for finding out which bucket a node belongs to |\n+|int distance_exp(node_id const& n1, node_id const& n2) |\n+|{ |\n+|return std::max(159 - distance(n1, n2).count_leading_zeroes(), 0); |\n+|} |\n | |\n-|#endif |\n+|int min_distance_exp(node_id const& n1, std::vector const& ids) |\n+|{ |\n+|\tTORRENT_ASSERT(ids.size() > 0); |\n | |\n-|\tbool session_impl::is_listening() const |\n+|\tint min = 160; // see distance_exp for the why of this constant |\n+|\tfor (auto const& node_id : ids) |\n |\t{ |\n-|\t\treturn !m_listen_sockets.empty(); |\n+|\t\tmin = std::min(min, distance_exp(n1, node_id)); |\n |\t} |\n | |\n-|\tsession_impl::~session_impl() |\n-|\t{ |\n-|\t\t// since we're destructing the session, no more alerts will make it out to |\n-|\t\t// the user. So stop posting them now |\n-|\t\tm_alerts.set_alert_mask({}); |\n-|\t\tm_alerts.set_notify_function({}); |\n-| |\n-|\t\t// this is not allowed to be the network thread! |\n-|//\t\tTORRENT_ASSERT(is_not_thread()); |\n-| |\n-|// this can happen if we end the io_context run loop with an exception |\n-|\t\tm_connections.clear(); |\n-|\t\tfor (auto& t : m_torrents) |\n-|\t\t{ |\n-|\t\t\tt->panic(); |\n-|\t\t\tt->abort(); |\n-|\t\t} |\n-|\t\tm_torrents.clear(); |\n-| |\n-|\t\t// this has probably been called already, but in case of sudden |\n-|\t\t// termination through an exception, it may not have been done |\n-|\t\tabort_stage2(); |\n+|\treturn min; |\n+|} |\n | |\n-|#if defined TORRENT_ASIO_DEBUGGING |\n-|\t\tFILE* f = fopen(\"wakeups.log\", \"w+\"); |\n-|\t\tif (f != nullptr) |\n-|\t\t{ |\n-|\t\t\ttime_point m = min_time(); |\n-|\t\t\tif (!_wakeups.empty()) m = _wakeups[0].timestamp; |\n-|\t\t\ttime_point prev = m; |\n-|\t\t\tstd::uint64_t prev_csw = 0; |\n-|\t\t\tif (!_wakeups.empty()) prev_csw = _wakeups[0].context_switches; |\n-|\t\t\tstd::fprintf(f, \"abs. time\\trel. time\\tctx switch\\tidle-wakeup\\toperation\\n\"); |\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/_\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+|node_id generate_id_impl(address const& ip_, std::uint32_t r) |\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+|\tstd::uint8_t* ip = nullptr; |\n | |\n-|\t\tm_storage = std::move(new_storage); |\n-|\t\tm_capacity = new_size; |\n-|\t} |\n+|\tstatic std::uint8_t const v4mask[] = { 0x03, 0x0f, 0x3f, 0xff }; |\n+|\tstatic std::uint8_t const v6mask[] = { 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f, 0xff }; |\n+|\tstd::uint8_t const* mask = nullptr; |\n+|\tint num_octets = 0; |\n | |\n-|\tpacket_ptr packet_buffer::remove(index_type idx) |\n+|\taddress_v4::bytes_type b4{}; |\n+|\taddress_v6::bytes_type b6{}; |\n+|\tif (ip_.is_v6()) |\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-|\t\t} |\n-| |\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+|\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 |_\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@@ -10618,69 +10776,68 @@\n |\t\tstd::vector const n = wanted_node->m_table.find_node(info_hash, {}); |\n |\t\tr[wanted_node->protocol_nodes_key()] = write_nodes_entry(n); |\n |\t} |\n |} |\n | |\n |node::protocol_descriptor const& node::map_protocol_to_descriptor(udp const protocol) |\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/_\bk_\ba_\bd_\be_\bm_\bl_\bi_\ba_\b/_\bn_\bo_\bd_\be_\b__\bi_\bd_\b._\bc_\bp_\bp_\b:_\b6_\b6|it's a little bit weird to return 159 - leading zeroes. It should probably be 160 - leading zeroes, but all other code in here 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|_\bt_\bu_\bn_\be_\bd_\b _\bt_\bo_\b _\bt_\bh_\bi_\bs_\b _\be_\bx_\bp_\be_\bc_\bt_\ba_\bt_\bi_\bo_\bn_\b _\bn_\bo_\bw_\b,_\b _\ba_\bn_\bd_\b _\bi_\bt_\b _\bd_\bo_\be_\bs_\bn_\b'_\bt_\b _\br_\be_\ba_\bl_\bl_\by_\b _\bm_\ba_\bt_\bt_\be_\br_\b _\b(_\bo_\bt_\bh_\be_\br_\b _\bt_\bh_\ba_\bn_\b _\bc_\bo_\bm_\bp_\bl_\be_\bx_\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 |\n-|*\b**\b**\b**\b**\b* i\bit\bt'\b's\bs a\ba l\bli\bit\btt\btl\ble\be b\bbi\bit\bt w\bwe\bei\bir\brd\bd t\bto\bo r\bre\bet\btu\bur\brn\bn 1\b15\b59\b9 -\b- l\ble\bea\bad\bdi\bin\bng\bg z\bze\ber\bro\boe\bes\bs.\b. I\bIt\bt s\bsh\bho\bou\bul\bld\bd p\bpr\bro\bob\bba\bab\bbl\bly\by b\bbe\be 1\b16\b60\b0 -\b- l\ble\bea\bad\bdi\bin\bng\bg z\bze\ber\bro\boe\bes\bs,\b, b\bbu\but\bt a\bal\bll\bl o\bot\bth\bhe\ber\br c\bco\bod\bde\be i\bin\bn h\bhe\ber\bre\be i\bis\bs t\btu\bun\bne\bed\bd t\bto\bo t\bth\bhi\bis\bs e\bex\bxp\bpe\bec\bct\bta\bat\bti\bio\bon\bn n\bno\bow\bw,\b, a\ban\bnd\bd i\bit\bt |\n-|d\bdo\boe\bes\bsn\bn'\b't\bt r\bre\bea\bal\bll\bly\by m\bma\bat\btt\bte\ber\br (\b(o\bot\bth\bhe\ber\br t\bth\bha\ban\bn c\bco\bom\bmp\bpl\ble\bex\bxi\bit\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/n\bno\bod\bde\be_\b_i\bid\bd.\b.c\bcp\bpp\bp:\b:6\b66\b6 *\b**\b**\b* |\n-|// returns the distance between the two nodes |\n-|// using the kademlia XOR-metric |\n-|node_id distance(node_id const& n1, node_id const& n2) |\n-|{ |\n-|\treturn n1 ^ n2; |\n-|} |\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-|// returns true if: distance(n1, ref) < distance(n2, ref) |\n-|bool compare_ref(node_id const& n1, node_id const& n2, node_id const& ref) |\n-|{ |\n-|\tnode_id const lhs = n1 ^ ref; |\n-|\tnode_id const rhs = n2 ^ ref; |\n-|\treturn lhs < rhs; |\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-|// returns n in: 2^n <= distance(n1, n2) < 2^(n+1) |\n-|// useful for finding out which bucket a node belongs to |\n-|int distance_exp(node_id const& n1, node_id const& n2) |\n-|{ |\n-|return std::max(159 - distance(n1, n2).count_leading_zeroes(), 0); |\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-|int min_distance_exp(node_id const& n1, std::vector const& ids) |\n-|{ |\n-|\tTORRENT_ASSERT(ids.size() > 0); |\n+|\t\treturn nullptr; |\n+|\t} |\n | |\n-|\tint min = 160; // see distance_exp for the why of this constant |\n-|\tfor (auto const& node_id : ids) |\n+|\tvoid dht_tracker::get_peers(sha1_hash const& ih |\n+|\t\t, std::function const&)> f) |\n |\t{ |\n-|\t\tmin = std::min(min, distance_exp(n1, node_id)); |\n+|\t\tfor (auto& n : m_nodes) |\n+|\t\t\tn.second.dht.get_peers(ih, f, {}, {}); |\n |\t} |\n | |\n-|\treturn min; |\n-|} |\n-| |\n-|node_id generate_id_impl(address const& ip_, std::uint32_t r) |\n-|{ |\n-|\tstd::uint8_t* ip = nullptr; |\n-| |\n-|\tstatic std::uint8_t const v4mask[] = { 0x03, 0x0f, 0x3f, 0xff }; |\n-|\tstatic std::uint8_t const v6mask[] = { 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f, 0xff }; |\n-|\tstd::uint8_t const* mask = nullptr; |\n-|\tint num_octets = 0; |\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-|\taddress_v4::bytes_type b4{}; |\n-|\taddress_v6::bytes_type b6{}; |\n-|\tif (ip_.is_v6()) |\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\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+|\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/ |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,335 +10977,43 @@\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-|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-|void put_data::done() |\n-|{ |\n-|\tm_done = true; |\n-| |\n-|#ifndef TORRENT_DISABLE_LOGGING |\n-|\tget_node().observer()->log(dht_logger::traversal, \"[%u] %s DONE, response %d, timeout %d\" |\n-|\t\t, id(), name(), num_responses(), num_timeouts()); |\n-|#endif |\n-| |\n-|\tm_put_callback(m_data, num_responses()); |\n-|\ttraversal_algorithm::done(); |\n-|} |\n-| |\n-|bool put_data::invoke(observer_ptr o) |\n-|{ |\n-|\tif (m_done) return false; |\n-| |\n-|auto* po = static_cast(o.get()); |\n-| |\n-|\tentry e; |\n-|\te[\"y\"] = \"q\"; |\n-|\te[\"q\"] = \"put\"; |\n-|\tentry& a = e[\"a\"]; |\n-|\ta[\"v\"] = m_data.value(); |\n-|\ta[\"token\"] = po->m_token; |\n-|\tif (m_data.is_mutable()) |\n-|\t{ |\n-|\t\ta[\"k\"] = m_data.pk().bytes; |\n-|\t\ta[\"seq\"] = m_data.seq().value; |\n-|\t\ta[\"sig\"] = m_data.sig().bytes; |\n-|\t\tif (!m_data.salt().empty()) |\n-|\t\t{ |\n-|\t\t\ta[\"salt\"] = m_data.salt(); |\n-|\t\t} |\n-|\t} |\n-| |\n-|\tm_node.stats_counters().inc_stats_counter(counters::dht_put_out); |\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-|\treturn m_node.m_rpc.invoke(e, o->target_ep(), o); |\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-|_\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/_\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+|#if TORRENT_ABI_VERSION <= 2 |\n+|\tudp TORRENT_DEPRECATED_ENUM = utp, |\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/_\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/ |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 | |\n-|\tvoid cancel(error_code& ec) |\n-|\t{ |\n-|\t\tTORRENT_ASSERT(m_magic == 0x1337); |\n-|\t\tm_sock.cancel(ec); |\n-|\t} |\n+|// return a short human readable name for types of socket |\n+|char const* socket_type_name(socket_type_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+|_\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/ |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@@ -11196,205 +11061,232 @@\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/ |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+|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_USE_ASSERTS || TORRENT_USE_INVARIANT_CHECKS |\n-|\t\tindex_range categories() const |\n-|\t\t{ return {{}, piece_picker::piece_pos::num_download_categories}; } |\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// the following vectors are mutable because they sometimes may |\n-|\t\t// be updated lazily, triggered by const functions |\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 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+|\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// 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+|\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// 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+|\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 number of bytes of pad file set in this piece picker |\n-|\t\tstd::int64_t m_num_pad_bytes = 0; |\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// the number of pad blocks that we already have |\n-|\t\tstd::int64_t m_have_pad_bytes = 0; |\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 number of pad blocks part of filtered pieces we don't have |\n-|\t\tstd::int64_t m_filtered_pad_bytes = 0; |\n+|\t\t// the hash(es) that identify this torrent |\n+|\t\tinfo_hash_t m_info_hash; |\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+|\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 seeds. These are not added to |\n-|\t\t// the availability counters of the pieces |\n-|\t\tint m_seeds = 0; |\n+|\t\t// the number of bytes in m_info_section |\n+|\t\tstd::int32_t m_info_section_size = 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+|\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/ |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\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+|\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\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+|\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-|\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+|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-|\t\t// the number of pieces we have that also are filtered |\n-|\t\tint m_num_have_filtered = 0; |\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-|\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+|private: |\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+|\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\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+|\t\tif (ec) |\n+|\t\t{ |\n+|\t\t\th(ec); |\n+|\t\t\treturn; |\n+|\t\t} |\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+|\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+| |_\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-|\t\tenum { max_pieces = (std::numeric_limits::max)() - 1 }; |\n+|#ifndef TORRENT_PEER_CONNECTION_INTERFACE_HPP |\n+|#define TORRENT_PEER_CONNECTION_INTERFACE_HPP |\n | |\n-|\t}; |\n-|} |\n+|#include \"libtorrent/fwd.hpp\" |\n+|#include \"libtorrent/socket.hpp\" |\n+|#include \"libtorrent/error_code.hpp\" |\n+|#include \"libtorrent/alert_types.hpp\" |\n+|#include \"libtorrent/operations.hpp\" // for operation_t enum |\n+|#include \"libtorrent/units.hpp\" |\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/ |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+|namespace libtorrent { |\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+|\tstruct torrent_peer; |\n+|\tclass stat; |\n | |\n-|TORRENT_EXTRA_EXPORT void find_control_url(int type, string_view, parse_state& state); |\n+|\tusing disconnect_severity_t = aux::strong_typedef; |\n | |\n-|TORRENT_EXTRA_EXPORT void find_error_code(int type, string_view string |\n-|\t, error_code_parse_state& state); |\n+|struct TORRENT_EXTRA_EXPORT peer_connection_interface |\n+|{ |\n+|\t\tstatic constexpr disconnect_severity_t normal{0}; |\n+|\t\tstatic constexpr disconnect_severity_t failure{1}; |\n+|\t\tstatic constexpr disconnect_severity_t peer_error{2}; |\n | |\n-|TORRENT_EXTRA_EXPORT void find_ip_address(int type, string_view string |\n-|\t, ip_address_parse_state& state); |\n+|#if TORRENT_USE_I2P |\n+|\t\tvirtual std::string const& destination() const = 0; |\n+|\t\tvirtual std::string const& local_i2p_endpoint() const = 0; |\n+|#endif |\n+|\t\tvirtual tcp::endpoint const& remote() const = 0; |\n+|\t\tvirtual tcp::endpoint local_endpoint() const = 0; |\n+|\t\tvirtual void disconnect(error_code const& ec |\n+|\t\t\t, operation_t op, disconnect_severity_t = peer_connection_interface::normal) = 0; |\n+|\t\tvirtual peer_id const& pid() const = 0; |\n+|\t\tvirtual peer_id our_pid() const = 0; |\n+|\t\tvirtual void set_holepunch_mode() = 0; |\n+|\t\tvirtual torrent_peer* peer_info_struct() const = 0; |\n+|\t\tvirtual void set_peer_info(torrent_peer* pi) = 0; |\n+|\t\tvirtual bool is_outgoing() const = 0; |\n+|\t\tvirtual void add_stat(std::int64_t downloaded, std::int64_t uploaded) = 0; |\n+|\t\tvirtual bool fast_reconnect() const = 0; |\n+|\t\tvirtual bool is_choked() const = 0; |\n+|\t\tvirtual bool failed() const = 0; |\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/ |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+|\t}; |\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+|\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-|\tvoid start(); |\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& trees); |\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/ |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+|\t\thash_request pick_hashes(typed_bitfield const& pieces); |\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+|\t\tadd_hashes_result add_hashes(hash_request const& req, span hashes); |\n+|set_block_hash_result set_block_hash(piece_index_t piece, int offset, sha256_hash const& h); |\n+|void hashes_rejected(hash_request const& req); |\n+|\t\tvoid verify_block_hashes(piece_index_t index); |\n | |\n-|#if TORRENT_ABI_VERSION <= 2 |\n-|\tudp TORRENT_DEPRECATED_ENUM = utp, |\n-|#endif |\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-|// return a short human readable name for types of socket |\n-|char const* socket_type_name(socket_type_t); |\n+|\t\tint piece_layer() const { return m_piece_layer; } |\n | |\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-|_\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+|\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+|_\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/ |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@@ -11442,124 +11334,178 @@\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/ |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-|\t}; |\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 | |\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 | |\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& trees); |\n+|#ifndef TORRENT_IDENTIFY_CLIENT_HPP_INCLUDED |\n+|#define TORRENT_IDENTIFY_CLIENT_HPP_INCLUDED |\n | |\n-|\t\thash_request pick_hashes(typed_bitfield const& pieces); |\n+|#include \"libtorrent/config.hpp\" |\n | |\n-|\t\tadd_hashes_result add_hashes(hash_request const& req, span hashes); |\n-|set_block_hash_result set_block_hash(piece_index_t piece, int offset, sha256_hash const& h); |\n-|void hashes_rejected(hash_request const& req); |\n-|\t\tvoid verify_block_hashes(piece_index_t index); |\n+|#if TORRENT_ABI_VERSION == 1 |\n+|#include \"libtorrent/aux_/disable_warnings_push.hpp\" |\n+|#include |\n+|#include \"libtorrent/aux_/disable_warnings_pop.hpp\" |\n+|#endif |\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/peer_id.hpp\" |\n+|#include \"libtorrent/fingerprint.hpp\" |\n | |\n-|\t\tint piece_layer() const { return m_piece_layer; } |\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+|namespace aux { |\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+|\tTORRENT_EXTRA_EXPORT |\n+|\tstd::string identify_client_impl(const peer_id& p); |\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-| |_\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 | |\n-|#ifndef TORRENT_PEER_CONNECTION_INTERFACE_HPP |\n-|#define TORRENT_PEER_CONNECTION_INTERFACE_HPP |\n+|\t// these functions don't really need to be public. This mechanism of |\n+|\t// advertising client software and version is also out-dated. |\n | |\n-|#include \"libtorrent/fwd.hpp\" |\n-|#include \"libtorrent/socket.hpp\" |\n-|#include \"libtorrent/error_code.hpp\" |\n-|#include \"libtorrent/alert_types.hpp\" |\n-|#include \"libtorrent/operations.hpp\" // for operation_t enum |\n-|#include \"libtorrent/units.hpp\" |\n+|\t// This function can can be used to extract a string describing a client |\n+|\t// version from its peer-id. It will recognize most clients that have this |\n+|\t// kind of identification in the peer-id. |\n+|\tTORRENT_DEPRECATED_EXPORT |\n+|\tstd::string identify_client(const peer_id& p); |\n | |\n-|namespace libtorrent { |\n+|#if TORRENT_ABI_VERSION == 1 |\n | |\n-|\tstruct torrent_peer; |\n-|\tclass stat; |\n+|#include \"libtorrent/aux_/disable_deprecation_warnings_push.hpp\" |\n | |\n-|\tusing disconnect_severity_t = aux::strong_typedef; |\n+|\t// Returns an optional fingerprint if any can be identified from the peer |\n+|\t// id. This can be used to automate the identification of clients. It will |\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-|struct TORRENT_EXTRA_EXPORT peer_connection_interface |\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/ |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-|\t\tstatic constexpr disconnect_severity_t normal{0}; |\n-|\t\tstatic constexpr disconnect_severity_t failure{1}; |\n-|\t\tstatic constexpr disconnect_severity_t peer_error{2}; |\n+|\tbool in_error_code = false; |\n+|\tbool exit = false; |\n+|\tint error_code = -1; |\n+|}; |\n | |\n-|#if TORRENT_USE_I2P |\n-|\t\tvirtual std::string const& destination() const = 0; |\n-|\t\tvirtual std::string const& local_i2p_endpoint() const = 0; |\n-|#endif |\n-|\t\tvirtual tcp::endpoint const& remote() const = 0; |\n-|\t\tvirtual tcp::endpoint local_endpoint() const = 0; |\n-|\t\tvirtual void disconnect(error_code const& ec |\n-|\t\t\t, operation_t op, disconnect_severity_t = peer_connection_interface::normal) = 0; |\n-|\t\tvirtual peer_id const& pid() const = 0; |\n-|\t\tvirtual peer_id our_pid() const = 0; |\n-|\t\tvirtual void set_holepunch_mode() = 0; |\n-|\t\tvirtual torrent_peer* peer_info_struct() const = 0; |\n-|\t\tvirtual void set_peer_info(torrent_peer* pi) = 0; |\n-|\t\tvirtual bool is_outgoing() const = 0; |\n-|\t\tvirtual void add_stat(std::int64_t downloaded, std::int64_t uploaded) = 0; |\n-|\t\tvirtual bool fast_reconnect() const = 0; |\n-|\t\tvirtual bool is_choked() const = 0; |\n-|\t\tvirtual bool failed() const = 0; |\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+|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/ |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/ |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@@ -11825,123 +11771,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/ |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-| |\n-|*/ |\n-| |\n-|#ifndef TORRENT_IDENTIFY_CLIENT_HPP_INCLUDED |\n-|#define TORRENT_IDENTIFY_CLIENT_HPP_INCLUDED |\n-| |\n-|#include \"libtorrent/config.hpp\" |\n-| |\n-|#if TORRENT_ABI_VERSION == 1 |\n-|#include \"libtorrent/aux_/disable_warnings_push.hpp\" |\n-|#include |\n-|#include \"libtorrent/aux_/disable_warnings_pop.hpp\" |\n-|#endif |\n-| |\n-|#include \"libtorrent/peer_id.hpp\" |\n-|#include \"libtorrent/fingerprint.hpp\" |\n-| |\n-|namespace libtorrent { |\n-| |\n-|namespace aux { |\n-| |\n-|\tTORRENT_EXTRA_EXPORT |\n-|\tstd::string identify_client_impl(const peer_id& p); |\n-| |\n-|} |\n-| |\n-|\t// these functions don't really need to be public. This mechanism of |\n-|\t// advertising client software and version is also out-dated. |\n-| |\n-|\t// This function can can be used to extract a string describing a client |\n-|\t// version from its peer-id. It will recognize most clients that have this |\n-|\t// kind of identification in the peer-id. |\n-|\tTORRENT_DEPRECATED_EXPORT |\n-|\tstd::string identify_client(const peer_id& p); |\n-| |\n-|#if TORRENT_ABI_VERSION == 1 |\n-| |\n-|#include \"libtorrent/aux_/disable_deprecation_warnings_push.hpp\" |\n-| |\n-|\t// Returns an optional fingerprint if any can be identified from the peer |\n-|\t// id. This can be used to automate the identification of clients. It will |\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/ |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/ |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@@ -11974,122 +11811,285 @@\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 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+|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\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+|\t\t// explicitly disallow assignment, to silence msvc warning |\n+|\t\tpeer_connection_hot_members& operator=(peer_connection_hot_members const&) = delete; |\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+|\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/ |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-|\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+|\tvoid cancel(error_code& ec) |\n+|\t{ |\n+|\t\tTORRENT_ASSERT(m_magic == 0x1337); |\n+|\t\tm_sock.cancel(ec); |\n+|\t} |\n | |\n-|\ttemplate |\n-|\tvoid async_name_lookup(char const* name, Handler handler) |\n+|\tvoid bind(endpoint_type const& /* endpoint */, error_code& /* ec */) |\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\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-|private: |\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-|\ttemplate |\n-|\tvoid on_sam_connect(error_code const& ec, std::shared_ptr, Handler h) |\n+|#ifndef BOOST_NO_EXCEPTIONS |\n+|\tvoid close() |\n |\t{ |\n-|\t\tCOMPLETE_ASYNC(\"i2p_stream::on_sam_connect\"); |\n-|\t\tm_state = sam_idle; |\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-|\t\tif (ec) |\n-|\t\t{ |\n-|\t\t\th(ec); |\n-|\t\t\treturn; |\n-|\t\t} |\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-|\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/ |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+|\tprivate: |\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+|#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// 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+|\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 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+|\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 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+|\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// an optional string naming the software used |\n-|\t\t// to create the torrent file |\n-|\t\tstd::string m_created_by; |\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 info section parsed. points into m_info_section |\n-|\t\t// parsed lazily |\n-|\t\tmutable bdecode_node m_info_dict; |\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// 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+|\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 hash(es) that identify this torrent |\n-|\t\tinfo_hash_t m_info_hash; |\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// 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+|\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 bytes in m_info_section |\n-|\t\tstd::int32_t m_info_section_size = 0; |\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 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\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@@ -12177,114 +12177,14 @@\n |\treturn verify_message_impl(msg, desc, ret, error); |\n |} |\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/ |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 |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@@ -12331,69 +12231,53 @@\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/ |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+|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-|#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 | |\n-|virtual proxy_settings proxy() const = 0; |\n+|#ifndef TORRENT_POOL_HPP |\n+|#define TORRENT_POOL_HPP |\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+|#include \"libtorrent/aux_/disable_warnings_push.hpp\" |\n+|#include |\n+|#include |\n+|#include \"libtorrent/aux_/disable_warnings_pop.hpp\" |\n | |\n-|\t\tvirtual void prioritize_connections(std::weak_ptr t) = 0; |\n+|namespace libtorrent { |\n+|namespace aux { |\n | |\n-|\t\tvirtual void trigger_auto_manage() = 0; |\n+|struct allocator_new_delete |\n+|{ |\n+|\tusing size_type = std::size_t; |\n+|\tusing difference_type = std::ptrdiff_t; |\n | |\n-|\t\tvirtual void apply_settings_pack(std::shared_ptr pack) = 0; |\n-|\t\tvirtual session_settings const& settings() const = 0; |\n+|static char* malloc(size_type const bytes) |\n+|{ return new char[bytes]; } |\n+|\tstatic void free(char* const block) |\n+|\t{ delete [] block; } |\n+|}; |\n | |\n-|\t\tvirtual void queue_tracker_request(tracker_request req |\n-|\t\t\t, std::weak_ptr c) = 0; |\n+|using pool = boost::pool; |\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+|template |\n+|using object_pool = boost::object_pool; |\n | |\n-|\t\tvirtual bandwidth_manager* get_bandwidth_manager(int channel) = 0; |\n+|} |\n+|} |\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+|_\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/ |make these direct members and generate shared_ptrs to them which alias the listen_socket_t shared_ptr |\n |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\bs_\be_\bs_\bs_\bi_\bo_\bn_\b__\bi_\bm_\bp_\bl_\b._\bh_\bp_\bp_\b:_\b2_\b6_\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* m\bma\bak\bke\be t\bth\bhe\bes\bse\be d\bdi\bir\bre\bec\bct\bt m\bme\bem\bmb\bbe\ber\brs\bs a\ban\bnd\bd g\bge\ben\bne\ber\bra\bat\bte\be s\bsh\bha\bar\bre\bed\bd_\b_p\bpt\btr\brs\bs t\bto\bo t\bth\bhe\bem\bm w\bwh\bhi\bic\bch\bh a\bal\bli\bia\bas\bs t\bth\bhe\be l\bli\bis\bst\bte\ben\bn_\b_s\bso\boc\bck\bke\bet\bt_\b_t\bt s\bsh\bha\bar\bre\bed\bd_\b_p\bpt\btr\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/s\bse\bes\bss\bsi\bio\bon\bn_\b_i\bim\bmp\bpl\bl.\b.h\bhp\bpp\bp:\b:2\b26\b65\b5 *\b**\b**\b* |\n |if (udp_sock) return udp_sock->sock.local_port(); |\n |\t\t\treturn 0; |\n |\t\t} |\n@@ -12552,108 +12436,14 @@\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/ |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-|\t{ |\n-|\t\tannounce_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/_\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-| |\n-|#ifndef TORRENT_POOL_HPP |\n-|#define TORRENT_POOL_HPP |\n-| |\n-|#include \"libtorrent/aux_/disable_warnings_push.hpp\" |\n-|#include |\n-|#include |\n-|#include \"libtorrent/aux_/disable_warnings_pop.hpp\" |\n-| |\n-|namespace libtorrent { |\n-|namespace aux { |\n-| |\n-|struct allocator_new_delete |\n-|{ |\n-|\tusing size_type = std::size_t; |\n-|\tusing difference_type = std::ptrdiff_t; |\n-| |\n-|static char* malloc(size_type const bytes) |\n-|{ return new char[bytes]; } |\n-|\tstatic void free(char* const block) |\n-|\t{ delete [] block; } |\n-|}; |\n-| |\n-|using pool = boost::pool; |\n-| |\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/ |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@@ -12754,7 +12544,217 @@\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/ |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+|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+|\t{ |\n+|\t\tannounce_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/_\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"}]}]}]}]}]}